@clickview/curator 1.0.19-dev.0 → 1.0.19-dev.2
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/curator-app.js +1 -1
- package/dist/libs/common/src/backbone/utils/UrlHelper.d.ts +1 -0
- package/dist/libs/common/src/react/utils/ArrayHelper.d.ts +4 -0
- package/dist/libs/shared/src/components/actions/ActionButton.d.ts +1 -0
- package/dist/libs/shared/src/components/actions/Actions.d.ts +1 -0
- package/dist/libs/shared/src/components/spinner-button/SpinnerButton.d.ts +1 -0
- package/dist/libs/shared/src/enums/PresentationType.d.ts +4 -0
- package/dist/libs/shared/src/enums/SettingKind.d.ts +4 -0
- package/dist/libs/shared/src/enums/SettingName.d.ts +3 -0
- package/dist/libs/shared/src/interfaces/models/EntitySetting.d.ts +9 -0
- package/dist/libs/shared/src/interfaces/models/Presentation.d.ts +3 -0
- package/dist/libs/shared/src/interfaces/models/index.d.ts +1 -0
- package/dist/projects/curator/src/apps/subjects/components/classifications/edit-classification-details/EditClassificationDetailsForm.d.ts +2 -1
- package/package.json +3 -3
package/dist/curator-app.js
CHANGED
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,m=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,b=r?Symbol.for("react.block"):60121,g=r?Symbol.for("react.fundamental"):60117,S=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function O(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case f:case p:case a:case s:case c:case m:return e;default:switch(e=e&&e.$$typeof){case l:case d:case v:case y:case u:return e;default:return t}}case i:return t}}}function j(e){return O(e)===p}t.AsyncMode=f,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=u,t.Element=o,t.ForwardRef=d,t.Fragment=a,t.Lazy=v,t.Memo=y,t.Portal=i,t.Profiler=s,t.StrictMode=c,t.Suspense=m,t.isAsyncMode=function(e){return j(e)||O(e)===f},t.isConcurrentMode=j,t.isContextConsumer=function(e){return O(e)===l},t.isContextProvider=function(e){return O(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return O(e)===d},t.isFragment=function(e){return O(e)===a},t.isLazy=function(e){return O(e)===v},t.isMemo=function(e){return O(e)===y},t.isPortal=function(e){return O(e)===i},t.isProfiler=function(e){return O(e)===s},t.isStrictMode=function(e){return O(e)===c},t.isSuspense=function(e){return O(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===s||e===c||e===m||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===y||e.$$typeof===u||e.$$typeof===l||e.$$typeof===d||e.$$typeof===g||e.$$typeof===S||e.$$typeof===E||e.$$typeof===b)},t.typeOf=O},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=f(i),c=f(n(16)),s=f(n(177)),u=f(n(178)),l=n(186);function f(e){return e&&e.__esModule?e:{default:e}}var p=function(){return!0},d=function(e){function t(e){var n=e.alwaysRenderSuggestions;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return m.call(r),r.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null},r.justPressedUpDown=!1,r.justMouseEntered=!1,r.pressedSuggestion=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown),document.addEventListener("mouseup",this.onDocumentMouseUp),this.input=this.autowhatever.input,this.suggestionsContainer=this.autowhatever.itemsContainer}},{key:"componentWillReceiveProps",value:function(e){(0,s.default)(e.suggestions,this.props.suggestions)?e.highlightFirstSuggestion&&e.suggestions.length>0&&!1===this.justPressedUpDown&&!1===this.justMouseEntered&&this.highlightFirstSuggestion():this.willRenderSuggestions(e)?this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions():this.resetHighlightedSuggestion()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.suggestions,o=n.onSuggestionHighlighted,i=n.highlightFirstSuggestion;if(!(0,s.default)(r,e.suggestions)&&r.length>0&&i)this.highlightFirstSuggestion();else if(o){var a=this.getHighlightedSuggestion();a!=t.highlightedSuggestion&&o({suggestion:a})}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown),document.removeEventListener("mouseup",this.onDocumentMouseUp)}},{key:"updateHighlightedSuggestion",value:function(e,t,n){var r=this;this.setState((function(o){var i=o.valueBeforeUpDown;return null===t?i=null:null===i&&void 0!==n&&(i=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:i}}))}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState((function(t){var n=t.valueBeforeUpDown;return{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:e?null:n}}))}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,r=n.suggestions,o=n.multiSection,i=n.getSectionSuggestions;return o?i(r[e])[t]:r[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){return(0,this.props.getSuggestionValue)(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var r=this.props.inputProps,o=r.value,i=r.onChange;t!==o&&i(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,r=e.shouldRenderSuggestions,o=n.value;return t.length>0&&r(o)}},{key:"getQuery",value:function(){var e=this.props.inputProps.value,t=this.state.valueBeforeUpDown;return(null===t?e:t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,o=t.renderInputComponent,i=t.onSuggestionsFetchRequested,c=t.renderSuggestion,s=t.inputProps,f=t.multiSection,d=t.renderSectionTitle,m=t.id,h=t.getSectionSuggestions,y=t.theme,v=t.getSuggestionValue,b=t.alwaysRenderSuggestions,g=t.highlightFirstSuggestion,S=this.state,E=S.isFocused,O=S.isCollapsed,j=S.highlightedSectionIndex,C=S.highlightedSuggestionIndex,w=S.valueBeforeUpDown,A=b?p:this.props.shouldRenderSuggestions,I=s.value,T=s.onFocus,k=s.onKeyDown,_=this.willRenderSuggestions(this.props),L=b||E&&!O&&_,x=L?n:[],P=r({},s,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=A(I);e.setState({isFocused:!0,isCollapsed:!n}),T&&T(t),n&&i({value:I,reason:"input-focused"})}},onBlur:function(t){e.justClickedOnSuggestionsContainer?e.input.focus():(e.blurEvent=t,e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested()))},onChange:function(t){var n=t.target.value,o=A(n);e.maybeCallOnChange(t,n,"type"),e.suggestionsContainer&&(e.suggestionsContainer.scrollTop=0),e.setState(r({},g?{}:{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null},{valueBeforeUpDown:null,isCollapsed:!o})),o?i({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var o=t.keyCode;switch(o){case 40:case 38:if(O)A(I)&&(i({value:I,reason:"suggestions-revealed"}),e.revealSuggestions());else if(n.length>0){var a=r.newHighlightedSectionIndex,c=r.newHighlightedItemIndex,s=void 0;s=null===c?null===w?I:w:e.getSuggestionValueByIndex(a,c),e.updateHighlightedSuggestion(a,c,I),e.maybeCallOnChange(t,s,40===o?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout((function(){e.justPressedUpDown=!1}));break;case 13:if(229===t.keyCode)break;var u=e.getHighlightedSuggestion();if(L&&!b&&e.closeSuggestions(),null!=u){var l=v(u);e.maybeCallOnChange(t,l,"enter"),e.onSuggestionSelected(t,{suggestion:u,suggestionValue:l,suggestionIndex:C,sectionIndex:j,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout((function(){e.justSelectedSuggestion=!1}))}break;case 27:L&&t.preventDefault();var f=L&&!b;if(null===w){if(!f){e.maybeCallOnChange(t,"","escape"),A("")?i({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,w,"escape");f?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}k&&k(t)}}),N={query:this.getQuery()};return a.default.createElement(u.default,{multiSection:f,items:x,renderInputComponent:o,renderItemsContainer:this.renderSuggestionsContainer,renderItem:c,renderItemData:N,renderSectionTitle:d,getSectionItems:h,highlightedSectionIndex:j,highlightedItemIndex:C,inputProps:P,itemProps:this.itemProps,theme:(0,l.mapToAutowhateverTheme)(y),id:m,ref:this.storeAutowhateverRef})}}]),t}(i.Component);d.propTypes={suggestions:c.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){var n=e[t];if("function"!=typeof n)throw new Error("'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp")},onSuggestionsClearRequested:function(e,t){var n=e[t];if(!1===e.alwaysRenderSuggestions&&"function"!=typeof n)throw new Error("'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp")},onSuggestionSelected:c.default.func,onSuggestionHighlighted:c.default.func,renderInputComponent:c.default.func,renderSuggestionsContainer:c.default.func,getSuggestionValue:c.default.func.isRequired,renderSuggestion:c.default.func.isRequired,inputProps:function(e,t){var n=e[t];if(!n.hasOwnProperty("value"))throw new Error("'inputProps' must have 'value'.");if(!n.hasOwnProperty("onChange"))throw new Error("'inputProps' must have 'onChange'.")},shouldRenderSuggestions:c.default.func,alwaysRenderSuggestions:c.default.bool,multiSection:c.default.bool,renderSectionTitle:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp")},getSectionSuggestions:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp")},focusInputOnSuggestionClick:c.default.bool,highlightFirstSuggestion:c.default.bool,theme:c.default.object,id:c.default.string},d.defaultProps={renderSuggestionsContainer:function(e){var t=e.containerProps,n=e.children;return a.default.createElement("div",t,n)},shouldRenderSuggestions:function(e){return e.trim().length>0},alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:l.defaultTheme,id:"1"};var m=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeAutowhateverRef=function(t){null!==t&&(e.autowhatever=t)},this.onSuggestionMouseEnter=function(t,n){var r=n.sectionIndex,o=n.itemIndex;e.updateHighlightedSuggestion(r,o),t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!0),e.justMouseEntered=!0,setTimeout((function(){e.justMouseEntered=!1}))},this.highlightFirstSuggestion=function(){e.updateHighlightedSuggestion(e.props.multiSection?0:null,0)},this.onDocumentMouseUp=function(){e.pressedSuggestion&&!e.justSelectedSuggestion&&e.input.focus(),e.pressedSuggestion=null},this.onSuggestionMouseDown=function(t){e.justSelectedSuggestion||(e.justSelectedSuggestion=!0,e.pressedSuggestion=t.target)},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var r=e.props,o=r.alwaysRenderSuggestions,i=r.onSuggestionSelected,a=r.onSuggestionsFetchRequested;i&&i(t,n),o?a({value:n.suggestionValue,reason:"suggestion-selected"}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,o=n.focusInputOnSuggestionClick,i=e.getSuggestionIndices(e.findSuggestionElement(t.target)),a=i.sectionIndex,c=i.suggestionIndex,s=e.getSuggestion(a,c),u=e.props.getSuggestionValue(s);e.maybeCallOnChange(t,u,"click"),e.onSuggestionSelected(t,{suggestion:s,suggestionValue:u,suggestionIndex:c,sectionIndex:a,method:"click"}),r||e.closeSuggestions(),!0===o?e.input.focus():e.onBlur(),setTimeout((function(){e.justSelectedSuggestion=!1}))},this.onBlur=function(){var t=e.props,n=t.inputProps,r=t.shouldRenderSuggestions,o=n.value,i=n.onBlur,a=e.getHighlightedSuggestion(),c=r(o);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!c}),i&&i(e.blurEvent,{highlightedSuggestion:a})},this.onSuggestionMouseLeave=function(t){e.resetHighlightedSuggestion(!1),e.justSelectedSuggestion&&t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!1)},this.onSuggestionTouchStart=function(){e.justSelectedSuggestion=!0},this.onSuggestionTouchMove=function(){e.justSelectedSuggestion=!1,e.pressedSuggestion=null,e.input.focus()},this.itemProps=function(t){return{"data-section-index":t.sectionIndex,"data-suggestion-index":t.itemIndex,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.onSuggestionMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionTouchStart,onTouchMove:e.onSuggestionTouchMove,onClick:e.onSuggestionClick}},this.renderSuggestionsContainer=function(t){var n=t.containerProps,r=t.children;return(0,e.props.renderSuggestionsContainer)({containerProps:n,children:r,query:e.getQuery()})}};t.default=d},function(e,t,n){"use strict";var r=n(176);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}},function(e,t,n){"use strict";e.exports=n(179).default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&c.return&&c.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),c=d(a),s=d(n(16)),u=d(n(180)),l=d(n(181)),f=d(n(183)),p=d(n(184));function d(e){return e&&e.__esModule?e:{default:e}}var m={},h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.storeInputReference=function(e){null!==e&&(n.input=e)},n.storeItemsContainerReference=function(e){null!==e&&(n.itemsContainer=e)},n.onHighlightedItemChange=function(e){n.highlightedItem=e},n.getItemId=function(e,t){return null===t?null:"react-autowhatever-"+n.props.id+"-"+(null===e?"":"section-"+e)+"-item-"+t},n.onFocus=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!0}),t.onFocus&&t.onFocus(e)},n.onBlur=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!1}),t.onBlur&&t.onBlur(e)},n.onKeyDown=function(e){var t=n.props,r=t.inputProps,i=t.highlightedSectionIndex,a=t.highlightedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var c="ArrowDown"===e.key?"next":"prev",s=n.sectionIterator[c]([i,a]),u=o(s,2),l=u[0],f=u[1];r.onKeyDown(e,{newHighlightedSectionIndex:l,newHighlightedItemIndex:f});break;default:r.onKeyDown(e,{highlightedSectionIndex:i,highlightedItemIndex:a})}},n.highlightedItem=null,n.state={isInputFocused:!1},n.setSectionsItems(e),n.setSectionIterator(e),n.setTheme(e),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.items!==this.props.items&&this.setSectionsItems(e),e.items===this.props.items&&e.multiSection===this.props.multiSection||this.setSectionIterator(e),e.theme!==this.props.theme&&this.setTheme(e)}},{key:"componentDidUpdate",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"setSectionsItems",value:function(e){e.multiSection&&(this.sectionsItems=e.items.map((function(t){return e.getSectionItems(t)})),this.sectionsLengths=this.sectionsItems.map((function(e){return e.length})),this.allSectionsAreEmpty=this.sectionsLengths.every((function(e){return 0===e})))}},{key:"setSectionIterator",value:function(e){this.sectionIterator=(0,u.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,l.default)(e.theme)}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,r=n.id,o=n.items,i=n.renderItem,a=n.renderItemData,s=n.renderSectionTitle,u=n.highlightedSectionIndex,l=n.highlightedItemIndex,d=n.itemProps;return o.map((function(n,o){var m="react-autowhatever-"+r+"-",h=m+"section-"+o+"-",y=0===o;return c.default.createElement("div",t(h+"container","sectionContainer",y&&"sectionContainerFirst"),c.default.createElement(f.default,{section:n,renderSectionTitle:s,theme:t,sectionKeyPrefix:h}),c.default.createElement(p.default,{items:e.sectionsItems[o],itemProps:d,renderItem:i,renderItemData:a,sectionIndex:o,highlightedItemIndex:u===o?l:null,onHighlightedItemChange:e.onHighlightedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:m,ref:e.storeItemsListReference}))}))}},{key:"renderItems",value:function(){var e=this.props.items;if(0===e.length)return null;var t=this.theme,n=this.props,r=n.id,o=n.renderItem,i=n.renderItemData,a=n.highlightedSectionIndex,s=n.highlightedItemIndex,u=n.itemProps;return c.default.createElement(p.default,{items:e,itemProps:u,renderItem:o,renderItemData:i,highlightedItemIndex:null===a?s:null,onHighlightedItemChange:this.onHighlightedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-"+r+"-"})}},{key:"ensureHighlightedItemIsVisible",value:function(){var e=this.highlightedItem;if(e){var t=this.itemsContainer,n=e.offsetParent===t?e.offsetTop:e.offsetTop-t.offsetTop,r=t.scrollTop;n<r?r=n:n+e.offsetHeight>r+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,o=t.multiSection,i=t.renderInputComponent,a=t.renderItemsContainer,s=t.highlightedSectionIndex,u=t.highlightedItemIndex,l=this.state.isInputFocused,f=o?this.renderSections():this.renderItems(),p=null!==f,d=this.getItemId(s,u),m="react-autowhatever-"+n,h=r({role:"combobox","aria-haspopup":"listbox","aria-owns":m,"aria-expanded":p},e("react-autowhatever-"+n+"-container","container",p&&"containerOpen"),this.props.containerProps),y=i(r({type:"text",value:"",autoComplete:"off","aria-autocomplete":"list","aria-controls":m,"aria-activedescendant":d},e("react-autowhatever-"+n+"-input","input",p&&"inputOpen",l&&"inputFocused"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),v=a({containerProps:r({id:m,role:"listbox"},e("react-autowhatever-"+n+"-items-container","itemsContainer",p&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:f});return c.default.createElement("div",h,y,v)}}]),t}(a.Component);h.propTypes={id:s.default.string,multiSection:s.default.bool,renderInputComponent:s.default.func,renderItemsContainer:s.default.func,items:s.default.array.isRequired,renderItem:s.default.func,renderItemData:s.default.object,renderSectionTitle:s.default.func,getSectionItems:s.default.func,containerProps:s.default.object,inputProps:s.default.object,itemProps:s.default.oneOfType([s.default.object,s.default.func]),highlightedSectionIndex:s.default.number,highlightedItemIndex:s.default.number,theme:s.default.oneOfType([s.default.object,s.default.array])},h.defaultProps={id:"1",multiSection:!1,renderInputComponent:function(e){return c.default.createElement("input",e)},renderItemsContainer:function(e){var t=e.containerProps,n=e.children;return c.default.createElement("div",t,n)},renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:m,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},containerProps:m,inputProps:m,itemProps:m,highlightedSectionIndex:null,highlightedItemIndex:null,theme:{container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",inputOpen:"react-autowhatever__input--open",inputFocused:"react-autowhatever__input--focused",itemsContainer:"react-autowhatever__items-container",itemsContainerOpen:"react-autowhatever__items-container--open",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFirst:"react-autowhatever__item--first",itemHighlighted:"react-autowhatever__item--highlighted",sectionContainer:"react-autowhatever__section-container",sectionContainerFirst:"react-autowhatever__section-container--first",sectionTitle:"react-autowhatever__section-title"}},t.default=h},function(e,t,n){"use strict";var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&c.return&&c.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.exports=function(e){var t=e.data,n=e.multiSection;function o(e){var o=r(e,2),i=o[0],a=o[1];return n?null===a||a===t[i]-1?null===(i=function(e){for(null===e?e=0:e++;e<t.length&&0===t[e];)e++;return e===t.length?null:e}(i))?[null,null]:[i,0]:[i,a+1]:0===t||a===t-1?[null,null]:null===a?[null,0]:[null,a+1]}return{next:o,prev:function(e){var o=r(e,2),i=o[0],a=o[1];return n?null===a||0===a?null===(i=function(e){for(null===e?e=t.length-1:e--;e>=0&&0===t[e];)e--;return-1===e?null:e}(i))?[null,null]:[i,t[i]-1]:[i,a-1]:0===t||0===a?[null,null]:null===a?[null,t-1]:[null,a-1]},isLast:function(e){return null===o(e)[1]}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&c.return&&c.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var i,a=n(182),c=(i=a)&&i.__esModule?i:{default:i},s=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=r(t,2),i=n[0],a=n[1];return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var u=n.map((function(e){return i[e]})).filter(s);return"string"==typeof u[0]||"function"==typeof a?{key:e,className:a?a.apply(void 0,o(u)):u.join(" ")}:{key:e,style:c.default.apply(void 0,[{}].concat(o(u)))}}},e.exports=t.default},function(e,t,n){"use strict";var r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function i(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter((function(t){return r.call(e,t)}))}e.exports=Object.assign||function(e,t){for(var n,r,a=o(e),c=1;c<arguments.length;c++){n=arguments[c],r=i(Object(n));for(var s=0;s<r.length;s++)a[r[s]]=n[r[s]]}return a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=s(o),a=s(n(16)),c=s(n(29));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var f=function(e){function t(){return u(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"shouldComponentUpdate",value:function(e){return(0,c.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,r=e.theme,o=e.sectionKeyPrefix,a=n(t);return a?i.default.createElement("div",r(o+"title","sectionTitle"),a):null}}]),t}(o.Component);f.propTypes={section:a.default.any.isRequired,renderSectionTitle:a.default.func.isRequired,theme:a.default.func.isRequired,sectionKeyPrefix:a.default.string.isRequired},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=l(i),c=l(n(16)),s=l(n(185)),u=l(n(29));function l(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=function(e){function t(){var e,n,r;f(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=p(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.storeHighlightedItemReference=function(e){r.props.onHighlightedItemChange(null===e?null:e.item)},p(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"shouldComponentUpdate",value:function(e){return(0,u.default)(e,this.props,["itemProps"])}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,o=t.itemProps,i=t.renderItem,c=t.renderItemData,u=t.sectionIndex,l=t.highlightedItemIndex,f=t.getItemId,p=t.theme,d=t.keyPrefix,m=null===u?d:d+"section-"+u+"-",h="function"==typeof o;return a.default.createElement("ul",r({role:"listbox"},p(m+"items-list","itemsList")),n.map((function(t,n){var d=0===n,y=n===l,v=m+"item-"+n,b=h?o({sectionIndex:u,itemIndex:n}):o,g=r({id:f(u,n),"aria-selected":y},p(v,"item",d&&"itemFirst",y&&"itemHighlighted"),b);return y&&(g.ref=e.storeHighlightedItemReference),a.default.createElement(s.default,r({},g,{sectionIndex:u,isHighlighted:y,itemIndex:n,item:t,renderItem:i,renderItemData:c}))})))}}]),t}(i.Component);d.propTypes={items:c.default.array.isRequired,itemProps:c.default.oneOfType([c.default.object,c.default.func]),renderItem:c.default.func.isRequired,renderItemData:c.default.object.isRequired,sectionIndex:c.default.number,highlightedItemIndex:c.default.number,onHighlightedItemChange:c.default.func.isRequired,getItemId:c.default.func.isRequired,theme:c.default.func.isRequired,keyPrefix:c.default.string.isRequired},d.defaultProps={sectionIndex:null},t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=u(i),c=u(n(16)),s=u(n(29));function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var p=function(e){function t(){var e,n,r;l(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=f(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.storeItemReference=function(e){null!==e&&(r.item=e)},r.onMouseEnter=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseEnter(e,{sectionIndex:n,itemIndex:o})},r.onMouseLeave=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseLeave(e,{sectionIndex:n,itemIndex:o})},r.onMouseDown=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseDown(e,{sectionIndex:n,itemIndex:o})},r.onClick=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onClick(e,{sectionIndex:n,itemIndex:o})},f(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"shouldComponentUpdate",value:function(e){return(0,s.default)(e,this.props,["renderItemData"])}},{key:"render",value:function(){var e=this.props,t=e.isHighlighted,n=e.item,o=e.renderItem,i=e.renderItemData,c=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["isHighlighted","item","renderItem","renderItemData"]);return delete c.sectionIndex,delete c.itemIndex,"function"==typeof c.onMouseEnter&&(c.onMouseEnter=this.onMouseEnter),"function"==typeof c.onMouseLeave&&(c.onMouseLeave=this.onMouseLeave),"function"==typeof c.onMouseDown&&(c.onMouseDown=this.onMouseDown),"function"==typeof c.onClick&&(c.onClick=this.onClick),a.default.createElement("li",r({role:"option"},c,{ref:this.storeItemReference}),o(n,r({isHighlighted:t},i)))}}]),t}(i.Component);p.propTypes={sectionIndex:c.default.number,isHighlighted:c.default.bool.isRequired,itemIndex:c.default.number.isRequired,item:c.default.any.isRequired,renderItem:c.default.func.isRequired,renderItemData:c.default.object.isRequired,onMouseEnter:c.default.func,onMouseLeave:c.default.func,onMouseDown:c.default.func,onClick:c.default.func},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"},t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}},function(e,t,n){"use strict";t.__esModule=!0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(188));var o=r.tokenize,i=r.options.Options;function a(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function c(e){return e.replace(/"/g,""")}function s(e){if(!e)return"";var t=[];for(var n in e){var r=e[n]+"";t.push(n+'="'+c(r)+'"')}return t.join(" ")}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=new i(t);for(var n=o(e),r=[],u=0;u<n.length;u++){var l=n[u];if("nl"===l.type&&t.nl2br)r.push("<br>\n");else if(l.isLink&&t.check(l)){var f=t.resolve(l),p=f.formatted,d=f.formattedHref,m=f.tagName,h=f.className,y=f.target,v=f.attributes,b="<"+m+' href="'+c(d)+'"';h&&(b+=' class="'+c(h)+'"'),y&&(b+=' target="'+c(y)+'"'),v&&(b+=" "+s(v)),b+=">"+a(p)+"</"+m+">",r.push(b)}else r.push(a(l.toString()))}return r.join("")}if(!String.prototype.linkify)try{Object.defineProperty(String.prototype,"linkify",{set:function(){},get:function(){return function(e){return u(this,e)}}})}catch(e){String.prototype.linkify||(String.prototype.linkify=function(e){return u(this,e)})}t.default=u},function(e,t,n){"use strict";t.__esModule=!0,t.tokenize=t.test=t.scanner=t.parser=t.options=t.inherits=t.find=void 0;var r=n(19),o=c(n(189)),i=c(n(190)),a=c(n(191));function c(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var s=function(e){return a.run(i.run(e))};t.find=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s(e),r=[],o=0;o<n.length;o++){var i=n[o];!i.isLink||t&&i.type!==t||r.push(i.toObject())}return r},t.inherits=r.inherits,t.options=o,t.parser=a,t.scanner=i,t.test=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s(e);return 1===n.length&&n[0].isLink&&(!t||n[0].type===t)},t.tokenize=s},function(e,t,n){"use strict";t.__esModule=!0;var 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},o={defaultProtocol:"http",events:null,format:a,formatHref:a,nl2br:!1,tagName:"a",target:function(e,t){return"url"===t?"_blank":null},validate:!0,ignoreTags:[],attributes:null,className:"linkified"};function i(e){e=e||{},this.defaultProtocol=e.hasOwnProperty("defaultProtocol")?e.defaultProtocol:o.defaultProtocol,this.events=e.hasOwnProperty("events")?e.events:o.events,this.format=e.hasOwnProperty("format")?e.format:o.format,this.formatHref=e.hasOwnProperty("formatHref")?e.formatHref:o.formatHref,this.nl2br=e.hasOwnProperty("nl2br")?e.nl2br:o.nl2br,this.tagName=e.hasOwnProperty("tagName")?e.tagName:o.tagName,this.target=e.hasOwnProperty("target")?e.target:o.target,this.validate=e.hasOwnProperty("validate")?e.validate:o.validate,this.ignoreTags=[],this.attributes=e.attributes||e.linkAttributes||o.attributes,this.className=e.hasOwnProperty("className")?e.className:e.linkClass||o.className;for(var t=e.hasOwnProperty("ignoreTags")?e.ignoreTags:o.ignoreTags,n=0;n<t.length;n++)this.ignoreTags.push(t[n].toUpperCase())}function a(e){return e}t.defaults=o,t.Options=i,t.contains=function(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1},i.prototype={resolve:function(e){var t=e.toHref(this.defaultProtocol);return{formatted:this.get("format",e.toString(),e),formattedHref:this.get("formatHref",t,e),tagName:this.get("tagName",t,e),className:this.get("className",t,e),target:this.get("target",t,e),events:this.getObject("events",t,e),attributes:this.getObject("attributes",t,e)}},check:function(e){return this.get("validate",e.toString(),e)},get:function(e,t,n){var i=void 0,a=this[e];if(!a)return a;switch(void 0===a?"undefined":r(a)){case"function":return a(t,n.type);case"object":return"function"==typeof(i=a.hasOwnProperty(n.type)?a[n.type]:o[e])?i(t,n.type):i}return a},getObject:function(e,t,n){var r=this[e];return"function"==typeof r?r(t,n.type):r}}},function(e,t,n){"use strict";t.__esModule=!0,t.start=t.run=t.TOKENS=t.State=void 0;var r=n(120),o=n(30),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(o);var a="aaa|aarp|abarth|abb|abbott|abbvie|abc|able|abogado|abudhabi|ac|academy|accenture|accountant|accountants|aco|active|actor|ad|adac|ads|adult|ae|aeg|aero|aetna|af|afamilycompany|afl|africa|ag|agakhan|agency|ai|aig|aigo|airbus|airforce|airtel|akdn|al|alfaromeo|alibaba|alipay|allfinanz|allstate|ally|alsace|alstom|am|americanexpress|americanfamily|amex|amfam|amica|amsterdam|analytics|android|anquan|anz|ao|aol|apartments|app|apple|aq|aquarelle|ar|arab|aramco|archi|army|arpa|art|arte|as|asda|asia|associates|at|athleta|attorney|au|auction|audi|audible|audio|auspost|author|auto|autos|avianca|aw|aws|ax|axa|az|azure|ba|baby|baidu|banamex|bananarepublic|band|bank|bar|barcelona|barclaycard|barclays|barefoot|bargains|baseball|basketball|bauhaus|bayern|bb|bbc|bbt|bbva|bcg|bcn|bd|be|beats|beauty|beer|bentley|berlin|best|bestbuy|bet|bf|bg|bh|bharti|bi|bible|bid|bike|bing|bingo|bio|biz|bj|black|blackfriday|blanco|blockbuster|blog|bloomberg|blue|bm|bms|bmw|bn|bnl|bnpparibas|bo|boats|boehringer|bofa|bom|bond|boo|book|booking|boots|bosch|bostik|boston|bot|boutique|box|br|bradesco|bridgestone|broadway|broker|brother|brussels|bs|bt|budapest|bugatti|build|builders|business|buy|buzz|bv|bw|by|bz|bzh|ca|cab|cafe|cal|call|calvinklein|cam|camera|camp|cancerresearch|canon|capetown|capital|capitalone|car|caravan|cards|care|career|careers|cars|cartier|casa|case|caseih|cash|casino|cat|catering|catholic|cba|cbn|cbre|cbs|cc|cd|ceb|center|ceo|cern|cf|cfa|cfd|cg|ch|chanel|channel|chase|chat|cheap|chintai|chloe|christmas|chrome|chrysler|church|ci|cipriani|circle|cisco|citadel|citi|citic|city|cityeats|ck|cl|claims|cleaning|click|clinic|clinique|clothing|cloud|club|clubmed|cm|cn|co|coach|codes|coffee|college|cologne|com|comcast|commbank|community|company|compare|computer|comsec|condos|construction|consulting|contact|contractors|cooking|cookingchannel|cool|coop|corsica|country|coupon|coupons|courses|cr|credit|creditcard|creditunion|cricket|crown|crs|cruise|cruises|csc|cu|cuisinella|cv|cw|cx|cy|cymru|cyou|cz|dabur|dad|dance|data|date|dating|datsun|day|dclk|dds|de|deal|dealer|deals|degree|delivery|dell|deloitte|delta|democrat|dental|dentist|desi|design|dev|dhl|diamonds|diet|digital|direct|directory|discount|discover|dish|diy|dj|dk|dm|dnp|do|docs|doctor|dodge|dog|doha|domains|dot|download|drive|dtv|dubai|duck|dunlop|duns|dupont|durban|dvag|dvr|dz|earth|eat|ec|eco|edeka|edu|education|ee|eg|email|emerck|energy|engineer|engineering|enterprises|epost|epson|equipment|er|ericsson|erni|es|esq|estate|esurance|et|etisalat|eu|eurovision|eus|events|everbank|exchange|expert|exposed|express|extraspace|fage|fail|fairwinds|faith|family|fan|fans|farm|farmers|fashion|fast|fedex|feedback|ferrari|ferrero|fi|fiat|fidelity|fido|film|final|finance|financial|fire|firestone|firmdale|fish|fishing|fit|fitness|fj|fk|flickr|flights|flir|florist|flowers|fly|fm|fo|foo|food|foodnetwork|football|ford|forex|forsale|forum|foundation|fox|fr|free|fresenius|frl|frogans|frontdoor|frontier|ftr|fujitsu|fujixerox|fun|fund|furniture|futbol|fyi|ga|gal|gallery|gallo|gallup|game|games|gap|garden|gb|gbiz|gd|gdn|ge|gea|gent|genting|george|gf|gg|ggee|gh|gi|gift|gifts|gives|giving|gl|glade|glass|gle|global|globo|gm|gmail|gmbh|gmo|gmx|gn|godaddy|gold|goldpoint|golf|goo|goodhands|goodyear|goog|google|gop|got|gov|gp|gq|gr|grainger|graphics|gratis|green|gripe|grocery|group|gs|gt|gu|guardian|gucci|guge|guide|guitars|guru|gw|gy|hair|hamburg|hangout|haus|hbo|hdfc|hdfcbank|health|healthcare|help|helsinki|here|hermes|hgtv|hiphop|hisamitsu|hitachi|hiv|hk|hkt|hm|hn|hockey|holdings|holiday|homedepot|homegoods|homes|homesense|honda|honeywell|horse|hospital|host|hosting|hot|hoteles|hotels|hotmail|house|how|hr|hsbc|ht|htc|hu|hughes|hyatt|hyundai|ibm|icbc|ice|icu|id|ie|ieee|ifm|ikano|il|im|imamat|imdb|immo|immobilien|in|industries|infiniti|info|ing|ink|institute|insurance|insure|int|intel|international|intuit|investments|io|ipiranga|iq|ir|irish|is|iselect|ismaili|ist|istanbul|it|itau|itv|iveco|iwc|jaguar|java|jcb|jcp|je|jeep|jetzt|jewelry|jio|jlc|jll|jm|jmp|jnj|jo|jobs|joburg|jot|joy|jp|jpmorgan|jprs|juegos|juniper|kaufen|kddi|ke|kerryhotels|kerrylogistics|kerryproperties|kfh|kg|kh|ki|kia|kim|kinder|kindle|kitchen|kiwi|km|kn|koeln|komatsu|kosher|kp|kpmg|kpn|kr|krd|kred|kuokgroup|kw|ky|kyoto|kz|la|lacaixa|ladbrokes|lamborghini|lamer|lancaster|lancia|lancome|land|landrover|lanxess|lasalle|lat|latino|latrobe|law|lawyer|lb|lc|lds|lease|leclerc|lefrak|legal|lego|lexus|lgbt|li|liaison|lidl|life|lifeinsurance|lifestyle|lighting|like|lilly|limited|limo|lincoln|linde|link|lipsy|live|living|lixil|lk|loan|loans|locker|locus|loft|lol|london|lotte|lotto|love|lpl|lplfinancial|lr|ls|lt|ltd|ltda|lu|lundbeck|lupin|luxe|luxury|lv|ly|ma|macys|madrid|maif|maison|makeup|man|management|mango|map|market|marketing|markets|marriott|marshalls|maserati|mattel|mba|mc|mckinsey|md|me|med|media|meet|melbourne|meme|memorial|men|menu|meo|merckmsd|metlife|mg|mh|miami|microsoft|mil|mini|mint|mit|mitsubishi|mk|ml|mlb|mls|mm|mma|mn|mo|mobi|mobile|mobily|moda|moe|moi|mom|monash|money|monster|mopar|mormon|mortgage|moscow|moto|motorcycles|mov|movie|movistar|mp|mq|mr|ms|msd|mt|mtn|mtr|mu|museum|mutual|mv|mw|mx|my|mz|na|nab|nadex|nagoya|name|nationwide|natura|navy|nba|nc|ne|nec|net|netbank|netflix|network|neustar|new|newholland|news|next|nextdirect|nexus|nf|nfl|ng|ngo|nhk|ni|nico|nike|nikon|ninja|nissan|nissay|nl|no|nokia|northwesternmutual|norton|now|nowruz|nowtv|np|nr|nra|nrw|ntt|nu|nyc|nz|obi|observer|off|office|okinawa|olayan|olayangroup|oldnavy|ollo|om|omega|one|ong|onl|online|onyourside|ooo|open|oracle|orange|org|organic|origins|osaka|otsuka|ott|ovh|pa|page|panasonic|panerai|paris|pars|partners|parts|party|passagens|pay|pccw|pe|pet|pf|pfizer|pg|ph|pharmacy|phd|philips|phone|photo|photography|photos|physio|piaget|pics|pictet|pictures|pid|pin|ping|pink|pioneer|pizza|pk|pl|place|play|playstation|plumbing|plus|pm|pn|pnc|pohl|poker|politie|porn|post|pr|pramerica|praxi|press|prime|pro|prod|productions|prof|progressive|promo|properties|property|protection|pru|prudential|ps|pt|pub|pw|pwc|py|qa|qpon|quebec|quest|qvc|racing|radio|raid|re|read|realestate|realtor|realty|recipes|red|redstone|redumbrella|rehab|reise|reisen|reit|reliance|ren|rent|rentals|repair|report|republican|rest|restaurant|review|reviews|rexroth|rich|richardli|ricoh|rightathome|ril|rio|rip|rmit|ro|rocher|rocks|rodeo|rogers|room|rs|rsvp|ru|rugby|ruhr|run|rw|rwe|ryukyu|sa|saarland|safe|safety|sakura|sale|salon|samsclub|samsung|sandvik|sandvikcoromant|sanofi|sap|sapo|sarl|sas|save|saxo|sb|sbi|sbs|sc|sca|scb|schaeffler|schmidt|scholarships|school|schule|schwarz|science|scjohnson|scor|scot|sd|se|search|seat|secure|security|seek|select|sener|services|ses|seven|sew|sex|sexy|sfr|sg|sh|shangrila|sharp|shaw|shell|shia|shiksha|shoes|shop|shopping|shouji|show|showtime|shriram|si|silk|sina|singles|site|sj|sk|ski|skin|sky|skype|sl|sling|sm|smart|smile|sn|sncf|so|soccer|social|softbank|software|sohu|solar|solutions|song|sony|soy|space|spiegel|spot|spreadbetting|sr|srl|srt|st|stada|staples|star|starhub|statebank|statefarm|statoil|stc|stcgroup|stockholm|storage|store|stream|studio|study|style|su|sucks|supplies|supply|support|surf|surgery|suzuki|sv|swatch|swiftcover|swiss|sx|sy|sydney|symantec|systems|sz|tab|taipei|talk|taobao|target|tatamotors|tatar|tattoo|tax|taxi|tc|tci|td|tdk|team|tech|technology|tel|telecity|telefonica|temasek|tennis|teva|tf|tg|th|thd|theater|theatre|tiaa|tickets|tienda|tiffany|tips|tires|tirol|tj|tjmaxx|tjx|tk|tkmaxx|tl|tm|tmall|tn|to|today|tokyo|tools|top|toray|toshiba|total|tours|town|toyota|toys|tr|trade|trading|training|travel|travelchannel|travelers|travelersinsurance|trust|trv|tt|tube|tui|tunes|tushu|tv|tvs|tw|tz|ua|ubank|ubs|uconnect|ug|uk|unicom|university|uno|uol|ups|us|uy|uz|va|vacations|vana|vanguard|vc|ve|vegas|ventures|verisign|versicherung|vet|vg|vi|viajes|video|vig|viking|villas|vin|vip|virgin|visa|vision|vista|vistaprint|viva|vivo|vlaanderen|vn|vodka|volkswagen|volvo|vote|voting|voto|voyage|vu|vuelos|wales|walmart|walter|wang|wanggou|warman|watch|watches|weather|weatherchannel|webcam|weber|website|wed|wedding|weibo|weir|wf|whoswho|wien|wiki|williamhill|win|windows|wine|winners|wme|wolterskluwer|woodside|work|works|world|wow|ws|wtc|wtf|xbox|xerox|xfinity|xihuan|xin|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--30rr7y|xn--3bst00m|xn--3ds443g|xn--3e0b707e|xn--3hcrj9c|xn--3oq18vl8pn36a|xn--3pxu8k|xn--42c2d9a|xn--45br5cyl|xn--45brj9c|xn--45q11c|xn--4gbrim|xn--54b7fta0cc|xn--55qw42g|xn--55qx5d|xn--5su34j936bgsg|xn--5tzm5g|xn--6frz82g|xn--6qq986b3xl|xn--80adxhks|xn--80ao21a|xn--80aqecdr1a|xn--80asehdb|xn--80aswg|xn--8y0a063a|xn--90a3ac|xn--90ae|xn--90ais|xn--9dbq2a|xn--9et52u|xn--9krt00a|xn--b4w605ferd|xn--bck1b9a5dre4c|xn--c1avg|xn--c2br7g|xn--cck2b3b|xn--cg4bki|xn--clchc0ea0b2g2a9gcd|xn--czr694b|xn--czrs0t|xn--czru2d|xn--d1acj3b|xn--d1alf|xn--e1a4c|xn--eckvdtc9d|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fhbei|xn--fiq228c5hs|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--fjq720a|xn--flw351e|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--fzys8d69uvgm|xn--g2xx48c|xn--gckr3f0f|xn--gecrj9c|xn--gk3at1e|xn--h2breg3eve|xn--h2brj9c|xn--h2brj9c8c|xn--hxt814e|xn--i1b6b1a6a2e|xn--imr513n|xn--io0a7i|xn--j1aef|xn--j1amh|xn--j6w193g|xn--jlq61u9w7b|xn--jvr189m|xn--kcrx77d1x4a|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--kput3i|xn--l1acc|xn--lgbbat1ad8j|xn--mgb9awbf|xn--mgba3a3ejt|xn--mgba3a4f16a|xn--mgba7c0bbn0a|xn--mgbaakc7dvf|xn--mgbaam7a8h|xn--mgbab2bd|xn--mgbai9azgqp6j|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a|xn--mgbbh1a71e|xn--mgbc0a9azcg|xn--mgbca7dzdo|xn--mgberp4a5d4ar|xn--mgbgu82a|xn--mgbi4ecexp|xn--mgbpl2fh|xn--mgbt3dhd|xn--mgbtx2b|xn--mgbx4cd0ab|xn--mix891f|xn--mk1bu44c|xn--mxtq1m|xn--ngbc5azd|xn--ngbe9e0a|xn--ngbrx|xn--node|xn--nqv7f|xn--nqv7fs00ema|xn--nyqy26a|xn--o3cw4h|xn--ogbpf8fl|xn--p1acf|xn--p1ai|xn--pbt977c|xn--pgbs0dh|xn--pssy2u|xn--q9jyb4c|xn--qcka1pmc|xn--qxam|xn--rhqv96g|xn--rovu88b|xn--rvc1e0am3e|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--tckwe|xn--tiq49xqyj|xn--unup4y|xn--vermgensberater-ctb|xn--vermgensberatung-pwb|xn--vhquv|xn--vuq861b|xn--w4r85el8fhu5dnra|xn--w4rs40l|xn--wgbh1c|xn--wgbl6a|xn--xhq521b|xn--xkc2al3hye2a|xn--xkc2dl3a5ee0h|xn--y9a3aq|xn--yfro4i67o|xn--ygbi2ammx|xn--zfr164b|xperia|xxx|xyz|yachts|yahoo|yamaxun|yandex|ye|yodobashi|yoga|yokohama|you|youtube|yt|yun|za|zappos|zara|zero|zip|zippo|zm|zone|zuerich|zw".split("|"),c="0123456789".split(""),s="0123456789abcdefghijklmnopqrstuvwxyz".split(""),u=[" ","\f","\r","\t","\v"," "," ",""],l=[],f=function(e){return new r.CharacterState(e)},p=f(),d=f(o.NUM),m=f(o.DOMAIN),h=f(),y=f(o.WS);p.on("@",f(o.AT)).on(".",f(o.DOT)).on("+",f(o.PLUS)).on("#",f(o.POUND)).on("?",f(o.QUERY)).on("/",f(o.SLASH)).on("_",f(o.UNDERSCORE)).on(":",f(o.COLON)).on("{",f(o.OPENBRACE)).on("[",f(o.OPENBRACKET)).on("<",f(o.OPENANGLEBRACKET)).on("(",f(o.OPENPAREN)).on("}",f(o.CLOSEBRACE)).on("]",f(o.CLOSEBRACKET)).on(">",f(o.CLOSEANGLEBRACKET)).on(")",f(o.CLOSEPAREN)).on("&",f(o.AMPERSAND)).on([",",";","!",'"',"'"],f(o.PUNCTUATION)),p.on("\n",f(o.NL)).on(u,y),y.on(u,y);for(var v=0;v<a.length;v++){var b=(0,r.stateify)(a[v],p,o.TLD,o.DOMAIN);l.push.apply(l,b)}var g=(0,r.stateify)("file",p,o.DOMAIN,o.DOMAIN),S=(0,r.stateify)("ftp",p,o.DOMAIN,o.DOMAIN),E=(0,r.stateify)("http",p,o.DOMAIN,o.DOMAIN),O=(0,r.stateify)("mailto",p,o.DOMAIN,o.DOMAIN);l.push.apply(l,g),l.push.apply(l,S),l.push.apply(l,E),l.push.apply(l,O);var j=g.pop(),C=S.pop(),w=E.pop(),A=O.pop(),I=f(o.DOMAIN),T=f(o.PROTOCOL),k=f(o.MAILTO);C.on("s",I).on(":",T),w.on("s",I).on(":",T),l.push(I),j.on(":",T),I.on(":",T),A.on(":",k);var _=(0,r.stateify)("localhost",p,o.LOCALHOST,o.DOMAIN);l.push.apply(l,_),p.on(c,d),d.on("-",h).on(c,d).on(s,m),m.on("-",h).on(s,m);for(var L=0;L<l.length;L++)l[L].on("-",h).on(s,m);h.on("-",h).on(c,m).on(s,m),p.defaultTransition=f(o.SYM);var x=p;t.State=r.CharacterState,t.TOKENS=i,t.run=function(e){for(var t=e.replace(/[A-Z]/g,(function(e){return e.toLowerCase()})),n=e.length,r=[],o=0;o<n;){for(var i=p,a=null,c=0,s=null,u=-1;o<n&&(a=i.next(t[o]));)(i=a).accepts()?(u=0,s=i):u>=0&&u++,c++,o++;if(!(u<0)){o-=u,c-=u;var l=s.emit();r.push(new l(e.substr(o-c,c)))}}return r},t.start=x},function(e,t,n){"use strict";t.__esModule=!0,t.start=t.run=t.TOKENS=t.State=void 0;var r=n(120),o=n(192),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(o),a=n(30);var c=function(e){return new r.TokenState(e)},s=c(),u=c(),l=c(),f=c(),p=c(),d=c(),m=c(),h=c(o.URL),y=c(),v=c(o.URL),b=c(o.URL),g=c(),S=c(),E=c(),O=c(),j=c(),C=c(o.URL),w=c(o.URL),A=c(o.URL),I=c(o.URL),T=c(),k=c(),_=c(),L=c(),x=c(),P=c(),N=c(o.EMAIL),R=c(),D=c(o.EMAIL),M=c(o.MAILTOEMAIL),U=c(),F=c(),V=c(),z=c(),B=c(o.NL);s.on(a.NL,B).on(a.PROTOCOL,u).on(a.MAILTO,l).on(a.SLASH,f),u.on(a.SLASH,f),f.on(a.SLASH,p),s.on(a.TLD,d).on(a.DOMAIN,d).on(a.LOCALHOST,h).on(a.NUM,d),p.on(a.TLD,b).on(a.DOMAIN,b).on(a.NUM,b).on(a.LOCALHOST,b),d.on(a.DOT,m),x.on(a.DOT,P),m.on(a.TLD,h).on(a.DOMAIN,d).on(a.NUM,d).on(a.LOCALHOST,d),P.on(a.TLD,N).on(a.DOMAIN,x).on(a.NUM,x).on(a.LOCALHOST,x),h.on(a.DOT,m),N.on(a.DOT,P),h.on(a.COLON,y).on(a.SLASH,b),y.on(a.NUM,v),v.on(a.SLASH,b),N.on(a.COLON,R),R.on(a.NUM,D);var H=[a.DOMAIN,a.AT,a.LOCALHOST,a.NUM,a.PLUS,a.POUND,a.PROTOCOL,a.SLASH,a.TLD,a.UNDERSCORE,a.SYM,a.AMPERSAND],q=[a.COLON,a.DOT,a.QUERY,a.PUNCTUATION,a.CLOSEBRACE,a.CLOSEBRACKET,a.CLOSEANGLEBRACKET,a.CLOSEPAREN,a.OPENBRACE,a.OPENBRACKET,a.OPENANGLEBRACKET,a.OPENPAREN];b.on(a.OPENBRACE,S).on(a.OPENBRACKET,E).on(a.OPENANGLEBRACKET,O).on(a.OPENPAREN,j),g.on(a.OPENBRACE,S).on(a.OPENBRACKET,E).on(a.OPENANGLEBRACKET,O).on(a.OPENPAREN,j),S.on(a.CLOSEBRACE,b),E.on(a.CLOSEBRACKET,b),O.on(a.CLOSEANGLEBRACKET,b),j.on(a.CLOSEPAREN,b),C.on(a.CLOSEBRACE,b),w.on(a.CLOSEBRACKET,b),A.on(a.CLOSEANGLEBRACKET,b),I.on(a.CLOSEPAREN,b),T.on(a.CLOSEBRACE,b),k.on(a.CLOSEBRACKET,b),_.on(a.CLOSEANGLEBRACKET,b),L.on(a.CLOSEPAREN,b),S.on(H,C),E.on(H,w),O.on(H,A),j.on(H,I),S.on(q,T),E.on(q,k),O.on(q,_),j.on(q,L),C.on(H,C),w.on(H,w),A.on(H,A),I.on(H,I),C.on(q,C),w.on(q,w),A.on(q,A),I.on(q,I),T.on(H,C),k.on(H,w),_.on(H,A),L.on(H,I),T.on(q,T),k.on(q,k),_.on(q,_),L.on(q,L),b.on(H,b),g.on(H,b),b.on(q,g),g.on(q,g),l.on(a.TLD,M).on(a.DOMAIN,M).on(a.NUM,M).on(a.LOCALHOST,M),M.on(H,M).on(q,U),U.on(H,M).on(q,U);var J=[a.DOMAIN,a.NUM,a.PLUS,a.POUND,a.QUERY,a.UNDERSCORE,a.SYM,a.AMPERSAND,a.TLD];d.on(J,F).on(a.AT,V),h.on(J,F).on(a.AT,V),m.on(J,F),F.on(J,F).on(a.AT,V).on(a.DOT,z),z.on(J,F),V.on(a.TLD,x).on(a.DOMAIN,x).on(a.LOCALHOST,N);t.State=r.TokenState,t.TOKENS=i,t.run=function(e){for(var t=e.length,n=0,r=[],i=[];n<t;){for(var a=s,c=null,u=null,l=0,f=null,p=-1;n<t&&!(c=a.next(e[n]));)i.push(e[n++]);for(;n<t&&(u=c||a.next(e[n]));)c=null,(a=u).accepts()?(p=0,f=a):p>=0&&p++,n++,l++;if(p<0)for(var d=n-l;d<n;d++)i.push(e[d]);else{i.length>0&&(r.push(new o.TEXT(i)),i=[]),n-=p,l-=p;var m=f.emit();r.push(new m(e.slice(n-l,n)))}}return i.length>0&&r.push(new o.TEXT(i)),r},t.start=s},function(e,t,n){"use strict";t.__esModule=!0,t.URL=t.TEXT=t.NL=t.EMAIL=t.MAILTOEMAIL=t.Base=void 0;var r=n(121),o=n(19),i=n(30);function a(e){return e instanceof i.DOMAIN||e instanceof i.TLD}var c=(0,r.createTokenClass)();c.prototype={type:"token",isLink:!1,toString:function(){for(var e=[],t=0;t<this.v.length;t++)e.push(this.v[t].toString());return e.join("")},toHref:function(){return this.toString()},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http";return{type:this.type,value:this.toString(),href:this.toHref(e)}}};var s=(0,o.inherits)(c,(0,r.createTokenClass)(),{type:"email",isLink:!0}),u=(0,o.inherits)(c,(0,r.createTokenClass)(),{type:"email",isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),l=(0,o.inherits)(c,(0,r.createTokenClass)(),{type:"text"}),f=(0,o.inherits)(c,(0,r.createTokenClass)(),{type:"nl"}),p=(0,o.inherits)(c,(0,r.createTokenClass)(),{type:"url",isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http",t=!1,n=!1,r=this.v,o=[],c=0;r[c]instanceof i.PROTOCOL;)t=!0,o.push(r[c].toString().toLowerCase()),c++;for(;r[c]instanceof i.SLASH;)n=!0,o.push(r[c].toString()),c++;for(;a(r[c]);)o.push(r[c].toString().toLowerCase()),c++;for(;c<r.length;c++)o.push(r[c].toString());return o=o.join(""),t||n||(o=e+"://"+o),o},hasProtocol:function(){return this.v[0]instanceof i.PROTOCOL}});t.Base=c,t.MAILTOEMAIL=s,t.EMAIL=u,t.NL=f,t.TEXT=l,t.URL=p},function(e,t,n){const{defaults:r}=n(17),{block:o}=n(122),{rtrim:i,splitCells:a,escape:c}=n(13);e.exports=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.rules=o.normal,this.options.pedantic?this.rules=o.pedantic:this.options.gfm&&(this.rules=o.gfm)}static get rules(){return o}static lex(t,n){return new e(n).lex(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.token(e,!0)}token(e,t){let n,r,s,u,l,f,p,d,m,h,y,v,b,g,S,E;for(e=e.replace(/^ +$/gm,"");e;)if((s=this.rules.newline.exec(e))&&(e=e.substring(s[0].length),s[0].length>1&&this.tokens.push({type:"space"})),s=this.rules.code.exec(e)){const t=this.tokens[this.tokens.length-1];e=e.substring(s[0].length),t&&"paragraph"===t.type?t.text+="\n"+s[0].trimRight():(s=s[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?s:i(s,"\n")}))}else if(s=this.rules.fences.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"code",lang:s[2]?s[2].trim():s[2],text:s[3]||""});else if(s=this.rules.heading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:s[1].length,text:s[2]});else if((s=this.rules.nptable.exec(e))&&(f={type:"table",header:a(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]},f.header.length===f.align.length)){for(e=e.substring(s[0].length),y=0;y<f.align.length;y++)/^ *-+: *$/.test(f.align[y])?f.align[y]="right":/^ *:-+: *$/.test(f.align[y])?f.align[y]="center":/^ *:-+ *$/.test(f.align[y])?f.align[y]="left":f.align[y]=null;for(y=0;y<f.cells.length;y++)f.cells[y]=a(f.cells[y],f.header.length);this.tokens.push(f)}else if(s=this.rules.hr.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"hr"});else if(s=this.rules.blockquote.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"blockquote_start"}),s=s[0].replace(/^ *> ?/gm,""),this.token(s,t),this.tokens.push({type:"blockquote_end"});else if(s=this.rules.list.exec(e)){for(e=e.substring(s[0].length),u=s[2],g=u.length>1,p={type:"list_start",ordered:g,start:g?+u:"",loose:!1},this.tokens.push(p),s=s[0].match(this.rules.item),d=[],n=!1,b=s.length,y=0;y<b;y++)f=s[y],h=f.length,f=f.replace(/^ *([*+-]|\d+\.) */,""),~f.indexOf("\n ")&&(h-=f.length,f=this.options.pedantic?f.replace(/^ {1,4}/gm,""):f.replace(new RegExp("^ {1,"+h+"}","gm"),"")),y!==b-1&&(l=o.bullet.exec(s[y+1])[0],(u.length>1?1===l.length:l.length>1||this.options.smartLists&&l!==u)&&(e=s.slice(y+1).join("\n")+e,y=b-1)),r=n||/\n\n(?!\s*$)/.test(f),y!==b-1&&(n="\n"===f.charAt(f.length-1),r||(r=n)),r&&(p.loose=!0),S=/^\[[ xX]\] /.test(f),E=void 0,S&&(E=" "!==f[1],f=f.replace(/^\[[ xX]\] +/,"")),m={type:"list_item_start",task:S,checked:E,loose:r},d.push(m),this.tokens.push(m),this.token(f,!1),this.tokens.push({type:"list_item_end"});if(p.loose)for(b=d.length,y=0;y<b;y++)d[y].loose=!0;this.tokens.push({type:"list_end"})}else if(s=this.rules.html.exec(e))e=e.substring(s[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===s[1]||"script"===s[1]||"style"===s[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):c(s[0]):s[0]});else if(t&&(s=this.rules.def.exec(e)))e=e.substring(s[0].length),s[3]&&(s[3]=s[3].substring(1,s[3].length-1)),v=s[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[v]||(this.tokens.links[v]={href:s[2],title:s[3]});else if((s=this.rules.table.exec(e))&&(f={type:"table",header:a(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]},f.header.length===f.align.length)){for(e=e.substring(s[0].length),y=0;y<f.align.length;y++)/^ *-+: *$/.test(f.align[y])?f.align[y]="right":/^ *:-+: *$/.test(f.align[y])?f.align[y]="center":/^ *:-+ *$/.test(f.align[y])?f.align[y]="left":f.align[y]=null;for(y=0;y<f.cells.length;y++)f.cells[y]=a(f.cells[y].replace(/^ *\| *| *\| *$/g,""),f.header.length);this.tokens.push(f)}else if(s=this.rules.lheading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:"="===s[2].charAt(0)?1:2,text:s[1]});else if(t&&(s=this.rules.paragraph.exec(e)))e=e.substring(s[0].length),this.tokens.push({type:"paragraph",text:"\n"===s[1].charAt(s[1].length-1)?s[1].slice(0,-1):s[1]});else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"text",text:s[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens}}},function(e,t,n){const r=n(31),o=n(123),i=n(124),a=n(125),{defaults:c}=n(17),{merge:s,unescape:u}=n(13);e.exports=class e{constructor(e){this.tokens=[],this.token=null,this.options=e||c,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options,this.slugger=new o}static parse(t,n){return new e(n).parse(t)}parse(e){this.inline=new i(e.links,this.options),this.inlineText=new i(e.links,s({},this.options,{renderer:new a})),this.tokens=e.reverse();let t="";for(;this.next();)t+=this.tok();return t}next(){return this.token=this.tokens.pop(),this.token}peek(){return this.tokens[this.tokens.length-1]||0}parseText(){let e=this.token.text;for(;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}tok(){let e="";switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,u(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":{let t,n,r,o,i="";for(r="",t=0;t<this.token.header.length;t++)r+=this.renderer.tablecell(this.inline.output(this.token.header[t]),{header:!0,align:this.token.align[t]});for(i+=this.renderer.tablerow(r),t=0;t<this.token.cells.length;t++){for(n=this.token.cells[t],r="",o=0;o<n.length;o++)r+=this.renderer.tablecell(this.inline.output(n[o]),{header:!1,align:this.token.align[o]});e+=this.renderer.tablerow(r)}return this.renderer.table(i,e)}case"blockquote_start":for(e="";"blockquote_end"!==this.next().type;)e+=this.tok();return this.renderer.blockquote(e);case"list_start":{e="";const t=this.token.ordered,n=this.token.start;for(;"list_end"!==this.next().type;)e+=this.tok();return this.renderer.list(e,t,n)}case"list_item_start":{e="";const t=this.token.loose,n=this.token.checked,r=this.token.task;if(this.token.task)if(t)if("text"===this.peek().type){const e=this.peek();e.text=this.renderer.checkbox(n)+" "+e.text}else this.tokens.push({type:"text",text:this.renderer.checkbox(n)});else e+=this.renderer.checkbox(n);for(;"list_item_end"!==this.next().type;)e+=t||"text"!==this.token.type?this.tok():this.parseText();return this.renderer.listitem(e,r,n)}case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText());default:{const e='Token with "'+this.token.type+'" type was not found.';if(!this.options.silent)throw new Error(e);console.log(e)}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var r=i(n(0)),o=i(n(196));function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return(a="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){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(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 f(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?d(e):t}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=function(e){function t(){var e,n;u(this,t);for(var i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];return h(d(n=f(this,(e=p(t)).call.apply(e,[this].concat(a)))),"onClick",(function(e){var t=n.props,i=t.text,a=t.onCopy,c=t.children,s=t.options,u=r.default.Children.only(c),l=(0,o.default)(i,s);a&&a(i,l),u&&u.props&&"function"==typeof u.props.onClick&&u.props.onClick(e)})),n}var n,i,a;return 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&&m(e,t)}(t,e),n=t,(i=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),n=s(e,["text","onCopy","options","children"]),o=r.default.Children.only(t);return r.default.cloneElement(o,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(n,!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n,{onClick:this.onClick}))}}])&&l(n.prototype,i),a&&l(n,a),t}(r.default.PureComponent);t.CopyToClipboard=y,h(y,"defaultProps",{onCopy:void 0,options:void 0})},function(e,t,n){"use strict";var r=n(197),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,i,a,c,s,u,l=!1;t||(t={}),n=t.debug||!1;try{if(a=r(),c=document.createRange(),s=document.getSelection(),(u=document.createElement("span")).textContent=e,u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=o[t.format]||o.default;window.clipboardData.setData(i,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(u),c.selectNodeContents(u),s.addRange(c),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),i=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(i,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(c):s.removeAllRanges()),u&&document.body.removeChild(u),a()}return l}},function(e,t){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}}},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"AppLinkHelper",(function(){return A})),n.d(r,"AppLinkUtility",(function(){return C})),n.d(r,"Application",(function(){return oe})),n.d(r,"AppRouter",(function(){return be})),n.d(r,"Behavior",(function(){return Ie})),n.d(r,"Collection",(function(){return De})),n.d(r,"CollectionView",(function(){return Je})),n.d(r,"ComponentCollection",(function(){return Je})),n.d(r,"Error",(function(){return H})),n.d(r,"ErrorHelper",(function(){return K})),n.d(r,"SilentError",(function(){return q})),n.d(r,"LayoutView",(function(){return Ot})),n.d(r,"NestedModel",(function(){return Vt})),n.d(r,"Service",(function(){return Yt})),n.d(r,"Model",(function(){return Lt})),n.d(r,"View",(function(){return mt})),n.d(r,"Component",(function(){return ht})),n.d(r,"EventNames",(function(){return v})),n.d(r,"LayoutService",(function(){return nn})),n.d(r,"Middleware",(function(){return ae})),n.d(r,"LocationUtils",(function(){return g})),n.d(r,"Shell",(function(){return mn}));var o={};n.r(o),n.d(o,"emptyResponse",(function(){return Gr})),n.d(o,"getResponse",(function(){return Wr})),n.d(o,"getFetch",(function(){return Zr})),n.d(o,"fetch",(function(){return Qr})),n.d(o,"useGetFetch",(function(){return Xr})),n.d(o,"useGetResponse",(function(){return eo})),n.d(o,"useBasicFetch",(function(){return to})),n.d(o,"createMiddleware",(function(){return uo})),n.d(o,"FlightReducer",(function(){return go})),n.d(o,"Simulator",(function(){return Lo})),n.d(o,"Actions",(function(){return wr})),n.d(o,"RequestStatus",(function(){return Or})),n.d(o,"ajaxRequest",(function(){return Tr})),n.d(o,"normalize",(function(){return Nr})),n.d(o,"denormalize",(function(){return Ur}));n(137),n(138),n(139),n(140),n(141),n(142),n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(154),n(155),n(156),n(157),n(158),n(159),n(160),n(161),n(162),n(163),n(164),n(165),n(166),n(167),n(168);var i={UPLOAD_IMAGE:"upload:image"},a={Subjects:Object.assign({SUBJECTS:"subjects",NEW_SUBJECT:"new:subject",EDIT_SUBJECT:"edit:subject",EDIT_SUBJECT_PLAYLISTS:"edit:subject:playlists",EDIT_SUBJECT_SERIES:"edit:subject:series",EDIT_SUBJECT_VIDEOS:"edit:subject:videos",SUBJECT_CLASSIFICATIONS:"subject:classifications",DELETE_SUBJECT:"delete:subject",ADD_SUBJECT_MEMBERS:"add:subject:members",REMOVE_SUBJECT_MEMBER:"remove:subject:member",CLASSIFICATIONS:"classifications",PRESENTATION_CLASSIFICATIONS:"presentation:classifications",NEW_CLASSIFICATION:"new:classification",EDIT_CLASSIFICATION:"edit:classification",EDIT_CLASSIFICATION_PLAYLISTS:"edit:classification:playlists",EDIT_CLASSIFICATION_SERIES:"edit:classification:series",EDIT_CLASSIFICATION_VIDEOS:"edit:classification:videos",DELETE_CLASSIFICATION:"delete:classification",REMOVE_CLASSIFICATION_MEMBER:"remove:classification:member",LEVELS:"levels",NEW_LEVEL:"new:level",EDIT_LEVEL:"edit:level",AUDIENCES:"audiences",PRESENTATION_AUDIENCES:"presentation:audiences",NEW_AUDIENCE:"new:audience",EDIT_AUDIENCE:"edit:audience",DELETE_AUDIENCE:"delete:audience",PRESENTATIONS:"presentations",NEW_PRESENTATION:"new:presentation",EDIT_PRESENTATION:"edit:presentation"},i),Playlists:Object.assign({PLAYLISTS:"index",SEARCH_PLAYLISTS:"search:playlists",NEW_PLAYLIST:"new:playlist",EDIT_PLAYLIST:"edit:playlist",EDIT_PLAYLIST_VIDEOS:"edit:playlist:videos",EDIT_PLAYLIST_SUBJECTS:"edit:playlist:subjects",EDIT_PLAYLIST_AUDIENCES:"edit:playlist:audiences",DELETE_PLAYLIST:"delete:playlist",REMOVE_VIDEO:"remove:video",REMOVE_FROM_SUBJECT:"remove:from:subject"},i),Series:Object.assign({EDIT_SERIES:"edit:series",EDIT_SERIES_VIDEOS:"edit:series:videos",EDIT_SERIES_SUBJECTS:"edit:series:subjects",EDIT_SERIES_AUDIENCES:"edit:series:audiences",LEGACY_EDIT_SERIES:"legacy:edit:series"},i),Videos:Object.assign({EDIT_VIDEO:"edit:video",EDIT_VIDEO_AUDIENCES:"edit:video:audiences",EDIT_VIDEO_SUBJECTS:"edit:video:subjects",EDIT_VIDEO_ALIASES:"edit:video:aliases",LEGACY_EDIT_VIDEO:"legacy:edit:video"},i),DomainOptions:{DOMAIN_OPTIONS:"domain:options",NEW_DOMAIN_OPTION:"new:domain:option",EDIT_DOMAIN_OPTION:"edit:domain:option",DELETE_DOMAIN_OPTION:"delete:domain:option"},People:{PEOPLE:"people",NEW_PERSON:"new:person",EDIT_PERSON:"edit:person"},Companies:{COMPANIES:"companies",NEW_COMPANY:"new:company",EDIT_COMPANY:"edit:company"},Themes:Object.assign({THEMES:"themes",NEW_THEME:"new:theme",EDIT_THEME:"edit:theme",DELETE_THEME:"delete:theme"},i),ReleaseNotes:{FORM:"form",GENERATOR:"generator"}},c={SUBJECT:"subject",SUBJECTS:"subjects",UPDATE_SUBJECT:"update:subject",DELETE_SUBJECT:"delete:subject",UPDATE_OBJECT_SUBJECTS:"update:object:subjects",ADD_TO_SUBJECT:"add:to:subject",REMOVE_FROM_SUBJECT:"remove:from:subject",CLASSIFICATION:"classification",CLASSIFICATIONS:"classifications",UPDATE_CLASSIFICATION:"update:classification",DELETE_CLASSIFICATION:"delete:classification",UPDATE_OBJECT_CLASSIFICATIONS:"update:object:classifications",ADD_TO_CLASSIFICATION:"add:to:classification",REMOVE_FROM_CLASSIFICATION:"remove:from:classification",PRESENTATION:"presentation",PRESENTATIONS:"presentations",UPDATE_PRESENTATION:"update:presentation",LEVEL:"level",LEVELS:"levels",UPDATE_LEVEL:"update:level",ADD_TO_LEVEL:"add:to:level",REMOVE_FROM_LEVEL:"remove:from:level",UPDATE_OBJECT_LEVELS:"update:object:levels",AUDIENCE:"audience",AUDIENCES:"audiences",UPDATE_AUDIENCE:"update:audience",DELETE_AUDIENCE:"delete:audience",UPDATE_OBJECT_AUDIENCES:"update:object:audiences",PLAYLIST:"playlist",PLAYLISTS:"playlists",UPDATE_PLAYLIST:"update:playlist",DELETE_PLAYLIST:"delete:playlist",PLAYLIST_VIDEOS:"playlist:videos",REORDER_PLAYLIST_VIDEOS:"reorder:playlist:videos",REMOVE_PLAYLIST_VIDEO:"remove:playlist:video",VIDEO:"video",SERIES:"series",SERIES_BY_ID:"series:by:id",UPDATE_SERIES:"update:series",CURRENT_USER:"current:user",UPLOAD_IMAGE:"upload:image",LOCALE:"locale",PHRASES:"PHRASES"},s={IMAGES:".".concat(["jpg","tif","png","bmp","gif","jpeg"].join(",."))},u={CURATOR_LAYOUT:"CuratorLayout"},l={COMPANIES:"companies:application",DOMAIN_OPTIONS:"domain:options:application",PEOPLE:"people:application",PLAYLISTS:"playlists:application",SERIES:"series:application",SUBJECTS:"subjects:application",THEMES:"themes:application",VIDEOS:"videos:application",RELEASE_NOTES:"release:notes:application"},f={IMAGE_UPLOAD:"image:upload:data:service",SUBJECT:"subject:data:service",LANGUAGE:"language:data:service"},p={IMAGE_UPLOAD:"ImageUploadDataService",SUBJECT:"SubjectDataService",LANGUAGE:"LanguageDataService"},d=n(0),m=n.n(d),h=n(1),y=n(4),v={SHOW_POPUP:"show:popup",ROUTE:"route",LOCK_NAV:"lock:nav",UNLOCK_NAV:"unlock:nav",NAV_IS_LOCKED:"navigation:islocked",NAV_UNLOCKED_BY_USER:"navigation:unlocked:by:user",ROUTING_START:"routing:start",ROUTING_END:"routing:end",HAS_ACTIVE_ROUTE:"has:active:route",ROUTE_LOOKUP:"route:look:up",URL_CHANGE:"url:change",ERROR:"error",CURRENT_ROUTE:"route:current"},b={SHELL:"global:shell",ALERT:"global:alert",POPUP:"global:popup"},g={GetQuery:function(){return g.DeserializeQueryParams(window.location.search.substring(1))},UpdateQuery:function(e){if(e){var t=g.GetQuery(),n=g.SerializeQueryParams(h.extend(t,e));n&&(n="?".concat(n)),g.UpdateUrl("".concat(g.GetCurrentPath()).concat(n),null,{replace:!0,trigger:!1})}},UpdateUrl:function(e,t,n){var r=A.buildRoute(e,t);y.history.navigate(r,n),y.Radio.channel(b.SHELL).trigger(v.URL_CHANGE,t,n)},SerializeQueryParams:function(e){return e?"string"==typeof e?e:$.param(e,!0):""},DeserializeQueryParams:function(e){return e?h.reduce(e.split("&"),(function(e,t){var n=t.split("="),r=n[0],o=n.length>0?decodeURIComponent(n[1]):"";return e[r]?e[r]instanceof Array?(e[r].push(o),e):(e[r]=[e[r],o],e):(e[r]=o,e)}),{}):{}},StartHistory:function(){y.History.started&&y.history.stop(),y.history.start({pushState:!0})},PageLoad:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?window.open(e,"_blank"):window.location.href=e},Redirect:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=function(){return t?window.location.replace(e):window.location.href=e};C.hasActiveRoute()?y.Radio.channel(b.SHELL).once("routing:end",n):n()},Reload:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];window.location.reload(e)},GetCurrentPath:function(){return window.location.pathname},GetCurrentQueryString:function(){return window.location.search},GetCurrentUrl:function(){return window.location.href},GetCurrentReferrer:function(){return document.referrer},SetPageTitle:function(e){document.title=e}},S=/((\(\?)?:\w+)|(\*\w+)/,E=/[\(\)]/g,O=/\(\/\)/g,j=/\/$/,C={routingStarted:function(){y.Radio.channel(b.SHELL).trigger(v.ROUTING_START)},routingEnded:function(){C.hasActiveRoute()&&y.Radio.channel(b.SHELL).trigger(v.ROUTING_END)},hasActiveRoute:function(){return y.Radio.channel(b.SHELL).request(v.HAS_ACTIVE_ROUTE)}},w=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.usedHelper=!0;var n=e.application,r=e.action;y.Radio.channel(n).trigger(r,e,t)},A={getHref:function(e){if(!e)return"";var t=e.application,n=e.action,r=e.args,o=e.params,i=y.Radio.channel(b.SHELL);return"/".concat(i.request(v.ROUTE_LOOKUP,"".concat(t,":").concat(n),r,o))},buildRoute:function(e,t){if(!t)return e;var n=t.args,r=t.params;if(h.each(n,(function(t){e=e.replace(S,t||"")})),e=(e=(e=e.replace(O,"")).replace(E,"")).replace(j,""),!r)return e;var o=g.SerializeQueryParams(r);return o.length?"".concat(e,"?").concat(o):e},trigger:function(e,t){e&&(C.hasActiveRoute()?y.Radio.channel(b.SHELL).once("routing:end",(function(){w(e,t)})):w(e,t))},getCurrentAppLink:function(){return y.Radio.channel(b.SHELL).request(v.CURRENT_ROUTE)}},I=n(7);function T(e,t,n,r){var o=e;return"string"==typeof e&&(o=y.Radio.channel(e)),r.call(this,o,t,n)}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)}}var _=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.variables={}}var t,n,r;return t=e,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"get",value:function(e){return this.variables[e]}},{key:"setUpVariables",value:function(e){this.variables=e}},{key:"name",get:function(){return"EnvironmentVariables"}},{key:"isDevelopment",get:function(){return this.variables.isDevelopment}}])&&k(t.prototype,n),r&&k(t,r),e}().Instance;function L(e){return(L="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 x(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 P(e,t,n){return t&&x(e.prototype,t),n&&x(e,n),e}function N(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R(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&&z(e,t)}function D(e){var t=V();return function(){var n,r=B(e);if(t){var o=B(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return M(this,n)}}function M(e,t){return!t||"object"!==L(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 U(e){var t="function"==typeof Map?new Map:void 0;return(U=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return F(e,arguments,B(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),z(r,e)})(e)}function F(e,t,n){return(F=V()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&z(o,n.prototype),o}).apply(null,arguments)}function V(){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}}function z(e,t){return(z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function B(e){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var H=function(e){R(n,e);var t=D(n);function n(e){return N(this,n),t.call(this,e)}return n}(U(Error)),q=function(e){R(n,e);var t=D(n);function n(){return N(this,n),t.apply(this,arguments)}return P(n,[{key:"name",get:function(){return"SilentError"}}]),n}(H),J=function(e){R(n,e);var t=D(n);function n(){return N(this,n),t.apply(this,arguments)}return P(n,[{key:"name",get:function(){return"CoreError"}}]),n}(U(Error)),K={throw:function(e){if(y.Radio.channel(b.SHELL).trigger(v.ERROR,e),!(e instanceof q||_.isDevelopment))throw e}};function Y(e){return(Y="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 G(e){return function(e){if(Array.isArray(e))return W(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return W(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Q(e,t,n){return(Q="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=re(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function X(e,t){return(X=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ee(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=re(e);if(t){var o=re(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return te(this,n)}}function te(e,t){return!t||"object"!==Y(t)&&"function"!=typeof t?ne(e):t}function ne(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function re(e){return(re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var oe=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&&X(e,t)}(i,e);var t,n,r,o=ee(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).mergeOptions(e,[].concat(G(t.defaultProps),G(t.props||[]))),h.result(ne(t),"name")||K.throw(new J("BaseApplication must define a name")),h.result(ne(t),"channelName")||K.throw(new J("BaseApplication must define a channelName")),t.listenTo(t.getGlobalRadioChannel("popup"),v.SHOW_POPUP,t.onShowPopup),t.listenTo(t.getGlobalRadioChannel("alert"),"show:alert",t.onShowAlert),t}return t=i,(n=[{key:"getGlobalRadioChannel",value:function(e){var t=this.shell.getGlobalRadioChannels()[e.toUpperCase()];return t||K.throw(new J("Global channel ".concat(t," does not exist"))),y.Radio.channel(t)}},{key:"onLoadLayout",value:function(){if(this.layoutOptions&&this.layoutOptions.name){var e=h.extend({},this.layoutOptions.options||{},{store:this.shell.store});this.layout=this.layoutService.getLayout(h.extend(this.layoutOptions,{options:e})),this.layout||K.throw(new J("Layout: ".concat(this.layoutOptions.name," does not exist or was not registered"))),this.shell.showView(this.layout),this.triggerMethod("layout:loaded")}}},{key:"onShowPopup",value:function(e){this.layout.getRegion("popup")||K.throw(new J("Your application layout must define a popup region")),this.layout.showChildView("popup",e)}},{key:"onShowAlert",value:function(e){var t=e.ctor,n=e.collection,r=this.layout.getRegion("alert");r||K.throw(new J("Your application layout must define an alert region")),r.hasView()||this.layout.showChildView("alert",new t({collection:n}))}},{key:"setDefaultQueryParams",value:function(e){this.defaultQueryParams&&(e=h.extend(this.defaultQueryParams,e)),this.defaultQueryParams=e}},{key:"getAndClearDefaultQueryParams",value:function(){var e=this.defaultQueryParams;return delete this.defaultQueryParams,e||{}}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Q(re(i.prototype),"listenTo",this))}},{key:"defaultProps",get:function(){return["shell","layoutService"]}}])&&Z(t.prototype,n),r&&Z(t,r),i}(I.Application);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)}}var ae=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,(n=[{key:"use",value:function(e){var t;this.go=(t=this.go,function(n,r){return t(n,(function(){return e(n,r)}))})}},{key:"go",value:function(e,t){t(e)}}])&&ie(t.prototype,n),r&&ie(t,r),e}();function ce(e){return(ce="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 se(e){return function(e){if(Array.isArray(e))return ue(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ue(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function le(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 fe(e,t,n){return(fe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=he(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function pe(e,t){return(pe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function de(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=he(e);if(t){var o=he(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return me(this,n)}}function me(e,t){return!t||"object"!==ce(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 he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ye=/([A-Z])/g,ve=/(^|:)(\w)/gi,be=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&&pe(e,t)}(i,e);var t,n,r,o=de(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).bindDisposal(),t.processInternalRoutes(),t.processExternalRoutes(),t.processAppLinks(),t}return t=i,(n=[{key:"bindDisposal",value:function(){var e=this;this.listenTo(b.SHELL,v.ROUTE,(function(t){t.application!==e.channelName&&e.destroyApp()}))}},{key:"addRouteLookup",value:function(e,t){var n=this;this.options.shell.addRouteLookup("".concat(this.channelName,":").concat(e),(function(r,o){return A.buildRoute(t,{application:n.channelName,action:e,args:r,params:o})}))}},{key:"processInternalRoutes",value:function(){var e=this;h.each(h.keys(this.appRoutes),(function(t){var n=e.appRoutes[t],r=e.toEventName(n);e.addRouteLookup(r,t),e.listenTo(e.channelName,r,(function(n,r){r&&r.usedHelper||K.throw(new J("Please use Core.AppLinkHelper.trigger({}) to trigger appLinks.")),e.executeRoute(n,{isAppRoute:!0},(function(){var o=h.extend({},e.controller.getAndClearDefaultQueryParams(),n.params);n.params=o,g.UpdateUrl(t,n,r)}))}))}))}},{key:"processExternalRoutes",value:function(){var e=this;this.externalRoutes&&h.each(h.keys(this.externalRoutes),(function(t){var n=e.externalRoutes[t],r=e.toEventName(n);e.addRouteLookup(r,t),e.listenTo(e.channelName,r,(function(e,t){t&&t.usedHelper||K.throw(new J("Please use Core.AppLinkHelper.trigger({}) to trigger appLinks.")),g.PageLoad(A.getHref(e))}))}))}},{key:"processAppLinks",value:function(){var e=this;this.appLinks&&h.each(this.appLinks,(function(t){var n=e.toEventName(t);e.listenTo(e.channelName,n,(function(t,n){n&&n.usedHelper||K.throw(new J("Please use Core.AppLinkHelper.trigger({}) to trigger appLinks.")),e.executeRoute(t,{isAppRoute:!1})}))}))}},{key:"executeRoute",value:function(e,t,n){var r=this;this.validateAppLink(e);var o=this.toMethodName(e.action);C.routingStarted();var i=y.Radio.channel(b.SHELL);if(this.options.shell.isNavLocked())return i.trigger(v.NAV_IS_LOCKED,e),void C.routingEnded();var a=new ae;h.each(this.filters,(function(e){return a.use(e)})),a.go(e,(function(){i.trigger(v.ROUTE,e,t),r.createApp();var a=r.controller;if(h.isFunction(a[o])||(C.routingEnded(),K.throw(new J("".concat(o," does not exist on the ").concat(h.result(a,"name"),".")))),!1===a.triggerMethod("before:action"))return a.triggerMethod("action:cancelled"),void C.routingEnded();a.triggerMethod("load:layout"),a[o].apply(a,[].concat(se(e.args||[]),[e.params||{}])),h.isFunction(n)&&n(),C.routingEnded()}))}},{key:"createApp",value:function(){this.controller||(this.controller=new this.options.appConstructor(this.options.appOptions),this.controller.start())}},{key:"destroyApp",value:function(){this.controller&&(this.controller.destroy(),delete this.controller)}},{key:"_addAppRoute",value:function(e,t,n){var r=this;this.route(t,n,(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];var i={application:r.channelName,action:r.toEventName(n),args:t.slice(0,t.length-1),params:g.DeserializeQueryParams(t[t.length-1])};r.executeRoute(i,{isAppRoute:!0},(function(){g.UpdateQuery(h.extend(r.controller.getAndClearDefaultQueryParams(),i.params))}))}))}},{key:"toEventName",value:function(e){return e.replace(ye,":$1").toLowerCase()}},{key:"toMethodName",value:function(e){var t=e.replace(ve,(function(e,t,n){return n.toUpperCase()}));return t[0].toLowerCase()+t.slice(1,t.length)}},{key:"validateAppLink",value:function(e){e.application&&e.action||(C.routingEnded(),K.throw(new J("Invalid AppLink")))}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],fe(he(i.prototype),"listenTo",this))}}])&&le(t.prototype,n),r&&le(t,r),i}(I.AppRouter);function ge(e){return(ge="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 Se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ee(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 Oe(e,t,n){return(Oe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ae(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function je(e,t){return(je=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ce(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=Ae(e);if(t){var o=Ae(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return we(this,n)}}function we(e,t){return!t||"object"!==ge(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 Ae(e){return(Ae=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ie=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&&je(e,t)}(i,e);var t,n,r,o=Ce(i);function i(){return Se(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Oe(Ae(i.prototype),"listenTo",this))}}])&&Ee(t.prototype,n),r&&Ee(t,r),i}(I.Behavior);function Te(e){return(Te="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 ke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _e(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 Le(e,t,n){return(Le="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Re(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function xe(e,t){return(xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pe(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=Re(e);if(t){var o=Re(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ne(this,n)}}function Ne(e,t){return!t||"object"!==Te(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 Re(e){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var De=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&&xe(e,t)}(i,e);var t,n,r,o=Pe(i);function i(){return ke(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Le(Re(i.prototype),"listenTo",this))}}])&&_e(t.prototype,n),r&&_e(t,r),i}(y.Collection);function Me(e){return(Me="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 Ue(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 Fe(e,t,n){return(Fe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=qe(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function Ve(e,t){return(Ve=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ze(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=qe(e);if(t){var o=qe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Be(this,n)}}function Be(e,t){return!t||"object"!==Me(t)&&"function"!=typeof t?He(e):t}function He(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qe(e){return(qe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Je=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&&Ve(e,t)}(i,e);var t,n,r,o=ze(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,e),h.result(He(t),"name")||K.throw(new J("Error: View with cid:".concat(t.cid," requires a name."))),t}return t=i,(n=[{key:"serializeModel",value:function(){return this.model?this.model.toJSON():{}}},{key:"serializeCollection",value:function(){return this.collection?this.collection.toJSON():[]}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Fe(qe(i.prototype),"listenTo",this))}}])&&Ue(t.prototype,n),r&&Ue(t,r),i}(I.CollectionView);function $e(e){return($e="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 Ke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ye(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 Ge(e,t){return(Ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function We(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=Qe(e);if(t){var o=Qe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ze(this,n)}}function Ze(e,t){return!t||"object"!==$e(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 Qe(e){return(Qe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Xe=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&&Ge(e,t)}(i,e);var t,n,r,o=We(i);function i(){return Ke(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"name",get:function(){return"DevError"}}])&&Ye(t.prototype,n),r&&Ye(t,r),i}(H);function et(e){return(et="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 tt(e){return function(e){if(Array.isArray(e))return nt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return nt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nt(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ot(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 it(e,t,n){return t&&ot(e.prototype,t),n&&ot(e,n),e}function at(e,t,n){return(at="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=pt(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function ct(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&&st(e,t)}function st(e,t){return(st=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ut(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=pt(e);if(t){var o=pt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return lt(this,n)}}function lt(e,t){return!t||"object"!==et(t)&&"function"!=typeof t?ft(e):t}function ft(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pt(e){return(pt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var dt=function(e){ct(n,e);var t=ut(n);function n(e){var r;rt(this,n),r=t.call(this,e);var o=[].concat(tt(r.defaultProps),tt(r.props||[]));return r.mergeOptions(e,o),h.result(ft(r),"name")||K.throw(new J("Error: View with cid:".concat(r.cid," requires a name."))),r}return it(n,[{key:"_setOptions",value:function(e){this.options=h.extend({},h.result(this,"defaults"),e)}},{key:"_setAttributes",value:function(e){var t,n,r;_.isDevelopment&&h.extend(e,(t={},n="cv-classname",r=this.name,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t)),this.$el.attr(e)}},{key:"serializeModel",value:function(){return this.model?this.model.toJSON():{}}},{key:"serializeCollection",value:function(){return this.collection?this.collection.toJSON():[]}},{key:"resetClassName",value:function(){this.$el.attr("class",h.result(this,"className"))}},{key:"serializeData",value:function(){var e=this,t=at(pt(n.prototype),"serializeData",this).call(this),r=h.result(this,"viewOptions"),o=h.extend({},t,{options:r});return n.ViewDataExtensions.length?h.extend.apply(h,[o].concat(tt(h.map(n.ViewDataExtensions,(function(t){return t instanceof Function?t(e):t}))))):o}},{key:"viewOptions",value:function(){return this.options}},{key:"undelegateAppLinks",value:function(){this.$el&&this.$el.off(".appLinks".concat(this.cid))}},{key:"renderAppLinks",value:function(){var e=this,t=this.appLinks;t&&(t=this.normalizeUIKeys(t),this.undelegateAppLinks(),h.each(h.keys(t),(function(n){var r=n,o=t[n],i=A.getHref(o);"[this]"===r&&(r=null);var a=r?e.$el.find(n):e.$el;(a.is("a")||a.is("button"))&&(i&&"/"!==i&&a.attr("href",i),e.delegate("click.appLinks".concat(e.cid),r,(function(e){e.preventDefault(),A.trigger(o)})))})))}},{key:"hasPartialLoadingRegions",value:function(){return void 0!==this._hasPartialLoadingRegions||(this._hasPartialLoadingRegions=h.some(this.regions,(function(e){return h.has(e,"partialLoading")}))),this._hasPartialLoadingRegions}},{key:"renderPartialLoading",value:function(e){y.Radio.channel(b.SHELL).trigger("render:partial:loading",this,e)}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],at(pt(n.prototype),"listenTo",this))}},{key:"render",value:function(){if(this._isDestroyed)return this;var e=this.processRequriedResources(!0);return e&&(e=this.triggerMethod("before:render",this)),!1!==e&&(e=!0),!1===(e=e&&this.processRequriedResources(!1))?(this._partialLoadingRendered||!this.hasPartialLoadingRegions()||(this._partialLoadingRendered=!0,this._reInitRegions(),this._renderTemplate(),this.renderPartialLoading()),this):((this._isRendered||this._partialLoadingRendered)&&this._reInitRegions(),this.setTitle(),this._renderTemplate(),this.bindUIElements(),this.renderAppLinks(),this._partialLoadingRendered=!1,this._isRendered=!0,this.triggerMethod("render",this),this)}},{key:"processRequriedResources",value:function(e){return!0}},{key:"setTitle",value:function(){}},{key:"defaultProps",get:function(){return["shell","layoutService"]}},{key:"ui",get:function(){return this.uiStorage||(this.uiStorage=this.elements),this.uiStorage},set:function(e){this.uiStorage=e}},{key:"elements",get:function(){return null}}],[{key:"AddViewDataExtension",value:function(e){n.ViewDataExtensions.push(e)}}]),n}(I.View);dt.ViewDataExtensions=[];var mt=function(e){ct(n,e);var t=ut(n);function n(e){var r;return rt(this,n),(r=t.call(this,e)).boundListeners={},r.resourceInstances={},r}return it(n,[{key:"processRequriedResources",value:function(e){var t=this,n=h.keys(this.requiredResources);if(!n.length)return!0;var r=this,o=!0;return h.each(n,(function(n){var i=t.requiredResources[n];if(i.beforeOnBeforeRender===e){var a=i.dataServiceName;t.resourceInstances[a]||(t.resourceInstances[a]=i.getInstance(t)),t.boundListeners["".concat(a,":").concat(i.eventName)]||(t.listenTo(t.resourceInstances[a].channelName,i.eventName,t.render),t.boundListeners["".concat(a,":").concat(i.eventName)]=!0),r[n]=i.getData(t.resourceInstances[a]),o=o&&!!r[n]}})),o}},{key:"setTitle",value:function(){h.isString(this.title)||!1===this.title||K.throw(new Xe("Must define a title for ".concat(this.name,"."))),y.Radio.channel(b.SHELL).trigger("set:page:title",this.title)}}]),n}(dt),ht=function(e){ct(n,e);var t=ut(n);function n(){return rt(this,n),t.apply(this,arguments)}return n}(dt);function yt(e){return(yt="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 vt(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 bt(e,t){return(bt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gt(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=Et(e);if(t){var o=Et(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return St(this,n)}}function St(e,t){return!t||"object"!==yt(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 Et(e){return(Et=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ot=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&&bt(e,t)}(i,e);var t,n,r,o=gt(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,r=[{key:"getCacheKey",value:function(e){K.throw(new Xe("Must define getCacheKey for ".concat(this.name,".")))}}],(n=[{key:"unmountRegion",value:function(e){this.trigger("unmount:".concat(e))}}])&&vt(t.prototype,n),r&&vt(t,r),i}(mt);function jt(e){return(jt="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 Ct(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wt(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 At(e,t,n){return(At="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_t(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function It(e,t){return(It=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Tt(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=_t(e);if(t){var o=_t(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return kt(this,n)}}function kt(e,t){return!t||"object"!==jt(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 _t(e){return(_t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Lt=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&&It(e,t)}(i,e);var t,n,r,o=Tt(i);function i(){return Ct(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"mixin",value:function(e){for(var t in e){if(this.hasOwnProperty(t)){var n=this[t];return void(this[t]=h.extend({},n,e[t]))}this[t]=e[t]}}},{key:"addValidation",value:function(e){this.mixin({validation:e})}},{key:"validate",value:function(e,t){At(_t(i.prototype),"validate",this).call(this,e,t)}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],At(_t(i.prototype),"listenTo",this))}}])&&wt(t.prototype,n),r&&wt(t,r),i}(y.Model);function xt(e){return(xt="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 Pt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nt(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 Rt(e,t,n){return(Rt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ft(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function Dt(e,t){return(Dt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mt(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=Ft(e);if(t){var o=Ft(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ut(this,n)}}function Ut(e,t){return!t||"object"!==xt(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 Ft(e){return(Ft=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Vt=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&&Dt(e,t)}(i,e);var t,n,r,o=Mt(i);function i(){return Pt(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"set",value:function(e,t,n){var r,o;if(null===e)return this;for(r in"object"===xt(e)?(o=e,n=t):(o={})[e]=t,n||(n={}),o)h.has(this.associations,r)&&(o[r]=this.setAssociation(r,o[r],n));return Rt(Ft(i.prototype),"set",this).call(this,o,n)}},{key:"get",value:function(e){var t=e.indexOf(".");if(-1===t)return Rt(Ft(i.prototype),"get",this).call(this,e);var n=e.substr(0,t),r=this.attributes[n];if(!r||!h.isFunction(r.get))return Rt(Ft(i.prototype),"get",this).call(this,e);var o=e.substr(t+1);return r.get(o)}},{key:"setAssociation",value:function(e,t,n){var r=this.associations[e],o=this.attributes[e];if(!h.isFunction(r))return t;if(n.unset)return o&&delete o.parent,delete this[e],o;if(o)return o instanceof Lt&&o.set(t,n),o instanceof De&&o.set(t,n),n.silent||this.trigger("change:".concat(e),this,t,n),o;var i=t instanceof Lt?t:new r(t,{parse:!0});return i.parent=this,this[e]=i,i}},{key:"toJSON",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Rt(Ft(i.prototype),"toJSON",this).apply(this,t);return h.each(this.associations,(function(e,t){h.has(r,t)&&h.isFunction(r[t].toJSON)?r[t]=r[t].toJSON():r[t]=(new e).toJSON()})),r}},{key:"toFlatJSON",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.omit(Rt(Ft(i.prototype),"toJSON",this).apply(this,t),h.keys(this.associations))}}])&&Nt(t.prototype,n),r&&Nt(t,r),i}(Lt);function zt(e){return(zt="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 Bt(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 Ht(e,t,n){return(Ht="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Kt(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function qt(e,t){return(qt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jt(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=Kt(e);if(t){var o=Kt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return $t(this,n)}}function $t(e,t){return!t||"object"!==zt(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 Kt(e){return(Kt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Yt=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&&qt(e,t)}(i,e);var t,n,r,o=Jt(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).name||K.throw(new J("Your service must be named.")),t}return t=i,(n=[{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Ht(Kt(i.prototype),"listenTo",this))}}])&&Bt(t.prototype,n),r&&Bt(t,r),i}(I.Object);function Gt(e){return(Gt="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 Wt(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 Zt(e,t,n){return(Zt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=tn(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function Qt(e,t){return(Qt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xt(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=tn(e);if(t){var o=tn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return en(this,n)}}function en(e,t){return!t||"object"!==Gt(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 tn(e){return(tn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var nn=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&&Qt(e,t)}(i,e);var t,n,r,o=Xt(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).layouts={},t.requiredRegions=e.requiredRegions,t}return t=i,(n=[{key:"clearLayout",value:function(){this.currentLayout&&(this.currentLayout.destroy(),delete this.currentLayout,delete this.currentLayoutCacheKey)}},{key:"registerLayout",value:function(e,t){return this.checkRequiredRegions(t),this.layouts[e]=t,this}},{key:"getLayout",value:function(e){var t=e.name,n=e.options,r=void 0===n?{}:n;this.layouts[t]||K.throw(new J("".concat(t," was not registered as a template.")));var o=this.layouts[t].getCacheKey(r);return this.currentLayoutCacheKey===o&&this.currentLayout?(this.currentLayout.triggerMethod("layout:requested",r),this.currentLayout):(this.clearLayout(),this.currentLayoutCacheKey=o,this.currentLayout=new this.layouts[t](r),this.listenToOnce(this.currentLayout,"destroy",this.clearLayout),this.currentLayout)}},{key:"checkRequiredRegions",value:function(e){h.each(this.requiredRegions,(function(t){h.has(h.result(e.prototype,"regions"),t)||K.throw(new J("Layout: ".concat(e.prototype.name," must define an ").concat(t," region.")))}))}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Zt(tn(i.prototype),"listenTo",this))}}])&&Wt(t.prototype,n),r&&Wt(t,r),i}(I.Object);function rn(e){return(rn="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 on(e,t,n){return(on="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=un(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function an(e,t){return(an=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cn(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=un(e);if(t){var o=un(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return sn(this,n)}}function sn(e,t){return!t||"object"!==rn(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 un(e){return(un=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ln(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fn(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 pn(e,t,n){return t&&fn(e.prototype,t),n&&fn(e,n),e}var dn=function(){function e(t,n){ln(this,e),this.application=t,this.options=n||{}}return pn(e,[{key:"Application",get:function(){return this.application}},{key:"Options",get:function(){return this.options}}]),e}(),mn=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&&an(e,t)}(n,e);var t=cn(n);function n(){return ln(this,n),t.apply(this,arguments)}return pn(n,[{key:"initialize",value:function(e){this.mergeOptions(e,["layoutService"]),this.applications=[],this.routeLookup={},this.shellState={navLock:!1,activeRoute:!1,currentAppLink:null},this.errorHandlers=[]}},{key:"bindListeners",value:function(){this.bindRouteLookup(),this.bindNavLockListeners(),this.bindAppLinkListeners(),this.bindErrorHandlers(),this.bindErrorListener()}},{key:"bindNavLockListeners",value:function(){var e=this;this.listenTo(b.SHELL,v.LOCK_NAV,(function(){return e.shellState.navLock=!0})),this.listenTo(b.SHELL,v.UNLOCK_NAV,(function(){return e.shellState.navLock=!1}))}},{key:"bindAppLinkListeners",value:function(){var e=this;this.listenTo(b.SHELL,v.ROUTING_START,(function(){return e.shellState.activeRoute=!0})),this.listenTo(b.SHELL,v.ROUTING_END,(function(){return e.shellState.activeRoute=!1})),this.listenTo(b.SHELL,v.ROUTE,(function(t){return e.shellState.currentAppLink=t}));var t=y.Radio.channel(b.SHELL);t.reply(v.HAS_ACTIVE_ROUTE,h.bind(this.hasActiveRoute,this)),t.reply(v.CURRENT_ROUTE,(function(){return e.shellState.currentAppLink}))}},{key:"bindErrorHandlers",value:function(){window.addEventListener("error",(function(){C.routingEnded()}))}},{key:"bindErrorListener",value:function(){var e=y.Radio.channel(b.SHELL);this.listenTo(e,v.ERROR,this.handleError)}},{key:"bindRouteLookup",value:function(){var e=this;y.Radio.channel(b.SHELL).reply(v.ROUTE_LOOKUP,(function(t,n,r){return e.routeLookup[t]?e.routeLookup[t](n,r):""}),this)}},{key:"addRouteLookup",value:function(e,t){this.routeLookup[e]=t}},{key:"registerApplication",value:function(e,t){return this.applications.push(new dn(e,t)),this}},{key:"getGlobalRadioChannels",value:function(){return b}},{key:"isNavLocked",value:function(){return this.shellState.navLock}},{key:"start",value:function(e){var t=this;e||(e={}),this.runInitializationSteps(this,(function(r,o){t.runStartUpSteps(t,e,(function(r,o,i){on(un(n.prototype),"start",t).call(t,e)}))}))}},{key:"hasActiveRoute",value:function(){return this.shellState.activeRoute}},{key:"onStart",value:function(){var e=this;h.each(this.applications,(function(t){var n={appConstructor:t.Application,shell:e,appOptions:Object.assign({region:"",shell:e,layoutService:e.layoutService},t.Options)};new t.Application.router(n)})),this.bindListeners(),g.StartHistory()}},{key:"addInitializationStep",value:function(e){var t;return this.runInitializationSteps=(t=this.runInitializationSteps,function(n,r){return t(n,(function(){return e(n,r)}))}),this}},{key:"runInitializationSteps",value:function(e,t){t(e)}},{key:"addStartUpStep",value:function(e){var t;return this.runStartUpSteps=(t=this.runStartUpSteps,function(n,r,o){return t(n,r,(function(){return e(n,r,o)}))}),this}},{key:"runStartUpSteps",value:function(e,t,n){n(e,t)}},{key:"registerLayout",value:function(e,t){return this.layoutService.registerLayout(e,t),this}},{key:"registerErrorHandler",value:function(e,t){return e||K.throw(new J("An error must have a name in order to register a handler for it.")),h.any(this.errorHandlers,(function(t){return t.errorType===e}))&&K.throw(new J("An error handler for ".concat(e.prototype.name," has already been defined."))),this.errorHandlers.push({errorType:e,handler:t}),this}},{key:"handleError",value:function(e){var t=h.find(this.errorHandlers,(function(t){return e instanceof t.errorType}));t&&t.handler&&t.handler(e)}},{key:"registerStore",value:function(e){this.store=e}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],on(un(n.prototype),"listenTo",this))}}]),n}(I.Application),hn=function(e){return h.isFunction(e)},yn=function(){return h.identity},vn=n(26),bn=n(5);function gn(e){return(gn="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 Sn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function En(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 On(e,t){return(On=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function jn(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=wn(e);if(t){var o=wn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Cn(this,n)}}function Cn(e,t){return!t||"object"!==gn(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 wn(e){return(wn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var An=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&&On(e,t)}(i,e);var t,n,r,o=jn(i);function i(){return Sn(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"isReactComponent",value:function(e){return d&&d.isValidElement(e)}},{key:"showChildView",value:function(e,t){this.isReactComponent(t)&&this.showChildReactComponent(e,t)}},{key:"showChildReactComponent",value:function(e,t){var n=this;this.isAttached()?this.renderChildReactComponent(e,t):this.listenToOnce(this,"attach",(function(){return n.renderChildReactComponent(e,t)}))}},{key:"renderChildReactComponent",value:function(e,t){var n=this.getRegion(e),r=this.$el.find(n.el);r&&r.length&&(n.trigger("before:show"),vn.render(t,r[0],(function(){return n.trigger("show")})),this.listenToOnce(this,"unmount:".concat(e),(function(){return vn.unmountComponentAtNode(r[0])})),this.listenToOnce(this,"before:destroy",(function(){return vn.unmountComponentAtNode(r[0])})))}},{key:"wrapWithStore",value:function(e){return d.createElement(bn.Provider,{store:this.options.store},e)}}])&&En(t.prototype,n),r&&En(t,r),i}(Ot),In="top:nav",Tn="left:nav",kn="content",_n="popup",Ln="alert",xn=n(126),Pn=n.n(xn),Nn=n(27),Rn=n.n(Nn);function Dn(e){return(Dn="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 Mn(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 Un(e,t,n){return(Un="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Bn(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function Fn(e,t){return(Fn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Vn(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=Bn(e);if(t){var o=Bn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return zn(this,n)}}function zn(e,t){return!t||"object"!==Dn(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 Bn(e){return(Bn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Hn=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&&Fn(e,t)}(a,e);var t,n,o,i=Vn(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).childComponents={},t}return t=a,o=[{key:"getCacheKey",value:function(e){var t="".concat(this.name),n=[];return Object.keys(e).forEach((function(t){n.push("".concat(t,":").concat(e[t]))})),n.length&&(n.sort(),t+=":".concat(n.join(":"))),t}}],(n=[{key:"regions",value:function(){return{layout:".layout-region"}}},{key:"getChildComponents",value:function(){return{topNav:{component:this.childComponents[In],className:Rn.a.topNavRegion},leftNav:{component:this.childComponents[Tn],className:"py-3 ".concat(Rn.a.leftNavRegion)},content:{component:this.childComponents[kn],className:"position-relative container py-3"},popup:{component:this.childComponents[_n]},alert:{component:this.childComponents[Ln]}}}},{key:"unsetRegion",value:function(e){delete this.childComponents[e],this.renderLayout()}},{key:"renderTopNav",value:function(){hn(this.options.getTopNavView)&&(this.childComponents[In]=this.options.getTopNavView(r.AppLinkHelper.getCurrentAppLink()))}},{key:"hideLeftNav",value:function(){this.unsetRegion(Tn)}},{key:"closePopup",value:function(){this.unsetRegion(_n)}},{key:"showChildView",value:function(e,t){this.childComponents[e]=t,this.renderTopNav(),this.renderLayout()}},{key:"renderLayout",value:function(){var e=Object.assign({provider:this.options.provider},this.getChildComponents());Un(Bn(a.prototype),"showChildView",this).call(this,"layout",this.wrapWithStore(d.createElement(Yn,Object.assign({},e))))}},{key:"title",get:function(){return!1}},{key:"name",get:function(){return"CuratorLayoutView"}},{key:"template",get:function(){return Pn.a}},{key:"className",get:function(){return"container-fluid ".concat(Rn.a.curatorLayout)}}])&&Mn(t.prototype,n),o&&Mn(t,o),a}(An),qn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Jn=function(e){var t=e.className,n=e.children;return d.createElement("div",{className:t},n)},$n=function(e,t){return"".concat(e).concat(t?" ".concat(t):"")},Kn=function(e){var t=e.topNav,n=e.leftNav,r=e.content,o=e.popup,i=e.alert;return d.createElement(d.Fragment,null,d.createElement("div",{className:"position-relative"},!!t.component&&d.createElement(Jn,{className:$n("top-nav-region",t.className)},t.component),!!n.component&&d.createElement(Jn,{className:$n("left-nav-region",n.className)},n.component),!!r.component&&d.createElement("div",{className:"content-container"},d.createElement(Jn,{className:$n("content-region",r.className)},r.component))),!!o.component&&d.createElement(Jn,{className:$n("popup-region",o.className)},o.component),!!i.component&&d.createElement(Jn,{className:$n("alert-region",i.className)},i.component))},Yn=function(e){var t=e.provider,n=qn(e,["provider"]);return t?d.createElement(t,null,d.createElement(Kn,Object.assign({},n))):d.createElement(Kn,Object.assign({},n))};function Gn(e){return(Gn="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 Wn(e){return function(e){if(Array.isArray(e))return Zn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Zn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Qn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xn(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 er(e,t){return(er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tr(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=rr(e);if(t){var o=rr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return nr(this,n)}}function nr(e,t){return!t||"object"!==Gn(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 rr(e){return(rr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var or=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&&er(e,t)}(a,e);var t,n,o,i=tr(a);function a(){return Qn(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"initialize",value:function(){this.listenTo(b.SHELL,r.EventNames.ROUTING_END,this.updateNav)}},{key:"updateNav",value:function(){var e=this,t=r.AppLinkHelper.getCurrentAppLink().application;if(t!==this.currentApplication){this.currentApplication=t;var n=this.options.navItemMappings[t];if(n){var o=document.querySelector(this.options.navSelector);o&&o.children&&Wn(o.children).forEach((function(t){var r=t.querySelector("a");r&&(r.classList.remove(e.options.currentItemClassName),r.text===n&&r.classList.add(e.options.currentItemClassName))}))}}}},{key:"name",get:function(){return"CuratorAppNavService"}}])&&Xn(t.prototype,n),o&&Xn(t,o),a}(r.Service);function ir(e){return(ir="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 ar(e){return function(e){if(Array.isArray(e))return cr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return cr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cr(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sr(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 ur(e,t){return(ur=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function lr(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=dr(e);if(t){var o=dr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return fr(this,n)}}function fr(e,t){return!t||"object"!==ir(t)&&"function"!=typeof t?pr(e):t}function pr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dr(e){return(dr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var mr=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&&ur(e,t)}(i,e);var t,n,r,o=lr(i);function i(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,e),h.result(pr(t),"name")||K.throw(new Xe("Must provide a name when extending BaseDataService")),h.result(pr(t),"channelName")||K.throw(new Xe("Must provide a channelName for ".concat(h.result(pr(t),"name"))));var n=[].concat(ar(t.defaultProps),ar(t.props||[]));return t.dataRequestSignatures={},t.mergeOptions(e,n),t}return t=i,(n=[{key:"getCursors",value:function(e){var t=this.cache.get(e);return t?t.cursors:{}}},{key:"clearCacheAndGet",value:function(e){var t=this,n=e.callback,r=e.errorCallback,o=e.eventPrefix,i=this.getEventNames(o),a=i.syncEvent,c=i.errorEvent,s=this.cache.get(o);if(s&&s.openRequest)return this.listenToOnce(this.getChannel(),a,(function(e){h.isFunction(r)&&t.stopListening(t.getChannel(),c,r),h.isFunction(n)&&n(e)})),void this.listenToOnce(this.getChannel(),c,(function(){h.isFunction(n)&&t.stopListening(t.getChannel(),a,n),h.isFunction(r)&&r()}));this.cache.remove(e.eventPrefix),this.get(e)}},{key:"get",value:function(e){var t=this,n=e.callback,r=e.errorCallback,o=e.eventPrefix,i=e.resource,a=e.formatData,c=e.expiryTime,s=e.successHandler,u=e.errorHandler,l=e.bootstrapName,f=this.getEventNames(o),p=f.syncEvent,d=f.requestEvent,m=f.successEvent,y=f.errorEvent,v=this.getChannel(),b=this.currentTimestamp();this.bootstrapData&&this.bootstrapData[l]&&(this.cacheData(o,this.bootstrapData[l],a,{openRequest:!1,timestamp:b}),delete this.bootstrapData[l]);var g,S=this.cache.get(o);S&&(g=S.data);var E=S&&S.openRequest,O=this.isExpired(o,c);if(E&&(this.listenToOnce(v,p,(function(e){h.isFunction(r)&&t.stopListening(t.getChannel(),y,r),h.isFunction(n)&&n(e)})),this.listenToOnce(v,y,(function(){h.isFunction(n)&&t.stopListening(t.getChannel(),p,n),h.isFunction(r)&&r()}))),this.cache.has(o)&&!O||(v.trigger(d),this.listenToResponse({eventPrefix:o,formatData:a,cacheOptions:{timestamp:b},callback:n,errorCallback:r,successHandler:s,errorHandler:u}),this.cacheData(o,null,null,{openRequest:!0,timestamp:b}),this.dataProvider.read(i,{channel:this.getTransportChannel(),successEvent:m,errorEvent:y})),g&&h.isFunction(n)&&!O&&n(g),g)return g}},{key:"create",value:function(e){var t=e.eventPrefix,n=e.resource,r=e.data,o=e.formatData,i=e.callback,a=e.errorCallback,c=e.invalidationKeys,s=e.successHandler,u=e.errorHandler,l=this.getEventNames(e.eventPrefix),f=l.requestEvent,p=l.successEvent,d=l.errorEvent,m=this.getChannel(),h=this.getTransportChannel();m.trigger(f),this.listenToResponse({eventPrefix:t,formatData:o,invalidationKeys:c,callback:i,errorCallback:a,successHandler:s,errorHandler:u}),this.dataProvider.create(n,r,{channel:h,successEvent:p,errorEvent:d})}},{key:"update",value:function(e){var t=e.data,n=e.callback,r=e.errorCallback,o=e.resource,i=e.formatData,a=e.eventPrefix,c=e.invalidationKeys,s=e.errorHandler,u=e.successHandler,l=this.getEventNames(e.eventPrefix),f=l.requestEvent,p=l.successEvent,d=l.errorEvent,m=this.getChannel(),h=this.getTransportChannel();m.trigger(f),this.listenToResponse({eventPrefix:a,formatData:i,invalidationKeys:c,callback:n,errorCallback:r,successHandler:u,errorHandler:s}),this.dataProvider.update(o,t,{channel:h,successEvent:p,errorEvent:d})}},{key:"delete",value:function(e){var t=e.eventPrefix,n=e.resource,r=e.callback,o=e.errorCallback,i=e.invalidationKeys,a=e.successHandler,c=e.errorHandler,s=this.getEventNames(t),u=s.successEvent,l=s.errorEvent,f=this.getTransportChannel();this.listenToResponse({eventPrefix:t,invalidationKeys:i,callback:r,errorCallback:o,cacheOptions:{noCache:!0,clearCacheKey:!0},successHandler:a,errorHandler:c}),this.dataProvider.delete(n,{channel:f,successEvent:u,errorEvent:l})}},{key:"listenToResponse",value:function(e){var t=this,n=e.eventPrefix,r=e.formatData,o=e.callback,i=e.errorCallback,a=e.successHandler,c=e.errorHandler,s=e.invalidationKeys,u=e.cacheOptions,l=void 0===u?{}:u,f=this.getEventNames(n),p=f.syncEvent,d=(f.requestEvent,f.successEvent),m=f.errorEvent,y=f.successAlertEvent,v=f.errorAlertEvent,b=this.getChannel(),g=this.getTransportChannel(),S=this.getAlertChannel();h.isFunction(o)&&this.listenToOnce(b,p,o),h.isFunction(i)&&this.listenToOnce(b,m,i),this.stopListening(S,y),this.stopListening(S,v),h.isFunction(a)&&this.listenToOnce(S,y,a),h.isFunction(c)&&this.listenToOnce(S,v,c),!h.isFunction(c)&&!1!==c&&h.isFunction(this.defaultErrorHandler)&&this.listenToOnce(S,v,this.defaultErrorHandler),this.hasRequestSignature(n)||(this.setRequestSignature(n),this.listenTo(g,d,(function(e){t.stopListening(b,m,i);for(var o=arguments.length,a=new Array(o>1?o-1:0),c=1;c<o;c++)a[c-1]=arguments[c];S.trigger.apply(S,[y,e].concat(a));var u=l.noCache?t.formatData(e,r):t.cacheData(n,e,r);l.clearCacheKey&&t.cache.remove(n),b.trigger(p,u),s&&s.length&&t.cache.invalidate(s,(function(e){return b.trigger("".concat(e,":invalidate"))}))})),this.listenTo(g,m,(function(){var e;t.stopListening(b,p,o);var r=(e=t.dataProvider).parseError.apply(e,arguments);S.trigger(v,r),b.trigger(m,r),l.noCache||t.cacheData(n,null,null)})))}},{key:"cacheData",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.openRequest,i=void 0!==o&&o,a=r.timestamp;a||(a=this.currentTimestamp());var c=this.processPagination(t),s=this.formatData(t,n);return this.cache.set(e,{data:s,timestamp:a,cursors:c,openRequest:i}),s}},{key:"processPagination",value:function(e){if(e){var t=e.pagination;if(t)return t.cursors?t.cursors:h.isUndefined(t.offset)||h.isUndefined(t.pageSize)?t.page?this.convertLegacyPaginationToCursors(t):void 0:this.convertOffsetPaginationToCursors(t)}}},{key:"formatData",value:function(e,t){return h.isFunction(t)?t(e):e}},{key:"chain",value:function(){var e=this,t=[],n=function(e,t){h.isFunction(e)&&e(t)},r=function(r,i){return t.push((function(){var o=r.callback;r.callback=function(e){n(o,e),n(t.shift())},e[i](r)})),o},o={func:function(e){return t.push((function(){e(t.shift()||function(){})})),o},get:function(e){return r(e,"get")},create:function(e){return r(e,"create")},update:function(e){return r(e,"update")},delete:function(e){return r(e,"delete")},run:function(){n(t.shift())}};return o}},{key:"invalidateCache",value:function(e){e&&e.length&&this.cache.invalidate(e)}},{key:"currentTimestamp",value:function(){return(new Date).valueOf()}},{key:"isExpired",value:function(e,t){if(!t)return!1;var n=this.cache.get(e);if(!n||!n.timestamp)return!0;var r=1e3*t;return n.timestamp<this.currentTimestamp()-r}},{key:"getEventNames",value:function(e){return{syncEvent:"".concat(e,":sync"),requestEvent:"".concat(e,":request"),successEvent:"".concat(e,":success"),errorEvent:"".concat(e,":error"),successAlertEvent:"".concat(e,":success:alert"),errorAlertEvent:"".concat(e,":error:alert")}}},{key:"getTransportChannel",value:function(){return y.Radio.channel("".concat(this.channelName,":transport"))}},{key:"getAlertChannel",value:function(){return y.Radio.channel("".concat(this.channelName,":alert"))}},{key:"setRequestSignature",value:function(e){this.dataRequestSignatures[e]=e}},{key:"hasRequestSignature",value:function(e){return!!this.dataRequestSignatures[e]}},{key:"convertOffsetPaginationToCursors",value:function(e){var t=e.offset,n=e.pageSize,r=e.totalItems,o=r>0&&t<r&&t+n,i=r>0&&t>0&&Math.max(t-n,0),a={};if(o&&o<r&&(a.next=o.toString()),h.isNumber(i)&&(a.previous=i.toString()),!h.isEmpty(a))return a}},{key:"convertLegacyPaginationToCursors",value:function(e){var t=e.page,n=e.totalPages,r=h.isNumber(t)&&t>0&&t<n&&t+1,o=h.isNumber(t)&&t>1&&t-1,i={};if(r&&r<=n&&(i.next=r.toString()),o&&(i.previous=o.toString()),!h.isEmpty(i))return i}},{key:"defaultProps",get:function(){return["dataProvider","cache","bootstrapData","defaultErrorHandler","alertService"]}}])&&sr(t.prototype,n),r&&sr(t,r),i}(Yt);function hr(e){return(hr="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 yr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vr(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 br(e,t){return(br=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gr(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=Er(e);if(t){var o=Er(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Sr(this,n)}}function Sr(e,t){return!t||"object"!==hr(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 Er(e){return(Er=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Or,jr,Cr=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&&br(e,t)}(i,e);var t,n,r,o=gr(i);function i(){return yr(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"uploadBase64Image",value:function(e,t,n,r){return this.create({resource:"/api/image/upload?type=".concat(t),eventPrefix:c.UPLOAD_IMAGE,data:e,callback:n,errorCallback:r})}},{key:"name",get:function(){return p.IMAGE_UPLOAD}},{key:"channelName",get:function(){return f.IMAGE_UPLOAD}}])&&vr(t.prototype,n),r&&vr(t,r),i}(mr),wr={API_REQUEST:"API_REQUEST",API_REPONSE:"API_RESPONSE",API_ERROR:"API_ERROR",INVALIDATE:"INVALIDATE",UPDATE:"UPDATE"};function Ar(e){return{getResponseHeader:e.getResponseHeader,responseJSON:e.responseJSON,status:e.status}}!function(e){e.None="None",e.Fetching="Fetching",e.Success="Success",e.Error="Error"}(Or||(Or={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"}(jr||(jr={}));var Ir=[jr.POST,jr.PUT];function Tr(e){var t=e.resource,n=e.type,r=e.success,o=e.error,i=e.always,a={url:t,method:n};Ir.includes(n)&&e.data&&(a.data=JSON.stringify(e.data)),$.ajax(a).done((function(e,t,n){r&&r(e,Ar(n))})).fail((function(e,t,n){o&&o(Ar(e))})).always((function(){i&&i()}))}function kr(e){return(kr="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){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.idAttribute,r=void 0===n?"id":n,o=t.namespace,i=void 0===o?"":o;return e[r]||K.throw(new Xe("There was an issue during normalization. Object did not have an id attribute.")),"".concat(i,"__").concat(e[r])}function Lr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.idAttribute,o=void 0===r?"id":r,i=[];return e.forEach((function(e){e[o]&&i.push(_r(e,n)),Pr(e,t,n)})),i}function xr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.idAttribute,o=void 0===r?"id":r,i=Object.assign({},e);if(Object.keys(e).forEach((function(r){var a=e[r];if(a)if(Array.isArray(a)){var c=Lr(a,t,n);c.length&&(i[r]=c)}else if("object"===kr(a)){var s=xr(a,t,n);a[o]?i[r]=_r(a,n):i[r]=s}})),e[o]){var a=_r(e,n);return t[a]=i,a}return i}function Pr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e)return Array.isArray(e)?Lr(e,t,n):"object"===kr(e)?xr(e,t,n):e}function Nr(e,t){var n={};return{result:Pr(e,n,t),entities:n}}var Rr={isEmpty:function(e){return h.isEmpty(e)},values:function(e){return h.values(e)},keys:function(e){return h.keys(e)},deepClone:function(e){return(h.isArray(e)?h.map:h.mapObject)(e,(function(e){return h.isObject(e)||h.isArray(e)?Rr.deepClone(e):e}))},getEnumKeys:function(e){return Object.keys(e).filter((function(e){return!(parseInt(e)>=0)}))},isObject:function(e){return h.isObject(e)},isEqual:function(e,t){return h.isEqual(e,t)},omit:function(e,t){return h.omit(e,t)}};function Dr(e){return(Dr="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 Mr(e,t,n){if(e){if("string"==typeof e)return function(e,t,n){if(n[e])return n[e];n[e]={};var r=Mr(t[e],t,n);return Object.assign(n[e],r),Rr.isEmpty(n[e])&&delete n[e],n[e]}(e,t,n);if(Array.isArray(e))return e.map((function(e){return Mr(e,t,n)}));if("object"===Dr(e)){var r={};return Object.keys(e).forEach((function(o){r[o]=Mr(e[o],t,n)||e[o]})),r}}}function Ur(e,t){return Mr(e,t,{})}function Fr(e,t){return e===t}function Vr(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}function zr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fr,n=null,r=null;return function(){return Vr(t,n,arguments)||(r=e.apply(null,arguments)),n=arguments,r}}function Br(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function Hr(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=0,a=r.pop(),c=Br(r),s=e.apply(void 0,[function(){return i++,a.apply(null,arguments)}].concat(n)),u=e((function(){for(var e=[],t=c.length,n=0;n<t;n++)e.push(c[n].apply(null,arguments));return s.apply(null,e)}));return u.resultFunc=a,u.dependencies=c,u.recomputations=function(){return i},u.resetRecomputations=function(){return i=0},u}}var qr=Hr(zr);var Jr={currentTimestamp:function(){return(new Date).valueOf()},isExpired:function(e,t){if(!t)return!1;var n=1e3*t;return e<Jr.currentTimestamp()-n},currentTimeOfDay:function(e){e||(e=new Date);var t=e.getHours();return t>=12&&t<18?"afternoon":t>=18?"evening":"morning"}};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)}}var Kr=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.status=t.status,this.requestTime=t.requestTime,this.cacheDuration=t.cacheDuration,this.data=t.data,this.statusCode=t.statusCode}var t,n,r;return t=e,(n=[{key:"shouldFetch",get:function(){return this.status===Or.None||this.isExpired}},{key:"isExpired",get:function(){return Jr.isExpired(this.requestTime,this.cacheDuration)}},{key:"isFetching",get:function(){return this.status===Or.Fetching}},{key:"hasError",get:function(){return this.status===Or.Error}},{key:"isComplete",get:function(){return this.status===Or.Success||this.status===Or.Error}}])&&$r(t.prototype,n),r&&$r(t,r),e}();function Yr(e,t,n){if(!e||!t)return Gr();var r=t.response;return!1!==t.request.normalize&&(r=Ur(t.response,n)),new Kr({status:t.status,statusCode:t.statusCode,requestTime:t.timestamp,cacheDuration:t.request.expiryTime,data:r})}function Gr(){return new Kr({status:Or.None})}function Wr(e,t){return Yr(t,e.flightData.resources[t],e.flightData.entities)}function Zr(e,t){return function(){Qr(e,t)}}function Qr(e,t){e({type:wr.API_REQUEST,request:t})}function Xr(e){return Zr(Object(bn.useDispatch)(),e)}function eo(e,t){var n=Object(d.useMemo)((function(){var n;return(null===(n=t)||void 0===n?void 0:n.optimize)?function(e){return Hr(zr,(function(e,t){var n=["response","request"];return Rr.isEqual(Rr.omit(e,n),Rr.omit(t,n))}))((function(t){return t.flightData.resources[e]}),(function(t){var n,r=t.flightData.resources[e];return(null===(n=r)||void 0===n?void 0:n.entityIds)?r.entityIds.reduce((function(e,n){return e[n]=t.flightData.entities[n],e}),{}):{}}),(function(t,n){return Yr(e,t,n)}))}(e):function(e){return qr((function(t){return t.flightData.resources[e]}),(function(e){return e.flightData.entities}),(function(t,n){return Yr(e,t,n)}))}(e)}),[e]);return Object(bn.useSelector)((function(e){return n(e)}))}function to(e,t){var n=Object(bn.useDispatch)(),r=eo(e&&e.key,t),o=Zr(n,e);return e&&r.shouldFetch&&o(),r}function no(e){return function(e){if(Array.isArray(e))return ro(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ro(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ro(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ro(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var oo,io=function(e,t,n){var r=Array.isArray(t)?t:[t],o=[];return r.forEach((function(t){var n,r=new RegExp(t,"i"),i=Object.keys(e.resources).filter((function(e){return r.test(e)}));(n=o).push.apply(n,no(i))})),n&&(o=o.filter((function(e){return e!==n}))),o.reduce((function(e,t){return e[t]=!0,e}),{})};!function(e){e[e.Ok=200]="Ok",e[e.NoContent=204]="NoContent",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.Conflict=409]="Conflict",e[e.InternalServer=500]="InternalServer"}(oo||(oo={}));var ao=function(e){var t=e;return!!(t.successResponse||t.errorResponse||t.noResponse)},co=function(e,t){var n=e.success,r=e.error,o=e.always,i=t;window.setTimeout((function(){i.noResponse||(i.successResponse?n(i.successResponse(),{status:oo.Ok,getResponseHeader:function(e){return""}}):i.errorResponse&&r(i.errorResponse()),o())}),function(e){var t=e.timeout||300;return t/2+(Math.floor(Math.random()*t/2)+1)}(t))},so=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function uo(e){var t=e.fetchData,n=e.bootstrappedData,r=e.defaultExpiryTime,o=Object.freeze({key:null,url:null,type:jr.GET,normalize:!0,formatData:function(e){return e},expiryTime:r});return function(e){return function(r){return function(i){if(i.type===wr.API_REQUEST){var a=e.getState(),c=Object.assign({},o,i.request),s=c.success,u=c.error,l=c.always,f=c.formatData,p=so(c,["success","error","always","formatData"]),d=a.flightData.resources[p.key];if(r(i),!d||d.status!==Or.Fetching){if(p.bootstrapName&&n[i.request.bootstrapName])return h(n[i.request.bootstrapName]),y(),void delete n[i.request.bootstrapName];var m={resource:p.url,type:p.type,data:p.data,success:h,error:function(t){e.dispatch({type:wr.API_ERROR,errorResponse:t.responseJSON,request:i.request,timestamp:Jr.currentTimestamp(),xhr:t}),u&&u(t)},always:y};return void(ao(p)?co(m,p):t(m))}}else r(i);function h(t,n){var r=f(t),o={result:r,entities:{}};(p.normalize&&(o=Nr(r,p.normalizeOptions)),e.dispatch({type:wr.API_REPONSE,result:o.result,entities:o.entities,request:p,timestamp:Jr.currentTimestamp(),xhr:n}),p.updateState)&&(Array.isArray(p.updateState)?p.updateState:[p.updateState]).forEach((function(t){var n,r,o,i;n=t,r=io(a.flightData,n.keys),o=Object.assign({},Object.keys(a.flightData.resources).filter((function(e){return r[e]})).reduce((function(e,t){var n=a.flightData.resources[t],r=n.response;return n.request.normalize&&(r=Ur(n.response,a.flightData.entities)),e[t]=r,e}),{})),i=n.updateData(o),Object.keys(i).forEach((function(t){var n=a.flightData.resources[t],r=i[t],o={result:r,entities:{}};n.request.normalize&&(o=Nr(r,n.request.normalizeOptions)),e.dispatch({type:wr.UPDATE,result:o.result,entities:o.entities,request:n.request})}))}));if(s){var i=o.result;p.normalize&&(i=Ur(o.result,Object.assign(Object.assign({},a.flightData.entities),o.entities))),s(i)}}function y(){p.invalidationKeys&&e.dispatch({type:wr.INVALIDATE,keys:p.invalidationKeys,request:p}),l&&l()}}}}}function lo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fo(e,t){var n=Object.assign({},e);return Object.keys(t).forEach((function(r){e[r]?n[r]=Object.assign(Object.assign({},e[r]),t[r]):n[r]=t[r]})),n}function po(e,t){var n=e.resources[t.request.key];return{entities:Object.assign({},e.entities),resources:Object.assign(Object.assign({},e.resources),lo({},t.request.key,{request:t.request,status:Or.Fetching,response:n?n.response:null,entityIds:n?n.entityIds:null}))}}function mo(e,t){var n,r=t.entities?Object.keys(t.entities):[];return{entities:fo(e.entities,t.entities),resources:Object.assign(Object.assign({},e.resources),lo({},t.request.key,{request:t.request,status:Or.Success,response:t.result,timestamp:t.timestamp,statusCode:null===(n=t.xhr)||void 0===n?void 0:n.status,entityIds:r}))}}function ho(e,t){var n;return{entities:Object.assign({},e.entities),resources:Object.assign(Object.assign({},e.resources),lo({},t.request.key,{request:t.request,status:Or.Error,errorResponse:t.errorResponse,timestamp:t.timestamp,statusCode:null===(n=t.xhr)||void 0===n?void 0:n.status}))}}function yo(e,t){var n,r=io(e,t.keys,null===(n=t.request)||void 0===n?void 0:n.key);return{entities:Object.assign({},e.entities),resources:Object.assign(Object.assign({},e.resources),Object.keys(e.resources).filter((function(e){return r[e]})).reduce((function(t,n){var r=e.resources[n];return t[n]=Object.assign({},r,{status:Or.None}),t}),{}))}}function vo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bo,t=arguments.length>1?arguments[1]:void 0,n=t.entities?Object.keys(t.entities):[];return{entities:fo(e.entities,t.entities),resources:Object.assign(Object.assign({},e.resources),lo({},t.request.key,Object.assign(Object.assign({},e.resources[t.request.key]),{request:t.request,response:t.result,entityIds:n})))}}var bo={resources:{},entities:{}};function go(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bo,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case wr.API_REQUEST:return po(e,t);case wr.API_REPONSE:return mo(e,t);case wr.API_ERROR:return ho(e,t);case wr.INVALIDATE:return yo(e,t);case wr.UPDATE:return vo(e,t)}return e}function So(e){return function(e){if(Array.isArray(e))return Eo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Eo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Eo(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Eo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Oo=function(e){return h.first(e)},jo=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=e&&e.length?e.slice():[];return t+1>o.length&&(o=[].concat(So(o),So(Array(t+1-o.length).fill(r)))),o.splice(t,1,n),o},Co=function(e,t,n){var r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r},wo=function(e,t){return h.groupBy(e,t)},Ao=function(){return h.intersection.apply(h,arguments)},Io=function(e,t){var n=e.indexOf(t);return-1===n?e.push(t):e.splice(n,1),e};var To="id";function ko(e,t){return localStorage.setItem(e,JSON.stringify(t)),t}function _o(e){var t=localStorage.getItem(e);return t?JSON.parse(t):null}var Lo={getAll:function(e,t){var n=_o(e);return n&&n.length?n:!n&&t?(t.forEach((function(t){return Lo.create(e,t)})),_o(e)):[]},get:function(e,t){var n=Lo.getAll(e);return n.length?n.find((function(e){return e[To]===t})):null},create:function(e,t){var n,r,o,i=Lo.getAll(e),a=Object.assign(Object.assign({},t),(n={},r=To,o=t[To]||(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)+1).toString(),r in n?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,n));return i.push(a),ko(e,i),a},update:function(e,t){var n=Lo.getAll(e);if(!n.length)return t;var r=n.findIndex((function(e){return e[To]===t[To]}));return n[r]=t,ko(e,n),t},delete:function(e,t){var n=Lo.getAll(e);n.length&&(Array.isArray(t)||(t=[t]),t.forEach((function(e){var t=n.findIndex((function(t){return t[To]===e}));n.splice(t,1)})),ko(e,n))},assoc:function(e,t,n,r,o){var i=Array.isArray(o),a=i?o:[o];"string"==typeof Oo(a)&&(a=Lo.getAll(r).filter((function(e){return a.includes(e.id)})));var c=a.map((function(e){return e.id?e:Lo.create(r,e)})),s=Lo.getAll(e);if(s.length){var u=s.find((function(e){return e.id===t}));if(u)return c.forEach((function(e){if(u[n])if(Array.isArray(u[n])){if(u[n].find((function(t){return t.id===e.id})))return;u[n].push(e)}else u[n]=e;else u[n]=i?[e]:e})),ko(e,s=s.map((function(e){return e.id!==u.id?e:u}))),i?c:Oo(c)}},dissoc:function(e,t,n,r){var o=Lo.getAll(e);if(o.length){var i=o.find((function(e){return e.id===t}));if(i){var a=i[n];if(a)return Array.isArray(r)||(r=[r]),Array.isArray(a)||(a=[a]),r.forEach((function(e){var t=a.findIndex((function(t){return t.id===e}));a.splice(t,1)})),i[n]=a,ko(e,o=o.map((function(e){return e.id!==i.id?e:i}))),o}}}},xo=function(e){var t="/api/master/v2/companies";return e?"".concat(t,"?cursor=").concat(e):t},Po=function(e){return"/api/master/v2/objects/".concat(e)},No=function(){return"/api/master/v2/companies"},Ro=function(e){return"/api/master/v2/objects/".concat(e)},Do="companies",Mo="company",Uo="update:company",Fo=function(e){return{key:"".concat(Do).concat(e?":".concat(e):""),url:xo(e)}},Vo=function(e){return{key:"".concat(Mo,":").concat(e),url:Po(e)}},zo=function(e,t,n){return{key:Mo,url:No(),data:e,type:jr.POST,success:t,error:n,invalidationKeys:[Do]}},Bo=function(e,t,n){return{key:"".concat(Uo,":").concat(e),url:Ro(e),data:t,type:jr.PUT,always:n}},Ho=n(12),qo=n.n(Ho),Jo=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===$o}(e)}(e)};var $o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Ko(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Go((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Yo(e,t,n){return e.concat(t).map((function(e){return Ko(e,n)}))}function Go(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Yo,n.isMergeableObject=n.isMergeableObject||Jo;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach((function(t){r[t]=Ko(e[t],n)})),Object.keys(t).forEach((function(o){n.isMergeableObject(t[o])&&e[o]?r[o]=Go(e[o],t[o],n):r[o]=Ko(t[o],n)})),r}(e,t,n):Ko(t,n)}Go.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Go(e,n,t)}),{})};var Wo=Go,Zo=n(6),Qo=Zo.a.Symbol,Xo=Object.prototype,ei=Xo.hasOwnProperty,ti=Xo.toString,ni=Qo?Qo.toStringTag:void 0;var ri=function(e){var t=ei.call(e,ni),n=e[ni];try{e[ni]=void 0;var r=!0}catch(e){}var o=ti.call(e);return r&&(t?e[ni]=n:delete e[ni]),o},oi=Object.prototype.toString;var ii=function(e){return oi.call(e)},ai=Qo?Qo.toStringTag:void 0;var ci=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ai&&ai in Object(e)?ri(e):ii(e)};var si=function(e,t){return function(n){return e(t(n))}},ui=si(Object.getPrototypeOf,Object);var li=function(e){return null!=e&&"object"==typeof e},fi=Function.prototype,pi=Object.prototype,di=fi.toString,mi=pi.hasOwnProperty,hi=di.call(Object);var yi=function(e){if(!li(e)||"[object Object]"!=ci(e))return!1;var t=ui(e);if(null===t)return!0;var n=mi.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&di.call(n)==hi};var vi=function(){this.__data__=[],this.size=0};var bi=function(e,t){return e===t||e!=e&&t!=t};var gi=function(e,t){for(var n=e.length;n--;)if(bi(e[n][0],t))return n;return-1},Si=Array.prototype.splice;var Ei=function(e){var t=this.__data__,n=gi(t,e);return!(n<0)&&(n==t.length-1?t.pop():Si.call(t,n,1),--this.size,!0)};var Oi=function(e){var t=this.__data__,n=gi(t,e);return n<0?void 0:t[n][1]};var ji=function(e){return gi(this.__data__,e)>-1};var Ci=function(e,t){var n=this.__data__,r=gi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function wi(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}wi.prototype.clear=vi,wi.prototype.delete=Ei,wi.prototype.get=Oi,wi.prototype.has=ji,wi.prototype.set=Ci;var Ai=wi;var Ii=function(){this.__data__=new Ai,this.size=0};var Ti=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var ki=function(e){return this.__data__.get(e)};var _i=function(e){return this.__data__.has(e)};var Li=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var xi,Pi=function(e){if(!Li(e))return!1;var t=ci(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Ni=Zo.a["__core-js_shared__"],Ri=(xi=/[^.]+$/.exec(Ni&&Ni.keys&&Ni.keys.IE_PROTO||""))?"Symbol(src)_1."+xi:"";var Di=function(e){return!!Ri&&Ri in e},Mi=Function.prototype.toString;var Ui=function(e){if(null!=e){try{return Mi.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Fi=/^\[object .+?Constructor\]$/,Vi=Function.prototype,zi=Object.prototype,Bi=Vi.toString,Hi=zi.hasOwnProperty,qi=RegExp("^"+Bi.call(Hi).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ji=function(e){return!(!Li(e)||Di(e))&&(Pi(e)?qi:Fi).test(Ui(e))};var $i=function(e,t){return null==e?void 0:e[t]};var Ki=function(e,t){var n=$i(e,t);return Ji(n)?n:void 0},Yi=Ki(Zo.a,"Map"),Gi=Ki(Object,"create");var Wi=function(){this.__data__=Gi?Gi(null):{},this.size=0};var Zi=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Qi=Object.prototype.hasOwnProperty;var Xi=function(e){var t=this.__data__;if(Gi){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Qi.call(t,e)?t[e]:void 0},ea=Object.prototype.hasOwnProperty;var ta=function(e){var t=this.__data__;return Gi?void 0!==t[e]:ea.call(t,e)};var na=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Gi&&void 0===t?"__lodash_hash_undefined__":t,this};function ra(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ra.prototype.clear=Wi,ra.prototype.delete=Zi,ra.prototype.get=Xi,ra.prototype.has=ta,ra.prototype.set=na;var oa=ra;var ia=function(){this.size=0,this.__data__={hash:new oa,map:new(Yi||Ai),string:new oa}};var aa=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ca=function(e,t){var n=e.__data__;return aa(t)?n["string"==typeof t?"string":"hash"]:n.map};var sa=function(e){var t=ca(this,e).delete(e);return this.size-=t?1:0,t};var ua=function(e){return ca(this,e).get(e)};var la=function(e){return ca(this,e).has(e)};var fa=function(e,t){var n=ca(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function pa(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}pa.prototype.clear=ia,pa.prototype.delete=sa,pa.prototype.get=ua,pa.prototype.has=la,pa.prototype.set=fa;var da=pa;var ma=function(e,t){var n=this.__data__;if(n instanceof Ai){var r=n.__data__;if(!Yi||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new da(r)}return n.set(e,t),this.size=n.size,this};function ha(e){var t=this.__data__=new Ai(e);this.size=t.size}ha.prototype.clear=Ii,ha.prototype.delete=Ti,ha.prototype.get=ki,ha.prototype.has=_i,ha.prototype.set=ma;var ya=ha;var va=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},ba=function(){try{var e=Ki(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var ga=function(e,t,n){"__proto__"==t&&ba?ba(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Sa=Object.prototype.hasOwnProperty;var Ea=function(e,t,n){var r=e[t];Sa.call(e,t)&&bi(r,n)&&(void 0!==n||t in e)||ga(e,t,n)};var Oa=function(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var c=t[i],s=r?r(n[c],e[c],c,n,e):void 0;void 0===s&&(s=e[c]),o?ga(n,c,s):Ea(n,c,s)}return n};var ja=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var Ca=function(e){return li(e)&&"[object Arguments]"==ci(e)},wa=Object.prototype,Aa=wa.hasOwnProperty,Ia=wa.propertyIsEnumerable,Ta=Ca(function(){return arguments}())?Ca:function(e){return li(e)&&Aa.call(e,"callee")&&!Ia.call(e,"callee")},ka=Array.isArray,_a=n(21),La=/^(?:0|[1-9]\d*)$/;var xa=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&La.test(e))&&e>-1&&e%1==0&&e<t};var Pa=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Na={};Na["[object Float32Array]"]=Na["[object Float64Array]"]=Na["[object Int8Array]"]=Na["[object Int16Array]"]=Na["[object Int32Array]"]=Na["[object Uint8Array]"]=Na["[object Uint8ClampedArray]"]=Na["[object Uint16Array]"]=Na["[object Uint32Array]"]=!0,Na["[object Arguments]"]=Na["[object Array]"]=Na["[object ArrayBuffer]"]=Na["[object Boolean]"]=Na["[object DataView]"]=Na["[object Date]"]=Na["[object Error]"]=Na["[object Function]"]=Na["[object Map]"]=Na["[object Number]"]=Na["[object Object]"]=Na["[object RegExp]"]=Na["[object Set]"]=Na["[object String]"]=Na["[object WeakMap]"]=!1;var Ra=function(e){return li(e)&&Pa(e.length)&&!!Na[ci(e)]};var Da=function(e){return function(t){return e(t)}},Ma=n(10),Ua=Ma.a&&Ma.a.isTypedArray,Fa=Ua?Da(Ua):Ra,Va=Object.prototype.hasOwnProperty;var za=function(e,t){var n=ka(e),r=!n&&Ta(e),o=!n&&!r&&Object(_a.a)(e),i=!n&&!r&&!o&&Fa(e),a=n||r||o||i,c=a?ja(e.length,String):[],s=c.length;for(var u in e)!t&&!Va.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||xa(u,s))||c.push(u);return c},Ba=Object.prototype;var Ha=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ba)},qa=si(Object.keys,Object),Ja=Object.prototype.hasOwnProperty;var $a=function(e){if(!Ha(e))return qa(e);var t=[];for(var n in Object(e))Ja.call(e,n)&&"constructor"!=n&&t.push(n);return t};var Ka=function(e){return null!=e&&Pa(e.length)&&!Pi(e)};var Ya=function(e){return Ka(e)?za(e):$a(e)};var Ga=function(e,t){return e&&Oa(t,Ya(t),e)};var Wa=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},Za=Object.prototype.hasOwnProperty;var Qa=function(e){if(!Li(e))return Wa(e);var t=Ha(e),n=[];for(var r in e)("constructor"!=r||!t&&Za.call(e,r))&&n.push(r);return n};var Xa=function(e){return Ka(e)?za(e,!0):Qa(e)};var ec=function(e,t){return e&&Oa(t,Xa(t),e)},tc=n(128);var nc=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var rc=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i};var oc=function(){return[]},ic=Object.prototype.propertyIsEnumerable,ac=Object.getOwnPropertySymbols,cc=ac?function(e){return null==e?[]:(e=Object(e),rc(ac(e),(function(t){return ic.call(e,t)})))}:oc;var sc=function(e,t){return Oa(e,cc(e),t)};var uc=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e},lc=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)uc(t,cc(e)),e=ui(e);return t}:oc;var fc=function(e,t){return Oa(e,lc(e),t)};var pc=function(e,t,n){var r=t(e);return ka(e)?r:uc(r,n(e))};var dc=function(e){return pc(e,Ya,cc)};var mc=function(e){return pc(e,Xa,lc)},hc=Ki(Zo.a,"DataView"),yc=Ki(Zo.a,"Promise"),vc=Ki(Zo.a,"Set"),bc=Ki(Zo.a,"WeakMap"),gc=Ui(hc),Sc=Ui(Yi),Ec=Ui(yc),Oc=Ui(vc),jc=Ui(bc),Cc=ci;(hc&&"[object DataView]"!=Cc(new hc(new ArrayBuffer(1)))||Yi&&"[object Map]"!=Cc(new Yi)||yc&&"[object Promise]"!=Cc(yc.resolve())||vc&&"[object Set]"!=Cc(new vc)||bc&&"[object WeakMap]"!=Cc(new bc))&&(Cc=function(e){var t=ci(e),n="[object Object]"==t?e.constructor:void 0,r=n?Ui(n):"";if(r)switch(r){case gc:return"[object DataView]";case Sc:return"[object Map]";case Ec:return"[object Promise]";case Oc:return"[object Set]";case jc:return"[object WeakMap]"}return t});var wc=Cc,Ac=Object.prototype.hasOwnProperty;var Ic=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ac.call(e,"index")&&(n.index=e.index,n.input=e.input),n},Tc=Zo.a.Uint8Array;var kc=function(e){var t=new e.constructor(e.byteLength);return new Tc(t).set(new Tc(e)),t};var _c=function(e,t){var n=t?kc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},Lc=/\w*$/;var xc=function(e){var t=new e.constructor(e.source,Lc.exec(e));return t.lastIndex=e.lastIndex,t},Pc=Qo?Qo.prototype:void 0,Nc=Pc?Pc.valueOf:void 0;var Rc=function(e){return Nc?Object(Nc.call(e)):{}};var Dc=function(e,t){var n=t?kc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var Mc=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return kc(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return _c(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Dc(e,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return xc(e);case"[object Set]":return new r;case"[object Symbol]":return Rc(e)}},Uc=Object.create,Fc=function(){function e(){}return function(t){if(!Li(t))return{};if(Uc)return Uc(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var Vc=function(e){return"function"!=typeof e.constructor||Ha(e)?{}:Fc(ui(e))};var zc=function(e){return li(e)&&"[object Map]"==wc(e)},Bc=Ma.a&&Ma.a.isMap,Hc=Bc?Da(Bc):zc;var qc=function(e){return li(e)&&"[object Set]"==wc(e)},Jc=Ma.a&&Ma.a.isSet,$c=Jc?Da(Jc):qc,Kc={};Kc["[object Arguments]"]=Kc["[object Array]"]=Kc["[object ArrayBuffer]"]=Kc["[object DataView]"]=Kc["[object Boolean]"]=Kc["[object Date]"]=Kc["[object Float32Array]"]=Kc["[object Float64Array]"]=Kc["[object Int8Array]"]=Kc["[object Int16Array]"]=Kc["[object Int32Array]"]=Kc["[object Map]"]=Kc["[object Number]"]=Kc["[object Object]"]=Kc["[object RegExp]"]=Kc["[object Set]"]=Kc["[object String]"]=Kc["[object Symbol]"]=Kc["[object Uint8Array]"]=Kc["[object Uint8ClampedArray]"]=Kc["[object Uint16Array]"]=Kc["[object Uint32Array]"]=!0,Kc["[object Error]"]=Kc["[object Function]"]=Kc["[object WeakMap]"]=!1;var Yc=function e(t,n,r,o,i,a){var c,s=1&n,u=2&n,l=4&n;if(r&&(c=i?r(t,o,i,a):r(t)),void 0!==c)return c;if(!Li(t))return t;var f=ka(t);if(f){if(c=Ic(t),!s)return nc(t,c)}else{var p=wc(t),d="[object Function]"==p||"[object GeneratorFunction]"==p;if(Object(_a.a)(t))return Object(tc.a)(t,s);if("[object Object]"==p||"[object Arguments]"==p||d&&!i){if(c=u||d?{}:Vc(t),!s)return u?fc(t,ec(c,t)):sc(t,Ga(c,t))}else{if(!Kc[p])return i?t:{};c=Mc(t,p,s)}}a||(a=new ya);var m=a.get(t);if(m)return m;a.set(t,c),$c(t)?t.forEach((function(o){c.add(e(o,n,r,o,t,a))})):Hc(t)&&t.forEach((function(o,i){c.set(i,e(o,n,r,i,t,a))}));var h=l?u?mc:dc:u?keysIn:Ya,y=f?void 0:h(t);return va(y||t,(function(o,i){y&&(o=t[i=o]),Ea(c,i,e(o,n,r,i,t,a))})),c};var Gc=function(e){return Yc(e,4)};var Wc=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o};var Zc=function(e){return"symbol"==typeof e||li(e)&&"[object Symbol]"==ci(e)};function Qc(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Qc.Cache||da),n}Qc.Cache=da;var Xc=Qc;var es=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ts=/\\(\\)?/g,ns=function(e){var t=Xc(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(es,(function(e,n,r,o){t.push(r?o.replace(ts,"$1"):n||e)})),t}));var rs=function(e){if("string"==typeof e||Zc(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},os=Qo?Qo.prototype:void 0,is=os?os.toString:void 0;var as=function e(t){if("string"==typeof t)return t;if(ka(t))return Wc(t,e)+"";if(Zc(t))return is?is.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var cs=function(e){return null==e?"":as(e)};var ss=function(e){return ka(e)?Wc(e,rs):Zc(e)?[e]:nc(ns(cs(e)))};var us=function(e,t){},ls=n(32),fs=n(33),ps=n.n(fs);var ds=function(e){return Yc(e,5)};function ms(){return(ms=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function hs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function ys(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function vs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var bs=function(e){return"function"==typeof e},gs=function(e){return null!==e&&"object"==typeof e},Ss=function(e){return String(Math.floor(Number(e)))===e},Es=function(e){return"[object String]"===Object.prototype.toString.call(e)},Os=function(e){return 0===d.Children.count(e)},js=function(e){return gs(e)&&bs(e.then)};function Cs(e,t,n,r){void 0===r&&(r=0);for(var o=ss(t);e&&r<o.length;)e=e[o[r++]];return void 0===e?n:e}function ws(e,t,n){for(var r=Gc(e),o=r,i=0,a=ss(t);i<a.length-1;i++){var c=a[i],s=Cs(e,a.slice(0,i+1));if(s&&(gs(s)||Array.isArray(s)))o=o[c]=Gc(s);else{var u=a[i+1];o=o[c]=Ss(u)&&Number(u)>=0?[]:{}}}return(0===i?e:o)[a[i]]===n?e:(void 0===n?delete o[a[i]]:o[a[i]]=n,0===i&&void 0===n&&delete r[a[i]],r)}function As(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var o=0,i=Object.keys(e);o<i.length;o++){var a=i[o],c=e[a];gs(c)?n.get(c)||(n.set(c,!0),r[a]=Array.isArray(c)?[]:{},As(c,t,n,r[a])):r[a]=t}return r}var Is=Object(d.createContext)(void 0),Ts=Is.Provider,ks=Is.Consumer;function _s(){var e=Object(d.useContext)(Is);return e||us(!1),e}function Ls(e,t){switch(t.type){case"SET_VALUES":return ms({},e,{values:t.payload});case"SET_TOUCHED":return ms({},e,{touched:t.payload});case"SET_ERRORS":return ms({},e,{errors:t.payload});case"SET_STATUS":return ms({},e,{status:t.payload});case"SET_ISSUBMITTING":return ms({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return ms({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return ms({},e,{values:ws(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return ms({},e,{touched:ws(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return ms({},e,{errors:ws(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return ms({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return ms({},e,{touched:As(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return ms({},e,{isSubmitting:!1});default:return e}}var xs={},Ps={};function Ns(e){var t=e.validateOnChange,n=void 0===t||t,r=e.validateOnBlur,o=void 0===r||r,i=e.validateOnMount,a=void 0!==i&&i,c=e.isInitialValid,s=e.enableReinitialize,u=void 0!==s&&s,l=e.onSubmit,f=ys(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=ms({validateOnChange:n,validateOnBlur:o,validateOnMount:a,onSubmit:l},f),m=Object(d.useRef)(p.initialValues),h=Object(d.useRef)(p.initialErrors||xs),y=Object(d.useRef)(p.initialTouched||Ps),v=Object(d.useRef)(p.initialStatus),b=Object(d.useRef)(!1),g=Object(d.useRef)({});Object(d.useEffect)((function(){0}),[]),Object(d.useEffect)((function(){return b.current=!0,function(){b.current=!1}}),[]);var S=Object(d.useReducer)(Ls,{values:p.initialValues,errors:p.initialErrors||xs,touched:p.initialTouched||Ps,status:p.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),E=S[0],O=S[1],j=Object(d.useCallback)((function(e,t){return new Promise((function(n,r){var o=p.validate(e,t);null==o?n(xs):js(o)?o.then((function(e){n(e||xs)}),(function(e){r(e)})):n(o)}))}),[p.validate]),C=Object(d.useCallback)((function(e,t){var n=p.validationSchema,r=bs(n)?n(t):n,o=t&&r.validateAt?r.validateAt(t,e):function(e,t,n,r){void 0===n&&(n=!1);void 0===r&&(r={});var o=function e(t){var n={};for(var r in t)if(t.hasOwnProperty(r)){var o=String(r);!0===Array.isArray(t[o])?n[o]=t[o].map((function(t){return!0===Array.isArray(t)||yi(t)?e(t):""!==t?t:void 0})):yi(t[o])?n[o]=e(t[o]):n[o]=""!==t[o]?t[o]:void 0}return n}(e);return t[n?"validateSync":"validate"](o,{abortEarly:!1,context:r})}(e,r);return new Promise((function(e,t){o.then((function(){e(xs)}),(function(n){"ValidationError"===n.name?e(function(e){var t={};if(e.inner){if(0===e.inner.length)return ws(t,e.path,e.message);var n=e.inner,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var i;if(r){if(o>=n.length)break;i=n[o++]}else{if((o=n.next()).done)break;i=o.value}var a=i;Cs(t,a.path)||(t=ws(t,a.path,a.message))}}return t}(n)):t(n)}))}))}),[p.validationSchema]),w=Object(d.useCallback)((function(e,t){return new Promise((function(n){return n(g.current[e].validate(t))}))}),[]),A=Object(d.useCallback)((function(e){var t=Object.keys(g.current).filter((function(e){return bs(g.current[e].validate)})),n=t.length>0?t.map((function(t){return w(t,Cs(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=ws(e,t[r],n)),e}),{})}))}),[w]),I=Object(d.useCallback)((function(e){return Promise.all([A(e),p.validationSchema?C(e):{},p.validate?j(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return Wo.all([t,n,r],{arrayMerge:Ds})}))}),[p.validate,p.validationSchema,A,j,C]),T=Us((function(e){return void 0===e&&(e=E.values),Object(ls.unstable_runWithPriority)(ls.LowPriority,(function(){return I(e).then((function(e){return b.current&&O({type:"SET_ERRORS",payload:e}),e}))}))})),k=Us((function(e){return void 0===e&&(e=E.values),O({type:"SET_ISVALIDATING",payload:!0}),I(e).then((function(e){return b.current&&(O({type:"SET_ISVALIDATING",payload:!1}),qo()(E.errors,e)||O({type:"SET_ERRORS",payload:e})),e}))}));Object(d.useEffect)((function(){a&&!0===b.current&&T(p.initialValues)}),[p.initialValues,a,T]);var _=Object(d.useCallback)((function(e){var t=e&&e.values?e.values:m.current,n=e&&e.errors?e.errors:h.current?h.current:p.initialErrors||{},r=e&&e.touched?e.touched:y.current?y.current:p.initialTouched||{},o=e&&e.status?e.status:v.current?v.current:p.initialStatus;m.current=t,h.current=n,y.current=r,v.current=o,O({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:o,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})}),[p.initialErrors,p.initialStatus,p.initialTouched]);Object(d.useEffect)((function(){u&&!0===b.current&&!qo()(m.current,p.initialValues)&&(m.current=p.initialValues,_())}),[u,p.initialValues,_]),Object(d.useEffect)((function(){u&&!0===b.current&&!qo()(h.current,p.initialErrors)&&(h.current=p.initialErrors||xs,O({type:"SET_ERRORS",payload:p.initialErrors||xs}))}),[u,p.initialErrors]),Object(d.useEffect)((function(){u&&!0===b.current&&!qo()(y.current,p.initialTouched)&&(y.current=p.initialTouched||Ps,O({type:"SET_TOUCHED",payload:p.initialTouched||Ps}))}),[u,p.initialTouched]),Object(d.useEffect)((function(){u&&!0===b.current&&!qo()(v.current,p.initialStatus)&&(v.current=p.initialStatus,O({type:"SET_STATUS",payload:p.initialStatus}))}),[u,p.initialStatus,p.initialTouched]);var L=Us((function(e){if(bs(g.current[e].validate)){var t=Cs(E.values,e),n=g.current[e].validate(t);return js(n)?(O({type:"SET_ISVALIDATING",payload:!0}),n.then((function(e){return e})).then((function(t){O({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),O({type:"SET_ISVALIDATING",payload:!1})}))):(O({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return Promise.resolve()})),x=Object(d.useCallback)((function(e,t){var n=t.validate;g.current[e]={validate:n}}),[]),P=Object(d.useCallback)((function(e){delete g.current[e]}),[]),N=Us((function(e){return O({type:"SET_TOUCHED",payload:e}),o?T(E.values):Promise.resolve()})),R=Object(d.useCallback)((function(e){O({type:"SET_ERRORS",payload:e})}),[]),D=Us((function(e){return O({type:"SET_VALUES",payload:e}),n?T(e):Promise.resolve()})),M=Object(d.useCallback)((function(e,t){O({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),U=Us((function(e,t,r){return void 0===r&&(r=!0),O({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),n&&r?T(ws(E.values,e,t)):Promise.resolve()})),F=Object(d.useCallback)((function(e,t){var n,r=t,o=e;if(!Es(e)){e.persist&&e.persist();var i=e.target,a=i.type,c=i.name,s=i.id,u=i.value,l=i.checked,f=(i.outerHTML,i.options),p=i.multiple;r=t||(c||s),o=/number|range/.test(a)?(n=parseFloat(u),isNaN(n)?"":n):/checkbox/.test(a)?function(e,t,n){if("true"==n||"false"==n)return!!t;if(t&&n)return Array.isArray(e)?e.concat(n):[n];if(!Array.isArray(e))return!e;var r=e.indexOf(n);if(r<0)return e;return e.slice(0,r).concat(e.slice(r+1))}(Cs(E.values,r),l,u):p?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(f):u}r&&U(r,o)}),[U,E.values]),V=Object(d.useCallback)((function(e){if(Es(e))return function(t){return F(t,e)};F(e)}),[F]),z=Us((function(e,t,n){return void 0===t&&(t=!0),void 0===n&&(n=!0),O({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),o&&n?T(E.values):Promise.resolve()})),B=Object(d.useCallback)((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,o=n.id,i=(n.outerHTML,t||(r||o));z(i,!0)}),[z]),H=Object(d.useCallback)((function(e){if(Es(e))return function(t){return B(t,e)};B(e)}),[B]),q=Object(d.useCallback)((function(e){bs(e)?O({type:"SET_FORMIK_STATE",payload:e}):O({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),J=Object(d.useCallback)((function(e){O({type:"SET_STATUS",payload:e})}),[]),$=Object(d.useCallback)((function(e){O({type:"SET_ISSUBMITTING",payload:e})}),[]),K={resetForm:_,validateForm:k,validateField:L,setErrors:R,setFieldError:M,setFieldTouched:z,setFieldValue:U,setStatus:J,setSubmitting:$,setTouched:N,setValues:D,setFormikState:q},Y=Us((function(){return l(E.values,K)})),G=Us((function(){return O({type:"SUBMIT_ATTEMPT"}),k().then((function(e){if(0===Object.keys(e).length){var t=Y();if(void 0===t)return;return Promise.resolve(t).then((function(){b.current&&O({type:"SUBMIT_SUCCESS"})})).catch((function(e){if(b.current)throw O({type:"SUBMIT_FAILURE"}),e}))}b.current&&O({type:"SUBMIT_FAILURE"})}))})),W=Us((function(e){e&&e.preventDefault&&bs(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&bs(e.stopPropagation)&&e.stopPropagation(),G()})),Z=Us((function(e){if(e&&e.preventDefault&&bs(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&bs(e.stopPropagation)&&e.stopPropagation(),p.onReset){var t=p.onReset(E.values,K);js(t)?t.then(_):_()}else _()})),Q=Object(d.useCallback)((function(e){return{value:Cs(E.values,e),error:Cs(E.errors,e),touched:!!Cs(E.touched,e),initialValue:Cs(m.current,e),initialTouched:!!Cs(y.current,e),initialError:Cs(h.current,e)}}),[E.errors,E.touched,E.values]),X=Object(d.useCallback)((function(e){var t=gs(e),n=t?e.name:e,r=Cs(E.values,n),o={name:n,value:r,onChange:V,onBlur:H};if(t){var i=e.type,a=e.value,c=e.as,s=e.multiple;"checkbox"===i?void 0===a?o.checked=!!r:(o.checked=!(!Array.isArray(r)||!~r.indexOf(a)),o.value=a):"radio"===i?(o.checked=r===a,o.value=a):"select"===c&&s&&(o.value=o.value||[],o.multiple=!0)}return o}),[H,V,E.values]),ee=Object(d.useMemo)((function(){return!qo()(m.current,E.values)}),[E.values]),te=Object(d.useMemo)((function(){return void 0!==c?ee?E.errors&&0===Object.keys(E.errors).length:!1!==c&&bs(c)?c(p):c:E.errors&&0===Object.keys(E.errors).length}),[c,ee,E.errors,p]);return ms({},E,{initialValues:m.current,initialErrors:h.current,initialTouched:y.current,initialStatus:v.current,handleBlur:H,handleChange:V,handleReset:Z,handleSubmit:W,resetForm:_,setErrors:R,setFormikState:q,setFieldTouched:z,setFieldValue:U,setFieldError:M,setStatus:J,setSubmitting:$,setTouched:N,setValues:D,submitForm:G,validateForm:k,validateField:L,isValid:te,dirty:ee,unregisterField:P,registerField:x,getFieldProps:X,getFieldMeta:Q,validateOnBlur:o,validateOnChange:n,validateOnMount:a})}function Rs(e){var t=Ns(e),n=e.component,r=e.children,o=e.render;return Object(d.useEffect)((function(){0}),[]),Object(d.createElement)(Ts,{value:t},n?Object(d.createElement)(n,t):o?o(t):r?bs(r)?r(t):Os(r)?null:d.Children.only(r):null)}function Ds(e,t,n){var r=e.slice();return t.forEach((function(t,o){if(void 0===r[o]){var i=!1!==n.clone&&n.isMergeableObject(t);r[o]=i?Wo(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[o]=Wo(e[o],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var Ms="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d.useLayoutEffect:d.useEffect;function Us(e){var t=Object(d.useRef)(e);return Ms((function(){t.current=e})),Object(d.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current.apply(void 0,n)}),[])}function Fs(e){var t=e.validate,n=e.name,r=e.render,o=e.children,i=e.as,a=e.component,c=ys(e,["validate","name","render","children","as","component"]),s=_s(),u=(s.validate,s.validationSchema,ys(s,["validate","validationSchema"]));Object(d.useEffect)((function(){0}),[]);var l=u.registerField,f=u.unregisterField;Object(d.useEffect)((function(){return l(n,{validate:t}),function(){f(n)}}),[l,f,n,t]);var p=u.getFieldProps(ms({name:n},c)),m=u.getFieldMeta(n),h={field:p,form:u};if(r)return r(ms({},h,{meta:m}));if(bs(o))return o(ms({},h,{meta:m}));if(a){if("string"==typeof a){var y=c.innerRef,v=ys(c,["innerRef"]);return Object(d.createElement)(a,ms({ref:y},p,v),o)}return Object(d.createElement)(a,ms({field:p,form:u},c),o)}var b=i||"input";if("string"==typeof b){var g=c.innerRef,S=ys(c,["innerRef"]);return Object(d.createElement)(b,ms({ref:g},p,S),o)}return Object(d.createElement)(b,ms({},p,c),o)}var Vs=Object(d.forwardRef)((function(e,t){var n=e.action,r=ys(e,["action"]),o=n||"#",i=_s(),a=i.handleReset,c=i.handleSubmit;return Object(d.createElement)("form",Object.assign({onSubmit:c,ref:t,onReset:a,action:o},r))}));function zs(e){var t=function(t){return Object(d.createElement)(ks,null,(function(n){return n||us(!1),Object(d.createElement)(e,Object.assign({},t,{formik:n}))}))},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return t.WrappedComponent=e,t.displayName="FormikConnect("+n+")",ps()(t,e)}Vs.displayName="Form";var Bs=function(e,t,n){var r=Hs(e);return r.splice(t,0,n),r},Hs=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map((function(e){return parseInt(e)})).reduce((function(e,t){return t>e?t:e}),0);return Array.from(ms({},e,{length:t+1}))}return[]},qs=function(e){function t(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var o=n.props,i=o.name,a=o.validateOnChange,c=o.formik,s=c.setFormikState,u=c.validateForm;s((function(n){var o="function"==typeof r?r:e,a="function"==typeof t?t:e;return ms({},n,{values:ws(n.values,i,e(Cs(n.values,i))),errors:r?ws(n.errors,i,o(Cs(n.errors,i))):n.errors,touched:t?ws(n.touched,i,a(Cs(n.touched,i))):n.touched})}),(function(){a&&u()}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat(Hs(t),[ds(e)])}),!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Hs(e),o=r[t];return r[t]=r[n],r[n]=o,r}(n,e,t)}),!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Hs(e),o=r[t];return r.splice(t,1),r.splice(n,0,o),r}(n,e,t)}),!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField((function(n){return Bs(n,e,t)}),(function(t){return Bs(t,e,null)}),(function(t){return Bs(t,e,null)}))},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Hs(e);return r[t]=n,r}(n,e,t)}),!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField((function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n})),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(vs(n)),n.pop=n.pop.bind(vs(n)),n}hs(t,e);var n=t.prototype;return n.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?Hs(n):[];return t||(t=r[e]),bs(r.splice)&&r.splice(e,1),r}),!0,!0),t},n.pop=function(){var e;return this.updateArrayField((function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n}),!0,!0),e},n.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,o=t.children,i=t.name,a=t.formik,c=(a.validate,a.validationSchema,ms({},e,{form:ys(a,["validate","validationSchema"]),name:i}));return n?Object(d.createElement)(n,c):r?r(c):o?"function"==typeof o?o(c):Os(o)?null:d.Children.only(o):null},t}(d.Component);qs.defaultProps={validateOnChange:!0};var Js=zs(function(e){function t(){return e.apply(this,arguments)||this}hs(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return Cs(this.props.formik.errors,this.props.name)!==Cs(e.formik.errors,this.props.name)||Cs(this.props.formik.touched,this.props.name)!==Cs(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,t=e.component,n=e.formik,r=e.render,o=e.children,i=e.name,a=ys(e,["component","formik","render","children","name"]),c=Cs(n.touched,i),s=Cs(n.errors,i);return c&&s?r?bs(r)?r(s):null:o?bs(o)?o(s):null:t?Object(d.createElement)(t,a,s):s:null},t}(d.Component));(function(e){function t(t){var n;n=e.call(this,t)||this;var r=t.render,o=t.children,i=t.component,a=t.as;t.name;return r&&us(!1),i&&r&&us(!1),a&&o&&bs(o)&&us(!1),i&&o&&bs(o)&&us(!1),r&&o&&!Os(o)&&us(!1),n}hs(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e,t,n){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):Cs(this.context.values,this.props.name)!==Cs(n.values,this.props.name)||Cs(this.context.errors,this.props.name)!==Cs(n.errors,this.props.name)||Cs(this.context.touched,this.props.name)!==Cs(n.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length||this.context.isSubmitting!==n.isSubmitting},n.componentDidMount=function(){this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentDidUpdate=function(e){this.props.name!==e.name&&(this.context.unregisterField(e.name),this.context.registerField(this.props.name,{validate:this.props.validate})),this.props.validate!==e.validate&&this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentWillUnmount=function(){this.context.unregisterField(this.props.name)},n.render=function(){var e=this.props,t=(e.validate,e.name),n=e.render,r=e.as,o=e.children,i=e.component,a=(e.shouldUpdate,ys(e,["validate","name","render","as","children","component","shouldUpdate"])),c=this.context,s=(c.validate,c.validationSchema,ys(c,["validate","validationSchema"])),u={value:"radio"===a.type||"checkbox"===a.type?a.value:Cs(c.values,t),name:t,onChange:c.handleChange,onBlur:c.handleBlur},l={field:u,meta:{value:Cs(c.values,t),error:Cs(c.errors,t),touched:!!Cs(c.touched,t),initialValue:Cs(c.initialValues,t),initialTouched:!!Cs(c.initialTouched,t),initialError:Cs(c.initialErrors,t)},form:s};if(n)return n(l);if(bs(o))return o(l);if(i){if("string"==typeof i){var f=a.innerRef,p=ys(a,["innerRef"]);return Object(d.createElement)(i,ms({ref:f},u,p),o)}return Object(d.createElement)(i,ms({field:u,form:c},a),o)}var m=r||"input";if("string"==typeof m){var h=a.innerRef,y=ys(a,["innerRef"]);return Object(d.createElement)(m,ms({ref:h},u,y),o)}return Object(d.createElement)(m,ms({},u,a),o)},t}(d.Component)).contextType=Is;var $s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Ks(e){var t=e.castInitialValues,n=e.castValuesOnSubmit,r=e.initialValues,o=e.onSubmit,i=e.resetOnSubmit,a=$s(e,["castInitialValues","castValuesOnSubmit","initialValues","onSubmit","resetOnSubmit"]),c=t&&e.validationSchema?e.validationSchema.cast(function e(t){var n=Rr.deepClone(t);return Object.keys(n).forEach((function(t){n.hasOwnProperty(t)&&(Rr.isObject(n[t])?n[t]=e(n[t]):null===n[t]&&delete n[t])})),n}(r)):r,s={allowInitialSubmit:e.allowInitialSubmit};return d.createElement(Rs,Object.assign({enableReinitialize:!0},a,{initialValues:c,onSubmit:function(t,r){var a=r.setSubmitting,c=r.resetForm,s=n&&e.validationSchema?e.validationSchema.cast(t):t;o(s,(function(){i&&c(),a(!1)}))},initialStatus:s}),hn(e.children)?function(t){return e.children(t)}:d.Children.count(e.children)?e.children:null)}Ks.defaultProps={castInitialValues:!0,castValuesOnSubmit:!0};var Ys=n(2),Gs=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),Ws=n(3),Zs=function(e,t,n,r){var o="form-control";return Cs(t,n)&&Cs(e,n)&&(o+=" is-invalid"),r&&(o+=" ".concat(r)),o};function Qs(e){var t=_s().values[e.fieldName];return"string"!=typeof t?d.createElement(d.Fragment,null):d.createElement("div",{className:"float-right text-muted"},t.length,"/",e.limit)}var Xs=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function eu(e){var t=e.label,n=Xs(e,["label"]);return d.createElement(Ws.Form.Group,null,d.createElement("div",{className:"custom-control custom-checkbox"},d.createElement(nu,Object.assign({className:"custom-control-input"},n)),d.createElement(Ws.Form.Label,{className:"custom-control-label",htmlFor:n.id},t)))}var tu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function nu(e){var t=e.children,n=tu(e,["children"]);return d.createElement(Fs,Object.assign({},n),hn(t)?function(e){return t(e)}:d.Children.count(t)?t:null)}function ru(e){var t=e.label,n=e.className,r=e.showCharacterCounter,o=tu(e,["label","className","showCharacterCounter"]),i=_s(),a=i.errors,c=i.touched;return"checkbox"===o.type?d.createElement(eu,Object.assign({},e)):d.createElement(Ws.Form.Group,null,!!t&&d.createElement(Ws.Form.Label,{htmlFor:o.id},t),d.createElement(nu,Object.assign({className:Zs(a,c,o.name,n)},o)),!!r&&!!o.maxLength&&d.createElement(Qs,{fieldName:o.name,limit:o.maxLength}),d.createElement(Js,{name:o.name},(function(e){return d.createElement(Ws.Form.Control.Feedback,{type:"invalid"},e)})))}function ou(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return iu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function au(e){var t,n=ou(d.useState(!1),2),r=n[0],o=n[1];return d.useEffect((function(){var t;e.isValid&&(e.dirty||(null===(t=e.initialStatus)||void 0===t?void 0:t.allowInitialSubmit))?o(!0):o(!1)}),[e.isValid,null===(t=e.initialStatus)||void 0===t?void 0:t.allowInitialSubmit,e.dirty,e.values]),d.useEffect((function(){e.isSubmitting&&o(!1)}),[e.isSubmitting]),r}function cu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return su(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return su(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function su(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var uu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function lu(e){var t=e.showSpinner,n=e.children,r=uu(e,["showSpinner","children"]),o=d.useRef(),i=cu(d.useState({}),2),a=i[0],c=i[1];return d.useEffect((function(){var e=a.width,t=a.height;if(!e||!t){var n=o.current,r=n.offsetHeight,i=n.offsetWidth;r&&i&&c({width:i,height:r})}})),d.useEffect((function(){var e=a.width,t=a.height;if(e&&t){var n=o.current;n.style.width="".concat(e+1,"px"),n.style.height="".concat(t+1,"px")}}),[a]),d.createElement(Ws.Button,Object.assign({ref:o,disabled:t},r),t?d.createElement(Ws.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):n)}var fu=n(129),pu=n(22),du="AlertService",mu="LanguageService";function hu(e){return(hu="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 yu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vu(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 bu(e,t){return(bu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gu(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=Eu(e);if(t){var o=Eu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Su(this,n)}}function Su(e,t){return!t||"object"!==hu(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 Eu(e){return(Eu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ou=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&&bu(e,t)}(i,e);var t,n,r,o=gu(i);function i(){return yu(this,i),o.apply(this,arguments)}return t=i,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"setConfig",value:function(e){this.polyglot=new fu({locale:e.locale,phrases:e.phrases.rootElement||e.phrases}),this.cache={}}},{key:"getPhrase",value:function(e,t,n){var r="".concat(e,".").concat(t);if(this.polyglot||K.throw(new Xe("LanguageService config must be set.")),!this.polyglot.has(r)){if(!_.isDevelopment){var o=window.trackJs;return o&&o.console.error("No phrase set for ".concat(r," in language config")),""}K.throw(new Xe("No phrase set for ".concat(r," in language config.")))}if(!n||h.isEmpty(n)){var i=this.cache[r];if(i)return i;var a=this.polyglot.t(r);return this.cache[r]=a,a}var c=h.omit(n,"smartCount"),s={};for(var u in c)s[u]=pu.sanitize(c[u]);h.isNumber(n.smartCount)&&(s.smart_count=n.smartCount);var l="".concat(r,":").concat(h.values(Object.assign({},s)).join(":")),f=this.cache[l];if(f)return f;var p=this.polyglot.t(r,s);return this.cache[l]=p,p}},{key:"encloseNamespace",value:function(e){var t=this;return function(n,r){return t.getPhrase(e,n,r)}}},{key:"name",get:function(){return mu}}])&&vu(t.prototype,n),r&&vu(t,r),i}(Yt).Instance,ju=d.createContext(""),Cu=d.memo((function(e){var t=e.phrase,n=e.namespace,r=e.options,o=d.useContext(ju),i=n||o,a=Ou.getPhrase(i,t,r);return d.createElement("span",{dangerouslySetInnerHTML:{__html:a}})}),(function(e,t){return e.namespace===t.namespace&&e.phrase===t.phrase&&Rr.isEqual(e.options,t.options)}));function wu(e){var t=_s(),n=au(t);d.useEffect((function(){function e(e){13===e.keyCode&&n&&t.validateForm().then((function(e){Object.keys(e).length||t.submitForm()}))}return window.addEventListener("keypress",e),function(){return window.removeEventListener("keypress",e)}}),[n]);var r="save";return e.isNew&&(r="create"),e.hasNext&&(r="next"),d.createElement(lu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},d.createElement(Cu,{namespace:"shared.formButtons",phrase:r}))}function Au(e){var t=_s();return d.createElement(Vs,null,d.createElement(ru,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this company",autoFocus:!0}),d.createElement(wu,{isNew:e.isNew}))}function Iu(e){return d.createElement(Ks,{initialValues:e.company,validationSchema:Gs,onSubmit:e.saveCompany},d.createElement(Au,{isNew:!(e.company&&e.company.id)}))}function Tu(e){var t=Object(bn.useDispatch)(),n=o.useBasicFetch(Vo(e.id));return d.createElement(d.Fragment,null,!!n.data&&d.createElement(Iu,{company:n.data,saveCompany:function(n,r){return o.fetch(t,Bo(e.id,n,r))}}))}function ku(){var e=Object(bn.useDispatch)();return d.createElement(Iu,{saveCompany:function(t,n){o.fetch(e,zo(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.PEOPLE,action:a.Companies.EDIT_COMPANY,args:[e.id]})}),n))}})}var _u,Lu=n(130);function xu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Nu(e){return(Nu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e){e.XS="(max-width: 575px)",e.SM="(min-width: 576px) and (max-width: 767px)",e.MD="(min-width: 768px) and (max-width: 991px)",e.LG="(min-width: 992px)",e.XL="(min-width: 1200px)",e.XXL="(min-width: 1440px)",e.SMDown="(max-width: 576px)",e.MDDown="(max-width: 768px)"}(_u||(_u={}));var Ru,Du={isNumber:function(e){return Du.isType(e,"number")},isString:function(e){return Du.isType(e,"string")},isType:function(e,t){return Nu(e)===t}},Mu=n(14),Uu=n.n(Mu);function Fu(e){return function(e){if(Array.isArray(e))return Vu(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Vu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vu(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bu(e,t){return Rr.isObject(e)&&e.hasOwnProperty(t)&&Du.isString(e[t])}function Hu(e,t,n){return function(r){var i=r.value;if(i.length||n(),!(i.length<e.activationLength)){if(e.local){var a=hn(e.getLocalSuggestions)?e.getLocalSuggestions(i,e.local):(c=i,s=e.local,u=e.valueKey,(l=c.trim().toLowerCase()).length?s.filter((function(e){return!(!Bu(e,u)||!Du.isString(e[u]))&&e[u].trim().toLowerCase().includes(l)})):[]);t((function(e){return Object.assign(Object.assign({},e),zu({},Ru.Local,a))}))}var c,s,u,l;e.getRemoteUrl&&function(e,t,n){var r=hn(e)&&e(t);r&&o.ajaxRequest({resource:r,type:jr.GET,success:n,error:function(){}})}(e.getRemoteUrl,i,(function(n){return t((function(t){return Object.assign(Object.assign({},t),zu({},Ru.Remote,hn(e.formatRemoteSuggestions)?e.formatRemoteSuggestions(n):n))}))}))}}}function qu(e,t,n,r,o,i){var a=function(t){return e[t]||[]},c=t?a(Ru.Recent):[],s=a(Ru.Local),u=a(Ru.Remote),l=[];c.length&&l.push({title:n,data:c});var f=[].concat(Fu(s),Fu(u));return Number.isInteger(i)&&l.length>i&&f.slice(0,i),hn(o)?l.push.apply(l,Fu(o(f))):l.push({title:r,data:f}),l}function Ju(e){return e.data}function $u(e){if(e.title)return d.createElement("strong",null,e.title)}!function(e){e.Local="local",e.Recent="recent",e.Remote="remote"}(Ru||(Ru={}));var Ku={container:"position-relative",suggestionsContainerOpen:"bg-white py-1 border rounded ".concat(Uu.a.suggestionsContainerOpen),suggestionsList:"list-unstyled m-0",suggestion:"cursor-pointer py-1 px-2",suggestionHighlighted:Uu.a.suggestionHighlighted,sectionContainer:"border-bottom py-1 ".concat(Uu.a.sectionContainer)};function Yu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Ku,e)}var Gu,Wu,Zu=n(15),Qu=n(35),Xu=n.n(Qu),el=n(36),tl=n.n(el),nl=n(37),rl=n.n(nl),ol=n(38),il=n.n(ol),al=(n(39),n(40),n(41)),cl=n.n(al),sl=n(42),ul=n.n(sl),ll=n(43),fl=n.n(ll),pl=n(44),dl=n.n(pl),ml=n(45),hl=n.n(ml),yl=n(46),vl=n.n(yl),bl=n(47),gl=n.n(bl),Sl=n(48),El=n.n(Sl),Ol=n(49),jl=n.n(Ol),Cl=n(50),wl=n.n(Cl),Al=n(51),Il=n.n(Al),Tl=n(52),kl=n.n(Tl),_l=n(53),Ll=n.n(_l),xl=n(54),Pl=n.n(xl),Nl=n(55),Rl=n.n(Nl),Dl=n(56),Ml=n.n(Dl),Ul=n(57),Fl=n.n(Ul),Vl=n(58),zl=n.n(Vl),Bl=n(59),Hl=n.n(Bl),ql=n(60),Jl=n.n(ql),$l=(n(61),n(62)),Kl=n.n($l),Yl=n(63),Gl=n.n(Yl),Wl=n(64),Zl=n.n(Wl),Ql=(n(65),n(66),n(67)),Xl=n.n(Ql),ef=n(68),tf=n.n(ef),nf=n(69),rf=n.n(nf),of=n(70),af=n.n(of),cf=n(71),sf=n.n(cf),uf=n(72),lf=n.n(uf),ff=(n(73),n(74)),pf=n.n(ff),df=n(75),mf=n.n(df),hf=n(76),yf=n.n(hf),vf=n(77),bf=n.n(vf),gf=n(78),Sf=n.n(gf),Ef=n(79),Of=n.n(Ef),jf=n(80),Cf=n.n(jf),wf=(n(81),n(82)),Af=n.n(wf),If=n(83),Tf=n.n(If),kf=n(84),_f=n.n(kf),Lf=n(85),xf=n.n(Lf),Pf=n(86),Nf=n.n(Pf),Rf=n(87),Df=n.n(Rf),Mf=n(88),Uf=n.n(Mf),Ff=n(89),Vf=n.n(Ff),zf=n(90),Bf=n.n(zf),Hf=n(91),qf=n.n(Hf),Jf=n(92),$f=n.n(Jf),Kf=n(93),Yf=n.n(Kf),Gf=n(94),Wf=n.n(Gf),Zf=(n(95),n(96),n(97),n(98)),Qf=n.n(Zf),Xf=(n(99),n(100),n(101),n(102),n(103)),ep=n.n(Xf),tp=n(104),np=n.n(tp),rp=(n(105),n(106),n(107),n(108)),op=n.n(rp),ip=n(109),ap=n.n(ip),cp=n(110),sp=n.n(cp),up=n(111),lp=n.n(up),fp=n(112),pp=n.n(fp),dp=n(113),mp=n.n(dp),hp=n(114),yp=n.n(hp),vp=(n(115),n(116),n(117),n(118)),bp=n.n(vp),gp=n(119),Sp=n.n(gp),Ep=[Xu.a,rl.a,il.a,cl.a,dl.a,hl.a,vl.a,gl.a,fl.a,tl.a,El.a,jl.a,wl.a,Il.a,kl.a,ul.a,Ll.a,Pl.a,Rl.a,Jl.a,Ml.a,Fl.a,zl.a,Hl.a,Kl.a,rf.a,Uf.a,Bf.a,Vf.a,Wf.a,qf.a,$f.a,Yf.a,bf.a,Of.a,Sf.a,Gl.a,Zl.a,mf.a,yf.a,pf.a,Xl.a,af.a,Tf.a,_f.a,sf.a,lf.a,xf.a,tf.a,Af.a,Nf.a,Df.a,Cf.a,ep.a,np.a,Qf.a,sp.a,ap.a,op.a,lp.a,mp.a,pp.a,yp.a,Sp.a,bp.a];function Op(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e){e.AddToPlaylists="add-to-playlist",e.Caret="caret",e.Delete="delete",e.Edit="edit",e.NoEdit="no-edit",e.Close="close",e.Folder="folder",e.Resources="resources",e.More="more",e.Bell="bell",e.Plus="plus",e.Search="search",e.Share="share",e.Upload="upload",e.Preview="preview",e.CircleCheck="circle-check",e.Down="down",e.Right="right",e.UpDown="up-down",e.ChevronUp="chevron-up",e.ChevronDown="chevron-down",e.ChevronLeft="chevron-left",e.ChevronRight="chevron-right",e.VisibleOff="visible-off",e.VisibleOn="visible-on",e.PublisherArchive="publisher-archive",e.Play="play",e.PlayCircle="play-circle",e.ArrowLeft="arrow-left",e.CheckCircleOutline="check-circle-o",e.CheckCircle="check-circle",e.Check="check",e.Lock="lock",e.Link="link",e.Info="info",e.Question="question",e.Star="star",e.StarOutline="star-o",e.Archive="archive",e.Warning="warning",e.WarningOutline="warning-o",e.NewWindow="new-window",e.File="file",e.FilePDF="file-pdf",e.FileExcel="file-excel",e.FilePowerpoint="file-ppt",e.FileWord="file-word",e.FileImg="file-img",e.FileZip="file-zip",e.Enter="enter",e.Calendar="calendar",e.CloseCaption="close-caption",e.CloseCaptionBadge="close-caption-badge",e.Playlist="playlist",e.Handle="handle",e.Subject="subject",e.Series="series",e.EditClickView="edit-clickview",e.Heart="heart",e.HeartOutline="heart-outline",e.WhiteWave="white-wave",e.Cog="cog",e.Video="video",e.Compass="compass",e.History="history",e.Tag="tag"}(Gu||(Gu={}));var jp;function Cp(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)}}h.extend(Zu.config,{autoReplaceSvg:!1,autoAddCss:!1,familyPrefix:"cv",autoA11y:!0,observeMutations:!1,replacementClass:"cv-svg",keepOriginalSource:!1}),(Wu=Zu.library).add.apply(Wu,function(e){if(Array.isArray(e))return Op(e)}(jp=Ep)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(jp)||function(e,t){if(e){if("string"==typeof e)return Op(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Op(e,t):void 0}}(jp)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var wp=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"getSvg",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.faIconLookup(e,t),r=this.getIcon(n,t);if(r&&(!r||r.html.length))return r.html.pop()}},{key:"getIcon",value:function(e,t){return Zu.icon(e,t.iconOptions||{})}},{key:"faIconLookup",value:function(e,t){var n=t.prefix,r=void 0===n?"cv":n;return Zu.findIconDefinition({prefix:r,iconName:e})}}])&&Cp(t.prototype,n),r&&Cp(t,r),e}().Instance,Ap=Gu,Ip=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return Math.floor(Math.random()*Math.floor(e))};function Tp(e){var t=e.title,n=e.placement,r=e.trigger,o=e.children;return d.createElement(Ws.OverlayTrigger,{placement:n,overlay:d.createElement(Ws.Tooltip,{id:"".concat(t,"-").concat(Ip())},t),trigger:r},d.createElement("span",null,o))}Tp.defaultProps={trigger:["hover","click","focus"],placement:"top"};var kp;function _p(e){var t=e.svgName,n=e.className,r=void 0===n?"d-inline-block svg-container":n,o=e.tagName,i=void 0===o?"span":o,a=e.size,c=void 0===a?kp.Standard:a,s=e.onClick,u=e.title,l=e.tooltipPlacement,f=void 0===l?"right":l,p=i,m={dangerouslySetInnerHTML:{__html:wp.getSvg(t)},className:"".concat(r," ").concat(c),onClick:hn(s)?s:null};return u?d.createElement(Tp,{title:u,placement:f},d.createElement(p,Object.assign({},m))):d.createElement(p,Object.assign({},m))}!function(e){e.Standard="std",e.Small="sm",e.Medium="md",e.Large="lg",e.ExtraLarge="xlg"}(kp||(kp={}));var Lp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},xp=function(e){var t="d-inline-block svg-container";return hn(e)?t+" cursor-pointer":t};function Pp(e){var t=e.onClickSearchIcon,n=e.searchIconPlacement,r=e.className,o=Lp(e,["onClickSearchIcon","searchIconPlacement","className"]),i="form-control ".concat(Uu.a.input),a="input-group-text bg-white";"right"===n&&(i+=" border-right-0",a+=" pl-0"),"left"===n&&(i+=" border-left-0",a+=" pr-0"),r&&(i+=" ".concat(r));var c=function(){return d.createElement("div",{className:a},d.createElement(_p,{svgName:Ap.Search,size:kp.Small,onClick:t,className:xp(t)}))};return d.createElement("div",{className:"input-group"},"left"===n&&d.createElement("div",{className:"input-group-prepend"},d.createElement(c,null)),d.createElement("input",Object.assign({className:i},o)),"right"===n&&d.createElement("div",{className:"input-group-append"},d.createElement(c,null)))}function Np(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Rp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Dp=hn;function Mp(e){var t,n,r,o=(t=e.initialSuggestions,n=e.recentSearches,zu(r={},Ru.Recent,n),zu(r,Ru.Local,t),zu(r,Ru.Remote,[]),r),i=Np(d.useState(e.initialQuery||""),2),a=i[0],c=i[1],s=Np(d.useState(o),2),u=s[0],l=s[1],f=function(e){var t=xu(Object(d.useState)(window.matchMedia(e).matches),2),n=t[0],r=t[1];return Object(d.useEffect)((function(){var t=window.matchMedia(e);t.matches!==n&&r(t.matches);var o=function(){return r(t.matches)};return t.addListener(o),function(){return t.removeListener(o)}}),[e]),n}(_u.XS),p=function(){l(o)},m=function(t){t.preventDefault(),Dp(e.onSubmit)&&e.onSubmit(a)};return d.createElement("form",{onSubmit:m},d.createElement(Lu,{suggestions:qu(u,!a,e.recentSearchHeading||Ou.getPhrase("shared.searchBar","recentSearchHeading"),e.suggestionsHeading,e.getSections,e.suggestionLimit),onSuggestionsFetchRequested:Hu(e,l,p),onSuggestionsClearRequested:function(){e.alwaysRenderSuggestions||p()},onSuggestionSelected:function(t,n){var r=n.suggestion;e.clearQueryOnSelect&&c(""),e.onSuggestionSelected(r)},getSuggestionValue:function(t){return e.updateQueryOnSelection?function(e,t){return Bu(t,e)?t[e]:""}(e.valueKey,t):a},renderSuggestion:function(t){return Dp(e.getSuggestionComponent)?e.getSuggestionComponent(t):function(e,t){return Bu(t,e)?d.createElement(d.Fragment,null,t[e]):d.createElement(d.Fragment,null)}(e.valueKey,t)},alwaysRenderSuggestions:e.alwaysRenderSuggestions,focusInputOnSuggestionClick:!f,inputProps:{placeholder:e.placeholder||Ou.getPhrase("shared.searchBar","placeholder"),value:a,onChange:function(t,n){var r=n.newValue;c(r),Dp(e.onQueryChange)&&e.onQueryChange(r)},onKeyDown:function(t){8===t.keyCode&&e.onBackspace&&!a&&e.onBackspace()},autoFocus:!!e.autoFocusInput,onClickSearchIcon:!!e.submitOnClickSearchIcon&&m,searchIconPlacement:e.searchIconPlacement},renderInputComponent:Pp,theme:Yu(e.theme),multiSection:!0,renderSectionTitle:$u,getSectionSuggestions:Ju}))}function Up(e){var t=e.appLink,n=e.className,o=e.children,i=e.tag,a=void 0===i?"a":i;if(!t)return d.createElement("span",{className:n||""},o);var c=e.onClick;c||(c=function(e){e.preventDefault(),r.AppLinkHelper.trigger(t)});var s={onClick:c,href:r.AppLinkHelper.getHref(t),className:n};return d.createElement(a,Object.assign({},s),o)}function Fp(e){var t=e.backToName,n=e.appLink;return d.createElement(Up,{appLink:n,className:"d-inline-flex align-items-center"},d.createElement(_p,{svgName:Ap.ArrowLeft,size:kp.Small}),d.createElement("span",{className:"ml-1"},"Back to ".concat(t)))}function Vp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return zp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Mp.defaultProps={updateQueryOnSelection:!0,valueKey:"name",activationLength:3,suggestionLimit:5,recentSearches:[],initialSuggestions:[],searchIconPlacement:"right"};var Bp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Hp(e){var t=e.selected,n=e.onToggle,r=Bp(e,["selected","onToggle"]),o=Vp(d.useState(t),2),i=o[0],a=o[1];d.useEffect((function(){return a(t)}),[t]);return d.createElement(Ws.Form.Check,Object.assign({type:"checkbox",id:"checkbox-".concat(Ip()),checked:i,onChange:function(){a(!i),n(!i)}},r))}var qp,Jp,$p,Kp,Yp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Gp(e){var t=e.onFileSelect,n=e.acceptMultiple,r=e.mimeType,o=e.label,i=e.error,a=e.touched,c=Yp(e,["onFileSelect","acceptMultiple","mimeType","label","error","touched"]),s="custom-file-input cursor-pointer";i&&a&&(s+=" is-invalid");var u=Object.assign({type:"file",className:s,onChange:function(e){var n=e.currentTarget.files;n&&n.length&&hn(t)&&t(n)},autoComplete:"off",value:"",multiple:!!n},r?{accept:r}:{});return d.createElement("div",{className:"form-group"},d.createElement("div",{className:"custom-file"},d.createElement(Fs,Object.assign({},u,c),e.children),d.createElement(Ws.Form.Label,{className:"custom-file-label",htmlFor:c.id},o)))}!function(e){e.Small="small",e.Medium="medium",e.Large="large"}(qp||(qp={})),function(e){e[e.Thumbnails=0]="Thumbnails",e[e.Banners=1]="Banners",e[e.Avatars=2]="Avatars",e[e.Logos=3]="Logos",e[e.Covers=4]="Covers",e[e.Posters=5]="Posters",e[e.TallPosters=6]="TallPosters",e[e.HeroBanners=7]="HeroBanners"}(Jp||(Jp={})),function(e){e[e.Crop=0]="Crop",e[e.Stretched=1]="Stretched",e[e.Cover=2]="Cover"}($p||($p={})),function(e){e[e.None=0]="None",e[e.ImageAPIv1=1]="ImageAPIv1",e[e.FileAPIv1=2]="FileAPIv1",e[e.ImageAPIv2=3]="ImageAPIv2"}(Kp||(Kp={}));var Wp,Zp,Qp=function(e,t){var n=h.map(t,(function(e,t){return t&&Array.isArray(e)?e.map((function(e){return"".concat(t,"=").concat(encodeURIComponent(e))})).join("&"):t&&void 0!==e?"".concat(t,"=").concat(encodeURIComponent(e)):""})),r=h.reduce(n,(function(e,t){return t?e?"".concat(e,"&").concat(t):t:e}));return r?"".concat(e,"?").concat(r):e},Xp=function(e,t){if(e){var n=e;return e.endsWith("/")||(n+="/"),t?n+=t.startsWith("/")?t.slice(1):t:n}};function ed(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.Banner="banner",e.Thumbnail="thumbnail"}(Zp||(Zp={}));var td,nd=(ed(Wp={},Jp.Banners,Zp.Banner),ed(Wp,Jp.Thumbnails,Zp.Thumbnail),Wp),rd=function(e){return"/v1/category-map/".concat(e)},od={createUrl:function(e,t){return od._createUrl(e,t)},createBannerUrl:function(e,t,n){return e&&e.url?od._createUrl(e.url,n):od._createCategoryMappedUrl(t,n)},Rfc3986EncodeURIComponent:function(e){return encodeURIComponent(e).replace(/[!'()*]/g,escape)},_createCategoryMappedUrl:function(e,t){var n=e.fallbackBaseUrl,r=e.fallbackCategoryName,o=e.type,i=Xp(n,"".concat(rd(nd[o]))),a=Object.assign({name:od.Rfc3986EncodeURIComponent(r)},t);return od._createUrl(i,a)},_createUrl:function(e,t){if(e){if(Rr.isEmpty(t))return e;var n=$.param(t),r=-1===e.indexOf("?")?"?":"&";return Xp(e,"".concat(r).concat(n))}},legacyCreateThumbnailUrl:function(e,t){if(!e)return"";var n;if(e&&(n=e instanceof r.Model?e.get("url"):"string"==typeof e?e:e.url)){var o=Object.assign({size:qp.Small,bgColor:"000"},t);return od._createUrl(n,o)}}};function id(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ad=(id(td={},Jp.Thumbnails,{width:1280,height:720}),id(td,Jp.Banners,{width:3600,height:666}),id(td,Jp.Covers,{width:1080,height:1080}),id(td,Jp.Posters,{width:1e3,height:1500}),id(td,Jp.TallPosters,{width:1080,height:1920}),id(td,Jp.HeroBanners,{width:1920,height:640}),td),cd={onFileSelect:function(e,t,n){if(t&&t.length){var r=new FileReader;r.addEventListener("load",(function(){return cd.onReaderLoad(r,e,n)})),r.readAsDataURL(t[0])}},onReaderLoad:function(e,t,n){var r=new Image;r.src=e.result;var o=ad[t].width,i=ad[t].height;r.addEventListener("load",(function(){cd.isImageValid(t,r)&&hn(n)?n(r):alert("Image too small: minimum dimensions are ".concat(o," x ").concat(i))}))},isImageValid:function(e,t){var n=ad[e].width,r=ad[e].height;return!(n&&t.width<n)&&!(r&&t.height<r)}},sd={isItemActive:function(e,t){return t||(t=r.AppLinkHelper.getCurrentAppLink()),t.application===e.appLink.application&&(Array.isArray(e.activeActions)?e.activeActions.includes(t.action):t.action===e.appLink.action)}},ud=function(e){return Object.values(e).every((function(e){return!!e}))},ld=(n(131),function(e,t){return!!e&&!!t&&e.toString()===t.toString()}),fd=function(e){return e.split(" ").map((function(e){return(e[0]?e[0].toUpperCase():"")+(e.substr(1)?e.substr(1).toLowerCase():"")})).join(" ")};function pd(e){return function(e){if(Array.isArray(e))return dd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return dd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dd(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var md={find:function(e,t){if(e&&e.children&&e.children.length)for(var n=function e(n){if(ld(n.id,t))return n;var r=n.children;if(r&&r.length)for(var o=0;o<r.length;o++){var i=e(r[o]);if(i)return i}},r=0;r<e.children.length;r++){var o=n(e.children[r]);if(o)return o}},getPath:function(e,t){for(var n=[t],r=function(e){return e.hasOwnProperty("parentIds")&&Array.isArray(e.parentIds)&&e.parentIds.length?e.parentIds[0]:e.hasOwnProperty("parentId")?e.parentId:null},o=r(t);o;){var i=md.find(e,o);i&&(n=[i].concat(pd(n))),o=i?r(i):null}return n}},hd=function(e){return e&&e.groups?e.groups.map((function(e){return e.name})):[]};function yd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bd,gd=d.createContext(void 0),Sd=function(e){var t=e.children,n=yd(d.useState(),2),r=n[0],o=n[1],i=yd(d.useState(!1),2),a=i[0],c=i[1],s=yd(d.useState(),2),u=s[0],l=s[1],f={getDataUrl:function(){var e=r;return o(null),e},setDataUrl:o,imageUploaded:a,getImage:function(){var e=u;return l(null),c(!1),e},setImage:function(e){l(e),c(!0)}};return d.createElement(gd.Provider,{value:f},t)};function Ed(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Od(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Od(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Od(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Cd=(jd(bd={},Jp.Thumbnails,"Thumbnail"),jd(bd,Jp.Banners,"Banner"),jd(bd,Jp.Avatars,"Avatar"),jd(bd,Jp.Logos,"Logo"),jd(bd,Jp.Covers,"Cover"),jd(bd,Jp.Posters,"Poster"),jd(bd,Jp.TallPosters,"Tall Poster"),jd(bd,Jp.HeroBanners,"Hero Banner"),bd);function wd(e){var t,n=_s(),o=Cs(null===(t=n)||void 0===t?void 0:t.values,e.fieldName),i=d.useContext(gd),a=i.setDataUrl,c=i.getImage,u=i.imageUploaded,l=Ed(d.useState(!1),2),f=l[0],p=l[1],m=Ed(d.useState(o),2),h=m[0],y=m[1],v=Ed(d.useState(!1),2),b=v[0],g=v[1];function S(t){p(!0),a(t.src),r.AppLinkHelper.trigger({application:e.application,action:e.uploadAction,args:[e.imageType]})}d.useEffect((function(){if(f){var t,r=c();if(r)p(!1),y(r),t=r,hn(e.setSelectedImage)?e.setSelectedImage(t):n&&n.setFieldValue(e.fieldName,{fileId:t.id,fileIdType:Kp.ImageAPIv2})}}),[u]);var E=e.label||Cd[e.imageType]||"Image";return d.createElement("div",{className:"form-group"},d.createElement("div",{className:"form-control h-auto py-2"},d.createElement("label",null,E),d.createElement("em",{className:"ml-1 text-muted"},"(Minimum dimensions are ".concat(ad[e.imageType].width,"px")+" x ".concat(ad[e.imageType].height,"px)")),d.createElement(Gp,{label:"Choose a ".concat(E.toLowerCase()),name:"image",mimeType:s.IMAGES,onFileSelect:function(t){return cd.onFileSelect(e.imageType,t,S)}}),!!h&&!!h.url&&d.createElement(d.Fragment,null,!b&&d.createElement("div",{className:"pb-2 ".concat(e.imageType===Jp.Banners?"w-100":"w-50")},d.createElement("img",{src:od.createUrl(h.url),className:"img img-fluid"})),d.createElement("div",{className:"d-flex justify-content-center"},d.createElement(_p,{svgName:b?Ap.ChevronDown:Ap.ChevronUp,size:kp.Large,className:"svg-container cursor-pointer",onClick:function(){return g(!b)},title:b?"Show image":"Hide image",tooltipPlacement:"top"})))))}var Ad,Id=n(132),Td=n.n(Id);function kd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _d(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e){e[e.NoRestrictions=0]="NoRestrictions",e[e.RestrictToCanvas=1]="RestrictToCanvas"}(Ad||(Ad={}));var Ld,xd,Pd,Nd,Rd,Dd,Md,Ud,Fd,Vd,zd,Bd,Hd,qd,Jd,$d,Kd,Yd,Gd,Wd,Zd,Qd,Xd=/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/;function em(e){var t=e.dataUrl,n=e.minHeight,r=e.minWidth,o=e.onCrop,i=e.onCancel,a=d.useRef(),c=d.useRef(),s=kd(d.useState(!1),2),u=s[0],l=s[1],f=kd(d.useState(!1),2),p=f[0],m=f[1];return d.useEffect((function(){var e=new Image;e.src=t;var o=a.current.offsetWidth/e.width;return c.current=new Td.a(a.current,{viewMode:Ad.RestrictToCanvas,autoCropArea:1,aspectRatio:r/n,minCropBoxWidth:r*o,minCropBoxHeight:n*o,ready:function(){return l(!0)}}),function(){return c.current.destroy()}}),[]),d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3"},d.createElement("img",{ref:a,src:t,className:"img img-fluid"})),d.createElement("div",{className:"d-flex justify-content-end border-top pt-3"},d.createElement(Ws.Button,{variant:"link",onClick:i},"Cancel"),d.createElement(lu,{onClick:function(){if(u){m(!0);var e=c.current.getCroppedCanvas().toDataURL(function(e){var t=e.match(Xd);if(t)return t[1]}(t));hn(o)&&o(e)}},disabled:!u,showSpinner:p},"Crop")))}function tm(e){return(tm="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 nm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rm(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 om(e,t){return(om=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function im(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=cm(e);if(t){var o=cm(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return am(this,n)}}function am(e,t){return!t||"object"!==tm(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 cm(e){return(cm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Stream="cv_product_stream",e.StreamRaw="cv_product_stream_raw",e.WebPlayerStream="cv_product_webplayer_stream",e.StreamProgress="cv_product_stream_progress",e.Login="cv_product_login",e.LoginSsoRedirect="cv_product_login_sso_redirect",e.LoginFailed="cv_product_login_failed",e.Search="cv_product_search",e.InstantSearch="cv_product_search",e.SearchEmptyResult="cv_product_search_empty_result",e.Filter="cv_product_search_filter",e.SearchLanding="cv_product_search_landing",e.Share="cv_product_share",e.WorkspaceAdd="cv_product_tv_add",e.Rename="cv_product_rename",e.Move="cv_product_move",e.Sort="cv_product_sort",e.Create="cv_product_create",e.Delete="cv_product_delete",e.Associate="cv_product_associate",e.Dissociate="cv_product_dissociate",e.Edit="cv_product_edit",e.Approve="cv_product_approve",e.Reject="cv_product_reject",e.Disable="cv_product_disable",e.Upload="cv_product_upload",e.Download="cv_product_download",e.Navigate="cv_product_navigate",e.Click="cv_product_click",e.Suggest="cv_product_suggest",e.EditAssoc="cv_product_edit_assoc",e.Play="cv_product_play",e.Favourite="cv_product_favourite",e.Follow="cv_product_follow",e.Prefer="cv_product_prefer",e.SetAccess="cv_product_set_access",e.AddToLocalCache="cv_product_add_to_lc",e.ResolveWarning="cv_product_resolve_warning",e.DismissWarning="cv_product_dismiss_warning"}(Ld||(Ld={})),function(e){e.Folder="folder",e.Video="video",e.Rating="rating",e.Series="series",e.Library="library",e.Resource="resource",e.Tag="tag",e.Subtitle="subtitle",e.Chapter="chapter",e.Restriction="restriction",e.Interactive="interactive",e.PDF="pdf",e.CustomerSetting="customer_setting",e.StaffRequest="staff_request",e.Logo="logo",e.Pagination="pagination",e.Thumbnail="thumbnail",e.Banner="banner",e.Link="link",e.Playlist="playlist",e.Person="person",e.Company="company",e.Classroom="classroom",e.ClassroomGroup="classroom_group",e.Classification="classification",e.ShareLink="share_link",e.Upload="upload",e.SearchResults="search_results",e.Audience="audience",e.User="user"}(xd||(xd={})),function(e){e.TopNav="top_nav",e.LeftNav="left_nav",e.Popup="popup",e.Banner="banner",e.VideoList="video_list",e.VideoListItem="video_list_item",e.VideoListHeader="video_header",e.VideoThumbnail="video_thumbnail",e.VideoItemPreview="video_item_preview",e.VideoDetails="video_details",e.VideoDetailsHeader="video_details_header",e.EditVideoDetails="edit_video_details",e.EditVideoChapters="edit_video_chapters",e.EditVideoResources="edit_video_resources",e.VideoUpload="video_upload",e.VideoRequest="video_request",e.Pagination="pagination",e.SearchBar="search_bar",e.InstantSearch="instant_search",e.SearchFilters="search_filters",e.LibraryHeader="library_header",e.LibraryTiles="library_tiles",e.StaffRequestDetails="staff_request_details",e.SubFolderList="sub_folder_list",e.AwaitingReviewVideoListHeader="awaiting_review_video_list_header",e.AwaitingReviewVideoItem="awaiting_review_video_item",e.PastReleasesHeader="past_releases_header",e.MigrationWarnings="migration_warnings",e.PlaylistListHeader="playlist_list_header",e.PlaylistListItem="playlist_list_item",e.TeacherManager="teacher_manager",e.TeacherManagerListItem="teacher_manager_list_item",e.StudentManager="student_manager",e.StudentManagerListItem="student_manager_list_item",e.ClassroomsList="classrooms_list",e.ClassroomsListItem="classrooms_list_item",e.ClassroomOverview="classroom_overview",e.ClassroomOverviewStudentListItem="classroom_overview_student_list_item",e.ManageClassroomStudents="manage_classroom_students",e.ManageClassroomStudentListItem="manage_classroom_student_list_item",e.ManageClassroomGroups="manage_classroom_groups",e.ManageClassroomGroupListItem="manage_classroom_group_list_item",e.PlayPage="play_page",e.FloatingPlayer="floating_player",e.InteractivePlayer="interactive_player",e.EmbeddedPlayer="embedded_player",e.ContentUpdatesClassificationBanner="content_updates_classification_banner",e.PreferencesSettings="preferences_settings",e.MyUploads="my_uploads"}(Pd||(Pd={})),function(e){e.Start="start",e.Complete="complete",e.Save="save",e.Discard="discard"}(Nd||(Nd={})),function(e){e.PageLoad="page_load"}(Rd||(Rd={})),function(e){e.Single="single",e.Bulk="bulk",e.All="all"}(Dd||(Dd={})),function(e){e.ProductionYear="production_year",e.Alphabetical="alphabetical"}(Md||(Md={})),function(e){e.Content="content",e.Quality="quality",e.Duration="duration",e.Reset="reset"}(Ud||(Ud={})),function(e){e.Submit="submit",e.ShowAll="show_all",e.Recent="recent",e.SearchIcon="search_icon"}(Fd||(Fd={})),function(e){e.Start="start",e.Finish="finish",e.Terminate="terminate",e.Play="play",e.Pause="pause",e.Playback="playback",e.NextChapter="next_chapter",e.PreviousChapter="previous_chapter",e.FullScreenEnter="full_screen_enter",e.FullScreenExit="full_screen_exit"}(Vd||(Vd={})),function(e){e.TogglePreview="toggle_preview",e.NavigateHome="navigate_home",e.OpenInStaffView="open_in_staff_view",e.Thumbnail="thumbnail",e.Title="title",e.ToggleHideValidListings="toggle_hide_valid_listings",e.LaunchImmersiveReader="launch_immersive_reader",e.CopyEmbedHtml="copy_embed_html",e.Close="close",e.Open="open"}(zd||(zd={})),function(e){e.LibraryReview="library_review"}(Bd||(Bd={})),function(e){e.FileSelect="file_select",e.DragDrop="drag_drop"}(Hd||(Hd={})),function(e){e.Edit="edit"}(qd||(qd={})),function(e){e.Image="image",e.User="user"}(Jd||(Jd={})),function(e){e.On="on",e.Off="off"}($d||($d={})),function(e){e.EntityRemoved="cv_entity_removed",e.ValueUpdated="cv_value_updated"}(Kd||(Kd={})),function(e){e.FileSelect="file_select",e.DragDrop="drag_drop"}(Yd||(Yd={})),function(e){e.Video="videos",e.Folder="categories",e.Series="series",e.Tags="tags"}(Gd||(Gd={})),function(e){e[e.V1=1]="V1"}(Wd||(Wd={})),function(e){e.Staff="staff",e.Learner="learner",e.Unknown="unknown"}(Zd||(Zd={})),function(e){e.Analytics="AnalyticsService",e.Context="ContextService"}(Qd||(Qd={}));var sm,um=new(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&&om(e,t)}(a,e);var t,n,o,i=im(a);function a(){var e;return nm(this,a),(e=i.apply(this,arguments)).contextHistory=[],e}return t=a,o=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"initialize",value:function(){this.listenTo(b.SHELL,r.EventNames.ROUTE,this.setContext)}},{key:"setContext",value:function(e){this.contextHistory.length>=5&&this.contextHistory.unshift(),this.contextHistory.push({pageLoad:!this.contextHistory.length,appLink:e})}},{key:"getCurrentContext",value:function(){if(this.contextHistory.length)return this.contextHistory[this.contextHistory.length-1]}},{key:"fromPageLoad",value:function(){return 1===this.contextHistory.length}},{key:"name",get:function(){return Qd.Context}}])&&rm(t.prototype,n),o&&rm(t,o),a}(r.Service));!function(e){e.Inlet="event:inlet",e.Outlet="event:outlet"}(sm||(sm={}));var lm="global:analytics";function fm(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)}}var pm=Wd.V1,dm=function(){function e(t,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=t,this.data=n,this.actionContext=r,this.eventVersion=o||pm}var t,n,o;return t=e,(n=[{key:"isType",value:function(e){return e===this.type}},{key:"enrich",value:function(e,t){this.validateKey(e),this[e]=t}},{key:"get",value:function(e){if(e&&this[e])return this[e]}},{key:"validateKey",value:function(e){"type"!==e&&"data"!==e||r.ErrorHelper.throw(new Xe("".concat(e," is not a valid key"))),this[e]&&r.ErrorHelper.throw(new Xe("Event already contains an enrichment named ".concat(e)))}}])&&fm(t.prototype,n),o&&fm(t,o),e}(),mm=function(e,t,n,r){y.Radio.channel(lm).trigger(sm.Inlet,new dm(e,t,n,r))};function hm(){var e=um.getCurrentContext().appLink;return h.isObject(e)||r.ErrorHelper.throw(new Xe("Applink does not exist. Check current context.")),e.application.replace(":","-")}function ym(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.location,n=e.entity,o=e.workflowPhase,i=void 0===o?null:o,a=e.descriptor,c=void 0===a?null:a;return t||r.ErrorHelper.throw(new Xe("location must be set.")),n||r.ErrorHelper.throw(new Xe("entity must be set.")),{productArea:hm(),location:t,entity:n,descriptor:c,workflowPhase:i}}function vm(){return r.LocationUtils.GetCurrentPath()+r.LocationUtils.GetCurrentQueryString()}var bm={logUserAction:function(e,t){if(function(e){return!(!h.isArray(e)||!h.every(e,(function(e){return h.isObject(e)})))||!!h.isObject(e)}(e)&&h.isObject(t)){var n=bm.buildUserActionEvent(t),r=n.userAction,o=n.action,i=n.eventVersion;mm(r,e,o,i)}},logNavigate:function(e,t){var n=Object.assign({currentLocation:vm(),appLink:e},t);mm(Ld.Navigate,n)},mergeOptions:function(e,t){return h.extend({},e,t)},buildActionContext:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ym(e)},buildUserActionEvent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.actionType,n=e.eventVersion,r=t,o=ym(e);return{userAction:r,action:o,eventVersion:n}},buildCurrentLocation:function(){return vm()},buildSearchEvent:function(e,t){return{data:{query:e},action:ym({entity:xd.Video,location:Pd.SearchBar,descriptor:t})}},buildInstantSearchEvent:function(e,t,n){var r;n===Gd.Series&&(r=xd.Series),n===Gd.Folder&&(r=xd.Folder),n===Gd.Tags&&(r=xd.Tag),n===Gd.Video&&(r=xd.Video);var o={instant:{},query:e};return t.id&&(o.instant.selectedId=t.id),t.name&&(o.instant.selectedName=t.name),{data:o,action:ym({entity:r,location:Pd.SearchBar})}},mapInteractionType:function(e){switch(e){case Yd.DragDrop:return Hd.DragDrop;case Yd.FileSelect:return Hd.FileSelect;default:return}}};function gm(e,t){return t?{application:e.application,action:e.action,args:e.args,params:Object.assign({},e.params,{cursor:t})}:null}function Sm(e){var t=e.appLink,n=e.cursors,r=e.className;function o(e){bm.logUserAction({page:e},{location:Pd.Pagination,entity:xd.Pagination,actionType:Ld.Navigate,workflowPhase:Nd.Complete})}return d.createElement(ju.Provider,{value:"shared.pagination"},d.createElement("div",{className:r},d.createElement(Up,{appLink:gm(t,n.previous),className:"btn btn-secondary mr-1 ".concat(n.previous?"":"disabled"),onClick:function(){return o("previous")}},d.createElement(Cu,{phrase:"previous"})),d.createElement(Up,{appLink:gm(t,n.next),className:"btn btn-secondary ".concat(n.next?"":"disabled"),onClick:function(){return o("next")}},d.createElement(Cu,{phrase:"next"}))))}function Em(e){if(!e.collection)return d.createElement(d.Fragment,null);var t=e.collection,n=t.data,r=t.pagination;return d.createElement(d.Fragment,null,!!n&&d.createElement(xm,{objects:n,getObjectAppLink:e.getObjectAppLink,newObjectAppLink:e.newObjectAppLink,objectName:e.objectName}),!!r&&!!r.cursors&&d.createElement(Sm,{cursors:r.cursors,appLink:e.collectionAppLink}))}Sm.defaultProps={className:"py-2"};var Om=n(23),jm=n.n(Om);function Cm(e){if(!e.actions||!e.actions.length)return d.createElement(d.Fragment,null);var t="actions-dropdown-".concat(Ip()),n="px-0 ".concat(jm.a.dropdownToggle);return e.dropdownToggleClassName&&(n+=" ".concat(e.dropdownToggleClassName)),d.createElement(Ws.Dropdown,{className:e.className?e.className:"",alignRight:!0},d.createElement(Ws.Dropdown.Toggle,{as:"button",type:"button",id:t,className:n},d.createElement(_p,{svgName:Ap.More,size:kp.Small})),d.createElement(Ws.Dropdown.Menu,null,e.actions.map((function(e,t){return d.createElement(Up,{key:t,appLink:e.appLink,onClick:e.onClick,className:(n=e.className,r="dropdown-item",n&&(r+=" ".concat(n)),r)},e.label);var n,r}))))}Cm.defaultProps={dropdownToggleClassName:"btn btn-light"};var wm=n(18),Am=n.n(wm);function Im(e){var t=e.svgName,n=e.children,r=e.appLink,o=e.className,i=e.onClick,a="".concat(o," ").concat(Am.a.iconButton);a+=" ".concat(n?Am.a.iconWithText:Am.a.iconOnly);var c=d.createElement(_p,{svgName:t,className:Am.a.svg});return r?d.createElement(Up,{appLink:r,className:a,onClick:i},c,n):d.createElement("button",{className:a,onClick:i},c,n)}function Tm(e){var t="ml-2";return e.className&&(t+=" ".concat(e.className)),e.tooltip?d.createElement(Tp,{title:e.tooltip},d.createElement(Im,{appLink:e.appLink,svgName:e.svgName,onClick:e.onClick,className:t},e.children)):e.svgName?d.createElement(Im,{onClick:e.onClick,appLink:e.appLink,svgName:e.svgName,className:t},e.children):e.appLink?d.createElement(Up,{onClick:e.onClick,appLink:e.appLink,className:t},e.children):d.createElement("button",{onClick:e.onClick,className:t},e.children)}function km(e){var t=[],n=[];e.actions.forEach((function(e){e.button?t.push(e):n.push(e)}));var r="d-flex";return e.className&&(r+=" ".concat(e.className)),d.createElement("div",{className:r},d.createElement(d.Fragment,null,!!t.length&&d.createElement("span",{className:jm.a.buttonList},t.map((function(e,t){return d.createElement(Tm,{key:t,appLink:e.appLink,onClick:e.onClick,svgName:e.svgName,className:e.className,tooltip:e.tooltip},e.label)}))),e.sortComponent?e.sortComponent:"",!!n.length&&d.createElement(Cm,{actions:n,className:!!t.length&&"ml-2",dropdownToggleClassName:e.actionsDropdownClassName})))}function _m(e){var t=e.object,n=e.actions;return d.createElement("div",{className:"d-flex justify-content-between py-2"},!!t&&d.createElement("h5",null,t.name),!!n&&d.createElement("span",null,d.createElement(km,{actions:n})))}function Lm(e){return d.createElement("tr",null,d.createElement("td",null,d.createElement(Up,{appLink:e.appLink},e.object.name)),d.createElement("td",null))}function xm(e){return d.createElement(Ws.Table,{responsive:!0},d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",null,"Name"),d.createElement("th",null,d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(Up,{appLink:e.newObjectAppLink},d.createElement(_p,{svgName:Ap.Plus,size:kp.Small}),d.createElement("span",null,"New ".concat(e.objectName))))))),d.createElement("tbody",null,e.objects.map((function(t){return d.createElement(Lm,{key:t.id,object:t,appLink:e.getObjectAppLink(t)})}))))}function Pm(e){var t=e.objects,n=e.getAppLink,r=e.emptyMessage;return t?t.length?d.createElement("ul",{className:"list-unstyled"},t.map((function(e,t){return d.createElement("li",{key:t,className:"border rounded mb-3"},d.createElement(Up,{appLink:n(e),className:"d-block p-3"},e.name))}))):d.createElement("div",{className:"py-3"},d.createElement("p",null,r)):d.createElement(d.Fragment,null)}Pm.defaultProps={emptyMessage:"There is nothing here."};function Nm(e){var t=_s();return d.createElement(ru,{as:"select",label:"Rating",name:"rating",id:"rating",value:t.values.rating&&t.values.rating.id,onChange:function(e){return t.setFieldValue("rating",e.target.value?{id:e.target.value}:{})},disabled:e.disabled},d.createElement(d.Fragment,null,d.createElement("option",{value:""},"Please select a rating"),e.ratings.map((function(e,t){return d.createElement("option",{key:t,value:e.id},function(e){return"".concat(e.name).concat(e.code?" (".concat(e.code,")"):"")}(e))}))))}function Rm(e){var t=e.tabs,n=e.isItemActive;return d.createElement(Ws.Nav,{fill:!0,variant:"tabs"},t.map((function(e,t){return d.createElement(Ws.Nav.Item,{key:t},d.createElement(Up,{appLink:e.appLink,className:(r=n(e),r?"nav-link active":"nav-link")},e.label));var r})))}Rm.defaultProps={isItemActive:sd.isItemActive};var Dm=n(8),Mm=n.n(Dm);function Um(e){var t=e.name,n=e.appLink,r=e.onSelect,o=e.isDisabled,i=e.className,a=e.actions,c=Mm.a.text;return i&&(c+=" ".concat(i)),o?d.createElement("a",{className:"".concat(c," text-muted ").concat(Mm.a.disabled)},t):d.createElement(d.Fragment,null,n?d.createElement(Up,{appLink:n,className:c},t):d.createElement("a",{onClick:r,className:c},t),!!a&&d.createElement(km,{className:Mm.a.actions,actions:a}))}function Fm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zm(e){var t=e.tree,n=e.selectedIds,r=e.getAppLink,o=e.onSelect,i=e.isDisabled,a=e.actions,c=Array.isArray(n)&&n.some((function(e){return ld(t.id,e)})),s=d.useMemo((function(){return Array.isArray(n)&&n.some((function(e){return md.find(t,e)}))}),[t,n]),u=Fm(d.useState(s),2),l=u[0],f=u[1],p=!!t.children&&!!t.children.length,m={name:t.name,appLink:hn(r)?r(t):null,onSelect:hn(o)?function(){return o(t)}:null,isDisabled:!!hn(i)&&i(t),className:c&&Mm.a.selected||s&&Mm.a.parentOfSelected,actions:!!a&&a.map((function(e){return Object.assign(Object.assign({},e),{appLink:e.getAppLink(t)})}))};return d.createElement("li",{className:"position-relative".concat(l?"":" ".concat(Mm.a.collapsed))},d.createElement("div",{className:"position-relative"},d.createElement("span",{className:Mm.a.node},p&&d.createElement(_p,{svgName:Ap.ChevronDown,size:kp.Small,className:"svg-container ".concat(Mm.a.chevron),onClick:function(){return f(!l)}}),d.createElement(Um,Object.assign({},m))),l&&d.createElement(Hm,Object.assign({},e))))}var Bm=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Hm(e){var t=e.tree,n=Bm(e,["tree"]);return t&&t.children?d.createElement("ul",{className:"m-0 p-0 ".concat(Mm.a.tree)},t.children.map((function(e){return d.createElement(zm,Object.assign({key:e.id,tree:e},n))}))):d.createElement(d.Fragment,null)}var qm={getChord:function(e,t){return md.getPath(e,t).map((function(e){return e.name})).join(" -> ")},getState:function(e,t){var n={};return Array.isArray(e)&&e.forEach((function(e){var r,o,i,a=md.find(t,e);a&&(n=Object.assign((r={},o=e,i=qm.getChord(t,a),o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r),n))})),n}};function Jm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return $m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $m(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Km=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Ym(e){var t=e.onSelect,n=e.label,r=e.hideCollapseBtn,o=e.collapse,i=e.noSelectionMessage,a=e.isNodeDisabled,c=e.getSelectedItemAppLink,s=Km(e,["onSelect","label","hideCollapseBtn","collapse","noSelectionMessage","isNodeDisabled","getSelectedItemAppLink"]),u=s.tree,l=s.selectedIds,f=Jm(d.useState(qm.getState(l,u)),2),p=f[0],m=f[1];d.useEffect((function(){return m(qm.getState(l,u))}),[l,u]);var h=Jm(d.useState(!!o),2),y=h[0],v=h[1];d.useEffect((function(){return v(!!o)}),[o]);var b=!r||!!n;return d.createElement(d.Fragment,null,b&&d.createElement("div",{className:"pb-2"},!!n&&d.createElement("label",{className:"m-0"},n),!r&&d.createElement("a",{className:"float-right cursor-pointer",onClick:function(){return v(!y)}},y?"Expand":"Collapse")),!y&&d.createElement("div",{className:"py-2 border-top"},d.createElement(Hm,Object.assign({onSelect:function(e){return hn(t)&&t(e)},isDisabled:a},s))),(!Rr.isEmpty(p)||!!i)&&d.createElement("div",{className:"py-2 border-top"},d.createElement("label",null,"Selected:"),d.createElement("ul",{className:"m-0"},Rr.isEmpty(p)?d.createElement("li",null,i):Object.keys(p).map((function(e,t){return d.createElement("li",{key:t},hn(c)?d.createElement(Up,{appLink:c(e)},p[e]):p[e])})))))}var Gm=n(24);var Wm=function(e){return e&&!(e.data&&e.data.length)},Zm=function(e){return e&&e.data&&e.data.length},Qm=function(e){var t="bg-white";return e&&(t+=" ".concat(e)),t};function Xm(e){var t=e.video,n=e.getVideoAppLink,r=e.getVideoActions,o=e.className,i=void 0===o?"":o,a=e.itemNumber,c=hn(n)&&n(t);return d.createElement("tr",{className:Qm(i)},!!a&&d.createElement("td",null,d.createElement("span",null,a)),d.createElement("td",null,c?d.createElement(Up,{appLink:c},t.name):t.name),hn(r)&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(km,{actions:r(t)}))))}var eh=Object(Gm.SortableElement)((function(e){return d.createElement(Xm,Object.assign({sortable:!0},e))})),th=n(11),nh=n.n(th),rh=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},oh=function(e){var t=e.sortable,n=e.getVideoActions;return d.createElement("thead",null,d.createElement("tr",null,!!t&&d.createElement("th",null,"#"),d.createElement("th",null,"Name"),!!n&&d.createElement("th",null)))},ih=d.forwardRef((function(e,t){var n=e.videos,r=e.sortable,o=rh(e,["videos","sortable"]);return d.createElement("tbody",{ref:t},!Wm(n)&&n.data.map((function(e,t){return r?d.createElement(eh,Object.assign({key:e.id,index:t,itemNumber:t+1,video:e,className:nh.a.draggableVideoItem},o)):d.createElement(Xm,Object.assign({video:e},o))})))}));var ah=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},ch=Object(Gm.SortableContainer)((function(e){var t=e.forwardedRef,n=ah(e,["forwardedRef"]);return d.createElement(ih,Object.assign({sortable:!0,ref:t},n))})),sh=function(e){return function(t){var n=t.node,r=e.current;if(r){r.classList.add(nh.a.sortingContainer);var o=r.querySelector(".".concat(nh.a.draggedVideoItem));n.childNodes.forEach((function(e,t){return o.childNodes[t].style.width="".concat(e.offsetWidth,"px")}))}}},uh=function(e,t){return function(n){var r=e.current;r&&r.classList.remove(nh.a.sortingContainer),t(n.oldIndex,n.newIndex)}};function lh(e){var t=e.onSortEnd,n=e.emptyMessage,r=ah(e,["onSortEnd","emptyMessage"]),o=d.useRef();return Wm(e.videos)?d.createElement("div",null,n):d.createElement(Ws.Table,{responsive:!0},d.createElement(oh,Object.assign({sortable:!0},e)),d.createElement(ch,Object.assign({forwardedRef:o,onSortStart:sh(o),onSortEnd:uh(o,t),lockAxis:"y",lockToContainerEdges:!0,distance:1,helperClass:nh.a.draggedVideoItem,helperContainer:function(){return o.current}},r)))}function fh(e){var t=e.alias,n=e.onDelete;return d.createElement("li",{className:"list-group-item d-flex justify-content-between"},t.name,d.createElement(_p,{svgName:Ap.Delete,onClick:function(){return n(t.id)}}))}function ph(e){var t=e.aliases,n=e.onDelete;return d.createElement("ul",{className:"list-group mb-3"},t?t.map((function(e){return d.createElement(fh,{key:e.id,alias:e,onDelete:n})})):d.createElement("span",null,"Currently there are no aliases for this object."))}lh.defaultProps={emptyMessage:"There are no videos in this list."};var dh=Object(Ys.object)().shape({name:Object(Ys.string)().trim().max(255,"Name is too long").required("Name is required").default("")});function mh(){var e=_s(),t=au(e);return d.createElement(Vs,null,d.createElement(ru,{label:"Create an alias",name:"name",id:"name",value:e.values.name,placeholder:"Add an alias"}),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(lu,{showSpinner:e.isSubmitting,type:"submit",disabled:!t},"Add")))}function hh(e){var t=e.onSave;return d.createElement(Ks,{initialValues:{name:""},validationSchema:dh,onSubmit:function(e,n){t(e,n)},resetOnSubmit:!0},d.createElement(mh,null))}function yh(e){var t=e.onSave,n=e.aliases,r=e.onDelete;return d.createElement("div",{className:"w-50"},d.createElement("h1",null,"Aliases"),d.createElement(ph,{aliases:n,onDelete:r}),d.createElement(hh,{onSave:t}))}var vh=l.COMPANIES,bh=function(e){return{application:vh,action:a.Companies.EDIT_COMPANY,args:[e.id]}},gh=function(e){return r.AppLinkHelper.trigger(bh(e))};function Sh(e){var t=o.useBasicFetch(Fo(e.cursor));return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3 w-50"},d.createElement(Mp,{placeholder:"Search for a company",onSuggestionSelected:gh,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/companies/instant/raw","?q=").concat(e)},activationLength:2})),d.createElement(Em,{collection:t&&t.data,collectionAppLink:{application:vh,action:a.Companies.COMPANIES},newObjectAppLink:{application:vh,action:a.Companies.NEW_COMPANY},getObjectAppLink:bh,objectName:"Company"}))}function Eh(e){return(Eh="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 Oh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jh(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 Ch(e,t,n){return t&&jh(e.prototype,t),n&&jh(e,n),e}function wh(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&&Ah(e,t)}function Ah(e,t){return(Ah=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ih(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=kh(e);if(t){var o=kh(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Th(this,n)}}function Th(e,t){return!t||"object"!==Eh(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 kh(e){return(kh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _h,Lh,xh=function(e){wh(n,e);var t=Ih(n);function n(){return Oh(this,n),t.apply(this,arguments)}return Ch(n,[{key:"channelName",get:function(){return l.COMPANIES}},{key:"appRoutes",get:function(){return{"manage/companies(/)":"companies","manage/companies/new(/)":"newCompany","manage/companies/:id(/)":"editCompany"}}}]),n}(r.AppRouter),Ph=function(e){wh(n,e);var t=Ih(n);function n(){return Oh(this,n),t.apply(this,arguments)}return Ch(n,[{key:"companies",value:function(e){var t=e.cursor;this.layout.showChildView(kn,d.createElement(Sh,{cursor:t}))}},{key:"newCompany",value:function(){this.layout.showChildView(kn,d.createElement(ku,null))}},{key:"editCompany",value:function(e){this.layout.showChildView(kn,d.createElement(Tu,{id:e}))}},{key:"name",get:function(){return"Companies Application"}},{key:"channelName",get:function(){return l.COMPANIES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return xh}}]),n}(r.Application),Nh=n(34);function Rh(e){return(Rh="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 Dh(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 Mh(e,t){return(Mh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Uh(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=Vh(e);if(t){var o=Vh(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Fh(this,n)}}function Fh(e,t){return!t||"object"!==Rh(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 Vh(e){return(Vh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Success="success",e.Warning="warning",e.Fail="danger",e.Info="info"}(_h||(_h={})),function(e){e.Success="Success! 🙌",e.Warning="Whoops...",e.Fail="Oops...",e.Info="FYI"}(Lh||(Lh={}));var zh=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&&Mh(e,t)}(i,e);var t,n,r,o=Uh(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(){this.alertCollection=new De,this.listenTo(b.ALERT,"remove:alert",this.removeAlert),this.showAlerts()}},{key:"showAlerts",value:function(){var e=y.Radio.channel(b.ALERT),t={collection:this.alertCollection};this.options.alertViewCtor&&(t=h.extend({},t,{ctor:this.options.alertViewCtor})),e.trigger("show:alert",t)}},{key:"removeAlert",value:function(e){this.alertCollection.remove(e),this.showAlerts()}},{key:"createAlert",value:function(e){this.alertCollection.length===this.options.maxAlerts&&this.alertCollection.shift(),e.id||(e=h.extend({},e,{id:this.generateUniqueAlertId()})),this.alertCollection.push(new Lt(e)),this.showAlerts()}},{key:"clearAllAlerts",value:function(){this.alertCollection.reset(null)}},{key:"success",value:function(e){var t=this;return"string"==typeof e?h.bind((function(){return t.createAlert(h.extend({},t.options.defaultSuccessAlert,{message:e}))}),this):e.useXHR?h.bind((function(e,n){return t.createAlert(h.extend({},t.options.defaultSuccessAlert,{message:n}))}),this):h.bind((function(){return t.createAlert(h.extend({},t.options.defaultSuccessAlert,e))}),this)}},{key:"error",value:function(e){var t=this;return"string"==typeof e?h.bind((function(){return t.createAlert(h.extend({},t.options.defaultErrorAlert,{message:e}))}),this):e.useXHR?h.bind((function(e){return t.createAlert(h.extend({},t.options.defaultErrorAlert,{message:e.message}))}),this):h.bind((function(){return t.createAlert(h.extend({},t.options.defaultErrorAlertIL_DEFAULT,e))}),this)}},{key:"generateUniqueAlertId",value:function(){return h.uniqueId("alert_")}},{key:"name",get:function(){return du}},{key:"defaults",get:function(){return{maxAlerts:3}}}])&&Dh(t.prototype,n),r&&Dh(t,r),i}(Yt),Bh=n(9),Hh=n.n(Bh);function qh(e){var t=e.alert,n=e.svgName,r=e.svgClassName,o=e.closeAlert,i=t.message,a=t.heading,c=t.appLink,s=t.appLinkText,u=t.appLinkClassName,l=void 0===u?"":u,f=Object(pu.sanitize)(i);return d.createElement(d.Fragment,null,d.createElement("div",{className:"d-inline-block ".concat(Hh.a.icon)},d.createElement(_p,{svgName:n,className:"svg-container ".concat(r)})),d.createElement("div",{className:"pl-2 d-inline-block ".concat(Hh.a.alertContent)},d.createElement("p",{className:"p-0 m-0 pb-1 ".concat(Hh.a.heading)},a),d.createElement("p",{className:"p-0 m-0 ".concat(Hh.a.message),dangerouslySetInnerHTML:{__html:f}}),!!c&&d.createElement(Up,{className:l,appLink:c},s)),d.createElement("div",{className:"close d-inline-block cursor-pointer",role:"button",onClick:o},"×"))}function Jh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return $h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $h(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Kh=function(e){switch(e.type){case _h.Success:return Ap.CheckCircleOutline;case _h.Fail:case _h.Warning:return Ap.Warning;case _h.Info:default:return Ap.Info}};function Yh(e){var t=e.alert,n=e.closeAlert,r=Jh(d.useState(!0),2),o=r[0],i=r[1],a=d.useRef();d.useEffect((function(){o?a.current=window.setTimeout(n,3e3):clearTimeout(a.current)}),[o]);var c="text-".concat(t.type.toLowerCase());return d.createElement("li",{className:"bg-white mt-2 p-2 show clearfix ".concat(Hh.a.alertItem),onMouseEnter:function(){return i(!1)},onMouseLeave:function(){return i(!0)}},d.createElement(qh,{alert:t,svgName:Kh(t),svgClassName:c,closeAlert:n}))}function Gh(e){var t=e.alerts,n=e.removeAlert;return d.createElement("div",{className:Hh.a.alertBox},d.createElement(Nh.TransitionGroup,{component:"ul",className:"".concat(Hh.a.alertList," list-unstyled")},t&&t.map((function(e,t){return d.createElement(Nh.CSSTransition,{key:t,timeout:200,classNames:"alert"},d.createElement(Yh,{alert:e,closeAlert:function(){return n(e.id)}}))}))))}function Wh(){return d.createElement("div",{className:"text-center p-5"},d.createElement(Ws.Spinner,{as:"div",animation:"border",role:"status"}))}function Zh(e){return d.createElement(Ws.Modal,{show:!0,onHide:e.closePopup,onEntered:e.onEntered,size:e.size},!!e.title&&d.createElement(Ws.Modal.Header,{closeButton:e.closeButton},d.createElement(Ws.Modal.Title,null,e.title)),e.showLoadingSpinner?d.createElement(Wh,null):d.createElement(Ws.Modal.Body,null,e.children))}Zh.defaultProps={closeButton:!0};var Qh,Xh,ey=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function ty(e){var t=e.buttons;return d.createElement("div",{className:"d-flex justify-content-end border-top pt-3 px-3 mx-n3"},t.map((function(e,t){return function(e,t){var n=e.buttonText,r=e.type,o=void 0===r?"button":r,i=e.isSpinnerButton,a=e.showSpinner,c=void 0!==a&&a,s=e.className,u=ey(e,["buttonText","type","isSpinnerButton","showSpinner","className"]),l=Object.assign({key:t,type:o,className:"ml-2".concat(s?" ".concat(s):"")},u);return i?d.createElement(lu,Object.assign({showSpinner:c},l),n):d.createElement(Ws.Button,Object.assign({},l),n)}(e,t)})))}!function(e){e.Boolean="System.Boolean",e.String="System.String",e.StaffRequest="ClickView.DomainApi.Models.Options.Enums.StaffRequestOption, ClickView.DomainApi.Models, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null",e.Long="System.Int64"}(Qh||(Qh={})),function(e){e[e.Permanent=0]="Permanent",e[e.Temporary=1]="Temporary"}(Xh||(Xh={}));var ny={namespace:"domain_options"},ry=function(){return"/api/domain/v3/settings/types"},oy=function(e){return"/api/domain/v3/settings/types/".concat(e)},iy=function(){return"/api/domain/v3/settings/types"},ay=function(e){return"/api/domain/v3/settings/types/".concat(e)},cy=function(e){return"/api/domain/v3/settings/types/".concat(e)},sy="domain:options",uy="domain:option",ly="update:domain:option",fy="delete:domain:option",py=function(){return{key:sy,url:ry(),normalizeOptions:ny}},dy=function(e){return{key:"".concat(uy,":").concat(e),url:oy(e),normalizeOptions:ny}},my=function(e,t,n){return e.type===Qh.String&&(e=vy(e)),{key:uy,url:iy(),data:e,type:jr.POST,success:t,error:n,invalidationKeys:[sy],normalizeOptions:ny}},hy=function(e,t){return e.type===Qh.String&&(e=vy(e)),{key:"".concat(ly,":").concat(e.id),url:ay(e.id),data:e,type:jr.PUT,always:t,formatData:function(){return e},normalizeOptions:ny}},yy=function(e,t){return{key:"".concat(fy,":").concat(e),url:cy(e),type:jr.DELETE,invalidationKeys:[sy],normalizeOptions:ny,success:t}};function vy(e){var t=e.defaultValue;if('"'===t)return Object.assign(Object.assign({},e),{defaultValue:'"'.concat(t,'"')});var n=t.charAt(0),r=t.charAt(t.length-1);return'"'!==n&&(t='"'.concat(t)),'"'!==r&&(t="".concat(t,'"')),Object.assign(Object.assign({},e),{defaultValue:t})}function by(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return gy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gy(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Sy(e){var t=by(d.useState(!1),2),n=t[0],i=t[1],c=o.useBasicFetch(dy(e.optionId)),s=Object(bn.useDispatch)(),u=function(){e.closePopup(),r.AppLinkHelper.trigger({application:l.DOMAIN_OPTIONS,action:a.DomainOptions.DOMAIN_OPTIONS})};return d.createElement(Zh,{title:"Delete Domain Option",closePopup:e.closePopup,showLoadingSpinner:!c.data},c.data&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,c.data.name),"?")),d.createElement(ty,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){i(!0),o.fetch(s,yy(e.optionId,u))},buttonText:"Yes, delete this domain option",isSpinnerButton:!0,showSpinner:n}]})))}var Ey,Oy=function(e){return{application:l.DOMAIN_OPTIONS,action:a.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]}},jy={application:l.DOMAIN_OPTIONS,action:a.DomainOptions.NEW_DOMAIN_OPTION};function Cy(){var e=o.useBasicFetch(py());if(!e.data)return d.createElement(d.Fragment,null);var t=e.data.map((function(e){return e.displayName&&(e.name=e.displayName),e}));return d.createElement(d.Fragment,null,d.createElement("div",{className:"d-flex justify-content-between mb-2"},d.createElement("h5",{className:"d-inline-block m-0"},"Select a domain option type to edit:"),d.createElement(Up,{appLink:jy,className:"d-block"},d.createElement(_p,{svgName:Ap.Plus,size:kp.Small}),d.createElement("span",null,"New Domain Option"))),d.createElement(Pm,{objects:t,getAppLink:Oy}))}!function(e){e[e.Audience=1]="Audience",e[e.Category=2]="Category",e[e.Channel=3]="Channel",e[e.Chapter=4]="Chapter",e[e.Comment=5]="Comment",e[e.OwnerComment=6]="OwnerComment",e[e.Image=7]="Image",e[e.Thumbnail=8]="Thumbnail",e[e.Avatar=9]="Avatar",e[e.Banner=10]="Banner",e[e.Video=11]="Video",e[e.Trailer=12]="Trailer",e[e.Rating=13]="Rating",e[e.Topic=14]="Topic",e[e.Series=15]="Series",e[e.Season=16]="Season",e[e.HostedMediaObjectCollection=17]="HostedMediaObjectCollection",e[e.ExchangeCollection=18]="ExchangeCollection",e[e.CustomMediaObjectCollection=19]="CustomMediaObjectCollection",e[e.Playlist=20]="Playlist",e[e.ClickViewTvCollection=21]="ClickViewTvCollection",e[e.ClickViewProductionsCollection=22]="ClickViewProductionsCollection",e[e.User=23]="User",e[e.SystemUser=24]="SystemUser",e[e.Customer=25]="Customer",e[e.Country=26]="Country",e[e.Organisation=28]="Organisation",e[e.SystemOrganisation=29]="SystemOrganisation",e[e.Group=30]="Group",e[e.SystemGroup=31]="SystemGroup",e[e.FlagReason=32]="FlagReason",e[e.Library=33]="Library",e[e.Interactive=34]="Interactive",e[e.WorkspaceCollection=35]="WorkspaceCollection",e[e.Conversation=36]="Conversation",e[e.Message=37]="Message",e[e.Notification=38]="Notification",e[e.Clip=39]="Clip",e[e.Link=40]="Link",e[e.UserChannel=41]="UserChannel",e[e.Resource=42]="Resource",e[e.VideoStream=43]="VideoStream",e[e.AudioStream=44]="AudioStream",e[e.Tag=45]="Tag",e[e.Subtitle=46]="Subtitle",e[e.LicencedContentCollection=47]="LicencedContentCollection",e[e.PublicCollection=48]="PublicCollection",e[e.CategoryTree=49]="CategoryTree",e[e.Logo=50]="Logo",e[e.Permission=51]="Permission",e[e.Subject=52]="Subject",e[e.Field=53]="Field",e[e.Company=54]="Company",e[e.Person=55]="Person",e[e.Cover=56]="Cover",e[e.Poster=57]="Poster",e[e.SubjectAudience=58]="SubjectAudience"}(Ey||(Ey={}));var wy=Ys.object().shape({id:Ys.string(),name:Ys.string().trim().max(64,"Name is too long").required("Name is required").default(""),displayName:Ys.string().trim().max(255,"Display name is too long").required("Display name is required").default(""),type:Ys.mixed().required("Type is required").default(Qh.Boolean),entityType:Ys.mixed().required("Entity type is required").default(Ey.Customer),kind:Ys.mixed().required("Kind is required").default(Xh.Temporary),defaultValue:Ys.mixed().required("Default value is required").default("false")}).noUnknown();function Ay(e){var t=e.type,n=e.defaultValue;if(!t)return d.createElement(d.Fragment,null);var r={label:"Default Value",name:"defaultValue",id:"defaultValue",value:n};return t===Qh.Boolean?d.createElement(ru,Object.assign({as:"select"},r),d.createElement("option",{value:"true"},"True"),d.createElement("option",{value:"false"},"False")):t===Qh.Long||t===Qh.StaffRequest?d.createElement(ru,Object.assign({as:"input",type:"number"},r)):t===Qh.String?d.createElement(ru,Object.assign({as:"input"},r)):void 0}var Iy=[Ey.Customer,Ey.User];function Ty(e){var t=null===e.id||void 0===e.id,n=_s(),r=au(n);return d.createElement(Vs,null,d.createElement(ru,{label:"Name (snake_case)",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this domain option",autoFocus:!0}),d.createElement(ru,{label:"Display Name",type:"text",name:"displayName",id:"displayName",value:n.values.displayName,placeholder:"Enter a display name for this domain option"}),d.createElement(ru,{as:"select",label:"Kind",name:"kind",id:"kind",value:n.values.kind},Rr.getEnumKeys(Xh).map((function(e){return d.createElement("option",{key:e,value:Xh[e]},e)}))),d.createElement(ru,{as:"select",label:"Entity",name:"entityType",id:"entityType",value:n.values.entityType},Rr.getEnumKeys(Ey).filter((function(e){return Iy.includes(Ey[e])})).map((function(e){return d.createElement("option",{key:e,value:Ey[e]},e)}))),d.createElement(ru,{as:"select",label:"Type",name:"type",id:"type",value:n.values.type},Rr.getEnumKeys(Qh).map((function(e){return d.createElement("option",{key:e,value:Qh[e]},e)}))),d.createElement(Ay,{type:n.values.type,defaultValue:n.values.defaultValue}),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(lu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&d.createElement(Ws.Button,{as:Up,variant:"danger",appLink:{application:l.DOMAIN_OPTIONS,action:a.DomainOptions.DELETE_DOMAIN_OPTION,args:[e.id]}},"Delete")))}function ky(e){return d.createElement(Ks,{initialValues:e.domainOption,validationSchema:wy,onSubmit:e.saveDomainOption},d.createElement(Ty,{id:e.domainOption&&e.domainOption.id}))}function _y(){var e=Object(bn.useDispatch)();return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Create New Domain Option"),d.createElement(ky,{saveDomainOption:function(t,n){o.fetch(e,my(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.DOMAIN_OPTIONS,action:a.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]})}),n))}}))}function Ly(e){var t=e.optionId,n=o.useBasicFetch(dy(t)),r=Object(bn.useDispatch)();return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Edit Domain Option"),n.data&&d.createElement(ky,{domainOption:n.data,saveDomainOption:function(e,t){return o.fetch(r,hy(e,t))}}))}function xy(e){return(xy="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 Py(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ny(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 Ry(e,t,n){return t&&Ny(e.prototype,t),n&&Ny(e,n),e}function Dy(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&&My(e,t)}function My(e,t){return(My=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Uy(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=Vy(e);if(t){var o=Vy(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Fy(this,n)}}function Fy(e,t){return!t||"object"!==xy(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 Vy(e){return(Vy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zy=function(e){Dy(n,e);var t=Uy(n);function n(){return Py(this,n),t.apply(this,arguments)}return Ry(n,[{key:"channelName",get:function(){return l.DOMAIN_OPTIONS}},{key:"appRoutes",get:function(){return{"developer/options(/)":"domainOptions","developer/options/new(/)":"newDomainOption","developer/options/:id(/)":"editDomainOption"}}},{key:"appLinks",get:function(){return["deleteDomainOption"]}}]),n}(r.AppRouter),By=function(e){Dy(n,e);var t=Uy(n);function n(){return Py(this,n),t.apply(this,arguments)}return Ry(n,[{key:"domainOptions",value:function(){this.layout.showChildView(kn,d.createElement(Cy,null))}},{key:"newDomainOption",value:function(){this.layout.showChildView(kn,d.createElement(_y,null))}},{key:"editDomainOption",value:function(e){this.layout.showChildView(kn,d.createElement(Ly,{optionId:e}))}},{key:"deleteDomainOption",value:function(e){this.layout.showChildView(_n,d.createElement(Sy,Object.assign({optionId:e},this.getPopupProps())))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(Ln,d.createElement(Gh,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Domain Options Application"}},{key:"channelName",get:function(){return l.DOMAIN_OPTIONS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return zy}}]),n}(r.Application),Hy=function(e){return e?"".concat("/api/master/v2/people","?cursor=").concat(e):"/api/master/v2/people"},qy=function(e){return"/api/master/v2/objects/".concat(e)},Jy=function(){return"/api/master/v2/people"},$y=function(e){return"/api/master/v2/objects/".concat(e)},Ky="people",Yy="person",Gy="update:person",Wy=function(e){return{key:"".concat(Ky).concat(e?":".concat(e):""),url:Hy(e)}},Zy=function(e){return{key:"".concat(Yy,":").concat(e),url:qy(e)}},Qy=function(e,t,n){return{key:Yy,url:Jy(),data:e,type:jr.POST,success:t,error:n,invalidationKeys:[Ky]}},Xy=function(e,t,n){return{key:"".concat(Gy,":").concat(e),url:$y(e),data:t,type:jr.PUT,always:n}},ev=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown();function tv(e){var t=_s();return d.createElement(Vs,null,d.createElement(ru,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this person",autoFocus:!0}),d.createElement(wu,{isNew:e.isNew}))}function nv(e){return d.createElement(Ks,{initialValues:e.person,validationSchema:ev,onSubmit:e.savePerson},d.createElement(tv,{isNew:!(e.person&&e.person.id)}))}function rv(e){var t=Object(bn.useDispatch)(),n=o.useBasicFetch(Zy(e.id));return d.createElement(d.Fragment,null,!!n.data&&d.createElement(nv,{person:n.data,savePerson:function(n,r){return o.fetch(t,Xy(e.id,n,r))}}))}function ov(){var e=Object(bn.useDispatch)();return d.createElement(nv,{savePerson:function(t,n){o.fetch(e,Qy(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.PEOPLE,action:a.People.EDIT_PERSON,args:[e.id]})}),n))}})}var iv=l.PEOPLE,av=function(e){return{application:iv,action:a.People.EDIT_PERSON,args:[e.id]}},cv=function(e){return r.AppLinkHelper.trigger(av(e))};function sv(e){var t=o.useBasicFetch(Wy(e.cursor));return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3 w-50"},d.createElement(Mp,{placeholder:"Search for a person",onSuggestionSelected:cv,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/people/instant/raw","?q=").concat(e)},activationLength:2})),d.createElement(Em,{collection:t&&t.data,collectionAppLink:{application:iv,action:a.People.PEOPLE},newObjectAppLink:{application:iv,action:a.People.NEW_PERSON},getObjectAppLink:av,objectName:"Person"}))}function uv(e){return(uv="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 lv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fv(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 pv(e,t,n){return t&&fv(e.prototype,t),n&&fv(e,n),e}function dv(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&&mv(e,t)}function mv(e,t){return(mv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function hv(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=vv(e);if(t){var o=vv(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return yv(this,n)}}function yv(e,t){return!t||"object"!==uv(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 vv(e){return(vv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var bv=function(e){dv(n,e);var t=hv(n);function n(){return lv(this,n),t.apply(this,arguments)}return pv(n,[{key:"channelName",get:function(){return l.PEOPLE}},{key:"appRoutes",get:function(){return{"manage/people(/)":"people","manage/people/new(/)":"newPerson","manage/people/:id(/)":"editPerson"}}}]),n}(r.AppRouter),gv=function(e){dv(n,e);var t=hv(n);function n(){return lv(this,n),t.apply(this,arguments)}return pv(n,[{key:"people",value:function(e){var t=e.cursor;this.layout.showChildView(kn,d.createElement(sv,{cursor:t}))}},{key:"newPerson",value:function(){this.layout.showChildView(kn,d.createElement(ov,null))}},{key:"editPerson",value:function(e){this.layout.showChildView(kn,d.createElement(rv,{id:e}))}},{key:"name",get:function(){return"People Application"}},{key:"channelName",get:function(){return l.PEOPLE}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return bv}}]),n}(r.Application);function Sv(e){return(Sv="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 Ev(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 Ov(e,t){return(Ov=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function jv(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=wv(e);if(t){var o=wv(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Cv(this,n)}}function Cv(e,t){return!t||"object"!==Sv(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 wv(e){return(wv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Av=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&&Ov(e,t)}(i,e);var t,n,r,o=jv(i);function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this)).constructors={},e.destructors={},e.instances={},e.singletonInstances={},e.referenceCounts={},e}return t=i,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"registerDataService",value:function(e,t){var n=this;this.validateConstructor(e);var r=e.prototype.name;return this.referenceCounts[r]=0,this.constructors[r]=function(){return new e({dataProvider:n.getInstance(t.dataProvider),cache:n.getInstance(t.cache),bootstrapData:t.bootstrapData,defaultErrorHandler:t.defaultErrorHandler,alertService:t.alertService})},this.destructors[r]=function(){n.instances[r]?n.instances[r].destroy():K.throw(new Xe("Trying to destroy a ".concat(r," instance that has already been destroyed"))),n.releaseInstance(t.dataProvider),n.releaseInstance(t.cache)},this}},{key:"registerInstance",value:function(e,t){var n=this;this.validateConstructor(e);var r=e.prototype.name;return this.referenceCounts[r]=0,this.constructors[r]=function(){return new e(t)},this.destructors[r]=function(){return h.isFunction(n.instances[r].destroy)&&n.instances[r].destroy()},this}},{key:"registerSingleton",value:function(e){var t=e.name;return this.singletonInstances[t]=e,this}},{key:"getInstance",value:function(e,t){var n=this;return this.singletonInstances[e]?this.singletonInstances[e]:(this.constructors[e]||K.throw(new Xe("".concat(e," was not registered with ").concat(this.name))),this.referenceCounts[e]++,t&&this.listenTo(t,"destroy",(function(){return n.releaseInstance(e)})),this.instances[e]||(this.instances[e]=this.constructors[e]()),this.instances[e])}},{key:"releaseInstance",value:function(e){var t=this;if(this.instances[e])return window.setTimeout((function(){t.referenceCounts[e]--,t.referenceCounts[e]<1&&(t.destructors[e](),delete t.instances[e])}),0),this}},{key:"validateConstructor",value:function(e){var t=e.prototype.name;t||K.throw(new Xe("Classes registered with ".concat(this.name," must have a unique name property."))),this.constructors[t]&&K.throw(new Xe("A class with the name: ".concat(t," has already been registered with ").concat(this.name)))}},{key:"name",get:function(){return"InstanceManager"}}])&&Ev(t.prototype,n),r&&Ev(t,r),i}(Yt).Instance;function Iv(e){var t,n;return t=e,n=Av.getInstance(t),d.useEffect((function(){return function(){return Av.releaseInstance(t)}})),n}function Tv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return kv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _v(e){var t=e.imageType,n=e.closePopup,r=d.useContext(gd),o=r.getDataUrl,i=r.setImage,a=Tv(d.useState(o()),1)[0],c=Tv(d.useState(!1),2),s=c[0],u=c[1],l=Iv(p.IMAGE_UPLOAD),f=function(e){i(e),n()},m={dataUrl:a,imageType:t,minWidth:ad[t].width,minHeight:ad[t].height,onCrop:function(e){return l.uploadBase64Image(e,t,f,n)},onCancel:n};return d.createElement(Zh,{title:"Crop Image",size:"lg",closePopup:n,onEntered:function(){return u(!0)}},s&&d.createElement(em,Object.assign({},m)))}var Lv=function(e){var t=e.children;return d.createElement(Sd,null,t)},xv=function(){var e=Iv(du);return{success:function(t){e.success(t)()},error:function(t){e.error(t)()},warning:function(t){e.createAlert({type:_h.Warning,heading:Lh.Warning,message:t})}}};function Pv(e){var t=e.page,n=e.totalPages,r=Du.isNumber(t)&&t>0&&t<n&&t+1,o=Du.isNumber(t)&&t>1&&t-1,i={};if(r&&r<=n&&(i.next=r.toString()),o&&(i.previous=o.toString()),!Rr.isEmpty(i))return i}var Nv,Rv={convertLegacyPaginatedCollection:function(e){if(e)return{data:e.data,pagination:{cursors:Pv(e.pagination),limit:e.pagination.pageSize}}}};!function(e){e.Developer="Curator Devs",e.Content="Content",e.Curator="Curators",e.Support="Support",e.SalesSupport="Sales Support"}(Nv||(Nv={}));var Dv=function(){return[{value:"protected",access:"r"}]},Mv=function(e){return[Nv.Developer,Nv.Content].some((function(t){return hd(e).includes(t)}))},Uv=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1";return{key:"playlists:".concat(e),url:"/ajax/playlists/curators?page=".concat(e),formatData:Rv.convertLegacyPaginatedCollection}},Fv=function(e,t){var n="/api/domain/v1/search/playlists?query=".concat(e);return t&&(n+="&filter={page:".concat(t,"}")),{key:"playlists:search:".concat(e).concat(t?":".concat(t):""),url:n,formatData:Rv.convertLegacyPaginatedCollection}},Vv=function(e){return{key:"playlist:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=cover,banner")}},zv=function(e){var t=e.slice().sort();return{key:"playlists:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},Bv=function(e,t,n,r,o){return{url:"/api/master/v2/objects/".concat(t,"/playlists"),key:"playlist",data:Object.assign(Object.assign({},e),{permissions:Dv()}),type:jr.POST,invalidationKeys:"playlists",success:n,error:r,always:o}},Hv=function(e,t,n,r,o){return{url:"/api/master/v2/objects/".concat(e),key:"update:playlist:".concat(e),data:t,type:jr.PUT,success:n,error:r,always:o}},qv=function(e,t,n,r){return{url:"/api/master/v1/playlists/".concat(e),key:"delete:playlist:".concat(e),type:jr.DELETE,invalidationKeys:"playlists",success:t,error:n,always:r}},Jv=function(e){return{key:"playlist:".concat(e,":videos"),url:"/api/master/v2/objects/".concat(e,"/videos?query={orderBy:orderindex,limit:100}")}},$v=function(e,t,n,r){return{key:"reorder:playlist",url:"/api/master/v1/objects/".concat(e,"/videos/reorder"),data:t,type:jr.PUT,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r}},Kv=function(e,t,n,r,o){return{key:"remove:playlist:video",url:"/api/master/v1/playlists/".concat(e,"/dissociate/").concat(t),type:jr.DELETE,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r,always:o}};function Yv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Gv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Wv(e){var t=Object(bn.useDispatch)(),n=xv(),i=Yv(d.useState(!1),2),c=i[0],s=i[1],u=o.useBasicFetch(Vv(e.playlistId));var f=[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){s(!0),o.fetch(t,qv(e.playlistId,(function(){n.success("Successfully deleted playlist."),r.AppLinkHelper.trigger({application:l.PLAYLISTS,action:a.Playlists.PLAYLISTS})}),(function(){s(!1),n.error("Failed to delete playlist.")}),e.closePopup))},buttonText:"Yes, delete playlist",isSpinnerButton:!0,showSpinner:c}],p=!!u.data;return d.createElement(Zh,{title:"Delete Playlist",closePopup:e.closePopup,showLoadingSpinner:!p},p&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,u.data.name),"?"),d.createElement("p",null,"Please ensure it is not being used in any widgets.")),d.createElement(ty,{buttons:f})))}var Zv={url:"/api/currentUser",key:"currentuser"},Qv=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Ys.string().trim().max(65535,"Description is too long").default(""),cover:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown(),banner:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown()}).noUnknown(),Xv=function(e,t){var n=l.PLAYLISTS,r=a.Playlists,o=[{label:"Edit Playlist Details",appLink:{application:n,action:r.EDIT_PLAYLIST,args:[t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_PLAYLIST_VIDEOS,args:[t]}}];return Mv(e)&&o.push.apply(o,[{label:"Subjects",appLink:{application:n,action:r.EDIT_PLAYLIST_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_PLAYLIST_AUDIENCES,args:[t]}}]),o};function eb(e){var t=_s(),n=au(t);return d.createElement(Vs,null,d.createElement(ru,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this playlist",autoFocus:!0}),d.createElement(ru,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this playlist here"}),d.createElement(wd,{imageType:Jp.Covers,fieldName:"cover",application:l.PLAYLISTS,uploadAction:a.Playlists.UPLOAD_IMAGE}),d.createElement(wd,{imageType:Jp.Banners,fieldName:"banner",application:l.PLAYLISTS,uploadAction:a.Playlists.UPLOAD_IMAGE}),d.createElement("div",{className:"d-flex justify-content-between align-items-center"},d.createElement(lu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.id?"Save":"Create"),!!e.actions&&d.createElement(km,{actions:e.actions})))}function tb(e){var t,n=e.playlist&&e.playlist.id;return d.createElement(Ks,{initialValues:e.playlist,validationSchema:Qv,onSubmit:e.savePlaylist},d.createElement(eb,{id:n,actions:!!n&&(t=n,[{label:"Delete playlist",appLink:{application:l.PLAYLISTS,action:a.Playlists.DELETE_PLAYLIST,args:[t]},className:"text-danger"}])}))}function nb(e){return d.createElement("div",{className:"py-2"},d.createElement(Rm,{tabs:Xv(e.currentUser,e.playlistId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function rb(e){var t=Object(bn.useDispatch)(),n=xv(),r=o.useBasicFetch(Vv(e.playlistId)),i=o.useBasicFetch(Zv);return d.createElement(d.Fragment,null,!!i.data&&d.createElement(nb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST,currentUser:i.data}),!!r.data&&d.createElement(tb,{playlist:r.data,savePlaylist:function(r,i){o.fetch(t,Hv(e.playlistId,r,(function(){n.success("Successfully updated playlist.")}),(function(){n.error("Failed to update playlist.")}),i))}}))}var ob=function(e,t){var n=e.dataServiceName,r=e.eventPrefix,o=e.fetchData,i=e.setData,a=e.onError,c=e.deleteEventPrefix;if(hn(o)){if(hn(i)){var s=a&&hn(a),u=Av.getInstance(n),l=y.Radio.channel(u.channelName),f="".concat(r,":request"),p="".concat(r,":sync"),d="".concat(r,":error"),m="".concat(r,":invalidate"),h=c&&"".concat(c,":sync"),v=function(){return t(!1)},b=function(){return t(!0)},g=function(){return t(!1)},S=function(){return l.off(m,g)};l.once(f,v),l.once(p,b),l.once(m,g),s&&l.once(d,a),h&&l.once(h,S);var E=o(u);return E&&(t(!0),e.setData(E)),function(){Av.releaseInstance(n),l.off(f,v),l.off(p,b),l.off(m,g),s&&l.off(d,a),h&&l.off(h,S)}}K.throw(new Xe("A setData function must be passed to fetch"))}else K.throw(new Xe("A fetchData function must be passed to fetch"))};function ib(e){return function(e){if(Array.isArray(e))return sb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||cb(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ab(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||cb(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cb(e,t){if(e){if("string"==typeof e)return sb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sb(e,t):void 0}}function sb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ub=function(e){return Array(Array.isArray(e)?e.length:0).fill(!1)};function lb(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=d.useState(ub(e)),o=ab(r,2),i=o[0],a=o[1];d.useEffect((function(){a(ub(e))}),ib(t)),d.useEffect((function(){if(n){var t=[];return e&&e.forEach((function(e,n){t.push(ob(e,(function(e){e!==i[n]&&a(jo(i,n,e))})))})),function(){return t.forEach((function(e){return e()}))}}}),[i,n])}function fb(e){return function(e){if(Array.isArray(e))return mb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||db(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||db(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function db(e,t){if(e){if("string"==typeof e)return mb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mb(e,t):void 0}}function mb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hb(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=d.useState(!1),o=pb(r,2),i=o[0],a=o[1];d.useEffect((function(){a(!1)}),fb(t)),d.useEffect((function(){if(n)return ob(e,a)}),[i,n])}var yb,vb,bb,gb,Sb=function(e,t,n){return function(r){return e((function(e){var o=hn(n)?n:yn();return Object.assign(Object.assign({},e),function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,o(r,e)))}))}},Eb={SHORT:120,STANDARD:600};!function(e){e[e.Subject=0]="Subject",e[e.Classification=1]="Classification"}(yb||(yb={})),function(e){e.Playlists="playlists",e.Series="series",e.Videos="videos"}(vb||(vb={})),function(e){e.Root="0"}(bb||(bb={})),function(e){e.Root="root"}(gb||(gb={}));var Ob,jb=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default(""),levelIds:Ys.array().of(Ys.string()).required("A level is required").default([])}).noUnknown();!function(e){e.Subject="Subject",e.Topic="Topic"}(Ob||(Ob={}));var Cb=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentIds:Ys.array().of(Ys.string()).default([gb.Root]),subjectIds:Ys.array().of(Ys.string()).min(1,"A classification must be mapped to at least one subject").required("A classification must be mapped to at least one subject").default([]),type:Ys.mixed().required("Type is required").default(Ob.Subject),emphasize:Ys.boolean().default(!1),comingSoon:Ys.boolean().default(!0),canBePreferred:Ys.boolean().default(!1),cover:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown(),banner:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown()}).noUnknown(),wb=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),Ab=Ys.object().shape({name:Ys.string().max(255,"Name is too long").required("Name is required"),description:Ys.string().max(65535,"Description is too long").required("Description is required")}),Ib=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentId:Ys.string().default(bb.Root)}).noUnknown(),Tb={singularizeMemberType:function(e){switch(e){case vb.Playlists:return"playlist";case vb.Series:return"series";case vb.Videos:return"video"}},getMemberAppLink:function(e,t){var n=[t];switch(e){case vb.Playlists:return{application:l.PLAYLISTS,action:a.Playlists.EDIT_PLAYLIST,args:n};case vb.Series:return{application:l.SERIES,action:a.Series.EDIT_SERIES,args:n};case vb.Videos:return{application:l.VIDEOS,action:a.Videos.EDIT_VIDEO,args:n}}},getMemberActions:function(e,t,n,r){return[{label:"Remove ".concat(Tb.singularizeMemberType(n)),appLink:{application:l.SUBJECTS,action:t===yb.Subject?a.Subjects.REMOVE_SUBJECT_MEMBER:a.Subjects.REMOVE_CLASSIFICATION_MEMBER,args:[e,r,n]},className:"text-danger"}]}},kb=function(){var e=l.SUBJECTS,t=a.Subjects;return[{label:"Classifications",appLink:{application:e,action:t.CLASSIFICATIONS},activeActions:[t.CLASSIFICATIONS,t.PRESENTATION_CLASSIFICATIONS,t.NEW_CLASSIFICATION,t.EDIT_CLASSIFICATION,t.EDIT_CLASSIFICATION_PLAYLISTS,t.EDIT_CLASSIFICATION_SERIES,t.EDIT_CLASSIFICATION_VIDEOS,t.DELETE_CLASSIFICATION,t.REMOVE_CLASSIFICATION_MEMBER]},{label:"Subjects",appLink:{application:e,action:t.SUBJECTS},activeActions:[t.SUBJECTS,t.NEW_SUBJECT,t.EDIT_SUBJECT,t.EDIT_SUBJECT_PLAYLISTS,t.EDIT_SUBJECT_SERIES,t.EDIT_SUBJECT_VIDEOS,t.SUBJECT_CLASSIFICATIONS,t.DELETE_SUBJECT,t.ADD_SUBJECT_MEMBERS,t.REMOVE_SUBJECT_MEMBER]},{label:"Audiences",appLink:{application:e,action:t.AUDIENCES},activeActions:[t.AUDIENCES,t.PRESENTATION_AUDIENCES,t.NEW_AUDIENCE,t.EDIT_AUDIENCE]},{label:"Levels",appLink:{application:e,action:t.LEVELS},activeActions:[t.LEVELS,t.NEW_LEVEL,t.EDIT_LEVEL]},{label:"Presentations",appLink:{application:e,action:t.PRESENTATIONS},activeActions:[t.PRESENTATIONS,t.NEW_PRESENTATION,t.EDIT_PRESENTATION]}]},_b=function(e){var t=l.SUBJECTS,n=a.Subjects;return[{label:"Edit Subject Details",appLink:{application:t,action:n.EDIT_SUBJECT,args:[e]}},{label:"Classifications",appLink:{application:t,action:n.SUBJECT_CLASSIFICATIONS,args:[e]}},{label:"Playlists",appLink:{application:t,action:n.EDIT_SUBJECT_PLAYLISTS,args:[e]}},{label:"Series",appLink:{application:t,action:n.EDIT_SUBJECT_SERIES,args:[e]}},{label:"Videos",appLink:{application:t,action:n.EDIT_SUBJECT_VIDEOS,args:[e]}}]},Lb=function(e,t){var n=l.SUBJECTS,r=a.Subjects;return[{label:"Edit Classification Details",appLink:{application:n,action:r.EDIT_CLASSIFICATION,args:[e,t]}},{label:"Playlists",appLink:{application:n,action:r.EDIT_CLASSIFICATION_PLAYLISTS,args:[e,t]}},{label:"Series",appLink:{application:n,action:r.EDIT_CLASSIFICATION_SERIES,args:[e,t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_CLASSIFICATION_VIDEOS,args:[e,t]}}]};function xb(e){return(xb="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 Pb(e){return function(e){if(Array.isArray(e))return Nb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Nb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nb(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Rb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Db(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 Mb(e,t){return(Mb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ub(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=Vb(e);if(t){var o=Vb(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Fb(this,n)}}function Fb(e,t){return!t||"object"!==xb(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 Vb(e){return(Vb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zb=function(){return"/api/subjects/v1/subjects/tree"},Bb=function(e){return"/api/subjects/v1/subjects/".concat(e)},Hb=function(e,t){return"/api/subjects/v1/subjects/".concat(e,"/").concat(t,"?query={limit:100}")},qb=function(e,t,n){var r="/api/subjects/v1/subjects/".concat(e,"/classifications"),o=[];return t&&o.push("presentationId=".concat(t)),n&&o.push("query=".concat(n,"{limit:100}")),o.length?"".concat(r,"?").concat(o.join("&")):r},Jb=function(){return"/api/subjects/v1/subjects"},$b=function(e){return"/api/subjects/v1/subjects/".concat(e)},Kb=function(e){return"/api/subjects/v1/subjects/".concat(e)},Yb=function(e){return"/api/subjects/v1/objects/".concat(e,"/subjects")},Gb=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/subjects?addToClassifications=").concat(!!t)},Wb=function(e,t){return"/api/subjects/v1/subjects/".concat(e,"/objects?addToClassifications=").concat(!!t)},Zb=function(e,t){return"/api/subjects/v1/subjects/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},Qb=function(){return"/api/subjects/v1/presentations"},Xb=function(e){return"/api/subjects/v1/presentations/".concat(e)},eg=function(){return"/api/subjects/v1/presentations"},tg=function(e){return"/api/subjects/v1/presentations/".concat(e)},ng=function(e){return"/api/subjects/v1/presentations/".concat(e,"/classifications/tree")},rg=function(e){return"/api/subjects/v1/classifications/".concat(e,"?query=cover,banner")},og=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/").concat(t,"?query={limit:100}")},ig=function(){return"/api/subjects/v1/classifications"},ag=function(e){return"/api/subjects/v1/classifications/".concat(e)},cg=function(e){return"/api/subjects/v1/classifications/".concat(e)},sg=function(e){return"/api/subjects/v1/objects/".concat(e,"/classifications")},ug=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/classifications?presentationId=").concat(t)},lg=function(e){return"/api/subjects/v1/classifications/".concat(e,"/objects")},fg=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},pg=function(){return"/api/subjects/v1/levels"},dg=function(e){return"/api/subjects/v1/levels/".concat(e)},mg=function(){return"/api/subjects/v1/levels"},hg=function(e){return"/api/subjects/v1/levels/".concat(e)},yg=function(e){return"/api/subjects/v1/objects/".concat(e,"/levels")},vg=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/levels?addToAudiences=").concat(!!t)},bg=function(e){return"/api/subjects/v1/presentations/".concat(e,"/audiences")},gg=function(e){return"/api/subjects/v1/audiences/".concat(e)},Sg=function(){return"/api/subjects/v1/audiences"},Eg=function(e){return"/api/subjects/v1/audiences/".concat(e)},Og=function(e){return"/api/subjects/v1/audiences/".concat(e)},jg=function(e){return"/api/subjects/v1/objects/".concat(e,"/audiences")},Cg=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/audiences?presentationId=").concat(t)},wg=function(e,t,n){var r="".concat(c.SUBJECT,":").concat(e);return t&&(r+=":".concat(t)),r+=":".concat(c.CLASSIFICATIONS),n&&(r+=":".concat(n)),r},Ag=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&&Mb(e,t)}(i,e);var t,n,r,o=Ub(i);function i(){return Rb(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"getPresentations",value:function(e,t){return this.get({resource:Qb(),eventPrefix:c.PRESENTATIONS,expiryTime:Eb.STANDARD,callback:e,errorCallback:t})}},{key:"getPresentation",value:function(e,t,n){return this.get({resource:Xb(e),eventPrefix:"".concat(c.PRESENTATION,":").concat(e),expiryTime:Eb.STANDARD,callback:t,errorCallback:n})}},{key:"createPresentation",value:function(e,t,n){return this.create({resource:eg(),data:e,callback:t,errorCallback:n,eventPrefix:c.PRESENTATION,invalidationKeys:[c.PRESENTATIONS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully created presentation."),errorHandler:this.alertService.error("Failed to create presentation.")})}},{key:"updatePresentation",value:function(e,t,n,r){return this.update({resource:tg(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_PRESENTATION,":").concat(e),invalidationKeys:["".concat(c.PRESENTATION,":").concat(e),c.PRESENTATIONS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully updated presentation."),errorHandler:this.alertService.error("Failed to update presentation.")})}},{key:"getSubjectTree",value:function(e,t){return this.get({resource:zb(),formatData:function(e){return{children:e,name:bb.Root,id:null}},eventPrefix:c.SUBJECTS,expiryTime:Eb.STANDARD,callback:e,errorCallback:t})}},{key:"getSubject",value:function(e,t,n){return this.get({resource:Bb(e),eventPrefix:"".concat(c.SUBJECT,":").concat(e),expiryTime:Eb.STANDARD,callback:t,errorCallback:n})}},{key:"getSubjectMemberIds",value:function(e,t,n,r){return this.get({resource:Hb(e,t),eventPrefix:"".concat(c.SUBJECT,":").concat(e,":").concat(t),expiryTime:Eb.STANDARD,callback:n,errorCallback:r})}},{key:"getSubjectClassifications",value:function(e,t,n,r,o){return this.get({resource:qb(e,t,n),eventPrefix:wg(e,t,n),expiryTime:Eb.STANDARD,callback:r,errorCallback:o})}},{key:"createSubject",value:function(e,t,n){return this.create({resource:Jb(),data:e,callback:t,errorCallback:n,eventPrefix:c.SUBJECT,invalidationKeys:[c.SUBJECTS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully created subject."),errorHandler:this.alertService.error("Failed to create subject.")})}},{key:"updateSubject",value:function(e,t,n,r){return this.update({resource:$b(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_SUBJECT,":").concat(e),invalidationKeys:["".concat(c.SUBJECT,":").concat(e),c.SUBJECTS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully updated subject."),errorHandler:this.alertService.error("Failed to save subject.")})}},{key:"deleteSubject",value:function(e,t,n){var r=this;return this.delete({resource:Kb(e),callback:t,errorCallback:n,eventPrefix:c.DELETE_SUBJECT,invalidationKeys:["".concat(c.SUBJECT,":").concat(e),c.SUBJECTS],successHandler:this.alertService.success("Successfully deleted subject."),errorHandler:function(e){var t,n=(null===(t=e)||void 0===t?void 0:t.code)===oo.Conflict?"Cannot delete a subject with child subjects and/or classifications.":"Failed to delete subject.";r.alertService.error(n)()}})}},{key:"getObjectSubjects",value:function(e,t,n,r){return this.get({resource:Yb(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.SUBJECTS),expiryTime:Eb.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectSubjects",value:function(e,t,n,r,o,i){var a=Tb.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(c.SUBJECTS)];return r&&s.push("".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)),s.push.apply(s,Pb(t.map((function(e){return"".concat(c.SUBJECTS,":").concat(e,":").concat(n)})))),this.update({resource:Gb(e,r),data:t,callback:o,errorCallback:i,eventPrefix:"".concat(c.UPDATE_OBJECT_SUBJECTS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(a," subjects.")),errorHandler:this.alertService.error("Failed to update ".concat(a," subjects."))})}},{key:"addObjectsToSubject",value:function(e,t,n,r,o,i){var a=1===t.length?Tb.singularizeMemberType(n):n,s=["".concat(c.SUBJECT,":").concat(e,":").concat(n)].concat(Pb(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.SUBJECTS)}))),Pb(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)}))));return this.create({resource:Wb(e,r),data:t,callback:o,errorCallback:i,eventPrefix:"".concat(c.ADD_TO_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:s,expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(a," to subject.")),errorHandler:this.alertService.error("Failed to add ".concat(a," to subject."))})}},{key:"removeObjectsFromSubject",value:function(e,t,n,r,o){var i=1===t.length?Tb.singularizeMemberType(n):n,a=["".concat(c.SUBJECT,":").concat(e,":").concat(n)].concat(Pb(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.SUBJECTS)}))));return this.delete({resource:Zb(e,t),callback:r,errorCallback:o,eventPrefix:"".concat(c.REMOVE_FROM_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:a,expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(i," from subject.")),errorHandler:this.alertService.error("Failed to remove ".concat(i," from subject."))})}},{key:"getClassificationTree",value:function(e,t,n){return this.get({resource:ng(e),formatData:function(e){return{children:e,name:gb.Root,id:null}},eventPrefix:"".concat(c.CLASSIFICATIONS,":").concat(e),expiryTime:Eb.STANDARD,callback:t,errorCallback:n})}},{key:"getClassification",value:function(e,t,n){return this.get({resource:rg(e),eventPrefix:"".concat(c.CLASSIFICATION,":").concat(e),expiryTime:Eb.STANDARD,callback:t,errorCallback:n})}},{key:"getClassificationMembers",value:function(e,t,n,r){return this.get({resource:og(e,t),eventPrefix:"".concat(c.CLASSIFICATION,":").concat(e,":").concat(t),expiryTime:Eb.STANDARD,callback:n,errorCallback:r})}},{key:"createClassification",value:function(e,t,n){return this.create({resource:ig(),data:e,callback:t,errorCallback:n,eventPrefix:c.CLASSIFICATION,invalidationKeys:[c.CLASSIFICATIONS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully created classification."),errorHandler:this.alertService.error("Failed to create classification.")})}},{key:"updateClassification",value:function(e,t,n,r){return this.update({resource:ag(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_CLASSIFICATION,":").concat(e),invalidationKeys:["".concat(c.CLASSIFICATION,":").concat(e),c.CLASSIFICATIONS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully updated classification."),errorHandler:this.alertService.error("Failed to save classification.")})}},{key:"deleteClassification",value:function(e,t,n){return this.delete({resource:cg(e),callback:t,errorCallback:n,eventPrefix:c.DELETE_CLASSIFICATION,invalidationKeys:["".concat(c.CLASSIFICATION,":").concat(e),c.CLASSIFICATIONS],successHandler:this.alertService.success("Successfully deleted classification"),errorHandler:this.alertService.error("Failed to delete classification")})}},{key:"getObjectClassifications",value:function(e,t,n,r){return this.get({resource:sg(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.CLASSIFICATIONS),expiryTime:Eb.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectClassifications",value:function(e,t,n,r,o,i){var a=Tb.singularizeMemberType(r),s=["".concat(r,":").concat(e,":").concat(c.CLASSIFICATIONS)];return s.push.apply(s,Pb(n.map((function(e){return"".concat(c.CLASSIFICATION,":").concat(e,":").concat(r)})))),this.update({resource:ug(e,t),data:n,callback:o,errorCallback:i,eventPrefix:"".concat(c.UPDATE_OBJECT_CLASSIFICATIONS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(a," classifications.")),errorHandler:this.alertService.error("Failed to update ".concat(a," classifications."))})}},{key:"addObjectsToClassification",value:function(e,t,n,r,o,i,a){var s=1===t.length?Tb.singularizeMemberType(n):n,u=["".concat(c.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(wg(r,o,n)),u.push.apply(u,Pb(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)})))),this.create({resource:lg(e),data:t,callback:i,errorCallback:a,eventPrefix:"".concat(c.ADD_TO_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(s," to classification.")),errorHandler:this.alertService.error("Failed to add ".concat(s," to classification."))})}},{key:"removeObjectsFromClassification",value:function(e,t,n,r,o,i,a){var s=1===t.length?Tb.singularizeMemberType(n):n,u=["".concat(c.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(wg(r,o,n)),u.push.apply(u,Pb(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)})))),this.delete({resource:fg(e,t),callback:i,errorCallback:a,eventPrefix:"".concat(c.REMOVE_FROM_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(s," from classification.")),errorHandler:this.alertService.error("Failed to remove ".concat(s," from classification."))})}},{key:"getLevels",value:function(e,t){return this.get({resource:pg(),eventPrefix:c.LEVELS,expiryTime:Eb.STANDARD,callback:e,errorCallback:t})}},{key:"getLevel",value:function(e,t,n){return this.get({resource:dg(e),eventPrefix:"".concat(c.LEVEL,":").concat(e),expiryTime:Eb.STANDARD,callback:t,errorCallback:n})}},{key:"createLevel",value:function(e,t,n){return this.create({resource:mg(),data:e,callback:t,errorCallback:n,eventPrefix:c.LEVEL,invalidationKeys:[c.LEVELS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully created level."),errorHandler:this.alertService.error("Failed to create level.")})}},{key:"updateLevel",value:function(e,t,n,r){return this.update({resource:hg(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_LEVEL,":").concat(e),invalidationKeys:["".concat(c.LEVEL,":").concat(e),c.LEVELS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully updated level."),errorHandler:this.alertService.error("Failed to save level.")})}},{key:"getObjectLevels",value:function(e,t,n,r){return this.get({resource:yg(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.LEVELS),expiryTime:Eb.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectLevels",value:function(e,t,n,r,o,i){var a=Tb.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(c.LEVELS)];return r&&s.push("".concat(n,":").concat(e,":").concat(c.AUDIENCES)),this.update({resource:vg(e,r),data:t,callback:o,errorCallback:i,eventPrefix:"".concat(c.UPDATE_OBJECT_LEVELS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(a," levels.")),errorHandler:this.alertService.error("Failed to update ".concat(a," levels."))})}},{key:"getAudiences",value:function(e,t,n){return this.get({resource:bg(e),callback:t,errorCallback:n,eventPrefix:"".concat(c.AUDIENCES,":").concat(e),expiryTime:Eb.STANDARD})}},{key:"getAudience",value:function(e,t,n){return this.get({resource:gg(e),callback:t,errorCallback:n,eventPrefix:"".concat(c.AUDIENCE,":").concat(e),expiryTime:Eb.STANDARD})}},{key:"createAudience",value:function(e,t,n){return this.create({resource:Sg(),data:e,callback:t,errorCallback:n,eventPrefix:c.AUDIENCE,invalidationKeys:[c.AUDIENCES],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully created audience."),errorHandler:this.alertService.error("Failed to create audience.")})}},{key:"updateAudience",value:function(e,t,n,r){return this.update({resource:Eg(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_AUDIENCE,":").concat(e),invalidationKeys:["".concat(c.AUDIENCE,":").concat(e),c.AUDIENCES],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully updated audience."),errorHandler:this.alertService.error("Failed to update audience.")})}},{key:"deleteAudience",value:function(e,t,n){return this.delete({resource:Og(e),callback:t,errorCallback:n,eventPrefix:c.DELETE_AUDIENCE,invalidationKeys:["".concat(c.AUDIENCE,":").concat(e),c.AUDIENCES],successHandler:this.alertService.success("Successfully deleted audience"),errorHandler:this.alertService.error("Failed to delete audience")})}},{key:"getObjectAudiences",value:function(e,t,n,r){return this.get({resource:jg(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.AUDIENCES),expiryTime:Eb.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectAudiences",value:function(e,t,n,r,o,i){var a=Tb.singularizeMemberType(r);return this.update({resource:Cg(e,t),data:n,callback:o,errorCallback:i,eventPrefix:"".concat(c.UPDATE_OBJECT_AUDIENCES,":").concat(e),invalidationKeys:["".concat(r,":").concat(e,":").concat(c.AUDIENCES)],successHandler:this.alertService.success("Successfully updated ".concat(a," audiences.")),errorHandler:this.alertService.error("Failed to update ".concat(a," audiences."))})}},{key:"name",get:function(){return p.SUBJECT}},{key:"channelName",get:function(){return f.SUBJECT}}])&&Db(t.prototype,n),r&&Db(t,r),i}(mr),Ig={dataServiceName:p.SUBJECT,dataChannelName:f.SUBJECT},Tg={getSubjectTreeFetchOptions:function(e,t){return Object.assign(Object.assign({},Ig),{eventPrefix:c.SUBJECTS,fetchData:function(e){return e.getSubjectTree()},setData:e,onError:t})},getSubjectFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.SUBJECT,":").concat(e),fetchData:function(t){return t.getSubject(e)},setData:t,onError:n,deleteEventPrefix:c.DELETE_SUBJECT})},getSubjectMemberIdsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.SUBJECT,":").concat(e,":").concat(t),fetchData:function(n){return n.getSubjectMemberIds(e,t)},setData:n,onError:r})},getSubjectClassificationFetchOptions:function(e,t,n,r,o){return Object.assign(Object.assign({},Ig),{eventPrefix:wg(e,n,r),fetchData:function(t){return t.getSubjectClassifications(e,n,r)},setData:t,onError:o})},getObjectSubjectsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.SUBJECTS),fetchData:function(n){return n.getObjectSubjects(e,t)},setData:n,onError:r})},getPresentationsFetchOptions:function(e,t){return Object.assign(Object.assign({},Ig),{eventPrefix:c.PRESENTATIONS,fetchData:function(e){return e.getPresentations()},setData:e,onError:t})},getPresentationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.PRESENTATION,":").concat(e),fetchData:function(t){return t.getPresentation(e)},setData:t,onError:n})},getClassificationTreeFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.CLASSIFICATIONS,":").concat(e),fetchData:function(t){return t.getClassificationTree(e)},setData:t,onError:n})},getClassificationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.CLASSIFICATION,":").concat(e),fetchData:function(t){return t.getClassification(e)},setData:t,onError:n,deleteEventPrefix:c.DELETE_CLASSIFICATION})},getClassificationMembersFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.CLASSIFICATION,":").concat(e,":").concat(t),fetchData:function(n){return n.getClassificationMembers(e,t)},setData:n,onError:r})},getObjectClassificationsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.CLASSIFICATIONS),fetchData:function(n){return n.getObjectClassifications(e,t)},setData:n,onError:r})},getLevelsFetchOptions:function(e,t){return Object.assign(Object.assign({},Ig),{eventPrefix:c.LEVELS,fetchData:function(e){return e.getLevels()},setData:e,onError:t})},getLevelFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.LEVEL,":").concat(e),fetchData:function(t){return t.getLevel(e)},setData:t,onError:n})},getObjectLevelsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.LEVELS),fetchData:function(n){return n.getObjectLevels(e,t)},setData:n,onError:r})},getAudiencesFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.AUDIENCES,":").concat(e),fetchData:function(t){return t.getAudiences(e)},setData:t,onError:n})},getAudienceFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.AUDIENCE,":").concat(e),fetchData:function(t){return t.getAudience(e)},setData:t,onError:n})},getObjectAudiencesFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.AUDIENCES),fetchData:function(n){return n.getObjectAudiences(e,t)},setData:n,onError:r})}},kg=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[e.id]}},_g=function(e,t){var n=e.levelIds;return t.filter((function(e){return n.includes(e.id)}))};function Lg(e){var t=e.showLevels;return d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",null,"Audiences"),!!t&&d.createElement("th",null,"Mapped Level(s)")))}function xg(e){var t,n=e.audience,r=e.levels;return d.createElement("tr",null,d.createElement("td",null,d.createElement(Up,{appLink:(t=n,{application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[t.presentationId,t.masterId]})},n.name)),d.createElement("td",null,r.map((function(e){return d.createElement(Up,{key:e.id,appLink:kg(e),className:"mr-2"},e.name)}))))}function Pg(e){var t=e.audiences,n=e.levels;return d.createElement(Ws.Table,{responsive:!0,bordered:!0},d.createElement(Lg,{showLevels:!!t.length}),d.createElement("tbody",null,t.length?t.map((function(e){return d.createElement(xg,{key:e.masterId,audience:e,levels:_g(e,n)})})):d.createElement("tr",null,d.createElement("td",null,"This presentation has no audiences."))))}function Ng(e){var t=null===e.masterId||void 0===e.masterId,n=_s(),r=au(n);return d.createElement(Vs,null,d.createElement(ru,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this audience",autoFocus:!0}),d.createElement(ru,{label:"Mapped Level(s)",as:"select",name:"levelIds",id:"level-ids",multiple:!0,size:e.levels.length,value:n.values.levelIds},e.levels.map((function(e){return d.createElement("option",{key:e.id,value:e.id},e.name)}))),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(lu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&d.createElement(Ws.Button,{as:Up,variant:"danger",appLink:{application:l.SUBJECTS,action:a.Subjects.DELETE_AUDIENCE,args:[e.presentationId,e.masterId]}},"Delete")))}function Rg(e){return d.createElement(Ks,{initialValues:e.audience,validationSchema:jb,onSubmit:e.saveAudience},d.createElement(Ng,{masterId:e.audience&&e.audience.masterId,presentationId:e.presentationId,levels:e.levels}))}function Dg(e){var t=e.objectAudiences,n=e.presentationAudiences;return t.filter((function(e){return n.some((function(t){return t.masterId===e.masterId}))}))}function Mg(e){var t,n,r,o,i,a=Tb.singularizeMemberType(e.memberType),c=(n=(t=e).presentationAudiences,r=t.objectLevels,o=t.objectAudiences,i=r.map((function(e){return e.id})),n.filter((function(e){return Ao(e.levelIds,i).length||o.some((function(t){return t.masterId===e.masterId}))})));return d.createElement(d.Fragment,null,d.createElement("div",{className:"border-bottom pb-3 mb-3"},d.createElement("h6",null,"Levels"),d.createElement("p",null,"Select which levels this ".concat(a," is mapped to.")),d.createElement("p",null,"To see how levels correspond to audiences, scroll down to the audience-level mappings table."),d.createElement(oS,{initialValues:{levelIds:e.objectLevels.map((function(e){return e.id})),addToAudiences:!0},saveLevels:e.saveLevels,levels:e.levels,memberType:e.memberType})),d.createElement("h6",null,"Audiences"),d.createElement("p",null,"Select a presentation to view its audiences and map them to this ".concat(a,".")),d.createElement("div",{className:"w-50 pb-3"},d.createElement(cS,{presentations:e.presentations,currentPresentation:e.currentPresentation,setCurrentPresentation:e.setCurrentPresentation})),d.createElement("p",null,"Audience to level mappings for this presentation are displayed below."),d.createElement(Pg,{levels:e.levels,audiences:e.presentationAudiences}),d.createElement("p",null,"Only the audiences which are mapped to a level that this"+" ".concat(a," is mapped to are displayed below.")),!!c.length&&d.createElement(Fg,{initialValues:{audienceIds:Dg(e).map((function(e){return e.masterId}))},saveAudiences:e.saveAudiences,audiences:c}))}function Ug(e){var t=_s(),n=au(t);return d.createElement(Vs,null,d.createElement(ru,{label:"Audience(s)",as:"select",name:"audienceIds",id:"audience-ids",multiple:!0,size:e.audiences.length,value:t.values.audienceIds},e.audiences.map((function(e){return d.createElement("option",{key:e.masterId,value:e.masterId},e.name)}))),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(lu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Audiences")))}function Fg(e){return d.createElement(Ks,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.audienceIds;return e.saveAudiences(r,n)},enableReinitialize:!0},d.createElement(Ug,{audiences:e.audiences}))}function Vg(e){var t=e.item,n=e.getItemAppLink,r=e.actions,o=e.pinState;return d.createElement("tr",null,d.createElement("td",null,d.createElement(Up,{appLink:n(t)},t.name)),o.isPinnable&&d.createElement("td",null,d.createElement(Hp,{selected:parseInt(t.id)===parseInt(o.currentPinnedVideo),onToggle:function(e){return o.onChange(e,t.id)},id:t.id})),r&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(km,{actions:r}))))}function zg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Bg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Hg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Jg(e){var t=e.items,n=e.memberType,r=e.classification,o=e.getItemAppLink,i=e.getActions,a=e.updatePinnedVideo,c=Hg(d.useState(!1),2),s=c[0],u=c[1],l=function(e,t){var n=e.pinnedVideoMasterId||null,r=zg(d.useState(n),2),o=r[0],i=r[1];return{currentPinnedVideo:o,onChange:function(e,t){i(e?t:null)},canSubmit:n!==o,isPinnable:t===vb.Videos}}(r,n);if(!t.length)return d.createElement("div",{className:"py-5"},"No ".concat(n," in this classification."));var f="".concat(fd(Tb.singularizeMemberType(n))," Name");return d.createElement(d.Fragment,null,d.createElement(Ws.Table,{responsive:!0},d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",null,f),l.isPinnable&&d.createElement("th",null,"Pinned"),hn(i)&&d.createElement("th",null))),d.createElement("tbody",null,t.map((function(e){return d.createElement(Vg,{item:e,key:e.id,getItemAppLink:o,actions:hn(i)&&i(e),pinState:l})})))),l.isPinnable&&d.createElement(lu,{showSpinner:s,onClick:function(){u(!0),a(l.currentPinnedVideo,(function(){return u(!1)}))},disabled:!l.canSubmit||s},"Save"))}function $g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Yg=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[e]}};function Gg(e){var t=_s(),n=au(t),r=null===e.id||void 0===e.id,o=!r||!(!t.values.parentIds||!t.values.parentIds.length),i=$g(d.useState(o),2),c=i[0],s=i[1];d.useEffect((function(){return s(o)}),[e.id,t.values.parentIds]),d.useEffect((function(){t.values.subjectIds.length&&!t.touched.subjectIds&&t.setFieldTouched("subjectIds",!0)}),[t.values.subjectIds]);var u=function(e){return t.setFieldValue("parentIds",Io(t.values.parentIds.map((function(e){return e.toString()})),e.id.toString()))},f=function(e){return t.setFieldValue("subjectIds",Io(t.values.subjectIds.map((function(e){return e.toString()})),e.id.toString()))},p=function(e){return"".concat(Zs(t.errors,t.touched,e)," h-auto py-2")};return d.createElement(Vs,null,d.createElement(ru,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this classification",autoFocus:!0}),d.createElement(ru,{as:"select",label:"Type",name:"type",id:"type",value:t.values.type},Rr.getEnumKeys(Ob).map((function(e){return d.createElement("option",{key:e,value:Ob[e]},e)}))),d.createElement(ru,{label:"Coming Soon",name:"comingSoon",id:"comingSoon",type:"checkbox",checked:t.values.comingSoon}),d.createElement(ru,{label:"Emphasize",name:"emphasize",id:"emphasize",type:"checkbox",checked:t.values.emphasize}),d.createElement(ru,{label:"Can Be Preferred",name:"canBePreferred",id:"canBePreferred",type:"checkbox",checked:t.values.canBePreferred}),d.createElement(ru,{name:"parentIds"},(function(){return d.createElement("div",{className:p("parentIds")},d.createElement(Ym,{label:"Parent Classification(s)",tree:e.classificationTree,selectedIds:t.values.parentIds,onSelect:u,collapse:c,noSelectionMessage:"No parent selected, this will be a root classification.",isNodeDisabled:(n=e.classificationTree,r=e.id,function(e){if(e.id===r)return!0;var t=md.find(n,r);return!!md.find(t,e.id)})}));var n,r})),d.createElement(ru,{name:"subjectIds"},(function(){return d.createElement("div",{className:p("subjectIds")},d.createElement(Ym,{label:"Mapped Subject(s)",tree:e.subjectTree,selectedIds:t.values.subjectIds,onSelect:f,collapse:!r,getSelectedItemAppLink:Yg}))})),d.createElement(wd,{imageType:Jp.Covers,fieldName:"cover",application:l.SUBJECTS,uploadAction:a.Subjects.UPLOAD_IMAGE}),d.createElement(wd,{imageType:Jp.Banners,fieldName:"banner",application:l.SUBJECTS,uploadAction:a.Subjects.UPLOAD_IMAGE}),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(lu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},r?"Create":"Save"),!r&&d.createElement(Ws.Button,{as:Up,variant:"danger",appLink:{application:l.SUBJECTS,action:a.Subjects.DELETE_CLASSIFICATION,args:[e.presentationId,e.id]}},"Delete")))}function Wg(e){return d.createElement(Ks,{initialValues:e.classification,validationSchema:Cb,onSubmit:e.saveClassification},d.createElement(Gg,{id:e.classification&&e.classification.id,presentationId:e.presentationId,classificationTree:e.classificationTree,subjectTree:e.subjectTree}))}var Zg=function(e){return function(t){if(!e)return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION;switch(e){case vb.Playlists:return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;case vb.Series:return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION_SERIES;case vb.Videos:return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION_VIDEOS}}};function Qg(e){var t=e.presentation,n=e.classificationId,r=e.memberType;return t?d.createElement(d.Fragment,null,d.createElement("h6",null,"Presentation: ".concat(!!t&&t.name)),d.createElement("div",{className:"py-2"},d.createElement(Rm,{tabs:Lb(t.id,n),isItemActive:Zg(r)}))):d.createElement(d.Fragment,null)}function Xg(e){var t=_s(),n=au(t),r=function(e){return t.setFieldValue("classificationIds",Io(t.values.classificationIds.map((function(e){return e.toString()})),e.id.toString()))},o="".concat(Zs(t.errors,t.touched,"classificationIds")," h-auto py-2");return d.createElement(Vs,null,d.createElement(ru,{name:"classificationIds"},(function(){return d.createElement("div",{className:o},d.createElement(Ym,{label:"Mapped Classification(s)",tree:e.classificationTree,selectedIds:t.values.classificationIds,onSelect:r,getSelectedItemAppLink:(n=e.presentationId,function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[n,e]}}),isNodeDisabled:e.isClassificationDisabled}));var n})),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(lu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Classifications")))}function eS(e){return d.createElement(Ks,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.classificationIds;return e.saveClassifications(r,n)},enableReinitialize:!0},d.createElement(Xg,{presentationId:e.presentationId,classificationTree:e.classificationTree,isClassificationDisabled:e.isClassificationDisabled}))}function tS(e){var t=null===e.id||void 0===e.id,n=_s(),r=au(n);return d.createElement(Vs,null,d.createElement(ru,{label:"Name",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this level",autoFocus:!0}),d.createElement(lu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"))}function nS(e){return d.createElement(Ks,{initialValues:e.level,validationSchema:wb,onSubmit:e.saveLevel},d.createElement(tS,{id:e.level&&e.level.id}))}function rS(e){var t=Tb.singularizeMemberType(e.memberType),n=_s(),r=au(n);return d.createElement(Vs,null,d.createElement(ru,{label:"Level(s)",as:"select",name:"levelIds",id:"level-ids",multiple:!0,size:e.levels.length,value:n.values.levelIds},e.levels.map((function(e){return d.createElement("option",{key:e.id,value:e.id},e.name)}))),d.createElement(ru,{label:"Automatically add to audiences*",name:"addToAudiences",id:"add-to-audiences",type:"checkbox",checked:n.values.addToAudiences}),d.createElement("p",null,d.createElement("em",null,"*If selected, when adding a ".concat(t," to a level, all of that level's")+" audiences across all presentations will also be added to.")),d.createElement("p",null,d.createElement("strong",null,"Note:")," When removing a ".concat(t," from a level, that level's audiences "),d.createElement("strong",null,"will not")," be automatically removed from."),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(lu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},"Save Levels")))}function oS(e){return d.createElement(Ks,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.levelIds,o=t.addToAudiences;return e.saveLevels(r,o,n)}},d.createElement(rS,{levels:e.levels,memberType:e.memberType}))}function iS(e){var t=e.values,n=t.name,r=t.description,o=e.id,i=e.isSubmitting,a=!o;return d.createElement(Vs,null,d.createElement(ru,{label:"Name",type:"text",name:"name",id:"name",value:n,placeholder:"Enter a name for this presentation",autoFocus:!0}),d.createElement(ru,{label:"Description",as:"textarea",name:"description",id:"description",value:r,placeholder:"Describe this presentation here"}),d.createElement(lu,{showSpinner:i,type:"submit"},a?"Create":"Save"))}function aS(e){var t=e.presentation,n=(t=void 0===t?{}:t).id,r=void 0===n?null:n,o=t.name,i=void 0===o?"":o,a=t.description,c=void 0===a?"":a,s=e.savePresentation;return d.createElement(Rs,{initialValues:{name:i,description:c},validationSchema:Ab,onSubmit:s},(function(e){return d.createElement(iS,Object.assign({id:r},e))}))}function cS(e){var t=e.presentations,n=e.currentPresentation,r=e.setCurrentPresentation,o=e.label,i=function(e){var n=function(e,t){return Oo(t.filter((function(t){return t.id.toString()===e.toString()})))}(e,t);r(n)};return d.useEffect((function(){t&&!n&&r(t[0])}),[t]),d.createElement(d.Fragment,null,!!n&&d.createElement(d.Fragment,null,d.createElement(Ws.Form.Label,null,o),d.createElement(Ws.Form.Control,{as:"select",value:n.id,onChange:function(e){return i(e.target.value)},className:"cursor-pointer"},t.map((function(e){return d.createElement("option",{value:e.id,key:e.id},e.name)})))))}function sS(e){return d.createElement(d.Fragment,null,d.createElement("h4",null,"".concat(fd(e.memberType))),d.createElement(Ws.Table,{responsive:!0},d.createElement("tbody",null,e.objects&&e.objects.map((function(t){return d.createElement("tr",{key:t.id},d.createElement("td",null,d.createElement(Up,{appLink:Tb.getMemberAppLink(e.memberType,t.id)},t.name)))})))),d.createElement(SS,{initialValues:{subjectIds:[],addToClassifications:!0},subjectTree:e.subjectTree,saveSubjects:e.onClickAddToSubject,memberType:e.memberType,saveBtnText:"Add to subject",subjectRequired:!0}))}function uS(e){return function(e){if(Array.isArray(e))return lS(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return lS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lS(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fS(e){var t=Tb.singularizeMemberType(e.memberType),n=[].concat(uS(e.objectClassifications),uS(e.objectSubjectClassifications)).map((function(e){return e.id}));return d.createElement(d.Fragment,null,d.createElement("div",{className:"border-bottom pb-3 mb-3"},d.createElement("h6",null,"Subjects"),d.createElement("p",null,"Select which subjects this ".concat(t," is mapped to.")),d.createElement(SS,{initialValues:{subjectIds:e.objectSubjects.map((function(e){return e.id}))},subjectTree:e.subjectTree,saveSubjects:e.saveSubjects,memberType:e.memberType,saveBtnText:"Save Subjects",allowMultiple:!0})),d.createElement("h6",null,"Classifications"),d.createElement("p",null,"Select a presentation to view its classifications and map them to this ".concat(t,".")),d.createElement("div",{className:"w-50 pb-3"},d.createElement(cS,{presentations:e.presentations,currentPresentation:e.currentPresentation,setCurrentPresentation:e.setCurrentPresentation})),e.currentPresentation&&e.classificationTree&&e.classificationTree.children.length?d.createElement(d.Fragment,null,d.createElement("p",null,"Only classifications which are mapped to one of the subjects selected above can be selected."),d.createElement(eS,{initialValues:{classificationIds:e.objectClassifications.map((function(e){return e.id}))},presentationId:e.currentPresentation.id,classificationTree:e.classificationTree,saveClassifications:e.saveClassifications,isClassificationDisabled:function(e){return!n.includes(e.id)}})):d.createElement("p",null,"This presentation has no classifications."))}function pS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return dS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}cS.defaultProps={label:"Presentation"};function mS(e){var t=!e.id,n=_s(),r=au(n),o=!t||!!n.values.parentId,i=pS(d.useState(o),2),c=i[0],s=i[1];d.useEffect((function(){return s(o)}),[e.id,n.values.parentId]);var u=function(e){var t=e.id===n.values.parentId?null:e.id;n.setFieldValue("parentId",t)},f="".concat(Zs(n.errors,n.touched,"parentId")," h-auto py-2");return d.createElement(Vs,null,d.createElement(ru,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this subject",autoFocus:!0}),d.createElement(ru,{name:"parentId"},(function(){return d.createElement("div",{className:f},d.createElement(Ym,{label:"Parent Subject",tree:e.subjectTree,selectedIds:[n.values.parentId],onSelect:u,collapse:c,noSelectionMessage:"No parent selected, this will be a root subject.",isNodeDisabled:(t=e.subjectTree,r=e.id,function(e){if(e.id===r)return!0;var n=md.find(t,r);return!!md.find(n,e.id)})}));var t,r})),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(lu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&d.createElement(Ws.Button,{as:Up,variant:"danger",appLink:{application:l.SUBJECTS,action:a.Subjects.DELETE_SUBJECT,args:[e.id]}},"Delete")))}function hS(e){return d.createElement(Ks,{initialValues:e.subject,validationSchema:Ib,onSubmit:e.saveSubject},d.createElement(mS,{id:e.subject&&e.subject.id,subjectTree:e.subjectTree}))}var yS=function(e){return function(t){return t.appLink.action===e}};function vS(e){var t=e.subjectId,n=e.activeAction;return d.createElement(d.Fragment,null,d.createElement(Ws.Alert,{variant:"danger"},"Warning: You are editing the backbone subjects."),d.createElement("div",{className:"py-2"},d.createElement(Rm,{tabs:_b(t),isItemActive:yS(n)})))}var bS=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[e]}};function gS(e){var t=_s(),n=au(t),r=function(n){var r=e.allowMultiple?Io(t.values.subjectIds.map((function(e){return e.toString()})),n.id.toString()):[n.id];t.setFieldValue("subjectIds",r)},o=Tb.singularizeMemberType(e.memberType),i="".concat(Zs(t.errors,t.touched,"subjectIds")," h-auto py-2");return d.createElement(Vs,null,d.createElement(ru,{name:"subjectIds"},(function(){return d.createElement("div",{className:i},d.createElement(Ym,{label:"Mapped Subject".concat(e.allowMultiple?"(s)":""),tree:e.subjectTree,selectedIds:t.values.subjectIds,onSelect:r,collapse:!!t.initialValues.subjectIds.length,getSelectedItemAppLink:bS}))})),d.createElement(ru,{label:"Automatically add to classifications*",name:"addToClassifications",id:"add-to-classifications",type:"checkbox",checked:t.values.addToClassifications}),d.createElement("p",null,d.createElement("em",null,"*If selected, when adding a ".concat(o," to a subject, all of that subject's")+" mapped classifications across all presentations will also be added to.")),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(lu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.saveBtnText)))}function SS(e){var t;return d.createElement(Ks,{initialValues:e.initialValues,validationSchema:(t=e.subjectRequired,Ys.object().shape({subjectIds:t?Ys.array().of(Ys.string()).min(1,"A subject is required").required("A subject is required"):Ys.array().of(Ys.string()),addToClassifications:Ys.boolean().default(!0)}).noUnknown()),onSubmit:function(t,n){var r=t.subjectIds,o=t.addToClassifications;return e.saveSubjects(r,o,n)}},d.createElement(gS,{subjectTree:e.subjectTree,memberType:e.memberType,allowMultiple:e.allowMultiple,saveBtnText:e.saveBtnText}))}gS.defaultProps={saveBtnText:"Save"};var ES=function(e){return d.createElement("div",{className:"border rounded p-2 mb-3"},d.createElement("h6",{className:"border-bottom pb-1"},e.presentation.name),e.classifications&&e.classifications.length?d.createElement("ul",{className:"list-unstyled mb-0"},e.classifications.map((function(t){return d.createElement("li",{key:t.id,className:"py-1"},d.createElement(Up,{appLink:(n=e.presentation.id,r=t.id,{application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[n,r]})},t.name));var n,r}))):d.createElement("p",null,d.createElement("em",null,"There are no classifications mapped to this subject in this presentation.")))},OS=function(e){return d.createElement(d.Fragment,null,!!e.presentations&&!!e.classificationDictionary&&e.presentations.map((function(t){return d.createElement(ES,{key:t.id,presentation:t,classifications:e.classificationDictionary[t.id]})})))},jS=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function CS(e){return d.createElement(d.Fragment,null,e.classifications.map((function(t){return d.createElement("th",{key:t.id},d.createElement("span",{className:"d-inline-block"},d.createElement(Hp,{selected:e.getIsClassificationSelected(t),onToggle:function(n){return e.onToggleClassification(t.id,n)}})),d.createElement(Up,{appLink:e.getClassificationAppLink(t.id)},function(e,t){return t?e.name:"Classification: ".concat(e.name)}(t,e.showClassificationSubHeader)))})))}function wS(e){var t=e.memberType,n=e.hasActions,r=e.classifications,o=jS(e,["memberType","hasActions","classifications"]),i="".concat(fd(Tb.singularizeMemberType(t))," Name"),a=!!r&&!!r.length,c=a&&r.length>1,s=a?2:1,u=Object.assign({classifications:r,showClassificationSubHeader:c},o);return d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",{rowSpan:s},i),a&&(c?d.createElement("th",{colSpan:r.length,className:"text-center"},"Classifications"):d.createElement(CS,Object.assign({},u))),n&&d.createElement("th",{rowSpan:s})),a&&c&&d.createElement("tr",null,d.createElement(CS,Object.assign({},u))))}function AS(e){var t=e.member,n=t.id,o=t.name,i=t.classifications,a=void 0===i?[]:i,c=e.getMemberAppLink,s=e.onToggleClassification,u=e.actions,l=hn(c)&&c(n);return a.length&&!hn(s)&&r.ErrorHelper.throw(new Xe("onToggleClassification must be passed to SubjectMemberItem")),d.createElement("tr",null,d.createElement("td",null,l?d.createElement(Up,{appLink:c(n)},o):o),!!a.length&&a.map((function(e){return d.createElement("td",{key:e.id},d.createElement(Hp,{selected:e.selected,onToggle:function(t){return s(e.id,t,n)}}))})),u&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(km,{actions:u}))))}var IS=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function TS(e,t){return function(n){var r=n[e],o=Zm(r);return!!o&&o===t.length}}function kS(e){var t=e.members,n=e.memberType,r=e.getActions,o=e.classifications,i=e.getClassificationAppLink,a=e.onToggleClassification,c=IS(e,["members","memberType","getActions","classifications","getClassificationAppLink","onToggleClassification"]);if(!t.length)return d.createElement("div",{className:"py-5"},"No ".concat(n," in this subject."));var s=hn(r),u={memberType:n,classifications:o,getClassificationAppLink:i,getIsClassificationSelected:TS(n,t),onToggleClassification:a,hasActions:s};return d.createElement(Ws.Table,{responsive:!0,bordered:!0},d.createElement(wS,Object.assign({},u)),d.createElement("tbody",null,t.map((function(e,t){return d.createElement(AS,Object.assign({key:t,member:e,actions:s&&r(e.id),onToggleClassification:a},c))}))))}function _S(e){var t=e.navItems,n=e.currentAppLink;return d.createElement(Ws.Container,null,d.createElement(Ws.Navbar,{className:"justify-content-between align-items-center"},d.createElement(Ws.Nav,null,!!t&&t.map((function(e,t){return d.createElement(Ws.Nav.Item,{key:t},d.createElement(Up,{appLink:e.appLink,className:"nav-link".concat(sd.isItemActive(e,n)?" text-primary":"")},e.label))})))))}function LS(e,t){d.useEffect((function(){e.presentations&&!e.currentPresentation&&Sb(t,"currentPresentation")(Oo(e.presentations))}),[e.presentations])}function xS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return PS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NS(e){var t=o.useBasicFetch(Vv(e.playlistId)),n=o.useBasicFetch(Zv),r=xS(d.useState({}),2),i=r[0],c=r[1],s=Iv(p.SUBJECT);!function(e,t,n){var r=function(e){return Sb(n,e)};lb([Tg.getObjectLevelsFetchOptions(e,vb.Playlists,r("playlistLevels"))],[e]),hb(Tg.getObjectAudiencesFetchOptions(e,vb.Playlists,r("playlistAudiences")),[e,t.playlistLevels]),lb([Tg.getPresentationsFetchOptions(r("presentations")),Tg.getLevelsFetchOptions(r("levels"))],[]),hb(!!t.currentPresentation&&Tg.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.playlistId,i,c),LS(i,c);var u=!!(i.presentations&&i.levels&&i.presentationAudiences&&i.playlistLevels&&i.playlistAudiences);return d.createElement(d.Fragment,null,!!n.data&&d.createElement(nb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST_AUDIENCES,currentUser:n.data}),d.createElement(_m,{object:t.data}),!!u&&d.createElement(Mg,{objectLevels:i.playlistLevels,objectAudiences:i.playlistAudiences,presentations:i.presentations,currentPresentation:i.currentPresentation,setCurrentPresentation:Sb(c,"currentPresentation"),levels:i.levels,presentationAudiences:i.presentationAudiences,memberType:vb.Playlists,saveLevels:function(t,n,r){return s.updateObjectLevels(e.playlistId,t,vb.Playlists,n,r,r)},saveAudiences:function(t,n){return s.updateObjectAudiences(e.playlistId,i.currentPresentation.id,t,vb.Playlists,n,n)}}))}function RS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||MS(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function DS(e){return function(e){if(Array.isArray(e))return US(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||MS(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function MS(e,t){if(e){if("string"==typeof e)return US(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?US(e,t):void 0}}function US(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function FS(e){var t=o.useBasicFetch(Vv(e.playlistId)),n=o.useBasicFetch(Zv),r=RS(d.useState({}),2),i=r[0],c=r[1],s=Iv(p.SUBJECT);!function(e,t,n){var r=function(e){return Sb(n,e)};lb([Tg.getSubjectTreeFetchOptions(r("subjectTree")),Tg.getPresentationsFetchOptions(r("presentations"))],[]),lb([Tg.getObjectSubjectsFetchOptions(e,vb.Playlists,r("playlistSubjects"))],[e]),hb(!!t.currentPresentation&&Tg.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),d.useEffect((function(){return r("subjectClassifications")([])}),[t.playlistSubjects]);var o=function(e,t){return[].concat(DS(t.subjectClassifications||[]),DS(e))},i=t.playlistSubjects&&t.playlistSubjects.map((function(e){return Tg.getSubjectClassificationFetchOptions(e.id,Sb(n,"subjectClassifications",o))}));lb(i,[t.playlistSubjects],!!i),hb(Tg.getObjectClassificationsFetchOptions(e,vb.Playlists,r("playlistClassifications")),[e,t.playlistSubjects])}(e.playlistId,i,c),LS(i,c);var u=!!(i.playlistSubjects&&i.subjectTree&&i.presentations&&i.classificationTree&&i.playlistClassifications&&i.subjectClassifications);return d.createElement(d.Fragment,null,!!n.data&&d.createElement(nb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST_SUBJECTS,currentUser:n.data}),d.createElement(_m,{object:t.data}),u&&d.createElement(fS,{objectSubjects:i.playlistSubjects,subjectTree:i.subjectTree,memberType:vb.Playlists,presentations:i.presentations,currentPresentation:i.currentPresentation,setCurrentPresentation:Sb(c,"currentPresentation"),objectClassifications:i.playlistClassifications,objectSubjectClassifications:i.subjectClassifications,classificationTree:i.classificationTree,saveSubjects:function(t,n,r){return s.updateObjectSubjects(e.playlistId,t,vb.Playlists,n,r,r)},saveClassifications:function(t,n){return s.updateObjectClassifications(e.playlistId,i.currentPresentation.id,t,vb.Playlists,n,n)}}))}var VS=function(e,t,n){if(t===n)return{reorderedItems:e,reorderRequest:null};var r=Co(e,t,n),o=n<e.length-1?r[n+1].id:null;return{reorderedItems:r,reorderRequest:{sourceMemberId:r[n].id,destinationMemberId:o}}};function zS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return BS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return BS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function BS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function HS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var JS=function(e){return{application:l.VIDEOS,action:a.Videos.EDIT_VIDEO,args:[e.id]}};function $S(e){var t,n,r,i,c,s,u=Object(bn.useDispatch)(),f=xv(),p=o.useBasicFetch(Vv(e.playlistId)),m=o.useBasicFetch(Jv(e.playlistId)),h=o.useBasicFetch(Zv),y=HS((n=null===(t=m.data)||void 0===t?void 0:t.data,r=zS(Object(d.useState)(),2),i=r[0],c=r[1],Object(d.useEffect)((function(){i&&(n.length!==i.length||function(e,t){var n=!0;if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r].id!==t[r].id){n=!1;break}return n}(n,i))&&c(null)}),[n]),[i,c]),2),v=y[0],b=y[1],g=v?{data:v,pagination:null}:m.data;return d.createElement(d.Fragment,null,!!h.data&&d.createElement(nb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST_VIDEOS,currentUser:h.data}),d.createElement(_m,{object:p.data}),!!g&&d.createElement(lh,{onSortEnd:function(t,n){if(t!==n){var r=VS(m.data.data,t,n),i=r.reorderRequest,a=r.reorderedItems;b(a);o.fetch(u,$v(e.playlistId,i,null,(function(){f.error("Failed to update playlist order."),b(null)})))}},videos:g,getVideoAppLink:JS,getVideoActions:(s=e.playlistId,function(e){return[{label:"Remove video",appLink:{application:l.PLAYLISTS,action:a.Playlists.REMOVE_VIDEO,args:[s.toString(),e.id.toString()]},className:"text-danger"}]}),emptyMessage:"There are no videos in this playlist."}))}function KS(){var e=Object(bn.useDispatch)(),t=xv(),n=o.useBasicFetch(Zv);return d.createElement(d.Fragment,null,!!n.data&&d.createElement(tb,{savePlaylist:function(i,c){o.fetch(e,Bv(i,n.data.id,(function(e){t.success("Successfully created playlist."),function(e){e&&e.id&&r.AppLinkHelper.trigger({application:l.PLAYLISTS,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]})}(e)}),(function(){t.error("Failed to create playlist.")}),c))}}))}var YS="rating,thumbnail,glance,herobanner",GS=function(e){return{url:"/api/master/v2/objects/".concat(e,"?query=").concat(YS),key:"videos:".concat(e)}},WS=function(e){var t=e.slice().sort();return{key:"videos:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},ZS=function(e){return{url:"/ajax/hostedlibraries/rightsline/programs/".concat(e),key:"rightsline:videos:".concat(e),normalizeOptions:{namespace:"rightsline"}}},QS=function(e,t,n,r,o){return{key:"videos:".concat(e),url:"/api/master/v2/objects/".concat(e),data:t,type:jr.PUT,success:n,error:r,always:o}};function XS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tE(e){var t=Object(bn.useDispatch)(),n=xv(),r=o.useBasicFetch(Vv(e.playlistId)),i=o.useBasicFetch(GS(e.videoId)),a=XS(d.useState(!1),2),c=a[0],s=a[1];var u=!!r.data&&!!i.data;return d.createElement(Zh,{title:"Remove Video",closePopup:e.closePopup,showLoadingSpinner:!u},!!u&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,i.data.name)," from ",d.createElement("strong",null,r.data.name),"?")),d.createElement(ty,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){s(!0),o.fetch(t,Kv(e.playlistId,e.videoId,(function(){n.success("Successfully removed video from playlist")}),(function(){n.error("Failed to remove video from playlist")}),e.closePopup))},buttonText:"Yes, remove video",isSpinnerButton:!0,showSpinner:c}]})))}function nE(e){return r.AppLinkHelper.trigger(function(e){return{application:l.PLAYLISTS,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]}}(e))}function rE(e){var t=e?{application:l.PLAYLISTS,action:a.Playlists.SEARCH_PLAYLISTS,params:{query:e}}:{application:l.PLAYLISTS,action:a.Playlists.PLAYLISTS};r.AppLinkHelper.trigger(t)}function oE(e){return d.createElement("div",{className:"pb-3 w-50"},d.createElement(Mp,{initialQuery:e.query,placeholder:"Search for a playlist",onSuggestionSelected:nE,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/playlists/instant/raw","?query=").concat(e)},activationLength:2,onSubmit:rE}))}var iE=l.PLAYLISTS,aE=function(e){return{application:iE,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]}};function cE(e){var t=o.useBasicFetch(Uv(e.cursor));return d.createElement(d.Fragment,null,d.createElement(oE,null),d.createElement(Em,{collection:t&&t.data,collectionAppLink:{application:iE,action:a.Playlists.PLAYLISTS},newObjectAppLink:{application:iE,action:a.Playlists.NEW_PLAYLIST},getObjectAppLink:aE,objectName:"Playlist"}))}var sE=l.PLAYLISTS,uE=function(e){return{application:sE,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]}};function lE(e){var t=o.useBasicFetch(Fv(e.query,e.cursor));return d.createElement(d.Fragment,null,d.createElement(oE,{query:e.query}),!!t.data&&(t.data.data.length?d.createElement(Em,{collection:t.data,collectionAppLink:{application:sE,action:a.Playlists.SEARCH_PLAYLISTS,params:{query:e.query}},newObjectAppLink:{application:sE,action:a.Playlists.NEW_PLAYLIST},getObjectAppLink:uE,objectName:"Playlist"}):d.createElement("p",null,"No playlists found, please try a different search query.")))}function fE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var dE=function(e,t,n){return[{variant:"link",onClick:t,buttonText:"Cancel"},{variant:"danger",onClick:e,buttonText:"Yes, delete this audience",isSpinnerButton:!0,showSpinner:n}]};function mE(e){var t=e.id,n=e.routeToOnDelete,o=e.closePopup,i=fE(d.useState(),2),a=i[0],c=i[1],s=fE(d.useState(!1),2),u=s[0],l=s[1],f=Iv(p.SUBJECT);hb(Tg.getAudienceFetchOptions(t,c),[t]);return d.createElement(Zh,{title:"Delete Audience",closePopup:o,showLoadingSpinner:!a},!!a&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,a.name),"?")),d.createElement(ty,{buttons:dE((function(){l(!0);f.deleteAudience(t,(function(){o(),n&&r.AppLinkHelper.trigger(n)}),o)}),o,u)})))}function hE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var vE=function(e){return{application:l.SUBJECTS,action:a.Subjects.PRESENTATION_AUDIENCES,args:[e]}};function bE(e){var t=e.presentationId,n=e.audienceId,r=hE(d.useState(),2),o=r[0],i=r[1],a=hE(d.useState(),2),c=a[0],s=a[1],u=hE(d.useState(),2),l=u[0],f=u[1],m=Iv(p.SUBJECT);hb(Tg.getAudienceFetchOptions(n,i),[n]),hb(Tg.getLevelsFetchOptions(s),[]),hb(Tg.getPresentationFetchOptions(t,f),[t]);return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3"},d.createElement(Fp,{appLink:vE(t),backToName:"audiences"})),!!l&&d.createElement("h6",null,"Presentation: ".concat(l.name)),!!o&&!!c&&d.createElement(Rg,{audience:o,levels:c,saveAudience:function(e,r){return m.updateAudience(n,Object.assign(Object.assign({},e),{presentationId:t}),r,r)},presentationId:t}))}function gE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return SE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return SE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function SE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var EE=function(e){return function(t){return{application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[e,t.masterId]}}},OE=function(e){return{application:l.SUBJECTS,action:a.Subjects.NEW_AUDIENCE,args:[e]}},jE={application:l.SUBJECTS,action:a.Subjects.AUDIENCES};function CE(e){var t=e.presentationId,n=gE(d.useState(),2),r=n[0],o=n[1];return hb(Tg.getAudiencesFetchOptions(t,o),[]),d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3"},d.createElement(Fp,{appLink:jE,backToName:"presentations"})),d.createElement("div",{className:"d-flex justify-content-between mb-2"},d.createElement("h5",{className:"d-inline-block m-0"},"Select an audience to edit:"),d.createElement(Up,{appLink:OE(t),className:"d-block"},d.createElement(_p,{svgName:Ap.Plus,size:kp.Small}),d.createElement("span",null,"New Audience"))),d.createElement(Pm,{objects:r,getAppLink:EE(e.presentationId),emptyMessage:"There are no audiences in this presentation yet. Click '+ New Audience' to create one."}))}function wE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return AE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return AE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function AE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var IE=function(e){return{application:l.SUBJECTS,action:a.Subjects.PRESENTATION_AUDIENCES,args:[e]}};function TE(e){var t=e.presentationId,n=wE(d.useState(),2),o=n[0],i=n[1],c=wE(d.useState(),2),s=c[0],u=c[1],f=Iv(p.SUBJECT);hb(Tg.getLevelsFetchOptions(i),[]),hb(Tg.getPresentationFetchOptions(t,u),[t]);return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-2"},d.createElement(Fp,{appLink:IE(t),backToName:"audiences"})),!!s&&d.createElement("h6",null,"Presentation: ".concat(s.name)),!!o&&d.createElement(Rg,{levels:o,presentationId:t,saveAudience:function(e,n){return f.createAudience(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[e,n.masterId]})}}(t,n),n)}}))}function kE(e){return{application:l.SUBJECTS,action:a.Subjects.NEW_CLASSIFICATION,args:[e]}}function _E(e){return[{label:"Add child",getAppLink:function(t){return Object.assign(Object.assign({},kE(e)),{args:[e],params:{parentId:t.id}})}},{label:"Delete classification",getAppLink:function(t){return{application:l.SUBJECTS,action:a.Subjects.DELETE_CLASSIFICATION,args:[e,t.id]}},className:"text-danger"}]}var LE=n(133),xE=n.n(LE);function PE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return NE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return NE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function NE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function RE(e){var t=e.presentationId,n=e.selectedClassificationId,r=PE(d.useState(),2),o=r[0],i=r[1],c=PE(d.useState(),2),s=c[0],u=c[1];return function(e,t,n){lb([Tg.getClassificationTreeFetchOptions(e,t),Tg.getPresentationFetchOptions(e,n)],[e])}(t,i,u),d.createElement("div",{className:"".concat(xE.a.navContainer," h-auto pr-2 border-right")},!!s&&d.createElement("h6",{className:"border-bottom pb-2"},"Classifications (".concat(s.name,")")),d.createElement(Up,{appLink:kE(t),className:"d-inline-block pb-2"},d.createElement(_p,{svgName:Ap.Plus,size:kp.Small}),d.createElement("span",null,"New Classification")),!!o&&d.createElement("div",{className:"border-top pt-1"},d.createElement(Hm,{tree:o,getAppLink:function(e){return function(e,t){return{application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[e,t.id]}}(t,e)},selectedIds:[n],actions:_E(t)})))}function DE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ME(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ME(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ME(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function UE(e){var t=e.classificationId,n=e.routeToOnDelete,o=e.closePopup,i=DE(d.useState(),2),a=i[0],c=i[1],s=DE(d.useState(!1),2),u=s[0],l=s[1];hb(Tg.getClassificationFetchOptions(t,c),[]);var f=Iv(p.SUBJECT),m=[{variant:"link",onClick:o,buttonText:"Cancel"},{variant:"danger",onClick:function(){l(!0);f.deleteClassification(t,(function(){o(),n&&r.AppLinkHelper.trigger(n)}),o)},buttonText:"Yes, delete this classification",isSpinnerButton:!0,showSpinner:u}];return d.createElement(Zh,{title:"Delete Classification",closePopup:o,showLoadingSpinner:!a},!!a&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,a.name),"?")),d.createElement(ty,{buttons:m})))}function FE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return VE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function VE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zE(e){var t=e.presentationId,n=e.classificationId,r=FE(d.useState(),2),o=r[0],i=r[1],a=FE(d.useState(),2),c=a[0],s=a[1],u=FE(d.useState(),2),l=u[0],f=u[1],m=FE(d.useState(),2),h=m[0],y=m[1],v=Iv(p.SUBJECT),b=Tg.getClassificationFetchOptions(n,i),g=Tg.getPresentationFetchOptions(t,s),S=Tg.getClassificationTreeFetchOptions(t,f);hb(Tg.getSubjectTreeFetchOptions(y),[]),hb(b,[n]),lb([g,S],[t]);return d.createElement("div",null,d.createElement(Qg,{presentation:c,classificationId:n}),!!o&&!!l&&!!h&&d.createElement(Wg,{classification:o,presentationId:t,subjectTree:h,classificationTree:l,saveClassification:function(e,t){return v.updateClassification(n,e,t,t)}}))}function BE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return HE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function HE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qE(e){var t=e.presentationId,n=e.classificationId,r=e.memberType,o=BE(d.useState(),2),i=o[0],a=o[1],c=BE(d.useState(),2),s=c[0],u=c[1],l=BE(d.useState(),2),f=l[0],m=l[1];hb(Tg.getPresentationFetchOptions(t,a),[]),hb(Tg.getClassificationFetchOptions(n,u),[n]),hb(Tg.getClassificationMembersFetchOptions(n,r,m),[n,r]);var h=Iv(p.SUBJECT),y={items:f&&f.data,memberType:r,classification:s,updatePinnedVideo:function(e,t){var r=Object.assign(Object.assign({},s),{pinnedVideoMasterId:e});h.updateClassification(n,r,t)},getItemAppLink:function(e){return Tb.getMemberAppLink(r,e.id)},getActions:function(e){return Tb.getMemberActions(n,yb.Classification,r,e.id)}},v={presentation:i,classificationId:n},b=ud(y);return d.createElement(d.Fragment,null,d.createElement(Qg,Object.assign({},v,{memberType:r})),b&&d.createElement(Jg,Object.assign({},y)))}function JE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return $E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $E(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function KE(e){var t=e.presentationId,n=e.parentId,o=JE(d.useState(),2),i=o[0],c=o[1],s=JE(d.useState(),2),u=s[0],f=s[1],m=Iv(p.SUBJECT),h=Tg.getClassificationTreeFetchOptions(t,c);hb(Tg.getSubjectTreeFetchOptions(f),[]),hb(h,[t]);return d.createElement("div",null,d.createElement("h4",{className:"py-2"},"Create New Classification"),!!u&&!!i&&d.createElement(Wg,{classification:n?{parentIds:[n]}:{},presentationId:t,subjectTree:u,classificationTree:i,saveClassification:function(e,n){return m.createClassification(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),n&&n.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]})}}(t,n),n)}}))}var YE=function(e){return{key:"series:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=thumbnail,tallPoster,banner,rating")}},GE=function(e){var t=e.slice().sort();return{key:"series:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},WE=function(e,t,n,r){return{url:"/api/master/v2/series",key:"series",data:e,type:jr.POST,success:t,error:n,always:r}},ZE=function(e,t,n,r,o){return{url:"/api/master/v2/objects/".concat(e),key:"update:series:".concat(e),data:t,type:jr.PUT,success:n,error:r,always:o}};function QE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return XE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return XE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function XE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eO(e){var t=QE(d.useState(),2),n=t[0],r=t[1],i=QE(d.useState(!1),2),a=i[0],c=i[1],s=o.useBasicFetch(function(e,t){switch(e){case vb.Playlists:return Vv(t);case vb.Series:return YE(t);case vb.Videos:return GS(t)}}(e.memberType,e.memberId)),u=Iv(p.SUBJECT);hb(Tg.getClassificationFetchOptions(e.classificationId,r),[e.classificationId]);var l=!!n&&!!s.data,f="Remove ".concat(fd(Tb.singularizeMemberType(e.memberType)));return d.createElement(Zh,{title:f,closePopup:e.closePopup,showLoadingSpinner:!l},l&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,s.data.name)," from ",d.createElement("strong",null,n.name),"?"),d.createElement("p",null,"This will not remove it from the backbone subject.")),d.createElement(ty,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),u.removeObjectsFromClassification(e.classificationId,[e.memberId],e.memberType,null,null,e.closePopup,e.closePopup),n.pinnedVideoMasterId===e.memberId&&u.updateClassification(e.classificationId,Object.assign(Object.assign({},n),{pinnedVideoMasterId:null}))},buttonText:"Yes, remove this ".concat(Tb.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function tO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rO(e){var t=e.id,n=tO(d.useState(),2),r=n[0],o=n[1],i=Iv(p.SUBJECT);hb(Tg.getLevelFetchOptions(t,o),[t]);return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Edit Level"),!!r&&d.createElement(nS,{level:r,saveLevel:function(e,n){return i.updateLevel(t,e,n,n)}}))}function oO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return iO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var aO=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[e.id]}},cO={application:l.SUBJECTS,action:a.Subjects.NEW_LEVEL};function sO(){var e=oO(d.useState(),2),t=e[0],n=e[1];return hb(Tg.getLevelsFetchOptions(n),[]),d.createElement("div",null,d.createElement("div",{className:"d-flex justify-content-between mb-2"},d.createElement("h5",{className:"d-inline-block m-0"},"Select a level to edit:"),d.createElement(Up,{appLink:cO,className:"d-block"},d.createElement(_p,{svgName:Ap.Plus,size:kp.Small}),d.createElement("span",null,"New Level"))),d.createElement(Pm,{objects:t,getAppLink:aO}))}function uO(){var e=Iv(p.SUBJECT);return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Create New Level"),d.createElement(nS,{saveLevel:function(t,n){return e.createLevel(t,function(e){return function(t){e(),t&&t.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[t.id]})}}(n),n)}}))}function lO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pO(e){var t=e.id,n=lO(d.useState(),2),r=n[0],o=n[1],i=Iv(p.SUBJECT);hb(Tg.getPresentationFetchOptions(t,o),[t]);var a={presentation:r,savePresentation:function(e,n){var r=n.setSubmitting;return i.updatePresentation(t,e,(function(){return r(!1)}),(function(){return r(!1)}))}},c=ud(a);return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Edit Presentation"),!!c&&d.createElement(aS,Object.assign({},a)))}function dO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return mO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var hO=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_PRESENTATION,args:[e.id]}},yO={application:l.SUBJECTS,action:a.Subjects.NEW_PRESENTATION};function vO(){var e=dO(d.useState(),2),t=e[0],n=e[1];return hb(Tg.getPresentationsFetchOptions(n),[]),d.createElement("div",null,d.createElement("div",{className:"d-flex justify-content-between mb-2"},d.createElement("h5",{className:"d-inline-block m-0"},"Select a presentation to edit:"),d.createElement(Up,{appLink:yO,className:"d-block"},d.createElement(_p,{svgName:Ap.Plus,size:kp.Small}),d.createElement("span",null,"New Presentation"))),d.createElement(Pm,{objects:t,getAppLink:hO}))}function bO(){var e=Iv(p.SUBJECT);return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Create New Presentation"),d.createElement(aS,{savePresentation:function(t,n){var o=n.setSubmitting;e.createPresentation(t,(function(e){return function(e,t){t(!1),e&&e.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_PRESENTATION,args:[e.id]})}(e,o)}),(function(){return o(!1)}))}}))}function gO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return SO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return SO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function SO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function EO(e){var t=e.objectType,n=e.getAppLink,r=gO(d.useState(),2),o=r[0],i=r[1];return hb(Tg.getPresentationsFetchOptions(i),[]),d.createElement("div",null,d.createElement("h5",null,d.createElement(Cu,{namespace:"subjects.selectPresentation",phrase:"heading",options:{objectType:t}})),d.createElement(Pm,{objects:o,getAppLink:n}))}function OO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return jO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function CO(e){var t=e.title,n=e.onClickConfirm,r=e.confirmButtonText,o=e.cancelButtonText,i=e.closePopup,a=OO(d.useState(!1),2),c=a[0],s=a[1],u=[{variant:"link",onClick:i,buttonText:o},{variant:"primary",onClick:function(){s(!0),n()},buttonText:r,isSpinnerButton:!0,showSpinner:c}];return d.createElement(Zh,{title:t,closePopup:i},d.createElement(d.Fragment,null,e.children,d.createElement(ty,{buttons:u})))}function wO(e,t){return Sb(e,t)}function AO(e,t,n,o,i){var c=o.selectedSubject,s=function(){return wO(i,"showConfirmationPopup")(!1)};t.addObjectsToSubject(c.id,e.map((function(e){return e.id})),n.memberType,o.addToClassifications,(function(){s(),r.AppLinkHelper.trigger(function(e,t){var n={application:l.SUBJECTS,args:[e]};switch(t){case vb.Playlists:return Object.assign(Object.assign({},n),{action:a.Subjects.EDIT_SUBJECT_PLAYLISTS});case vb.Series:return Object.assign(Object.assign({},n),{action:a.Subjects.EDIT_SUBJECT_SERIES});case vb.Videos:return Object.assign(Object.assign({},n),{action:a.Subjects.EDIT_SUBJECT_VIDEOS})}}(c.id,n.memberType))}),s)}function IO(e,t,n){if(t&&n){var r=1===t.length?"this ".concat(Tb.singularizeMemberType(e)):"these ".concat(e);return"Add ".concat(r," to ").concat(n.name)}}function TO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return kO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _O(e,t){return function(n,r,o){o(),wO(t,"selectedSubject")(md.find(e.subjectTree,Oo(n))),wO(t,"addToClassifications")(r),wO(t,"showConfirmationPopup")(!0)}}function LO(e){var t=TO(d.useState({}),2),n=t[0],r=t[1],i=o.useBasicFetch(function(e,t){switch(e){case vb.Playlists:return zv(t);case vb.Series:return GE(t);case vb.Videos:return WS(t)}}(e.memberType,e.objectIds)),a=Iv(p.SUBJECT);!function(e,t){e.memberType,e.objectIds,hb(Tg.getSubjectTreeFetchOptions(wO(t,"subjectTree")),[])}(e,r);var c;return d.createElement(d.Fragment,null,!!i.data&&!!n.subjectTree&&d.createElement(sS,{memberType:e.memberType,objects:i.data,subjectTree:n.subjectTree,onClickAddToSubject:_O(n,r)}),n.showConfirmationPopup&&d.createElement(CO,{title:IO(e.memberType,i.data,n.selectedSubject),onClickConfirm:function(){return AO(i.data,a,e,n,r)},closePopup:function(){return e=!1,wO(r,"showConfirmationPopup")(e);var e}},d.createElement("p",null,"The following ".concat(e.memberType," will be added to "),d.createElement("strong",null,n.selectedSubject.name),n.addToClassifications?" and its mapped classifications:":":"),d.createElement("ul",null,i.data.map((function(e){return d.createElement("li",{key:e.id},e.name)}))),!n.addToClassifications&&d.createElement("p",null,"".concat(1===i.data.length?"It":"They"," will not be added to its mapped classifications.")),d.createElement("p",null,"".concat((c=e.memberType,fd(Tb.singularizeMemberType(c)))," to classification mappings can be managed from the "),d.createElement("strong",null,"Edit Subject ".concat(fd(e.memberType)," ")),"page.")))}function xO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return PO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NO(e){var t=e.subjectId,n=e.routeToOnDelete,o=e.closePopup,i=xO(d.useState(),2),a=i[0],c=i[1],s=xO(d.useState(!1),2),u=s[0],l=s[1];hb(Tg.getSubjectFetchOptions(t,c),[]);var f=Iv(p.SUBJECT),m=[{variant:"link",onClick:o,buttonText:"Cancel"},{variant:"danger",onClick:function(){l(!0);f.deleteSubject(t,(function(){o(),n&&r.AppLinkHelper.trigger(n)}),o)},buttonText:"Yes, delete this subject",isSpinnerButton:!0,showSpinner:u}];return d.createElement(Zh,{title:"Delete Subject",closePopup:o,showLoadingSpinner:!a},!!a&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,a.name),"?"),d.createElement("p",null,"Subjects that have mapped classifications cannot be deleted.")),d.createElement(ty,{buttons:m})))}function RO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return DO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function DO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function MO(e){var t=e.subjectId,n=RO(d.useState(),2),r=n[0],o=n[1],i=RO(d.useState(),2),c=i[0],s=i[1],u=Iv(p.SUBJECT),l=Tg.getSubjectFetchOptions(t,o);hb(Tg.getSubjectTreeFetchOptions(s),[]),hb(l,[t]);return d.createElement(d.Fragment,null,d.createElement(vS,{subjectId:t,activeAction:a.Subjects.EDIT_SUBJECT}),!!r&&!!c&&d.createElement(hS,{subject:r,subjectTree:c,saveSubject:function(e,n){return u.updateSubject(t,e,n,n)}}))}function UO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return FO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return FO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function FO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}CO.defaultProps={confirmButtonText:"Confirm",cancelButtonText:"Cancel"};var VO=d.createContext(void 0);function zO(e){var t=e.children,n=UO(d.useState(),2),r=n[0],o=n[1];return d.createElement(VO.Provider,{value:[r,o]},t)}var BO=function(e){var t=e.children;return d.createElement(zO,null,d.createElement(Sd,null,t))};function HO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function JO(e,t){return Sb(e,t)}function $O(e){switch(e){case vb.Playlists:return a.Subjects.EDIT_SUBJECT_PLAYLISTS;case vb.Series:return a.Subjects.EDIT_SUBJECT_SERIES;case vb.Videos:return a.Subjects.EDIT_SUBJECT_VIDEOS}}function KO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return YO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return YO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function YO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function GO(e){var t=KO(d.useState({}),2),n=t[0],r=t[1],i=n.presentations,c=n.classifications,s=n.memberIds,u=n.membersWithClassifications,f=o.useBasicFetch(Array.isArray(s)&&function(e,t){switch(e){case vb.Playlists:return zv(t);case vb.Series:return GE(t);case vb.Videos:return WS(t)}}(e.memberType,s)),m=KO(d.useContext(VO),2),h=m[0],y=m[1],v=Iv(p.SUBJECT);!function(e,t,n){var r=e.subjectId,o=e.memberType,i=HO(d.useContext(VO),1)[0];hb(Tg.getPresentationsFetchOptions(JO(n,"presentations")),[]),hb(Tg.getSubjectMemberIdsFetchOptions(r,o,JO(n,"memberIds")),[r,o]),hb(!!i&&Tg.getSubjectClassificationFetchOptions(r,JO(n,"classifications"),i.id,o),[r,o,i],!!i)}(e,0,r),function(e,t,n,r){var o=n.classifications;d.useEffect((function(){JO(r,"membersWithClassifications")(function(e,t,n){if(!t||!n)return;return t.map((function(t){return{id:t.id,name:t.name,classifications:n.map((function(n){return{id:n.id,selected:(r=t,o=n,!!o[e]&&!!o[e].data.filter((function(e){return e.id===r.id})).length)};var r,o}))}}))}(t.memberType,e,o))}),[e,o])}(f.data,e,n,r);var b,g,S=!!h&&!!c;return d.createElement(d.Fragment,null,d.createElement(vS,{subjectId:e.subjectId,activeAction:$O(e.memberType)}),d.createElement(Ws.Alert,{variant:"info",className:"m-0"},"Select which ".concat(e.memberType," are shown for each classification in this subject.")+" Change the selected presentation to view different classifications."),d.createElement("div",{className:"w-50 py-2"},!!i&&d.createElement(cS,{presentations:i,currentPresentation:h,setCurrentPresentation:y})),S&&d.createElement(kS,{members:u||[],memberType:e.memberType,getMemberAppLink:function(t){return Tb.getMemberAppLink(e.memberType,t)},getActions:function(t){return Tb.getMemberActions(e.subjectId,yb.Subject,e.memberType,t)},classifications:c,getClassificationAppLink:h&&(b=e.memberType,g=h.id,function(e){var t,n=l.SUBJECTS,r=[g,e];switch(b){case vb.Playlists:t=a.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;break;case vb.Series:t=a.Subjects.EDIT_CLASSIFICATION_SERIES;break;case vb.Videos:t=a.Subjects.EDIT_CLASSIFICATION_VIDEOS}return{application:n,action:t,args:r}}),onToggleClassification:function(t,n,r){return function(e,t,n,r,o,i,a){(a?e.addObjectsToClassification.bind(e):e.removeObjectsFromClassification.bind(e))(i,n,t,r,o)}(v,e.memberType,r?[r]:s,e.subjectId,h&&h.id,t,n)}}))}function WO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ZO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ZO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ZO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function QO(e){var t=e.parentId,n=WO(d.useState(),2),o=n[0],i=n[1],c=Iv(p.SUBJECT);hb(Tg.getSubjectTreeFetchOptions(i),[]);var s={application:l.SUBJECTS,action:a.Subjects.PRESENTATIONS};return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-2 border-bottom"},d.createElement(Fp,{backToName:"Presentations",appLink:s})),d.createElement("h4",{className:"py-2"},"Create New Subject"),!!o&&d.createElement(hS,{subject:{parentId:t},subjectTree:o,saveSubject:function(e,t){return c.createSubject(e,function(e){return function(t){e(),t&&t.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[t.id]})}}(t),t)}}))}function XO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ej(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ej(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ej(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tj(e){var t=XO(d.useState(),2),n=t[0],r=t[1],i=XO(d.useState(!1),2),a=i[0],c=i[1],s=o.useBasicFetch(function(e,t){switch(e){case vb.Playlists:return Vv(t);case vb.Series:return YE(t);case vb.Videos:return GS(t)}}(e.memberType,e.memberId)),u=Iv(p.SUBJECT);hb(Tg.getSubjectFetchOptions(e.subjectId,r),[e.subjectId]);var l=!!n&&!!s.data,f="Remove ".concat(fd(Tb.singularizeMemberType(e.memberType)));return d.createElement(Zh,{title:f,closePopup:e.closePopup,showLoadingSpinner:!l},l&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,s.data.name)," from ",d.createElement("strong",null,n.name),"?"),d.createElement("p",null,"Please ensure that it is not in any classifications before removing.")),d.createElement(ty,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),u.removeObjectsFromSubject(e.subjectId,[e.memberId],e.memberType,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(Tb.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function nj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return rj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rj(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oj(e){var t=e.subjectId,n=nj(d.useState({}),2),r=n[0];return function(e,t){var n=function(e){return Sb(t,e)};hb(Tg.getSubjectClassificationFetchOptions(e,n("classifications")),[e]),hb(Tg.getPresentationsFetchOptions(n("presentations")),[])}(t,n[1]),d.createElement(d.Fragment,null,d.createElement(vS,{subjectId:t,activeAction:a.Subjects.SUBJECT_CLASSIFICATIONS}),d.createElement(OS,{presentations:r.presentations,classificationDictionary:wo(r.classifications,"presentationId")}))}var ij=n(134),aj=n.n(ij);function cj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sj(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uj(e){var t=e.selectedSubjectId,n=cj(d.useState(),2),r=n[0],o=n[1];hb(Tg.getSubjectTreeFetchOptions(o),[]);var i=d.useCallback((function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[e.id]}}),[]),c={application:l.SUBJECTS,action:a.Subjects.NEW_SUBJECT},s=[{label:"Add child",getAppLink:function(e){return Object.assign(Object.assign({},c),{params:{parentId:e.id}})}},{label:"Delete subject",getAppLink:function(e){return{application:l.SUBJECTS,action:a.Subjects.DELETE_SUBJECT,args:[e.id]}},className:"text-danger"}];return d.createElement("div",{className:"".concat(aj.a.navContainer," h-auto pr-2 border-right")},d.createElement("h5",{className:"border-bottom pb-2"},"Subjects"),d.createElement(Up,{appLink:c,className:"d-inline-block pb-2"},d.createElement(_p,{svgName:Ap.Plus,size:kp.Small}),d.createElement("span",null,"New Subject")),!!r&&d.createElement("div",{className:"border-top pt-1"},d.createElement(Hm,{tree:r,getAppLink:i,selectedIds:[t],actions:s})))}function lj(e){var t=e.currentAppLink;return d.createElement(_S,{navItems:kb(),currentAppLink:t})}function fj(e){return(fj="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 pj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dj(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 mj(e,t,n){return t&&dj(e.prototype,t),n&&dj(e,n),e}function hj(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&&yj(e,t)}function yj(e,t){return(yj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vj(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=gj(e);if(t){var o=gj(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return bj(this,n)}}function bj(e,t){return!t||"object"!==fj(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 gj(e){return(gj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Sj=function(e){hj(n,e);var t=vj(n);function n(){return pj(this,n),t.apply(this,arguments)}return mj(n,[{key:"channelName",get:function(){return l.PLAYLISTS}},{key:"appRoutes",get:function(){return{"manage/playlists(/)":"index","manage/playlists/new(/)":"newPlaylist","manage/playlists/search(/)":"searchPlaylists","manage/playlists/:id(/)":"editPlaylist","manage/playlists/:id/videos(/)":"editPlaylistVideos","manage/playlists/:id/subjects(/)":"editPlaylistSubjects","manage/playlists/:id/audiences(/)":"editPlaylistAudiences"}}},{key:"appLinks",get:function(){return["deletePlaylist","removeVideo","uploadImage","removeFromSubject"]}}]),n}(r.AppRouter),Ej=function(e){hj(n,e);var t=vj(n);function n(){return pj(this,n),t.apply(this,arguments)}return mj(n,[{key:"initialize",value:function(){var e=this;Rr.values(p).forEach((function(t){return Av.getInstance(t,e)}))}},{key:"index",value:function(e){var t;this.layout.showChildView(kn,d.createElement(cE,{cursor:null===(t=e)||void 0===t?void 0:t.cursor}))}},{key:"searchPlaylists",value:function(e){var t,n;this.layout.showChildView(kn,d.createElement(lE,{query:null===(t=e)||void 0===t?void 0:t.query,cursor:null===(n=e)||void 0===n?void 0:n.cursor}))}},{key:"newPlaylist",value:function(){this.layout.showChildView(kn,d.createElement(KS,null))}},{key:"editPlaylist",value:function(e){this.layout.showChildView(kn,d.createElement(rb,{key:e,playlistId:e}))}},{key:"editPlaylistVideos",value:function(e){this.layout.showChildView(kn,d.createElement($S,{key:e,playlistId:e}))}},{key:"editPlaylistSubjects",value:function(e){this.layout.showChildView(kn,d.createElement(FS,{key:e,playlistId:e}))}},{key:"editPlaylistAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(NS,{key:e,playlistId:e}))}},{key:"deletePlaylist",value:function(e){var t=Object.assign({playlistId:e},this.getPopupProps());this.layout.showChildView(_n,d.createElement(Wv,Object.assign({},t)))}},{key:"removeVideo",value:function(e,t){var n=Object.assign({playlistId:e,videoId:t},this.getPopupProps());this.layout.showChildView(_n,d.createElement(tE,Object.assign({},n)))}},{key:"removeFromSubject",value:function(e,t){var n=Object.assign({subjectId:t,memberId:e,memberType:vb.Playlists},this.getPopupProps());this.layout.showChildView(_n,d.createElement(tj,Object.assign({},n)))}},{key:"uploadImage",value:function(e){var t=Object.assign({imageType:e},this.getPopupProps());this.layout.showChildView(_n,d.createElement(_v,Object.assign({},t)))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(Ln,d.createElement(Gh,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Playlists Application"}},{key:"channelName",get:function(){return l.PLAYLISTS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:Lv}}}}],[{key:"router",get:function(){return Sj}}]),n}(r.Application),Oj=function(e){var t=e.children;return d.createElement(Sd,null,t)},jj=function(){return"/api/domain/v2/me/ratings"},Cj="ratings",wj=function(){return{url:jj(),key:Cj}},Aj=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Ys.string().trim().max(350,"Description is too long").default(""),rating:Ys.object().shape({id:Ys.string()}).default({}).noUnknown(),tallPoster:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown(),banner:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown()}).noUnknown(),Ij=function(e,t){var n=l.SERIES,r=a.Series,o=[{label:"Edit Series Details",appLink:{application:n,action:r.EDIT_SERIES,args:[t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_SERIES_VIDEOS,args:[t]}}];return Mv(e)&&o.push.apply(o,[{label:"Subjects",appLink:{application:n,action:r.EDIT_SERIES_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_SERIES_AUDIENCES,args:[t]}}]),o};function Tj(e){var t=_s(),n=au(t);return d.createElement(Vs,null,d.createElement(ru,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this series",autoFocus:!0}),d.createElement(ru,{label:"Description",as:"textarea",name:"description",id:"description",maxLength:350,value:t.values.description,placeholder:"Describe this series here",showCharacterCounter:!0}),d.createElement(Nm,{ratings:e.ratings}),d.createElement(wd,{imageType:Jp.TallPosters,fieldName:"tallPoster",application:l.SERIES,uploadAction:a.Series.UPLOAD_IMAGE}),d.createElement(wd,{imageType:Jp.Banners,fieldName:"banner",application:l.SERIES,uploadAction:a.Playlists.UPLOAD_IMAGE}),d.createElement("div",{className:"d-flex justify-content-between align-items-center"},d.createElement(lu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.id?"Save":"Create"),!!e.actions&&d.createElement(km,{actions:e.actions})))}function kj(e){return d.createElement(Ks,{initialValues:e.series,validationSchema:Aj,onSubmit:e.saveSeries},d.createElement(Tj,{id:e.series&&e.series.id,ratings:e.ratings}))}function _j(e){return d.createElement("div",{className:"py-2"},d.createElement(Rm,{tabs:Ij(e.currentUser,e.seriesId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function Lj(e){var t,n=Object(bn.useDispatch)(),r=xv(),i=o.useBasicFetch(YE(e.seriesId)),c=o.useBasicFetch(wj()),s=o.useBasicFetch(Zv);return d.createElement(d.Fragment,null,!!s.data&&d.createElement(_j,{seriesId:e.seriesId,activeAction:a.Series.EDIT_SERIES,currentUser:s.data}),!!i.data&&!!c.data&&d.createElement(kj,{series:i.data,saveSeries:function(t,i){o.fetch(n,ZE(e.seriesId,t,(function(){r.success("Successfully updated series.")}),(function(){r.error("Failed to update series.")}),i))},ratings:c.data}),d.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit series page ",d.createElement(Up,{className:"info-link",appLink:(t=e.seriesId,{application:l.SERIES,action:a.Series.LEGACY_EDIT_SERIES,args:[t]})},"here"),"."))}function xj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pj(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Nj(e){var t=xj(d.useState({}),2),n=t[0],r=t[1],i=o.useBasicFetch(YE(e.seriesId)),c=o.useBasicFetch(Zv),s=Iv(p.SUBJECT);!function(e,t,n){var r=function(e){return Sb(n,e)};hb(Tg.getObjectLevelsFetchOptions(e,vb.Series,r("seriesLevels")),[e]),hb(Tg.getObjectAudiencesFetchOptions(e,vb.Series,r("seriesAudiences")),[e,t.seriesLevels]),lb([Tg.getPresentationsFetchOptions(r("presentations")),Tg.getLevelsFetchOptions(r("levels"))],[]),hb(!!t.currentPresentation&&Tg.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.seriesId,n,r),LS(n,r);var u=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.seriesLevels&&n.seriesAudiences);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(_j,{seriesId:e.seriesId,activeAction:a.Series.EDIT_SERIES_AUDIENCES,currentUser:c.data}),d.createElement(_m,{object:i.data}),!!u&&d.createElement(Mg,{objectLevels:n.seriesLevels,objectAudiences:n.seriesAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Sb(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:vb.Series,saveLevels:function(t,n,r){return s.updateObjectLevels(e.seriesId,t,vb.Series,n,r,r)},saveAudiences:function(t,r){return s.updateObjectAudiences(e.seriesId,n.currentPresentation.id,t,vb.Series,r,r)}}))}function Rj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||Mj(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dj(e){return function(e){if(Array.isArray(e))return Uj(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Mj(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mj(e,t){if(e){if("string"==typeof e)return Uj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uj(e,t):void 0}}function Uj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Fj(e){var t=Rj(d.useState({}),2),n=t[0],r=t[1],i=o.useBasicFetch(YE(e.seriesId)),c=o.useBasicFetch(Zv),s=Iv(p.SUBJECT);!function(e,t,n){var r=function(e){return Sb(n,e)};lb([Tg.getSubjectTreeFetchOptions(r("subjectTree")),Tg.getPresentationsFetchOptions(r("presentations"))],[]),hb(Tg.getObjectSubjectsFetchOptions(e,vb.Series,r("seriesSubjects")),[e]),hb(!!t.currentPresentation&&Tg.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),d.useEffect((function(){return r("subjectClassifications")([])}),[t.seriesSubjects]);var o=function(e,t){return[].concat(Dj(t.subjectClassifications||[]),Dj(e))},i=t.seriesSubjects&&t.seriesSubjects.map((function(e){return Tg.getSubjectClassificationFetchOptions(e.id,Sb(n,"subjectClassifications",o))}));lb(i,[t.seriesSubjects],!!i),hb(Tg.getObjectClassificationsFetchOptions(e,vb.Series,r("seriesClassifications")),[e,t.seriesSubjects])}(e.seriesId,n,r),LS(n,r);var u=!!(n.seriesSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.seriesClassifications&&n.subjectClassifications);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(_j,{seriesId:e.seriesId,activeAction:a.Series.EDIT_SERIES_SUBJECTS,currentUser:c.data}),d.createElement(_m,{object:i.data}),u&&d.createElement(fS,{objectSubjects:n.seriesSubjects,subjectTree:n.subjectTree,memberType:vb.Series,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Sb(r,"currentPresentation"),objectClassifications:n.seriesClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return s.updateObjectSubjects(e.seriesId,t,vb.Series,n,r,r)},saveClassifications:function(t,r){return s.updateObjectClassifications(e.seriesId,n.currentPresentation.id,t,vb.Series,r,r)}}))}function Vj(){var e=Object(bn.useDispatch)(),t=xv(),n=o.useBasicFetch(wj());return d.createElement(d.Fragment,null,!!n.data&&d.createElement(kj,{saveSeries:function(n,i){var c=function(){t.error("Failed to create series.")},s=function(e){t.success("Successfully created series."),function(e){r.AppLinkHelper.trigger({application:l.SERIES,action:a.Series.EDIT_SERIES,args:[e.id]})}(e)};o.fetch(e,WE(n,(function(t){var n={permissions:Dv()};o.fetch(e,ZE(t.id,n,s,c,i))}),c))},ratings:n.data}))}function zj(e){return(zj="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 Bj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hj(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 qj(e,t,n){return t&&Hj(e.prototype,t),n&&Hj(e,n),e}function Jj(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&&$j(e,t)}function $j(e,t){return($j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Kj(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=Gj(e);if(t){var o=Gj(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Yj(this,n)}}function Yj(e,t){return!t||"object"!==zj(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 Gj(e){return(Gj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Wj=function(e){Jj(n,e);var t=Kj(n);function n(){return Bj(this,n),t.apply(this,arguments)}return qj(n,[{key:"channelName",get:function(){return l.SERIES}},{key:"appRoutes",get:function(){return{"manage/series/new(/)":"newSeries","manage/series/:id(/)":"editSeries","manage/series/:id/videos(/)":"editSeriesVideos","manage/series/:id/subjects(/)":"editSeriesSubjects","manage/series/:id/audiences(/)":"editSeriesAudiences","manage/legacy/series/:id(/)":"legacyEditSeries"}}},{key:"appLinks",get:function(){return["uploadImage"]}}]),n}(r.AppRouter),Zj=function(e){Jj(n,e);var t=Kj(n);function n(){return Bj(this,n),t.apply(this,arguments)}return qj(n,[{key:"initialize",value:function(){var e=this;Rr.values(p).forEach((function(t){return Av.getInstance(t,e)}))}},{key:"newSeries",value:function(){this.layout.showChildView(kn,d.createElement(Vj,null))}},{key:"editSeries",value:function(e){this.layout.showChildView(kn,d.createElement(Lj,{seriesId:e}))}},{key:"editSeriesVideos",value:function(e){this.legacyEditSeries(e)}},{key:"editSeriesSubjects",value:function(e){this.layout.showChildView(kn,d.createElement(Fj,{seriesId:e}))}},{key:"editSeriesAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(Nj,{seriesId:e}))}},{key:"legacyEditSeries",value:function(e){r.LocationUtils.Redirect("/manage/legacy/series/".concat(e),!0)}},{key:"uploadImage",value:function(e){var t=Object.assign({imageType:e},this.getPopupProps());this.layout.showChildView(_n,d.createElement(_v,Object.assign({},t)))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(Ln,d.createElement(Gh,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Series Application"}},{key:"channelName",get:function(){return l.SERIES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:Oj}}}}],[{key:"router",get:function(){return Wj}}]),n}(r.Application);function Qj(e){return(Qj="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 Xj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eC(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 tC(e,t,n){return t&&eC(e.prototype,t),n&&eC(e,n),e}function nC(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&&rC(e,t)}function rC(e,t){return(rC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oC(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=aC(e);if(t){var o=aC(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return iC(this,n)}}function iC(e,t){return!t||"object"!==Qj(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 aC(e){return(aC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var cC=function(e){nC(n,e);var t=oC(n);function n(){return Xj(this,n),t.apply(this,arguments)}return tC(n,[{key:"channelName",get:function(){return l.SUBJECTS}},{key:"appRoutes",get:function(){return{"manage/subjects(/)":"subjects","manage/subjects/add-objects(/)":"addSubjectMembers","manage/subjects/new(/)":"newSubject","manage/subjects/:id/edit(/)":"editSubject","manage/subjects/:id/edit/playlists(/)":"editSubjectPlaylists","manage/subjects/:id/edit/series(/)":"editSubjectSeries","manage/subjects/:id/edit/videos(/)":"editSubjectVideos","manage/subjects/:id/classifications(/)":"subjectClassifications","manage/subjects/classifications(/)":"classifications","manage/subjects/presentations/:id/classifications(/)":"presentationClassifications","manage/subjects/presentations/:id/classifications/new(/)":"newClassification","manage/subjects/presentations/:id/classifications/:id/edit(/)":"editClassification","manage/subjects/presentations/:id/classifications/:id/edit/playlists(/)":"editClassificationPlaylists","manage/subjects/presentations/:id/classifications/:id/edit/series(/)":"editClassificationSeries","manage/subjects/presentations/:id/classifications/:id/edit/videos(/)":"editClassificationVideos","manage/subjects/levels(/)":"levels","manage/subjects/levels/new(/)":"newLevel","manage/subjects/levels/:id(/)":"editLevel","manage/subjects/audiences(/)":"audiences","manage/subjects/presentations/:id/audiences(/)":"presentationAudiences","manage/subjects/presentations/:id/audiences/new(/)":"newAudience","manage/subjects/presentations/:id/audiences/:id/edit(/)":"editAudience","manage/subjects/presentations(/)":"presentations","manage/subjects/presentations/new":"newPresentation","manage/subjects/presentations/:id(/)":"editPresentation"}}},{key:"appLinks",get:function(){return["deleteClassification","removeClassificationMember","deleteSubject","removeSubjectMember","deleteAudience","uploadImage"]}}]),n}(r.AppRouter),sC=function(e){nC(n,e);var t=oC(n);function n(){return Xj(this,n),t.apply(this,arguments)}return tC(n,[{key:"initialize",value:function(){var e=this;this.subjectDataService=Av.getInstance(p.SUBJECT,this),Rr.values(p).forEach((function(t){return Av.getInstance(t,e)}))}},{key:"subjects",value:function(){this.subjectDataService.getSubjectTree((function(e){var t=!!e.children&&e.children[0];t?r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[t.id]},{replace:!0}):r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.NEW_SUBJECT},{replace:!0})}))}},{key:"newSubject",value:function(e){var t={parentId:e.parentId};this.layout.showChildView(kn,d.createElement(QO,Object.assign({key:e.parentId},t))),this.renderSubjectsLeftNav()}},{key:"editSubject",value:function(e){this.layout.showChildView(kn,d.createElement(MO,{key:e,subjectId:e})),this.renderSubjectsLeftNav(e)}},{key:"editSubjectPlaylists",value:function(e){var t={subjectId:e,memberType:vb.Playlists};this.layout.showChildView(kn,d.createElement(GO,Object.assign({key:"".concat(e,":playlists")},t))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectSeries",value:function(e){var t={subjectId:e,memberType:vb.Series};this.layout.showChildView(kn,d.createElement(GO,Object.assign({key:"".concat(e,":series")},t))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectVideos",value:function(e){var t={subjectId:e,memberType:vb.Videos};this.layout.showChildView(kn,d.createElement(GO,Object.assign({key:"".concat(e,":videos")},t))),this.renderSubjectsLeftNav(e)}},{key:"subjectClassifications",value:function(e){this.layout.showChildView(kn,d.createElement(oj,{key:e,subjectId:e})),this.renderSubjectsLeftNav(e)}},{key:"addSubjectMembers",value:function(e){var t=e.memberType,n=e.objectIds;if(t&&n){var r={memberType:t,objectIds:Array.isArray(n)?n:[n]};this.layout.showChildView(kn,d.createElement(LO,Object.assign({},r))),this.hideLeftNav()}}},{key:"removeSubjectMember",value:function(e,t,n){var r=Object.assign({subjectId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(_n,d.createElement(tj,Object.assign({},r)))}},{key:"deleteSubject",value:function(e){var t=e.toString()===this.currentLeftNavId.toString()?{application:l.SUBJECTS,action:a.Subjects.NEW_SUBJECT}:null,n=Object.assign({subjectId:e,routeToOnDelete:t||null},this.getPopupProps());this.layout.showChildView(_n,d.createElement(NO,Object.assign({},n)))}},{key:"classifications",value:function(){var e={objectType:"classifications",getAppLink:function(e){return{application:l.SUBJECTS,action:a.Subjects.PRESENTATION_CLASSIFICATIONS,args:[e.id]}}};this.layout.showChildView(kn,d.createElement(EO,Object.assign({},e))),this.hideLeftNav()}},{key:"presentationClassifications",value:function(e){this.subjectDataService.getClassificationTree(e,(function(t){var n=!!t.children&&t.children[0];n?r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]},{replace:!0}):r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.NEW_CLASSIFICATION,args:[e]},{replace:!0})}))}},{key:"newClassification",value:function(e,t){var n={presentationId:e,parentId:t.parentId};this.layout.showChildView(kn,d.createElement(KE,Object.assign({key:t.parentId},n))),this.renderClassificationLeftNav(e)}},{key:"editClassification",value:function(e,t){var n={presentationId:e,classificationId:t};this.layout.showChildView(kn,d.createElement(zE,Object.assign({key:t},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationPlaylists",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:vb.Playlists};this.layout.showChildView(kn,d.createElement(qE,Object.assign({key:"".concat(t,":playlists")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationSeries",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:vb.Series};this.layout.showChildView(kn,d.createElement(qE,Object.assign({key:"".concat(t,":series")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationVideos",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:vb.Videos};this.layout.showChildView(kn,d.createElement(qE,Object.assign({key:"".concat(t,":videos")},n))),this.renderClassificationLeftNav(e,t)}},{key:"removeClassificationMember",value:function(e,t,n){var r=Object.assign({classificationId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(_n,d.createElement(eO,Object.assign({},r)))}},{key:"deleteClassification",value:function(e,t){var n=t===this.currentLeftNavId?{application:l.SUBJECTS,action:a.Subjects.NEW_CLASSIFICATION,args:[e]}:null,r=Object.assign({classificationId:t,routeToOnDelete:n||null},this.getPopupProps());this.layout.showChildView(_n,d.createElement(UE,Object.assign({},r)))}},{key:"levels",value:function(){this.layout.showChildView(kn,d.createElement(sO,null)),this.hideLeftNav()}},{key:"newLevel",value:function(){this.layout.showChildView(kn,d.createElement(uO,null)),this.hideLeftNav()}},{key:"editLevel",value:function(e){this.layout.showChildView(kn,d.createElement(rO,{key:e,id:e})),this.hideLeftNav()}},{key:"audiences",value:function(){var e={objectType:"audiences",getAppLink:function(e){return{application:l.SUBJECTS,action:a.Subjects.PRESENTATION_AUDIENCES,args:[e.id]}}};this.layout.showChildView(kn,d.createElement(EO,Object.assign({},e))),this.hideLeftNav()}},{key:"presentationAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(CE,{presentationId:e})),this.hideLeftNav()}},{key:"newAudience",value:function(e){this.layout.showChildView(kn,d.createElement(TE,{presentationId:e})),this.hideLeftNav()}},{key:"editAudience",value:function(e,t){var n={presentationId:e,audienceId:t};this.layout.showChildView(kn,d.createElement(bE,Object.assign({key:t},n))),this.hideLeftNav()}},{key:"deleteAudience",value:function(e,t){var n={application:l.SUBJECTS,action:a.Subjects.PRESENTATION_AUDIENCES,args:[e]},r=Object.assign({id:t,routeToOnDelete:n},this.getPopupProps());this.layout.showChildView(_n,d.createElement(mE,Object.assign({},r)))}},{key:"presentations",value:function(){this.layout.showChildView(kn,d.createElement(vO,null)),this.hideLeftNav()}},{key:"newPresentation",value:function(){this.layout.showChildView(kn,d.createElement(bO,null))}},{key:"editPresentation",value:function(e){this.layout.showChildView(kn,d.createElement(pO,{key:e,id:e})),this.hideLeftNav()}},{key:"uploadImage",value:function(e){var t=Object.assign({imageType:e},this.getPopupProps());this.layout.showChildView(_n,d.createElement(_v,Object.assign({},t)))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(Ln,d.createElement(Gh,{alerts:n,removeAlert:r}))}},{key:"renderClassificationLeftNav",value:function(e,t){this.setCurrentLeftNavItem(t);var n={presentationId:e,selectedClassificationId:t};this.layout.showChildView(Tn,d.createElement(RE,Object.assign({},n)))}},{key:"renderSubjectsLeftNav",value:function(e){this.setCurrentLeftNavItem(e),this.layout.showChildView(Tn,d.createElement(uj,{selectedSubjectId:e}))}},{key:"setCurrentLeftNavItem",value:function(e){this.currentLeftNavId=e||null}},{key:"hideLeftNav",value:function(){this.setCurrentLeftNavItem(),this.layout.hideLeftNav()}},{key:"getTopNav",value:function(e){return d.createElement(lj,{currentAppLink:e})}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Subjects Application"}},{key:"channelName",get:function(){return l.SUBJECTS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:BO,getTopNavView:this.getTopNav}}}}],[{key:"router",get:function(){return cC}}]),n}(r.Application);function uC(e){return(uC="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 lC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fC(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 pC(e,t){return(pC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dC(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=hC(e);if(t){var o=hC(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return mC(this,n)}}function mC(e,t){return!t||"object"!==uC(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 hC(e){return(hC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var yC,vC=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&&pC(e,t)}(i,e);var t,n,r,o=dC(i);function i(){return lC(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"onShowAlert",value:function(e){if(this.layoutOptions.options.alertRegion){var t=e.ctor,n=e.collection,r=n?n.toJSON():[];this.layout.showChildView(this.layoutOptions.options.alertRegion,d.createElement(t,{alerts:r,removeAlert:function(e){return y.Radio.channel(b.ALERT).trigger("remove:alert",e)}}))}}}])&&fC(t.prototype,n),r&&fC(t,r),i}(oe),bC=function(e){return{url:"/api/domain/v1/themes/".concat(e),key:"themes:".concat(e)}},gC=function(e){var t="/api/domain/v1/themes",n="themes";return e&&(t+="?type=".concat(e),n+=":type:".concat(e)),{url:t,key:n}},SC=function(e,t,n,r){return{url:"/api/domain/v1/themes",key:"theme",data:e,type:jr.POST,invalidationKeys:"themes",success:t,error:n,always:r}},EC=function(e,t,n,r,o){return{url:"/api/domain/v1/themes/".concat(e),key:"update:theme:".concat(e),data:t,type:jr.PUT,success:n,error:r,always:o}},OC=function(e,t,n,r){return{url:"/api/domain/v1/themes/".concat(e),key:"delete:theme:".concat(e),type:jr.DELETE,invalidationKeys:"themes",success:t,error:n,always:r}},jC=function(e){return{application:l.THEMES,action:a.Themes.EDIT_THEME,args:[e.id]}};function CC(){var e=o.useBasicFetch(gC());return e.data?d.createElement(xm,{objects:e.data,getObjectAppLink:jC,newObjectAppLink:{application:l.THEMES,action:a.Themes.NEW_THEME},objectName:"Theme"}):d.createElement(d.Fragment,null)}!function(e){e.Glance="glance"}(yC||(yC={}));var wC=[{key:"topLeft",label:"Top Left"},{key:"topRight",label:"Top Right"},{key:"bottomLeft",label:"Bottom Left"},{key:"bottomRight",label:"Bottom Right"}];function AC(){var e=_s();return d.createElement("div",{className:"form-group"},wC.map((function(t){var n="data.".concat(t.key);return d.createElement(wd,{label:t.label,imageType:Jp.HeroBanners,fieldName:n,application:l.THEMES,uploadAction:a.Videos.UPLOAD_IMAGE,setSelectedImage:function(t){e.setFieldValue(n,{fileId:t.id,url:t.url,fileIdType:Kp.ImageAPIv2})}})})))}var IC=Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown(),TC=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default(""),type:Ys.mixed().required("Type is required"),data:Ys.mixed().when("type",{is:yC.Glance,then:Ys.object().shape({topLeft:IC,topRight:IC,bottomLeft:IC,bottomRight:IC}).noUnknown(),otherwise:Ys.mixed().strip(!0)}).default({})}).noUnknown();function kC(e){var t=_s(),n=function(e){switch(e){case yC.Glance:return AC;default:return}}(t.values.type);return d.createElement(Vs,null,d.createElement(ru,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this theme",autoFocus:!0}),d.createElement(ru,{as:"select",label:"Type",name:"type",id:"type",value:t.values.type},d.createElement("option",{value:null},"Select a type..."),Rr.getEnumKeys(yC).map((function(e){return d.createElement("option",{key:e,value:yC[e]},e)}))),!!n&&d.createElement(n,null),d.createElement("div",{className:"d-flex justify-content-between align-items-center"},d.createElement(wu,{isNew:e.isNew}),!!e.actions&&d.createElement(km,{actions:e.actions})))}function _C(e){var t;return d.createElement(Ks,{initialValues:e.theme,validationSchema:TC,onSubmit:e.saveTheme},d.createElement(kC,{isNew:!(null===(t=e.theme)||void 0===t?void 0:t.id),actions:e.actions}))}function LC(){var e=Object(bn.useDispatch)();return d.createElement(_C,{saveTheme:function(t,n){o.fetch(e,SC(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.THEMES,action:a.Themes.EDIT_THEME,args:[e.id]})}),null,n))}})}function xC(e){var t=Object(bn.useDispatch)(),n=xv(),r=o.useBasicFetch(bC(e.id));return r.data?d.createElement(_C,{theme:r.data,saveTheme:function(r,i){o.fetch(t,EC(e.id,r,(function(){n.success("Successfully updated theme")}),(function(){n.error("Failed to update theme")}),i))},actions:[{label:"Delete theme",className:"btn btn-danger",button:!0,appLink:{application:l.THEMES,action:a.Themes.DELETE_THEME,args:[e.id]}}]}):d.createElement(d.Fragment,null)}function PC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return NC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return NC(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function NC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function RC(e){var t=Object(bn.useDispatch)(),n=xv(),i=PC(d.useState(!1),2),c=i[0],s=i[1],u=o.useBasicFetch(bC(e.id));return d.createElement(Zh,{title:"Delete Theme",closePopup:e.closePopup,showLoadingSpinner:!u.data},d.createElement(d.Fragment,null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,u.data.name),"?"),d.createElement(ty,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){s(!0),o.fetch(t,OC(e.id,(function(){n.success("Successfully deleted theme"),r.AppLinkHelper.trigger({application:l.THEMES,action:a.Themes.THEMES})}),(function(){n.error("Failed to delete theme")})))},buttonText:"Yes, delete this theme",isSpinnerButton:!0,showSpinner:c}]})))}var DC=function(e){var t=e.children;return d.createElement(Sd,null,t)};function MC(e){return(MC="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 UC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FC(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 VC(e,t,n){return t&&FC(e.prototype,t),n&&FC(e,n),e}function zC(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&&BC(e,t)}function BC(e,t){return(BC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function HC(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=JC(e);if(t){var o=JC(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return qC(this,n)}}function qC(e,t){return!t||"object"!==MC(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 JC(e){return(JC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $C=function(e){zC(n,e);var t=HC(n);function n(){return UC(this,n),t.apply(this,arguments)}return VC(n,[{key:"channelName",get:function(){return l.THEMES}},{key:"appRoutes",get:function(){return{"manage/themes(/)":"themes","manage/themes/new(/)":"newTheme","manage/themes/:id(/)":"editTheme"}}},{key:"appLinks",get:function(){return["deleteTheme","uploadImage"]}}]),n}(r.AppRouter),KC=function(e){zC(n,e);var t=HC(n);function n(){return UC(this,n),t.apply(this,arguments)}return VC(n,[{key:"themes",value:function(){this.layout.showChildView(kn,d.createElement(CC,null))}},{key:"newTheme",value:function(){this.layout.showChildView(kn,d.createElement(LC,null))}},{key:"editTheme",value:function(e){this.layout.showChildView(kn,d.createElement(xC,{id:e}))}},{key:"deleteTheme",value:function(e){var t=this;this.layout.showChildView(_n,d.createElement(RC,{id:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(_n,d.createElement(_v,{imageType:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"name",get:function(){return"Themes Application"}},{key:"channelName",get:function(){return l.THEMES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:DC}}}}],[{key:"router",get:function(){return $C}}]),n}(vC),YC=function(e){var t=e.children;return d.createElement(Sd,null,t)},GC=function(e,t){var n=l.VIDEOS,r=a.Videos,o=[{label:"Edit Video Details",appLink:{application:n,action:r.EDIT_VIDEO,args:[t]}}];return Mv(e)?[].concat(o,[{label:"Subjects",appLink:{application:n,action:r.EDIT_VIDEO_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_VIDEO_AUDIENCES,args:[t]}},{label:"Aliases",appLink:{application:n,action:r.EDIT_VIDEO_ALIASES,args:[t]}}]):o};function WC(e){var t,n=GC(e.currentUser,e.videoId);return n.length<2?d.createElement(d.Fragment,null):d.createElement("div",{className:"py-2"},d.createElement(Rm,{tabs:n,isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}))}var ZC,QC=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Ys.string().trim().default(""),status:Ys.mixed().required("Status is required"),productionYear:Ys.number().min(1900),rating:Ys.object().shape({id:Ys.string()}).default({}).noUnknown(),thumbnail:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown(),heroBanner:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown(),glance:Ys.object().shape({theme:Ys.string(),format:Ys.mixed(),content:Ys.string()}).default({}).noUnknown()}).noUnknown();!function(e){e[e.Draft=0]="Draft",e[e.Published=1]="Published",e[e.Archived=2]="Archived",e[e.Pending=3]="Pending",e[e.Rejected=4]="Rejected",e[e.Processing=5]="Processing"}(ZC||(ZC={}));var XC,ew=n(25),tw=n.n(ew);function nw(e){var t,n,r,o,i,a=_s();return d.createElement("div",{className:"form-group p-2 border"},d.createElement("div",{className:"border-bottom mb-2"},d.createElement("label",null,"Summary")),d.createElement(ru,{as:"select",label:"Theme",name:"glance.theme",id:"type",value:null===(t=a.values.glance)||void 0===t?void 0:t.theme},d.createElement("option",{value:null},"Select a theme..."),e.themes.map((function(e){return d.createElement("option",{key:e.id,value:e.name},e.name)}))),d.createElement(ru,{as:"select",label:"Format",name:"glance.format",id:"type",value:null===(n=a.values.glance)||void 0===n?void 0:n.format},d.createElement("option",{value:null},"Select a format..."),Rr.getEnumKeys(XC).map((function(e){return d.createElement("option",{key:e,value:XC[e]},e)}))),d.createElement(ru,{label:"Content",as:"textarea",name:"glance.content",id:"content",value:null===(r=a.values.glance)||void 0===r?void 0:r.content}),(null===(o=a.values.glance)||void 0===o?void 0:o.format)===XC.Markdown&&d.createElement("div",{className:"form-group"},d.createElement("label",null,"Content Preview"),d.createElement("div",{className:"border rounded py-2",dangerouslySetInnerHTML:{__html:ew(null===(i=a.values.glance)||void 0===i?void 0:i.content)}})))}function rw(e){switch(e){case ZC.Published:return"badge-success";case ZC.Archived:return"badge-danger";case ZC.Draft:return"badge-warning";case ZC.Pending:return"badge-info";case ZC.Rejected:return"badge-dark";default:return"badge-secondary"}}function ow(e){var t=_s(),n=!!e.rightslineId,r=Mv(e.currentUser);return d.createElement(Vs,null,n&&d.createElement(ru,{label:"Rightsline ID",name:"rightslineId",id:"rightslineId",value:e.rightslineId,disabled:!0}),d.createElement(ru,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this video",disabled:n,autoFocus:!0}),d.createElement("div",{className:"form-group"},d.createElement("label",null,"Status"),d.createElement("div",null,d.createElement("span",{className:"badge ".concat(rw(t.values.status))},ZC[t.values.status]))),d.createElement(ru,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this video here",disabled:n,showCharacterCounter:!0}),d.createElement(ru,{label:"Production Year",type:"number",name:"productionYear",id:"productionYear",value:t.values.productionYear,disabled:n}),d.createElement(Nm,{ratings:e.ratings,disabled:n}),d.createElement(wd,{imageType:Jp.Thumbnails,fieldName:"thumbnail",application:l.VIDEOS,uploadAction:a.Videos.UPLOAD_IMAGE}),d.createElement(wd,{imageType:Jp.HeroBanners,fieldName:"heroBanner",application:l.VIDEOS,uploadAction:a.Videos.UPLOAD_IMAGE}),r&&d.createElement(nw,{themes:e.themes}),d.createElement(wu,{isNew:!e.id}))}function iw(e,t){if(e)return t?Object.assign(Object.assign({},e),t):e}function aw(e){return d.createElement(Ks,{initialValues:iw(e.video,e.rightslineVideo),validationSchema:QC,onSubmit:e.saveVideo,allowInitialSubmit:!!e.rightslineVideo},d.createElement(ow,{id:e.video&&e.video.id,ratings:e.ratings,themes:e.themes,currentUser:e.currentUser,rightslineId:e.rightslineId}))}function cw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sw(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uw(e){var t,n=Object(bn.useDispatch)(),r=cw(d.useState(!1),2),i=r[0],c=r[1],s=o.useBasicFetch(GS(e.videoId)),u=o.useBasicFetch(ZS(e.videoId)),f=o.useBasicFetch(wj()),p=o.useBasicFetch(gC(yC.Glance)),m=o.useBasicFetch(Zv);var h,y=!!s.data&&!!f.data&&!!p.data&&!!m.data&&u.isComplete;return d.createElement(d.Fragment,null,!!m.data&&d.createElement(WC,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO,currentUser:m.data}),!!u.data&&d.createElement("div",{className:"pt-3 text-right"},d.createElement(Ws.Button,{variant:"outline-dark",size:"sm",onClick:function(){u.isFetching||(c(!0),o.fetch(n,ZS(e.videoId)))}},"Sync from Rightsline")),y&&d.createElement(aw,{video:s.data,saveVideo:function(t,r){o.fetch(n,QS(e.videoId,t,null,null,r))},ratings:f.data,themes:p.data,currentUser:m.data,rightslineId:null===(t=u.data)||void 0===t?void 0:t.rightslineId,rightslineVideo:i&&u.data}),d.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit video page ",d.createElement(Up,{className:"info-link",appLink:(h=e.videoId,{application:l.VIDEOS,action:a.Videos.LEGACY_EDIT_VIDEO,args:[h]})},"here"),"."))}function lw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fw(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pw(e){var t=lw(d.useState({}),2),n=t[0],r=t[1],i=o.useBasicFetch(GS(e.videoId)),c=o.useBasicFetch(Zv),s=Iv(p.SUBJECT);!function(e,t,n){var r=function(e){return Sb(n,e)};hb(Tg.getObjectLevelsFetchOptions(e,vb.Videos,r("videoLevels")),[e]),hb(Tg.getObjectAudiencesFetchOptions(e,vb.Videos,r("videoAudiences")),[e,t.videoLevels]),lb([Tg.getPresentationsFetchOptions(r("presentations")),Tg.getLevelsFetchOptions(r("levels"))],[]),hb(!!t.currentPresentation&&Tg.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.videoId,n,r),LS(n,r);var u=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.videoLevels&&n.videoAudiences);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(WC,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO_AUDIENCES,currentUser:c.data}),d.createElement(_m,{object:i.data}),!!u&&d.createElement(Mg,{objectLevels:n.videoLevels,objectAudiences:n.videoAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Sb(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:vb.Videos,saveLevels:function(t,n,r){return s.updateObjectLevels(e.videoId,t,vb.Videos,n,r,r)},saveAudiences:function(t,r){return s.updateObjectAudiences(e.videoId,n.currentPresentation.id,t,vb.Videos,r,r)}}))}function dw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||hw(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mw(e){return function(e){if(Array.isArray(e))return yw(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||hw(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hw(e,t){if(e){if("string"==typeof e)return yw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yw(e,t):void 0}}function yw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vw(e){var t=dw(d.useState({}),2),n=t[0],r=t[1],i=o.useBasicFetch(GS(e.videoId)),c=o.useBasicFetch(Zv),s=Iv(p.SUBJECT);!function(e,t,n){var r=function(e){return Sb(n,e)};lb([Tg.getSubjectTreeFetchOptions(r("subjectTree")),Tg.getPresentationsFetchOptions(r("presentations"))],[]),hb(Tg.getObjectSubjectsFetchOptions(e,vb.Videos,r("videoSubjects")),[e]),hb(!!t.currentPresentation&&Tg.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),d.useEffect((function(){return r("subjectClassifications")([])}),[t.videoSubjects]);var o=function(e,t){return[].concat(mw(t.subjectClassifications||[]),mw(e))},i=t.videoSubjects&&t.videoSubjects.map((function(e){return Tg.getSubjectClassificationFetchOptions(e.id,Sb(n,"subjectClassifications",o))}));lb(i,[t.videoSubjects],!!i),hb(Tg.getObjectClassificationsFetchOptions(e,vb.Videos,r("videoClassifications")),[e,t.videoSubjects])}(e.videoId,n,r),LS(n,r);var u=!!(n.videoSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.videoClassifications&&n.subjectClassifications);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(WC,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO_SUBJECTS,currentUser:c.data}),d.createElement(_m,{object:i.data}),u&&d.createElement(fS,{objectSubjects:n.videoSubjects,subjectTree:n.subjectTree,memberType:vb.Videos,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Sb(r,"currentPresentation"),objectClassifications:n.videoClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return s.updateObjectSubjects(e.videoId,t,vb.Videos,n,r,r)},saveClassifications:function(t,r){return s.updateObjectClassifications(e.videoId,n.currentPresentation.id,t,vb.Videos,r,r)}}))}!function(e){e.Markdown="text/markdown"}(XC||(XC={}));var bw=function(e){return{key:"aliases:".concat(e),url:"/api/master/v2/objects/".concat(e,"/aliases")}},gw=function(e,t,n,r){return{key:"create:alias",url:"/api/master/v2/objects/".concat(e,"/aliases"),type:jr.POST,invalidationKeys:"aliases:".concat(e),data:t,success:n,error:r}},Sw=function(e,t,n,r){return{key:"delete:alias",url:"/api/domain/v2/objects/".concat(e,"/aliases/").concat(t),type:jr.DELETE,invalidationKeys:"aliases:".concat(e),success:n,error:r}};function Ew(e){var t=Object(bn.useDispatch)(),n=xv(),r=o.useBasicFetch(bw(e.videoId)),i=o.useBasicFetch(Zv);return r.data?d.createElement(d.Fragment,null,!!i.data&&d.createElement(WC,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO_ALIASES,currentUser:i.data}),d.createElement(yh,{aliases:r.data.data,onSave:function(r,i){o.fetch(t,gw(e.videoId,r,(function(){n.success("Successfully created alias"),i()}),(function(){n.error("Something went wrong creating your alias")})))},onDelete:function(r){o.fetch(t,Sw(e.videoId,r,(function(){n.success("Successfully deleted alias")}),(function(){n.error("Something went wrong deleting your alias")})))}})):d.createElement(d.Fragment,null,"Loading...")}function Ow(e){return(Ow="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 jw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cw(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 ww(e,t,n){return t&&Cw(e.prototype,t),n&&Cw(e,n),e}function Aw(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&&Iw(e,t)}function Iw(e,t){return(Iw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Tw(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 o=_w(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return kw(this,n)}}function kw(e,t){return!t||"object"!==Ow(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 Lw=function(e){Aw(n,e);var t=Tw(n);function n(){return jw(this,n),t.apply(this,arguments)}return ww(n,[{key:"channelName",get:function(){return l.VIDEOS}},{key:"appRoutes",get:function(){return{"manage/videos/:id(/)":"editVideo","manage/videos/:id/audiences(/)":"editVideoAudiences","manage/videos/:id/subjects(/)":"editVideoSubjects","manage/videos/:id/aliases(/)":"editVideoAliases","tools/programlookup/:id":"legacyEditVideo"}}},{key:"appLinks",get:function(){return["uploadImage"]}}]),n}(r.AppRouter),xw=function(e){Aw(n,e);var t=Tw(n);function n(){return jw(this,n),t.apply(this,arguments)}return ww(n,[{key:"initialize",value:function(){var e=this;Rr.values(p).forEach((function(t){return Av.getInstance(t,e)}))}},{key:"editVideo",value:function(e){this.layout.showChildView(kn,d.createElement(uw,{videoId:e}))}},{key:"editVideoAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(pw,{videoId:e}))}},{key:"editVideoSubjects",value:function(e){this.layout.showChildView(kn,d.createElement(vw,{videoId:e}))}},{key:"editVideoAliases",value:function(e){this.layout.showChildView(kn,d.createElement(Ew,{videoId:e}))}},{key:"legacyEditVideo",value:function(e){r.LocationUtils.Redirect("/tools/programlookup/".concat(e))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(_n,d.createElement(_v,{imageType:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"name",get:function(){return"Videos Application"}},{key:"channelName",get:function(){return l.VIDEOS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:YC,alertRegion:Ln}}}}],[{key:"router",get:function(){return Lw}}]),n}(vC),Pw="UPDATE_VIEW_MODEL",Nw=function(e,t){var n=Object(bn.useDispatch)(),r=Object(bn.useSelector)((function(t){return t.viewModelData[e]}));function o(t,r){n({type:Pw,payload:{viewModelKey:e,dataOrKey:t,keyData:r}})}return void 0!==t&&void 0===r&&o(t),[r,o]},Rw="release:notes:config",Dw=[{id:"798",name:"Monorepo"},{id:"109",name:"Online"},{id:"822",name:"Lite"},{id:"534",name:"Library Editor"},{id:"62",name:"Curator"}];function Mw(e){var t=_s(),n=au(t),r="798"===t.values.project;return m.a.useEffect((function(){e.getMilestones(t.values.project),r&&e.getBranchNames(t.values.project)}),[t.values.project]),m.a.useEffect((function(){t.setFieldValue("milestone",Oo(e.milestones))}),[e.milestones]),m.a.useEffect((function(){t.setFieldValue("branchName",Oo(e.branchNames))}),[e.branchNames]),m.a.createElement(Vs,null,m.a.createElement(ru,{as:"select",label:"Project",name:"project",id:"project",value:t.values.project},Dw.map((function(e){return m.a.createElement("option",{key:e.id,value:e.id},e.name)}))),m.a.createElement(ru,{as:"select",label:"Milestone",name:"milestone",id:"milestone",value:t.values.milestone,disabled:!e.milestones.length},e.milestones.map((function(e){return m.a.createElement("option",{key:e,value:e},e)}))),r&&m.a.createElement(ru,{as:"select",label:"Branch Name",name:"branchName",id:"branchName",value:t.values.branchName,disabled:!e.branchNames.length},e.branchNames.map((function(e){return m.a.createElement("option",{key:e,value:e},e)}))),m.a.createElement("div",{className:"d-flex justify-content-between"},m.a.createElement(lu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Generate")))}var Uw="U_Jxes3Htv-xiaDX5wfn",Fw="https://gitlab.cvinternal.net/api/v4",Vw=function(e,t){return{key:"milestones:".concat(e),url:Qp("".concat(Fw,"/projects/").concat(e,"/milestones"),{private_token:Uw}),normalize:!1,formatData:function(e){return e.map((function(e){return e.title}))},success:t}},zw=function(e,t){return{key:"branch:names:".concat(e),url:Qp("".concat(Fw,"/projects/").concat(e,"/repository/branches"),{private_token:Uw}),normalize:!1,formatData:function(e){return e.map((function(e){return e.name}))},success:t}},Bw=function(e,t,n,r){return{key:"merge:requests:".concat(e,":").concat(t,":").concat(n),url:Qp("".concat(Fw,"/projects/").concat(e,"/merge_requests"),{private_token:Uw,milestone:t,state:"merged",per_page:50,page:n}),success:r}},Hw=function(e,t,n){return{key:"file:paths:".concat(t,":").concat(e),url:Qp("".concat(Fw,"/projects/").concat(e,"/search"),{scope:"blobs",search:t,private_token:Uw}),normalize:!1,formatData:function(e){return e.filter((function(e){return e.filename.includes(t)}))},success:n}},qw=function(e,t,n,r){return{key:"file:".concat(e,":").concat(t,":").concat(n),url:Qp("".concat(Fw,"/projects/").concat(e,"/repository/files/").concat(encodeURIComponent(t),"/raw"),{ref:n,private_token:Uw}),normalize:!1,formatData:function(e){return JSON.parse(e)},success:r}},Jw=Ys.object().shape({project:Ys.string().required("Project is required").default(""),milestone:Ys.string().required("Milestone is required").default(""),branchName:Ys.string().when("project",(function(e,t){return"798"===e?t.required("Branch name is required"):t})).default("")}).noUnknown();function $w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kw(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Yw={project:Oo(Dw).id};function Gw(){var e=$w(m.a.useState([]),2),t=e[0],n=e[1],i=$w(m.a.useState([]),2),c=i[0],s=i[1],u=$w(Nw(Rw),2)[1],f=Object(bn.useDispatch)();return m.a.createElement(m.a.Fragment,null,m.a.createElement("h4",{className:"py-2"},"Generate Release Notes"),m.a.createElement(Ks,{initialValues:Yw,onSubmit:function(e){u(e),r.AppLinkHelper.trigger({application:l.RELEASE_NOTES,action:a.ReleaseNotes.GENERATOR})},validationSchema:Jw},m.a.createElement(Mw,{getMilestones:function(e){n([]),o.fetch(f,Vw(e,n))},milestones:t,getBranchNames:function(e){s([]),o.fetch(f,zw(e,s))},branchNames:c})))}var Ww=n(135),Zw=/#*/;function Qw(e){return e=e.replace("-"," "),e="## "+(e=(e=fd(e)).replace(Zw,"").trim())}function Xw(e){var t=e.toLowerCase();return"## notes"===t||"## dependencies"===t}function eA(e){return e=e.replace("-"," "),e=fd(e)}function tA(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return nA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function nA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rA=["# online","# curator","# library editor","# lite","# styles","# tooling","# analytics","# common","# shared"];function oA(e){for(var t={name:"",changes:""},n=0;t.name||n<e.length;n++){var r=e[n];if(!r)break;if("#"===r){var o=e.indexOf("\n",n),i=e.slice(n,o);rA.includes(i.toLowerCase().trim())&&(t.name=fd(i.replace("#","").trim()),e=e.slice(o))}}for(var a=0;!t.changes&&a<e.length;a++){if(a+1===e.length){t.changes=e,e="";break}if("#"===e[a]&&"#"!==e[a+1]){var c=e.indexOf("\n",a),s=e.slice(a,c);rA.includes(s.toLowerCase().trim())&&(t.changes=e.slice(0,a),e=e.slice(a))}}return{section:t,remainingDescription:e}}function iA(e){var t,n={},r=tA(e);try{for(r.s();!(t=r.n()).done;)for(var o=t.value;o;){var i=oA(o),a=i.section;if(o=i.remainingDescription,!a.name)break;n[a.name]||(n[a.name]=[]),n[a.name].push(a.changes)}}catch(e){r.e(e)}finally{r.f()}var c={};return Object.keys(n).forEach((function(e){var t,r;c[e]=(t=n[e],r={},t.forEach((function(e){for(var t=e.split("");t&&t.length;){for(var n=0;n<t.length&&t.length!==n+1;n++)if("#"===t[n]&&"#"===t[n+1]){var o=t.indexOf("\n",n),i=eA(t.slice(n,o).join(""));r[i]||(r[i]="");for(var a=o;a<t.length;a++){if(t.length===a+1){var c=t.slice(o+1).join("");r[i]+=c,t=[];break}if("#"===t[a]&&"#"===t[a+1]){var s=t.slice(o+1,a).join("");if(!s.length){t=t.slice(a);break}r[i]+=s,t=t.slice(a);break}}r[i]+="\n"}break}})),Object.keys(r).reduce((function(e,t){return e+=t+"\n",e+=r[t]+"\n"}),""))})),Object.keys(c).reduce((function(e,t){return e+="\n",e+="\n# ".concat(t),e+="\n".concat(c[t])}),"")}var aA=n(136),cA=n.n(aA);function sA(e){return function(e){if(Array.isArray(e))return fA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||lA(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||lA(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lA(e,t){if(e){if("string"==typeof e)return fA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fA(e,t):void 0}}function fA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pA(){var e=uA(m.a.useState(!0),2),t=e[0],n=e[1],i=uA(m.a.useState(1),2),c=i[0],s=i[1],u=uA(m.a.useState([]),2),f=u[0],p=u[1],d=uA(m.a.useState([]),2),h=d[0],y=d[1],v=uA(m.a.useState(!0),2),b=v[0],g=v[1],S=uA(m.a.useState(""),2),E=S[0],O=S[1],j=uA(m.a.useState("Copy"),2),C=j[0],w=j[1],A=uA(Nw(Rw),1)[0],I=A&&"798"===A.project,T=Object(bn.useDispatch)();return m.a.useEffect((function(){if(A){var e=A.project,t=A.milestone;o.fetch(T,Bw(e,t,c,(function(e){p([].concat(sA(f),sA(e))),50===e.length?s(c+1):n(!1)})))}}),[c]),m.a.useEffect((function(){if(!(t||I&&b)){var e=f.map((function(e){return e.description.replace("\r\n","\n").replace("\r","")})),n=I?function(e,t){var n=function(e){var t="# Final Package Versions\n\n| Package | Version |\n| ------------------------- | ------------------------ |\n| @clickview/analytics | <analytics-version> |\n| @clickview/styles | <styles-version> |\n| @clickview/tooling | <tooling-version> |\n| @clickview/curator | <curator-version> |\n| @clickview/library-editor | <library-editor-version> |\n| @clickview/lite | <lite-version> |\n| @clickview/online | <online-version> |\n";return e.forEach((function(e){var n=e.name,r=e.version;r&&(t=t.replace("<".concat(n.replace("@clickview/",""),"-version>"),r))})),t}(t),r=iA(e);return"".concat(n,"\n").concat(r)}(e,h):function(e){var t={};return e.forEach((function(e){for(var n=e.split("");;){var r=!1;if(!n||!n.length)break;for(var o=0;o<n.length&&n.length!==o+1;o++)if("#"===n[o]){var i=n.indexOf("\n",o),a=Qw(n.slice(o,i).join(""));t[a]||(Xw(a)?r=!0:t[a]="");for(var c=i;c<n.length;c++){if(n.length===c+1){if(r){r=!1,n=[];break}var s=n.slice(i+1).join("");t[a]+=s,n=[];break}if("#"===n[c]){if(r){r=!1,n=n.slice(c);break}var u=n.slice(i+1,c).join("");if(!u.length){n=n.slice(c);break}t[a]+=u,n=n.slice(c);break}}t[a]?t[a]+="\n":delete t[a]}break}})),Object.keys(t).reduce((function(e,n){return t[n]?(e+=n+"\n",e+=t[n]+"\n"):e}),"")}(e);O(n)}}),[t,b]),m.a.useEffect((function(){if(A&&I){var e=[];o.fetch(T,Hw(A.project,"package.json",(function(t){var n,r=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=lA(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;o.fetch(T,qw(A.project,i.path,A.branchName,(function(n){e.push(n),e.length===t.length&&(y(e),g(!1))})))}}catch(e){r.e(e)}finally{r.f()}})))}}),[]),A?m.a.createElement(m.a.Fragment,null,E?m.a.createElement("div",{className:"position-relative border rounded p-3"},m.a.createElement(Ww,{onCopy:function(){return w("Copied")},text:E},m.a.createElement("button",{className:"btn btn-white ".concat(cA.a.copyBtn)},C)),m.a.createElement("div",{dangerouslySetInnerHTML:{__html:tw()(E)}})):t?"Fetching merge requests..":"Merging descriptions.."):(r.AppLinkHelper.trigger({application:l.RELEASE_NOTES,action:a.ReleaseNotes.FORM}),m.a.createElement(m.a.Fragment,null))}function dA(e){return(dA="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 mA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hA(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 yA(e,t,n){return t&&hA(e.prototype,t),n&&hA(e,n),e}function vA(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&&bA(e,t)}function bA(e,t){return(bA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gA(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=EA(e);if(t){var o=EA(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return SA(this,n)}}function SA(e,t){return!t||"object"!==dA(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 EA(e){return(EA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var OA,jA=function(e){vA(n,e);var t=gA(n);function n(){return mA(this,n),t.apply(this,arguments)}return yA(n,[{key:"channelName",get:function(){return l.RELEASE_NOTES}},{key:"appRoutes",get:function(){return{"developer/release-notes(/)":"index","developer/release-notes/generate(/)":"form","developer/release-notes/generator(/)":"generator"}}}]),n}(r.AppRouter),CA=function(e){vA(n,e);var t=gA(n);function n(){return mA(this,n),t.apply(this,arguments)}return yA(n,[{key:"index",value:function(){r.AppLinkHelper.trigger({application:l.RELEASE_NOTES,action:a.ReleaseNotes.GENERATOR},{replace:!0})}},{key:"form",value:function(){this.layout.showChildView(kn,d.createElement(Gw,null))}},{key:"generator",value:function(){this.layout.showChildView(kn,d.createElement(pA,null))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(Ln,d.createElement(Gh,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Release Notes Application"}},{key:"channelName",get:function(){return l.RELEASE_NOTES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return jA}}]),n}(r.Application);function wA(e){return(wA="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 AA(e){return function(e){if(Array.isArray(e))return IA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return IA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IA(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function TA(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 kA(e,t){return(kA=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=xA(e);if(t){var o=xA(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return LA(this,n)}}function LA(e,t){return!t||"object"!==wA(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 xA(e){return(xA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Fifo="FifoMemoryCache"}(OA||(OA={}));var PA,NA=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&&kA(e,t)}(i,e);var t,n,r,o=_A(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this)).size=e.size,t.cache={},t.cachedkeys=[],t}return t=i,(n=[{key:"removeCacheKey",value:function(e){this.cachedkeys=h.without(this.cachedkeys,e)}},{key:"has",value:function(e){return!!this.cache[e]}},{key:"get",value:function(e){return this.cache[e]}},{key:"set",value:function(e,t){e&&t||K.throw(new Xe("Must provide a cache key and a value to cache in FifoMemoryCache.")),this.has(e)&&this.removeCacheKey(e),this.cachedkeys.push(e),this.cache[e]=t,this.cachedkeys.length>this.size&&delete this.cache[this.cachedkeys.shift()]}},{key:"getOrSet",value:function(e,t){if(this.has(e))return this.get(e);var n=t();return this.set(e,n),n}},{key:"remove",value:function(e){return!!this.has(e)&&(delete this.cache[e],this.removeCacheKey(e),!0)}},{key:"invalidate",value:function(e,t){var n=this,r=h.object(this.cachedkeys,this.cachedkeys),o=[];h.each(e,(function(e){var t;r[e]&&o.push(e);var n=new RegExp(e,"i"),i=h.filter(r,(function(e){return n.test(e)}));(t=o).push.apply(t,AA(i))})),o.length&&(o=h.uniq(o),h.each(o,(function(e){delete n.cache[e],h.isFunction(t)&&t(e)})),this.cachedkeys=h.without.apply(h,[this.cachedkeys].concat(AA(o))))}},{key:"name",get:function(){return OA.Fifo}}])&&TA(t.prototype,n),r&&TA(t,r),i}(Yt);!function(e){e[e.Unknown=0]="Unknown",e[e.BadRequest=1]="BadRequest",e[e.Unauthorized=2]="Unauthorized",e[e.Forbidden=3]="Forbidden",e[e.NotFound=4]="NotFound",e[e.InternalServer=5]="InternalServer"}(PA||(PA={}));var RA,DA={type:PA.Unknown,message:"",code:0};!function(e){e.Ajax="AjaxDataProvider",e.Notifications="NotificationsSignalRDataProvider"}(RA||(RA={}));var MA=function(e,t,n){if(!n||!n.errorCode)return e[t];var r="".concat(n.errorCode);return n.errorSubCode&&(r+=".".concat(n.errorSubCode)),e[r]||e[t]};function UA(e){return(UA="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 FA(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 VA(e,t){return(VA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function zA(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=HA(e);if(t){var o=HA(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return BA(this,n)}}function BA(e,t){return!t||"object"!==UA(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 HA(e){return(HA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var qA=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&&VA(e,t)}(i,e);var t,n,r,o=zA(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,e),$.ajaxSetup({cache:!1,contentType:"application/json; charset=utf-8"}),t.successMiddleware={},t.errorMiddleware={},t.dataServiceErrorMessageMappings=e.dataServiceErrorMessageMappings,t.defaultErrorMessageKey=e.defaultErrorMessageKey,t}return t=i,(n=[{key:"parseUrl",value:function(e){var t=document.createElement("a");return t.href=e,""===t.host&&(t.href=t.href),t}},{key:"makeHttps",value:function(e){var t=this.parseUrl(e);return"http:"===t.protocol&&(t.protocol="https:"),t.href}},{key:"base",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n||(n=jr.GET);var o=h.defaults(r,{forceHttps:!1}),i={url:e,method:n,type:n};t&&(i.data=n===jr.POST||n===jr.PUT?JSON.stringify(t):t),o.forceHttps&&(i.url=this.makeHttps(i.url)),o.traditional&&(i.traditional=o.traditional);var a=$.ajax(i);return h.keys(this.successMiddleware).length&&a.done(h.values(this.successMiddleware)),h.keys(this.errorMiddleware).length&&a.fail(h.values(this.errorMiddleware)),a}},{key:"create",value:function(e,t,n){var r=n.channel,o=n.successEvent,i=n.errorEvent;this.base(e,t,jr.POST).done((function(e,t,n){return r.trigger(o,e,t,n)})).fail((function(e,t,n){return r.trigger(i,e,t,n)}))}},{key:"read",value:function(e,t){var n=t.channel,r=t.successEvent,o=t.errorEvent;this.base(e,null,jr.GET).done((function(e,t,o){n.trigger(r,e,t,o)})).fail((function(e,t,r){n.trigger(o,e,t,r)}))}},{key:"update",value:function(e,t,n){var r=n.channel,o=n.successEvent,i=n.errorEvent;this.base(e,t,jr.PUT).done((function(e,t,n){return r.trigger(o,e,t,n)})).fail((function(e,t,n){return r.trigger(i,e,t,n)}))}},{key:"delete",value:function(e,t){var n=t.channel,r=t.successEvent,o=t.errorEvent;this.base(e,null,jr.DELETE).done((function(e,t,o){return n.trigger(r,e,t,o)})).fail((function(e,t,r){return n.trigger(o,e,t,r)}))}},{key:"useMiddleware",value:function(e,t){this.successMiddleware[e]||(this.successMiddleware[e]=t)}},{key:"useErrorMiddleware",value:function(e,t){this.errorMiddleware[e]||(this.errorMiddleware[e]=t)}},{key:"parseError",value:function(e,t,n){var r=e.responseJSON,o=DA;switch(o.code=e.status,o.message=MA(this.dataServiceErrorMessageMappings,this.defaultErrorMessageKey,r),e.status){case 400:o.type=PA.BadRequest;break;case 401:o.type=PA.Unauthorized;break;case 403:o.type=PA.Forbidden;break;case 404:o.type=PA.NotFound;break;case 500:o.type=PA.InternalServer}return o}},{key:"name",get:function(){return RA.Ajax}}])&&FA(t.prototype,n),r&&FA(t,r),i}(I.Object);function JA(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $A(e,t){return"string"==typeof t.payload.dataOrKey&&void 0!==t.payload.keyData?Object.assign(Object.assign({},e),JA({},t.payload.viewModelKey,Object.assign(Object.assign({},e[t.payload.viewModelKey]),JA({},t.payload.dataOrKey,t.payload.keyData)))):Object.assign(Object.assign({},e),JA({},t.payload.viewModelKey,t.payload.dataOrKey))}function KA(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Pw:return $A(e,t)}return e}var YA="LanguageDataService",GA="locale",WA="phrases",ZA="language:data:service",QA="locale",XA="phrases";function eI(e){return(eI="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 tI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nI(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 rI(e,t){return(rI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oI(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=aI(e);if(t){var o=aI(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return iI(this,n)}}function iI(e,t){return!t||"object"!==eI(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 aI(e){return(aI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var cI=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&&rI(e,t)}(i,e);var t,n,r,o=oI(i);function i(){return tI(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"getLanguageConfig",value:function(e){var t={locale:"",phrases:null};this.get({resource:"/api/locale",eventPrefix:GA,expiryTime:Eb.STANDARD,bootstrapName:QA,callback:function(n){t.locale=n,t.phrases&&h.isFunction(e)&&e(t)}}),this.get({resource:"/api/phrases",eventPrefix:WA,expiryTime:Eb.STANDARD,bootstrapName:XA,callback:function(n){t.phrases=n,t.locale&&h.isFunction(e)&&e(t)}})}},{key:"name",get:function(){return YA}},{key:"channelName",get:function(){return ZA}}])&&nI(t.prototype,n),r&&nI(t,r),i}(mr);n.d(t,"Actions",(function(){return a})),n.d(t,"DataPrefixes",(function(){return c})),n.d(t,"FileExtensions",(function(){return s})),n.d(t,"Layouts",(function(){return u})),n.d(t,"AppChannels",(function(){return l})),n.d(t,"DataChannels",(function(){return f})),n.d(t,"DataServices",(function(){return p})),n.d(t,"CuratorLayoutView",(function(){return Hn})),n.d(t,"LayoutComponent",(function(){return Yn})),n.d(t,"CuratorAppNavService",(function(){return or})),n.d(t,"ImageUploadDataService",(function(){return Cr})),n.d(t,"CompaniesApplication",(function(){return Ph})),n.d(t,"DomainOptionsApplication",(function(){return By})),n.d(t,"PeopleApplication",(function(){return gv})),n.d(t,"PlaylistsApplication",(function(){return Ej})),n.d(t,"SeriesApplication",(function(){return Zj})),n.d(t,"SubjectDataService",(function(){return Ag})),n.d(t,"SubjectDataServiceHelper",(function(){return Tg})),n.d(t,"SubjectsApplication",(function(){return sC})),n.d(t,"ThemesApplication",(function(){return KC})),n.d(t,"VideosApplication",(function(){return xw})),n.d(t,"DomainOptionsApplication",(function(){return By})),n.d(t,"ReleaseNotesApplication",(function(){return CA})),n.d(t,"Core",(function(){return r})),n.d(t,"InstanceManager",(function(){return Av})),n.d(t,"FifoMemoryCache",(function(){return NA})),n.d(t,"AjaxDataProvider",(function(){return qA})),n.d(t,"AlertList",(function(){return Gh})),n.d(t,"AlertType",(function(){return _h})),n.d(t,"BaseAlertService",(function(){return zh})),n.d(t,"LanguageService",(function(){return Ou})),n.d(t,"Flight",(function(){return o})),n.d(t,"CacheDurations",(function(){return Eb})),n.d(t,"ViewModelReducer",(function(){return KA})),n.d(t,"LanguageDataService",(function(){return cI}))}])}));
|
|
17
|
+
*/var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,m=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,b=r?Symbol.for("react.block"):60121,g=r?Symbol.for("react.fundamental"):60117,S=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function O(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case f:case p:case a:case s:case c:case m:return e;default:switch(e=e&&e.$$typeof){case l:case d:case v:case y:case u:return e;default:return t}}case i:return t}}}function j(e){return O(e)===p}t.AsyncMode=f,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=u,t.Element=o,t.ForwardRef=d,t.Fragment=a,t.Lazy=v,t.Memo=y,t.Portal=i,t.Profiler=s,t.StrictMode=c,t.Suspense=m,t.isAsyncMode=function(e){return j(e)||O(e)===f},t.isConcurrentMode=j,t.isContextConsumer=function(e){return O(e)===l},t.isContextProvider=function(e){return O(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return O(e)===d},t.isFragment=function(e){return O(e)===a},t.isLazy=function(e){return O(e)===v},t.isMemo=function(e){return O(e)===y},t.isPortal=function(e){return O(e)===i},t.isProfiler=function(e){return O(e)===s},t.isStrictMode=function(e){return O(e)===c},t.isSuspense=function(e){return O(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===s||e===c||e===m||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===y||e.$$typeof===u||e.$$typeof===l||e.$$typeof===d||e.$$typeof===g||e.$$typeof===S||e.$$typeof===E||e.$$typeof===b)},t.typeOf=O},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=f(i),c=f(n(16)),s=f(n(177)),u=f(n(178)),l=n(186);function f(e){return e&&e.__esModule?e:{default:e}}var p=function(){return!0},d=function(e){function t(e){var n=e.alwaysRenderSuggestions;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return m.call(r),r.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null},r.justPressedUpDown=!1,r.justMouseEntered=!1,r.pressedSuggestion=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown),document.addEventListener("mouseup",this.onDocumentMouseUp),this.input=this.autowhatever.input,this.suggestionsContainer=this.autowhatever.itemsContainer}},{key:"componentWillReceiveProps",value:function(e){(0,s.default)(e.suggestions,this.props.suggestions)?e.highlightFirstSuggestion&&e.suggestions.length>0&&!1===this.justPressedUpDown&&!1===this.justMouseEntered&&this.highlightFirstSuggestion():this.willRenderSuggestions(e)?this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions():this.resetHighlightedSuggestion()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.suggestions,o=n.onSuggestionHighlighted,i=n.highlightFirstSuggestion;if(!(0,s.default)(r,e.suggestions)&&r.length>0&&i)this.highlightFirstSuggestion();else if(o){var a=this.getHighlightedSuggestion();a!=t.highlightedSuggestion&&o({suggestion:a})}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown),document.removeEventListener("mouseup",this.onDocumentMouseUp)}},{key:"updateHighlightedSuggestion",value:function(e,t,n){var r=this;this.setState((function(o){var i=o.valueBeforeUpDown;return null===t?i=null:null===i&&void 0!==n&&(i=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:i}}))}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState((function(t){var n=t.valueBeforeUpDown;return{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:e?null:n}}))}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,r=n.suggestions,o=n.multiSection,i=n.getSectionSuggestions;return o?i(r[e])[t]:r[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){return(0,this.props.getSuggestionValue)(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var r=this.props.inputProps,o=r.value,i=r.onChange;t!==o&&i(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,r=e.shouldRenderSuggestions,o=n.value;return t.length>0&&r(o)}},{key:"getQuery",value:function(){var e=this.props.inputProps.value,t=this.state.valueBeforeUpDown;return(null===t?e:t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,o=t.renderInputComponent,i=t.onSuggestionsFetchRequested,c=t.renderSuggestion,s=t.inputProps,f=t.multiSection,d=t.renderSectionTitle,m=t.id,h=t.getSectionSuggestions,y=t.theme,v=t.getSuggestionValue,b=t.alwaysRenderSuggestions,g=t.highlightFirstSuggestion,S=this.state,E=S.isFocused,O=S.isCollapsed,j=S.highlightedSectionIndex,C=S.highlightedSuggestionIndex,w=S.valueBeforeUpDown,A=b?p:this.props.shouldRenderSuggestions,I=s.value,T=s.onFocus,k=s.onKeyDown,_=this.willRenderSuggestions(this.props),L=b||E&&!O&&_,x=L?n:[],P=r({},s,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=A(I);e.setState({isFocused:!0,isCollapsed:!n}),T&&T(t),n&&i({value:I,reason:"input-focused"})}},onBlur:function(t){e.justClickedOnSuggestionsContainer?e.input.focus():(e.blurEvent=t,e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested()))},onChange:function(t){var n=t.target.value,o=A(n);e.maybeCallOnChange(t,n,"type"),e.suggestionsContainer&&(e.suggestionsContainer.scrollTop=0),e.setState(r({},g?{}:{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null},{valueBeforeUpDown:null,isCollapsed:!o})),o?i({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var o=t.keyCode;switch(o){case 40:case 38:if(O)A(I)&&(i({value:I,reason:"suggestions-revealed"}),e.revealSuggestions());else if(n.length>0){var a=r.newHighlightedSectionIndex,c=r.newHighlightedItemIndex,s=void 0;s=null===c?null===w?I:w:e.getSuggestionValueByIndex(a,c),e.updateHighlightedSuggestion(a,c,I),e.maybeCallOnChange(t,s,40===o?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout((function(){e.justPressedUpDown=!1}));break;case 13:if(229===t.keyCode)break;var u=e.getHighlightedSuggestion();if(L&&!b&&e.closeSuggestions(),null!=u){var l=v(u);e.maybeCallOnChange(t,l,"enter"),e.onSuggestionSelected(t,{suggestion:u,suggestionValue:l,suggestionIndex:C,sectionIndex:j,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout((function(){e.justSelectedSuggestion=!1}))}break;case 27:L&&t.preventDefault();var f=L&&!b;if(null===w){if(!f){e.maybeCallOnChange(t,"","escape"),A("")?i({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,w,"escape");f?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}k&&k(t)}}),N={query:this.getQuery()};return a.default.createElement(u.default,{multiSection:f,items:x,renderInputComponent:o,renderItemsContainer:this.renderSuggestionsContainer,renderItem:c,renderItemData:N,renderSectionTitle:d,getSectionItems:h,highlightedSectionIndex:j,highlightedItemIndex:C,inputProps:P,itemProps:this.itemProps,theme:(0,l.mapToAutowhateverTheme)(y),id:m,ref:this.storeAutowhateverRef})}}]),t}(i.Component);d.propTypes={suggestions:c.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){var n=e[t];if("function"!=typeof n)throw new Error("'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp")},onSuggestionsClearRequested:function(e,t){var n=e[t];if(!1===e.alwaysRenderSuggestions&&"function"!=typeof n)throw new Error("'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp")},onSuggestionSelected:c.default.func,onSuggestionHighlighted:c.default.func,renderInputComponent:c.default.func,renderSuggestionsContainer:c.default.func,getSuggestionValue:c.default.func.isRequired,renderSuggestion:c.default.func.isRequired,inputProps:function(e,t){var n=e[t];if(!n.hasOwnProperty("value"))throw new Error("'inputProps' must have 'value'.");if(!n.hasOwnProperty("onChange"))throw new Error("'inputProps' must have 'onChange'.")},shouldRenderSuggestions:c.default.func,alwaysRenderSuggestions:c.default.bool,multiSection:c.default.bool,renderSectionTitle:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp")},getSectionSuggestions:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp")},focusInputOnSuggestionClick:c.default.bool,highlightFirstSuggestion:c.default.bool,theme:c.default.object,id:c.default.string},d.defaultProps={renderSuggestionsContainer:function(e){var t=e.containerProps,n=e.children;return a.default.createElement("div",t,n)},shouldRenderSuggestions:function(e){return e.trim().length>0},alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:l.defaultTheme,id:"1"};var m=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeAutowhateverRef=function(t){null!==t&&(e.autowhatever=t)},this.onSuggestionMouseEnter=function(t,n){var r=n.sectionIndex,o=n.itemIndex;e.updateHighlightedSuggestion(r,o),t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!0),e.justMouseEntered=!0,setTimeout((function(){e.justMouseEntered=!1}))},this.highlightFirstSuggestion=function(){e.updateHighlightedSuggestion(e.props.multiSection?0:null,0)},this.onDocumentMouseUp=function(){e.pressedSuggestion&&!e.justSelectedSuggestion&&e.input.focus(),e.pressedSuggestion=null},this.onSuggestionMouseDown=function(t){e.justSelectedSuggestion||(e.justSelectedSuggestion=!0,e.pressedSuggestion=t.target)},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var r=e.props,o=r.alwaysRenderSuggestions,i=r.onSuggestionSelected,a=r.onSuggestionsFetchRequested;i&&i(t,n),o?a({value:n.suggestionValue,reason:"suggestion-selected"}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,o=n.focusInputOnSuggestionClick,i=e.getSuggestionIndices(e.findSuggestionElement(t.target)),a=i.sectionIndex,c=i.suggestionIndex,s=e.getSuggestion(a,c),u=e.props.getSuggestionValue(s);e.maybeCallOnChange(t,u,"click"),e.onSuggestionSelected(t,{suggestion:s,suggestionValue:u,suggestionIndex:c,sectionIndex:a,method:"click"}),r||e.closeSuggestions(),!0===o?e.input.focus():e.onBlur(),setTimeout((function(){e.justSelectedSuggestion=!1}))},this.onBlur=function(){var t=e.props,n=t.inputProps,r=t.shouldRenderSuggestions,o=n.value,i=n.onBlur,a=e.getHighlightedSuggestion(),c=r(o);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!c}),i&&i(e.blurEvent,{highlightedSuggestion:a})},this.onSuggestionMouseLeave=function(t){e.resetHighlightedSuggestion(!1),e.justSelectedSuggestion&&t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!1)},this.onSuggestionTouchStart=function(){e.justSelectedSuggestion=!0},this.onSuggestionTouchMove=function(){e.justSelectedSuggestion=!1,e.pressedSuggestion=null,e.input.focus()},this.itemProps=function(t){return{"data-section-index":t.sectionIndex,"data-suggestion-index":t.itemIndex,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.onSuggestionMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionTouchStart,onTouchMove:e.onSuggestionTouchMove,onClick:e.onSuggestionClick}},this.renderSuggestionsContainer=function(t){var n=t.containerProps,r=t.children;return(0,e.props.renderSuggestionsContainer)({containerProps:n,children:r,query:e.getQuery()})}};t.default=d},function(e,t,n){"use strict";var r=n(176);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}},function(e,t,n){"use strict";e.exports=n(179).default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&c.return&&c.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),c=d(a),s=d(n(16)),u=d(n(180)),l=d(n(181)),f=d(n(183)),p=d(n(184));function d(e){return e&&e.__esModule?e:{default:e}}var m={},h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.storeInputReference=function(e){null!==e&&(n.input=e)},n.storeItemsContainerReference=function(e){null!==e&&(n.itemsContainer=e)},n.onHighlightedItemChange=function(e){n.highlightedItem=e},n.getItemId=function(e,t){return null===t?null:"react-autowhatever-"+n.props.id+"-"+(null===e?"":"section-"+e)+"-item-"+t},n.onFocus=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!0}),t.onFocus&&t.onFocus(e)},n.onBlur=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!1}),t.onBlur&&t.onBlur(e)},n.onKeyDown=function(e){var t=n.props,r=t.inputProps,i=t.highlightedSectionIndex,a=t.highlightedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var c="ArrowDown"===e.key?"next":"prev",s=n.sectionIterator[c]([i,a]),u=o(s,2),l=u[0],f=u[1];r.onKeyDown(e,{newHighlightedSectionIndex:l,newHighlightedItemIndex:f});break;default:r.onKeyDown(e,{highlightedSectionIndex:i,highlightedItemIndex:a})}},n.highlightedItem=null,n.state={isInputFocused:!1},n.setSectionsItems(e),n.setSectionIterator(e),n.setTheme(e),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.items!==this.props.items&&this.setSectionsItems(e),e.items===this.props.items&&e.multiSection===this.props.multiSection||this.setSectionIterator(e),e.theme!==this.props.theme&&this.setTheme(e)}},{key:"componentDidUpdate",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"setSectionsItems",value:function(e){e.multiSection&&(this.sectionsItems=e.items.map((function(t){return e.getSectionItems(t)})),this.sectionsLengths=this.sectionsItems.map((function(e){return e.length})),this.allSectionsAreEmpty=this.sectionsLengths.every((function(e){return 0===e})))}},{key:"setSectionIterator",value:function(e){this.sectionIterator=(0,u.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,l.default)(e.theme)}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,r=n.id,o=n.items,i=n.renderItem,a=n.renderItemData,s=n.renderSectionTitle,u=n.highlightedSectionIndex,l=n.highlightedItemIndex,d=n.itemProps;return o.map((function(n,o){var m="react-autowhatever-"+r+"-",h=m+"section-"+o+"-",y=0===o;return c.default.createElement("div",t(h+"container","sectionContainer",y&&"sectionContainerFirst"),c.default.createElement(f.default,{section:n,renderSectionTitle:s,theme:t,sectionKeyPrefix:h}),c.default.createElement(p.default,{items:e.sectionsItems[o],itemProps:d,renderItem:i,renderItemData:a,sectionIndex:o,highlightedItemIndex:u===o?l:null,onHighlightedItemChange:e.onHighlightedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:m,ref:e.storeItemsListReference}))}))}},{key:"renderItems",value:function(){var e=this.props.items;if(0===e.length)return null;var t=this.theme,n=this.props,r=n.id,o=n.renderItem,i=n.renderItemData,a=n.highlightedSectionIndex,s=n.highlightedItemIndex,u=n.itemProps;return c.default.createElement(p.default,{items:e,itemProps:u,renderItem:o,renderItemData:i,highlightedItemIndex:null===a?s:null,onHighlightedItemChange:this.onHighlightedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-"+r+"-"})}},{key:"ensureHighlightedItemIsVisible",value:function(){var e=this.highlightedItem;if(e){var t=this.itemsContainer,n=e.offsetParent===t?e.offsetTop:e.offsetTop-t.offsetTop,r=t.scrollTop;n<r?r=n:n+e.offsetHeight>r+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,o=t.multiSection,i=t.renderInputComponent,a=t.renderItemsContainer,s=t.highlightedSectionIndex,u=t.highlightedItemIndex,l=this.state.isInputFocused,f=o?this.renderSections():this.renderItems(),p=null!==f,d=this.getItemId(s,u),m="react-autowhatever-"+n,h=r({role:"combobox","aria-haspopup":"listbox","aria-owns":m,"aria-expanded":p},e("react-autowhatever-"+n+"-container","container",p&&"containerOpen"),this.props.containerProps),y=i(r({type:"text",value:"",autoComplete:"off","aria-autocomplete":"list","aria-controls":m,"aria-activedescendant":d},e("react-autowhatever-"+n+"-input","input",p&&"inputOpen",l&&"inputFocused"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),v=a({containerProps:r({id:m,role:"listbox"},e("react-autowhatever-"+n+"-items-container","itemsContainer",p&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:f});return c.default.createElement("div",h,y,v)}}]),t}(a.Component);h.propTypes={id:s.default.string,multiSection:s.default.bool,renderInputComponent:s.default.func,renderItemsContainer:s.default.func,items:s.default.array.isRequired,renderItem:s.default.func,renderItemData:s.default.object,renderSectionTitle:s.default.func,getSectionItems:s.default.func,containerProps:s.default.object,inputProps:s.default.object,itemProps:s.default.oneOfType([s.default.object,s.default.func]),highlightedSectionIndex:s.default.number,highlightedItemIndex:s.default.number,theme:s.default.oneOfType([s.default.object,s.default.array])},h.defaultProps={id:"1",multiSection:!1,renderInputComponent:function(e){return c.default.createElement("input",e)},renderItemsContainer:function(e){var t=e.containerProps,n=e.children;return c.default.createElement("div",t,n)},renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:m,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},containerProps:m,inputProps:m,itemProps:m,highlightedSectionIndex:null,highlightedItemIndex:null,theme:{container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",inputOpen:"react-autowhatever__input--open",inputFocused:"react-autowhatever__input--focused",itemsContainer:"react-autowhatever__items-container",itemsContainerOpen:"react-autowhatever__items-container--open",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFirst:"react-autowhatever__item--first",itemHighlighted:"react-autowhatever__item--highlighted",sectionContainer:"react-autowhatever__section-container",sectionContainerFirst:"react-autowhatever__section-container--first",sectionTitle:"react-autowhatever__section-title"}},t.default=h},function(e,t,n){"use strict";var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&c.return&&c.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.exports=function(e){var t=e.data,n=e.multiSection;function o(e){var o=r(e,2),i=o[0],a=o[1];return n?null===a||a===t[i]-1?null===(i=function(e){for(null===e?e=0:e++;e<t.length&&0===t[e];)e++;return e===t.length?null:e}(i))?[null,null]:[i,0]:[i,a+1]:0===t||a===t-1?[null,null]:null===a?[null,0]:[null,a+1]}return{next:o,prev:function(e){var o=r(e,2),i=o[0],a=o[1];return n?null===a||0===a?null===(i=function(e){for(null===e?e=t.length-1:e--;e>=0&&0===t[e];)e--;return-1===e?null:e}(i))?[null,null]:[i,t[i]-1]:[i,a-1]:0===t||0===a?[null,null]:null===a?[null,t-1]:[null,a-1]},isLast:function(e){return null===o(e)[1]}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&c.return&&c.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var i,a=n(182),c=(i=a)&&i.__esModule?i:{default:i},s=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=r(t,2),i=n[0],a=n[1];return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var u=n.map((function(e){return i[e]})).filter(s);return"string"==typeof u[0]||"function"==typeof a?{key:e,className:a?a.apply(void 0,o(u)):u.join(" ")}:{key:e,style:c.default.apply(void 0,[{}].concat(o(u)))}}},e.exports=t.default},function(e,t,n){"use strict";var r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function i(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter((function(t){return r.call(e,t)}))}e.exports=Object.assign||function(e,t){for(var n,r,a=o(e),c=1;c<arguments.length;c++){n=arguments[c],r=i(Object(n));for(var s=0;s<r.length;s++)a[r[s]]=n[r[s]]}return a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=s(o),a=s(n(16)),c=s(n(29));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var f=function(e){function t(){return u(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"shouldComponentUpdate",value:function(e){return(0,c.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,r=e.theme,o=e.sectionKeyPrefix,a=n(t);return a?i.default.createElement("div",r(o+"title","sectionTitle"),a):null}}]),t}(o.Component);f.propTypes={section:a.default.any.isRequired,renderSectionTitle:a.default.func.isRequired,theme:a.default.func.isRequired,sectionKeyPrefix:a.default.string.isRequired},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=l(i),c=l(n(16)),s=l(n(185)),u=l(n(29));function l(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=function(e){function t(){var e,n,r;f(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=p(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.storeHighlightedItemReference=function(e){r.props.onHighlightedItemChange(null===e?null:e.item)},p(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"shouldComponentUpdate",value:function(e){return(0,u.default)(e,this.props,["itemProps"])}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,o=t.itemProps,i=t.renderItem,c=t.renderItemData,u=t.sectionIndex,l=t.highlightedItemIndex,f=t.getItemId,p=t.theme,d=t.keyPrefix,m=null===u?d:d+"section-"+u+"-",h="function"==typeof o;return a.default.createElement("ul",r({role:"listbox"},p(m+"items-list","itemsList")),n.map((function(t,n){var d=0===n,y=n===l,v=m+"item-"+n,b=h?o({sectionIndex:u,itemIndex:n}):o,g=r({id:f(u,n),"aria-selected":y},p(v,"item",d&&"itemFirst",y&&"itemHighlighted"),b);return y&&(g.ref=e.storeHighlightedItemReference),a.default.createElement(s.default,r({},g,{sectionIndex:u,isHighlighted:y,itemIndex:n,item:t,renderItem:i,renderItemData:c}))})))}}]),t}(i.Component);d.propTypes={items:c.default.array.isRequired,itemProps:c.default.oneOfType([c.default.object,c.default.func]),renderItem:c.default.func.isRequired,renderItemData:c.default.object.isRequired,sectionIndex:c.default.number,highlightedItemIndex:c.default.number,onHighlightedItemChange:c.default.func.isRequired,getItemId:c.default.func.isRequired,theme:c.default.func.isRequired,keyPrefix:c.default.string.isRequired},d.defaultProps={sectionIndex:null},t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=u(i),c=u(n(16)),s=u(n(29));function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var p=function(e){function t(){var e,n,r;l(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=f(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.storeItemReference=function(e){null!==e&&(r.item=e)},r.onMouseEnter=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseEnter(e,{sectionIndex:n,itemIndex:o})},r.onMouseLeave=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseLeave(e,{sectionIndex:n,itemIndex:o})},r.onMouseDown=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseDown(e,{sectionIndex:n,itemIndex:o})},r.onClick=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onClick(e,{sectionIndex:n,itemIndex:o})},f(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"shouldComponentUpdate",value:function(e){return(0,s.default)(e,this.props,["renderItemData"])}},{key:"render",value:function(){var e=this.props,t=e.isHighlighted,n=e.item,o=e.renderItem,i=e.renderItemData,c=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["isHighlighted","item","renderItem","renderItemData"]);return delete c.sectionIndex,delete c.itemIndex,"function"==typeof c.onMouseEnter&&(c.onMouseEnter=this.onMouseEnter),"function"==typeof c.onMouseLeave&&(c.onMouseLeave=this.onMouseLeave),"function"==typeof c.onMouseDown&&(c.onMouseDown=this.onMouseDown),"function"==typeof c.onClick&&(c.onClick=this.onClick),a.default.createElement("li",r({role:"option"},c,{ref:this.storeItemReference}),o(n,r({isHighlighted:t},i)))}}]),t}(i.Component);p.propTypes={sectionIndex:c.default.number,isHighlighted:c.default.bool.isRequired,itemIndex:c.default.number.isRequired,item:c.default.any.isRequired,renderItem:c.default.func.isRequired,renderItemData:c.default.object.isRequired,onMouseEnter:c.default.func,onMouseLeave:c.default.func,onMouseDown:c.default.func,onClick:c.default.func},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"},t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}},function(e,t,n){"use strict";t.__esModule=!0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(188));var o=r.tokenize,i=r.options.Options;function a(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function c(e){return e.replace(/"/g,""")}function s(e){if(!e)return"";var t=[];for(var n in e){var r=e[n]+"";t.push(n+'="'+c(r)+'"')}return t.join(" ")}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=new i(t);for(var n=o(e),r=[],u=0;u<n.length;u++){var l=n[u];if("nl"===l.type&&t.nl2br)r.push("<br>\n");else if(l.isLink&&t.check(l)){var f=t.resolve(l),p=f.formatted,d=f.formattedHref,m=f.tagName,h=f.className,y=f.target,v=f.attributes,b="<"+m+' href="'+c(d)+'"';h&&(b+=' class="'+c(h)+'"'),y&&(b+=' target="'+c(y)+'"'),v&&(b+=" "+s(v)),b+=">"+a(p)+"</"+m+">",r.push(b)}else r.push(a(l.toString()))}return r.join("")}if(!String.prototype.linkify)try{Object.defineProperty(String.prototype,"linkify",{set:function(){},get:function(){return function(e){return u(this,e)}}})}catch(e){String.prototype.linkify||(String.prototype.linkify=function(e){return u(this,e)})}t.default=u},function(e,t,n){"use strict";t.__esModule=!0,t.tokenize=t.test=t.scanner=t.parser=t.options=t.inherits=t.find=void 0;var r=n(19),o=c(n(189)),i=c(n(190)),a=c(n(191));function c(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var s=function(e){return a.run(i.run(e))};t.find=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s(e),r=[],o=0;o<n.length;o++){var i=n[o];!i.isLink||t&&i.type!==t||r.push(i.toObject())}return r},t.inherits=r.inherits,t.options=o,t.parser=a,t.scanner=i,t.test=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s(e);return 1===n.length&&n[0].isLink&&(!t||n[0].type===t)},t.tokenize=s},function(e,t,n){"use strict";t.__esModule=!0;var 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},o={defaultProtocol:"http",events:null,format:a,formatHref:a,nl2br:!1,tagName:"a",target:function(e,t){return"url"===t?"_blank":null},validate:!0,ignoreTags:[],attributes:null,className:"linkified"};function i(e){e=e||{},this.defaultProtocol=e.hasOwnProperty("defaultProtocol")?e.defaultProtocol:o.defaultProtocol,this.events=e.hasOwnProperty("events")?e.events:o.events,this.format=e.hasOwnProperty("format")?e.format:o.format,this.formatHref=e.hasOwnProperty("formatHref")?e.formatHref:o.formatHref,this.nl2br=e.hasOwnProperty("nl2br")?e.nl2br:o.nl2br,this.tagName=e.hasOwnProperty("tagName")?e.tagName:o.tagName,this.target=e.hasOwnProperty("target")?e.target:o.target,this.validate=e.hasOwnProperty("validate")?e.validate:o.validate,this.ignoreTags=[],this.attributes=e.attributes||e.linkAttributes||o.attributes,this.className=e.hasOwnProperty("className")?e.className:e.linkClass||o.className;for(var t=e.hasOwnProperty("ignoreTags")?e.ignoreTags:o.ignoreTags,n=0;n<t.length;n++)this.ignoreTags.push(t[n].toUpperCase())}function a(e){return e}t.defaults=o,t.Options=i,t.contains=function(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1},i.prototype={resolve:function(e){var t=e.toHref(this.defaultProtocol);return{formatted:this.get("format",e.toString(),e),formattedHref:this.get("formatHref",t,e),tagName:this.get("tagName",t,e),className:this.get("className",t,e),target:this.get("target",t,e),events:this.getObject("events",t,e),attributes:this.getObject("attributes",t,e)}},check:function(e){return this.get("validate",e.toString(),e)},get:function(e,t,n){var i=void 0,a=this[e];if(!a)return a;switch(void 0===a?"undefined":r(a)){case"function":return a(t,n.type);case"object":return"function"==typeof(i=a.hasOwnProperty(n.type)?a[n.type]:o[e])?i(t,n.type):i}return a},getObject:function(e,t,n){var r=this[e];return"function"==typeof r?r(t,n.type):r}}},function(e,t,n){"use strict";t.__esModule=!0,t.start=t.run=t.TOKENS=t.State=void 0;var r=n(120),o=n(30),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(o);var a="aaa|aarp|abarth|abb|abbott|abbvie|abc|able|abogado|abudhabi|ac|academy|accenture|accountant|accountants|aco|active|actor|ad|adac|ads|adult|ae|aeg|aero|aetna|af|afamilycompany|afl|africa|ag|agakhan|agency|ai|aig|aigo|airbus|airforce|airtel|akdn|al|alfaromeo|alibaba|alipay|allfinanz|allstate|ally|alsace|alstom|am|americanexpress|americanfamily|amex|amfam|amica|amsterdam|analytics|android|anquan|anz|ao|aol|apartments|app|apple|aq|aquarelle|ar|arab|aramco|archi|army|arpa|art|arte|as|asda|asia|associates|at|athleta|attorney|au|auction|audi|audible|audio|auspost|author|auto|autos|avianca|aw|aws|ax|axa|az|azure|ba|baby|baidu|banamex|bananarepublic|band|bank|bar|barcelona|barclaycard|barclays|barefoot|bargains|baseball|basketball|bauhaus|bayern|bb|bbc|bbt|bbva|bcg|bcn|bd|be|beats|beauty|beer|bentley|berlin|best|bestbuy|bet|bf|bg|bh|bharti|bi|bible|bid|bike|bing|bingo|bio|biz|bj|black|blackfriday|blanco|blockbuster|blog|bloomberg|blue|bm|bms|bmw|bn|bnl|bnpparibas|bo|boats|boehringer|bofa|bom|bond|boo|book|booking|boots|bosch|bostik|boston|bot|boutique|box|br|bradesco|bridgestone|broadway|broker|brother|brussels|bs|bt|budapest|bugatti|build|builders|business|buy|buzz|bv|bw|by|bz|bzh|ca|cab|cafe|cal|call|calvinklein|cam|camera|camp|cancerresearch|canon|capetown|capital|capitalone|car|caravan|cards|care|career|careers|cars|cartier|casa|case|caseih|cash|casino|cat|catering|catholic|cba|cbn|cbre|cbs|cc|cd|ceb|center|ceo|cern|cf|cfa|cfd|cg|ch|chanel|channel|chase|chat|cheap|chintai|chloe|christmas|chrome|chrysler|church|ci|cipriani|circle|cisco|citadel|citi|citic|city|cityeats|ck|cl|claims|cleaning|click|clinic|clinique|clothing|cloud|club|clubmed|cm|cn|co|coach|codes|coffee|college|cologne|com|comcast|commbank|community|company|compare|computer|comsec|condos|construction|consulting|contact|contractors|cooking|cookingchannel|cool|coop|corsica|country|coupon|coupons|courses|cr|credit|creditcard|creditunion|cricket|crown|crs|cruise|cruises|csc|cu|cuisinella|cv|cw|cx|cy|cymru|cyou|cz|dabur|dad|dance|data|date|dating|datsun|day|dclk|dds|de|deal|dealer|deals|degree|delivery|dell|deloitte|delta|democrat|dental|dentist|desi|design|dev|dhl|diamonds|diet|digital|direct|directory|discount|discover|dish|diy|dj|dk|dm|dnp|do|docs|doctor|dodge|dog|doha|domains|dot|download|drive|dtv|dubai|duck|dunlop|duns|dupont|durban|dvag|dvr|dz|earth|eat|ec|eco|edeka|edu|education|ee|eg|email|emerck|energy|engineer|engineering|enterprises|epost|epson|equipment|er|ericsson|erni|es|esq|estate|esurance|et|etisalat|eu|eurovision|eus|events|everbank|exchange|expert|exposed|express|extraspace|fage|fail|fairwinds|faith|family|fan|fans|farm|farmers|fashion|fast|fedex|feedback|ferrari|ferrero|fi|fiat|fidelity|fido|film|final|finance|financial|fire|firestone|firmdale|fish|fishing|fit|fitness|fj|fk|flickr|flights|flir|florist|flowers|fly|fm|fo|foo|food|foodnetwork|football|ford|forex|forsale|forum|foundation|fox|fr|free|fresenius|frl|frogans|frontdoor|frontier|ftr|fujitsu|fujixerox|fun|fund|furniture|futbol|fyi|ga|gal|gallery|gallo|gallup|game|games|gap|garden|gb|gbiz|gd|gdn|ge|gea|gent|genting|george|gf|gg|ggee|gh|gi|gift|gifts|gives|giving|gl|glade|glass|gle|global|globo|gm|gmail|gmbh|gmo|gmx|gn|godaddy|gold|goldpoint|golf|goo|goodhands|goodyear|goog|google|gop|got|gov|gp|gq|gr|grainger|graphics|gratis|green|gripe|grocery|group|gs|gt|gu|guardian|gucci|guge|guide|guitars|guru|gw|gy|hair|hamburg|hangout|haus|hbo|hdfc|hdfcbank|health|healthcare|help|helsinki|here|hermes|hgtv|hiphop|hisamitsu|hitachi|hiv|hk|hkt|hm|hn|hockey|holdings|holiday|homedepot|homegoods|homes|homesense|honda|honeywell|horse|hospital|host|hosting|hot|hoteles|hotels|hotmail|house|how|hr|hsbc|ht|htc|hu|hughes|hyatt|hyundai|ibm|icbc|ice|icu|id|ie|ieee|ifm|ikano|il|im|imamat|imdb|immo|immobilien|in|industries|infiniti|info|ing|ink|institute|insurance|insure|int|intel|international|intuit|investments|io|ipiranga|iq|ir|irish|is|iselect|ismaili|ist|istanbul|it|itau|itv|iveco|iwc|jaguar|java|jcb|jcp|je|jeep|jetzt|jewelry|jio|jlc|jll|jm|jmp|jnj|jo|jobs|joburg|jot|joy|jp|jpmorgan|jprs|juegos|juniper|kaufen|kddi|ke|kerryhotels|kerrylogistics|kerryproperties|kfh|kg|kh|ki|kia|kim|kinder|kindle|kitchen|kiwi|km|kn|koeln|komatsu|kosher|kp|kpmg|kpn|kr|krd|kred|kuokgroup|kw|ky|kyoto|kz|la|lacaixa|ladbrokes|lamborghini|lamer|lancaster|lancia|lancome|land|landrover|lanxess|lasalle|lat|latino|latrobe|law|lawyer|lb|lc|lds|lease|leclerc|lefrak|legal|lego|lexus|lgbt|li|liaison|lidl|life|lifeinsurance|lifestyle|lighting|like|lilly|limited|limo|lincoln|linde|link|lipsy|live|living|lixil|lk|loan|loans|locker|locus|loft|lol|london|lotte|lotto|love|lpl|lplfinancial|lr|ls|lt|ltd|ltda|lu|lundbeck|lupin|luxe|luxury|lv|ly|ma|macys|madrid|maif|maison|makeup|man|management|mango|map|market|marketing|markets|marriott|marshalls|maserati|mattel|mba|mc|mckinsey|md|me|med|media|meet|melbourne|meme|memorial|men|menu|meo|merckmsd|metlife|mg|mh|miami|microsoft|mil|mini|mint|mit|mitsubishi|mk|ml|mlb|mls|mm|mma|mn|mo|mobi|mobile|mobily|moda|moe|moi|mom|monash|money|monster|mopar|mormon|mortgage|moscow|moto|motorcycles|mov|movie|movistar|mp|mq|mr|ms|msd|mt|mtn|mtr|mu|museum|mutual|mv|mw|mx|my|mz|na|nab|nadex|nagoya|name|nationwide|natura|navy|nba|nc|ne|nec|net|netbank|netflix|network|neustar|new|newholland|news|next|nextdirect|nexus|nf|nfl|ng|ngo|nhk|ni|nico|nike|nikon|ninja|nissan|nissay|nl|no|nokia|northwesternmutual|norton|now|nowruz|nowtv|np|nr|nra|nrw|ntt|nu|nyc|nz|obi|observer|off|office|okinawa|olayan|olayangroup|oldnavy|ollo|om|omega|one|ong|onl|online|onyourside|ooo|open|oracle|orange|org|organic|origins|osaka|otsuka|ott|ovh|pa|page|panasonic|panerai|paris|pars|partners|parts|party|passagens|pay|pccw|pe|pet|pf|pfizer|pg|ph|pharmacy|phd|philips|phone|photo|photography|photos|physio|piaget|pics|pictet|pictures|pid|pin|ping|pink|pioneer|pizza|pk|pl|place|play|playstation|plumbing|plus|pm|pn|pnc|pohl|poker|politie|porn|post|pr|pramerica|praxi|press|prime|pro|prod|productions|prof|progressive|promo|properties|property|protection|pru|prudential|ps|pt|pub|pw|pwc|py|qa|qpon|quebec|quest|qvc|racing|radio|raid|re|read|realestate|realtor|realty|recipes|red|redstone|redumbrella|rehab|reise|reisen|reit|reliance|ren|rent|rentals|repair|report|republican|rest|restaurant|review|reviews|rexroth|rich|richardli|ricoh|rightathome|ril|rio|rip|rmit|ro|rocher|rocks|rodeo|rogers|room|rs|rsvp|ru|rugby|ruhr|run|rw|rwe|ryukyu|sa|saarland|safe|safety|sakura|sale|salon|samsclub|samsung|sandvik|sandvikcoromant|sanofi|sap|sapo|sarl|sas|save|saxo|sb|sbi|sbs|sc|sca|scb|schaeffler|schmidt|scholarships|school|schule|schwarz|science|scjohnson|scor|scot|sd|se|search|seat|secure|security|seek|select|sener|services|ses|seven|sew|sex|sexy|sfr|sg|sh|shangrila|sharp|shaw|shell|shia|shiksha|shoes|shop|shopping|shouji|show|showtime|shriram|si|silk|sina|singles|site|sj|sk|ski|skin|sky|skype|sl|sling|sm|smart|smile|sn|sncf|so|soccer|social|softbank|software|sohu|solar|solutions|song|sony|soy|space|spiegel|spot|spreadbetting|sr|srl|srt|st|stada|staples|star|starhub|statebank|statefarm|statoil|stc|stcgroup|stockholm|storage|store|stream|studio|study|style|su|sucks|supplies|supply|support|surf|surgery|suzuki|sv|swatch|swiftcover|swiss|sx|sy|sydney|symantec|systems|sz|tab|taipei|talk|taobao|target|tatamotors|tatar|tattoo|tax|taxi|tc|tci|td|tdk|team|tech|technology|tel|telecity|telefonica|temasek|tennis|teva|tf|tg|th|thd|theater|theatre|tiaa|tickets|tienda|tiffany|tips|tires|tirol|tj|tjmaxx|tjx|tk|tkmaxx|tl|tm|tmall|tn|to|today|tokyo|tools|top|toray|toshiba|total|tours|town|toyota|toys|tr|trade|trading|training|travel|travelchannel|travelers|travelersinsurance|trust|trv|tt|tube|tui|tunes|tushu|tv|tvs|tw|tz|ua|ubank|ubs|uconnect|ug|uk|unicom|university|uno|uol|ups|us|uy|uz|va|vacations|vana|vanguard|vc|ve|vegas|ventures|verisign|versicherung|vet|vg|vi|viajes|video|vig|viking|villas|vin|vip|virgin|visa|vision|vista|vistaprint|viva|vivo|vlaanderen|vn|vodka|volkswagen|volvo|vote|voting|voto|voyage|vu|vuelos|wales|walmart|walter|wang|wanggou|warman|watch|watches|weather|weatherchannel|webcam|weber|website|wed|wedding|weibo|weir|wf|whoswho|wien|wiki|williamhill|win|windows|wine|winners|wme|wolterskluwer|woodside|work|works|world|wow|ws|wtc|wtf|xbox|xerox|xfinity|xihuan|xin|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--30rr7y|xn--3bst00m|xn--3ds443g|xn--3e0b707e|xn--3hcrj9c|xn--3oq18vl8pn36a|xn--3pxu8k|xn--42c2d9a|xn--45br5cyl|xn--45brj9c|xn--45q11c|xn--4gbrim|xn--54b7fta0cc|xn--55qw42g|xn--55qx5d|xn--5su34j936bgsg|xn--5tzm5g|xn--6frz82g|xn--6qq986b3xl|xn--80adxhks|xn--80ao21a|xn--80aqecdr1a|xn--80asehdb|xn--80aswg|xn--8y0a063a|xn--90a3ac|xn--90ae|xn--90ais|xn--9dbq2a|xn--9et52u|xn--9krt00a|xn--b4w605ferd|xn--bck1b9a5dre4c|xn--c1avg|xn--c2br7g|xn--cck2b3b|xn--cg4bki|xn--clchc0ea0b2g2a9gcd|xn--czr694b|xn--czrs0t|xn--czru2d|xn--d1acj3b|xn--d1alf|xn--e1a4c|xn--eckvdtc9d|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fhbei|xn--fiq228c5hs|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--fjq720a|xn--flw351e|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--fzys8d69uvgm|xn--g2xx48c|xn--gckr3f0f|xn--gecrj9c|xn--gk3at1e|xn--h2breg3eve|xn--h2brj9c|xn--h2brj9c8c|xn--hxt814e|xn--i1b6b1a6a2e|xn--imr513n|xn--io0a7i|xn--j1aef|xn--j1amh|xn--j6w193g|xn--jlq61u9w7b|xn--jvr189m|xn--kcrx77d1x4a|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--kput3i|xn--l1acc|xn--lgbbat1ad8j|xn--mgb9awbf|xn--mgba3a3ejt|xn--mgba3a4f16a|xn--mgba7c0bbn0a|xn--mgbaakc7dvf|xn--mgbaam7a8h|xn--mgbab2bd|xn--mgbai9azgqp6j|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a|xn--mgbbh1a71e|xn--mgbc0a9azcg|xn--mgbca7dzdo|xn--mgberp4a5d4ar|xn--mgbgu82a|xn--mgbi4ecexp|xn--mgbpl2fh|xn--mgbt3dhd|xn--mgbtx2b|xn--mgbx4cd0ab|xn--mix891f|xn--mk1bu44c|xn--mxtq1m|xn--ngbc5azd|xn--ngbe9e0a|xn--ngbrx|xn--node|xn--nqv7f|xn--nqv7fs00ema|xn--nyqy26a|xn--o3cw4h|xn--ogbpf8fl|xn--p1acf|xn--p1ai|xn--pbt977c|xn--pgbs0dh|xn--pssy2u|xn--q9jyb4c|xn--qcka1pmc|xn--qxam|xn--rhqv96g|xn--rovu88b|xn--rvc1e0am3e|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--tckwe|xn--tiq49xqyj|xn--unup4y|xn--vermgensberater-ctb|xn--vermgensberatung-pwb|xn--vhquv|xn--vuq861b|xn--w4r85el8fhu5dnra|xn--w4rs40l|xn--wgbh1c|xn--wgbl6a|xn--xhq521b|xn--xkc2al3hye2a|xn--xkc2dl3a5ee0h|xn--y9a3aq|xn--yfro4i67o|xn--ygbi2ammx|xn--zfr164b|xperia|xxx|xyz|yachts|yahoo|yamaxun|yandex|ye|yodobashi|yoga|yokohama|you|youtube|yt|yun|za|zappos|zara|zero|zip|zippo|zm|zone|zuerich|zw".split("|"),c="0123456789".split(""),s="0123456789abcdefghijklmnopqrstuvwxyz".split(""),u=[" ","\f","\r","\t","\v"," "," ",""],l=[],f=function(e){return new r.CharacterState(e)},p=f(),d=f(o.NUM),m=f(o.DOMAIN),h=f(),y=f(o.WS);p.on("@",f(o.AT)).on(".",f(o.DOT)).on("+",f(o.PLUS)).on("#",f(o.POUND)).on("?",f(o.QUERY)).on("/",f(o.SLASH)).on("_",f(o.UNDERSCORE)).on(":",f(o.COLON)).on("{",f(o.OPENBRACE)).on("[",f(o.OPENBRACKET)).on("<",f(o.OPENANGLEBRACKET)).on("(",f(o.OPENPAREN)).on("}",f(o.CLOSEBRACE)).on("]",f(o.CLOSEBRACKET)).on(">",f(o.CLOSEANGLEBRACKET)).on(")",f(o.CLOSEPAREN)).on("&",f(o.AMPERSAND)).on([",",";","!",'"',"'"],f(o.PUNCTUATION)),p.on("\n",f(o.NL)).on(u,y),y.on(u,y);for(var v=0;v<a.length;v++){var b=(0,r.stateify)(a[v],p,o.TLD,o.DOMAIN);l.push.apply(l,b)}var g=(0,r.stateify)("file",p,o.DOMAIN,o.DOMAIN),S=(0,r.stateify)("ftp",p,o.DOMAIN,o.DOMAIN),E=(0,r.stateify)("http",p,o.DOMAIN,o.DOMAIN),O=(0,r.stateify)("mailto",p,o.DOMAIN,o.DOMAIN);l.push.apply(l,g),l.push.apply(l,S),l.push.apply(l,E),l.push.apply(l,O);var j=g.pop(),C=S.pop(),w=E.pop(),A=O.pop(),I=f(o.DOMAIN),T=f(o.PROTOCOL),k=f(o.MAILTO);C.on("s",I).on(":",T),w.on("s",I).on(":",T),l.push(I),j.on(":",T),I.on(":",T),A.on(":",k);var _=(0,r.stateify)("localhost",p,o.LOCALHOST,o.DOMAIN);l.push.apply(l,_),p.on(c,d),d.on("-",h).on(c,d).on(s,m),m.on("-",h).on(s,m);for(var L=0;L<l.length;L++)l[L].on("-",h).on(s,m);h.on("-",h).on(c,m).on(s,m),p.defaultTransition=f(o.SYM);var x=p;t.State=r.CharacterState,t.TOKENS=i,t.run=function(e){for(var t=e.replace(/[A-Z]/g,(function(e){return e.toLowerCase()})),n=e.length,r=[],o=0;o<n;){for(var i=p,a=null,c=0,s=null,u=-1;o<n&&(a=i.next(t[o]));)(i=a).accepts()?(u=0,s=i):u>=0&&u++,c++,o++;if(!(u<0)){o-=u,c-=u;var l=s.emit();r.push(new l(e.substr(o-c,c)))}}return r},t.start=x},function(e,t,n){"use strict";t.__esModule=!0,t.start=t.run=t.TOKENS=t.State=void 0;var r=n(120),o=n(192),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(o),a=n(30);var c=function(e){return new r.TokenState(e)},s=c(),u=c(),l=c(),f=c(),p=c(),d=c(),m=c(),h=c(o.URL),y=c(),v=c(o.URL),b=c(o.URL),g=c(),S=c(),E=c(),O=c(),j=c(),C=c(o.URL),w=c(o.URL),A=c(o.URL),I=c(o.URL),T=c(),k=c(),_=c(),L=c(),x=c(),P=c(),N=c(o.EMAIL),R=c(),D=c(o.EMAIL),M=c(o.MAILTOEMAIL),U=c(),F=c(),V=c(),z=c(),B=c(o.NL);s.on(a.NL,B).on(a.PROTOCOL,u).on(a.MAILTO,l).on(a.SLASH,f),u.on(a.SLASH,f),f.on(a.SLASH,p),s.on(a.TLD,d).on(a.DOMAIN,d).on(a.LOCALHOST,h).on(a.NUM,d),p.on(a.TLD,b).on(a.DOMAIN,b).on(a.NUM,b).on(a.LOCALHOST,b),d.on(a.DOT,m),x.on(a.DOT,P),m.on(a.TLD,h).on(a.DOMAIN,d).on(a.NUM,d).on(a.LOCALHOST,d),P.on(a.TLD,N).on(a.DOMAIN,x).on(a.NUM,x).on(a.LOCALHOST,x),h.on(a.DOT,m),N.on(a.DOT,P),h.on(a.COLON,y).on(a.SLASH,b),y.on(a.NUM,v),v.on(a.SLASH,b),N.on(a.COLON,R),R.on(a.NUM,D);var H=[a.DOMAIN,a.AT,a.LOCALHOST,a.NUM,a.PLUS,a.POUND,a.PROTOCOL,a.SLASH,a.TLD,a.UNDERSCORE,a.SYM,a.AMPERSAND],q=[a.COLON,a.DOT,a.QUERY,a.PUNCTUATION,a.CLOSEBRACE,a.CLOSEBRACKET,a.CLOSEANGLEBRACKET,a.CLOSEPAREN,a.OPENBRACE,a.OPENBRACKET,a.OPENANGLEBRACKET,a.OPENPAREN];b.on(a.OPENBRACE,S).on(a.OPENBRACKET,E).on(a.OPENANGLEBRACKET,O).on(a.OPENPAREN,j),g.on(a.OPENBRACE,S).on(a.OPENBRACKET,E).on(a.OPENANGLEBRACKET,O).on(a.OPENPAREN,j),S.on(a.CLOSEBRACE,b),E.on(a.CLOSEBRACKET,b),O.on(a.CLOSEANGLEBRACKET,b),j.on(a.CLOSEPAREN,b),C.on(a.CLOSEBRACE,b),w.on(a.CLOSEBRACKET,b),A.on(a.CLOSEANGLEBRACKET,b),I.on(a.CLOSEPAREN,b),T.on(a.CLOSEBRACE,b),k.on(a.CLOSEBRACKET,b),_.on(a.CLOSEANGLEBRACKET,b),L.on(a.CLOSEPAREN,b),S.on(H,C),E.on(H,w),O.on(H,A),j.on(H,I),S.on(q,T),E.on(q,k),O.on(q,_),j.on(q,L),C.on(H,C),w.on(H,w),A.on(H,A),I.on(H,I),C.on(q,C),w.on(q,w),A.on(q,A),I.on(q,I),T.on(H,C),k.on(H,w),_.on(H,A),L.on(H,I),T.on(q,T),k.on(q,k),_.on(q,_),L.on(q,L),b.on(H,b),g.on(H,b),b.on(q,g),g.on(q,g),l.on(a.TLD,M).on(a.DOMAIN,M).on(a.NUM,M).on(a.LOCALHOST,M),M.on(H,M).on(q,U),U.on(H,M).on(q,U);var J=[a.DOMAIN,a.NUM,a.PLUS,a.POUND,a.QUERY,a.UNDERSCORE,a.SYM,a.AMPERSAND,a.TLD];d.on(J,F).on(a.AT,V),h.on(J,F).on(a.AT,V),m.on(J,F),F.on(J,F).on(a.AT,V).on(a.DOT,z),z.on(J,F),V.on(a.TLD,x).on(a.DOMAIN,x).on(a.LOCALHOST,N);t.State=r.TokenState,t.TOKENS=i,t.run=function(e){for(var t=e.length,n=0,r=[],i=[];n<t;){for(var a=s,c=null,u=null,l=0,f=null,p=-1;n<t&&!(c=a.next(e[n]));)i.push(e[n++]);for(;n<t&&(u=c||a.next(e[n]));)c=null,(a=u).accepts()?(p=0,f=a):p>=0&&p++,n++,l++;if(p<0)for(var d=n-l;d<n;d++)i.push(e[d]);else{i.length>0&&(r.push(new o.TEXT(i)),i=[]),n-=p,l-=p;var m=f.emit();r.push(new m(e.slice(n-l,n)))}}return i.length>0&&r.push(new o.TEXT(i)),r},t.start=s},function(e,t,n){"use strict";t.__esModule=!0,t.URL=t.TEXT=t.NL=t.EMAIL=t.MAILTOEMAIL=t.Base=void 0;var r=n(121),o=n(19),i=n(30);function a(e){return e instanceof i.DOMAIN||e instanceof i.TLD}var c=(0,r.createTokenClass)();c.prototype={type:"token",isLink:!1,toString:function(){for(var e=[],t=0;t<this.v.length;t++)e.push(this.v[t].toString());return e.join("")},toHref:function(){return this.toString()},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http";return{type:this.type,value:this.toString(),href:this.toHref(e)}}};var s=(0,o.inherits)(c,(0,r.createTokenClass)(),{type:"email",isLink:!0}),u=(0,o.inherits)(c,(0,r.createTokenClass)(),{type:"email",isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),l=(0,o.inherits)(c,(0,r.createTokenClass)(),{type:"text"}),f=(0,o.inherits)(c,(0,r.createTokenClass)(),{type:"nl"}),p=(0,o.inherits)(c,(0,r.createTokenClass)(),{type:"url",isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http",t=!1,n=!1,r=this.v,o=[],c=0;r[c]instanceof i.PROTOCOL;)t=!0,o.push(r[c].toString().toLowerCase()),c++;for(;r[c]instanceof i.SLASH;)n=!0,o.push(r[c].toString()),c++;for(;a(r[c]);)o.push(r[c].toString().toLowerCase()),c++;for(;c<r.length;c++)o.push(r[c].toString());return o=o.join(""),t||n||(o=e+"://"+o),o},hasProtocol:function(){return this.v[0]instanceof i.PROTOCOL}});t.Base=c,t.MAILTOEMAIL=s,t.EMAIL=u,t.NL=f,t.TEXT=l,t.URL=p},function(e,t,n){const{defaults:r}=n(17),{block:o}=n(122),{rtrim:i,splitCells:a,escape:c}=n(13);e.exports=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.rules=o.normal,this.options.pedantic?this.rules=o.pedantic:this.options.gfm&&(this.rules=o.gfm)}static get rules(){return o}static lex(t,n){return new e(n).lex(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.token(e,!0)}token(e,t){let n,r,s,u,l,f,p,d,m,h,y,v,b,g,S,E;for(e=e.replace(/^ +$/gm,"");e;)if((s=this.rules.newline.exec(e))&&(e=e.substring(s[0].length),s[0].length>1&&this.tokens.push({type:"space"})),s=this.rules.code.exec(e)){const t=this.tokens[this.tokens.length-1];e=e.substring(s[0].length),t&&"paragraph"===t.type?t.text+="\n"+s[0].trimRight():(s=s[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?s:i(s,"\n")}))}else if(s=this.rules.fences.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"code",lang:s[2]?s[2].trim():s[2],text:s[3]||""});else if(s=this.rules.heading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:s[1].length,text:s[2]});else if((s=this.rules.nptable.exec(e))&&(f={type:"table",header:a(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]},f.header.length===f.align.length)){for(e=e.substring(s[0].length),y=0;y<f.align.length;y++)/^ *-+: *$/.test(f.align[y])?f.align[y]="right":/^ *:-+: *$/.test(f.align[y])?f.align[y]="center":/^ *:-+ *$/.test(f.align[y])?f.align[y]="left":f.align[y]=null;for(y=0;y<f.cells.length;y++)f.cells[y]=a(f.cells[y],f.header.length);this.tokens.push(f)}else if(s=this.rules.hr.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"hr"});else if(s=this.rules.blockquote.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"blockquote_start"}),s=s[0].replace(/^ *> ?/gm,""),this.token(s,t),this.tokens.push({type:"blockquote_end"});else if(s=this.rules.list.exec(e)){for(e=e.substring(s[0].length),u=s[2],g=u.length>1,p={type:"list_start",ordered:g,start:g?+u:"",loose:!1},this.tokens.push(p),s=s[0].match(this.rules.item),d=[],n=!1,b=s.length,y=0;y<b;y++)f=s[y],h=f.length,f=f.replace(/^ *([*+-]|\d+\.) */,""),~f.indexOf("\n ")&&(h-=f.length,f=this.options.pedantic?f.replace(/^ {1,4}/gm,""):f.replace(new RegExp("^ {1,"+h+"}","gm"),"")),y!==b-1&&(l=o.bullet.exec(s[y+1])[0],(u.length>1?1===l.length:l.length>1||this.options.smartLists&&l!==u)&&(e=s.slice(y+1).join("\n")+e,y=b-1)),r=n||/\n\n(?!\s*$)/.test(f),y!==b-1&&(n="\n"===f.charAt(f.length-1),r||(r=n)),r&&(p.loose=!0),S=/^\[[ xX]\] /.test(f),E=void 0,S&&(E=" "!==f[1],f=f.replace(/^\[[ xX]\] +/,"")),m={type:"list_item_start",task:S,checked:E,loose:r},d.push(m),this.tokens.push(m),this.token(f,!1),this.tokens.push({type:"list_item_end"});if(p.loose)for(b=d.length,y=0;y<b;y++)d[y].loose=!0;this.tokens.push({type:"list_end"})}else if(s=this.rules.html.exec(e))e=e.substring(s[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===s[1]||"script"===s[1]||"style"===s[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):c(s[0]):s[0]});else if(t&&(s=this.rules.def.exec(e)))e=e.substring(s[0].length),s[3]&&(s[3]=s[3].substring(1,s[3].length-1)),v=s[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[v]||(this.tokens.links[v]={href:s[2],title:s[3]});else if((s=this.rules.table.exec(e))&&(f={type:"table",header:a(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]},f.header.length===f.align.length)){for(e=e.substring(s[0].length),y=0;y<f.align.length;y++)/^ *-+: *$/.test(f.align[y])?f.align[y]="right":/^ *:-+: *$/.test(f.align[y])?f.align[y]="center":/^ *:-+ *$/.test(f.align[y])?f.align[y]="left":f.align[y]=null;for(y=0;y<f.cells.length;y++)f.cells[y]=a(f.cells[y].replace(/^ *\| *| *\| *$/g,""),f.header.length);this.tokens.push(f)}else if(s=this.rules.lheading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:"="===s[2].charAt(0)?1:2,text:s[1]});else if(t&&(s=this.rules.paragraph.exec(e)))e=e.substring(s[0].length),this.tokens.push({type:"paragraph",text:"\n"===s[1].charAt(s[1].length-1)?s[1].slice(0,-1):s[1]});else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"text",text:s[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens}}},function(e,t,n){const r=n(31),o=n(123),i=n(124),a=n(125),{defaults:c}=n(17),{merge:s,unescape:u}=n(13);e.exports=class e{constructor(e){this.tokens=[],this.token=null,this.options=e||c,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options,this.slugger=new o}static parse(t,n){return new e(n).parse(t)}parse(e){this.inline=new i(e.links,this.options),this.inlineText=new i(e.links,s({},this.options,{renderer:new a})),this.tokens=e.reverse();let t="";for(;this.next();)t+=this.tok();return t}next(){return this.token=this.tokens.pop(),this.token}peek(){return this.tokens[this.tokens.length-1]||0}parseText(){let e=this.token.text;for(;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}tok(){let e="";switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,u(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":{let t,n,r,o,i="";for(r="",t=0;t<this.token.header.length;t++)r+=this.renderer.tablecell(this.inline.output(this.token.header[t]),{header:!0,align:this.token.align[t]});for(i+=this.renderer.tablerow(r),t=0;t<this.token.cells.length;t++){for(n=this.token.cells[t],r="",o=0;o<n.length;o++)r+=this.renderer.tablecell(this.inline.output(n[o]),{header:!1,align:this.token.align[o]});e+=this.renderer.tablerow(r)}return this.renderer.table(i,e)}case"blockquote_start":for(e="";"blockquote_end"!==this.next().type;)e+=this.tok();return this.renderer.blockquote(e);case"list_start":{e="";const t=this.token.ordered,n=this.token.start;for(;"list_end"!==this.next().type;)e+=this.tok();return this.renderer.list(e,t,n)}case"list_item_start":{e="";const t=this.token.loose,n=this.token.checked,r=this.token.task;if(this.token.task)if(t)if("text"===this.peek().type){const e=this.peek();e.text=this.renderer.checkbox(n)+" "+e.text}else this.tokens.push({type:"text",text:this.renderer.checkbox(n)});else e+=this.renderer.checkbox(n);for(;"list_item_end"!==this.next().type;)e+=t||"text"!==this.token.type?this.tok():this.parseText();return this.renderer.listitem(e,r,n)}case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText());default:{const e='Token with "'+this.token.type+'" type was not found.';if(!this.options.silent)throw new Error(e);console.log(e)}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var r=i(n(0)),o=i(n(196));function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return(a="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){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(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 f(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?d(e):t}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=function(e){function t(){var e,n;u(this,t);for(var i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];return h(d(n=f(this,(e=p(t)).call.apply(e,[this].concat(a)))),"onClick",(function(e){var t=n.props,i=t.text,a=t.onCopy,c=t.children,s=t.options,u=r.default.Children.only(c),l=(0,o.default)(i,s);a&&a(i,l),u&&u.props&&"function"==typeof u.props.onClick&&u.props.onClick(e)})),n}var n,i,a;return 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&&m(e,t)}(t,e),n=t,(i=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),n=s(e,["text","onCopy","options","children"]),o=r.default.Children.only(t);return r.default.cloneElement(o,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(n,!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n,{onClick:this.onClick}))}}])&&l(n.prototype,i),a&&l(n,a),t}(r.default.PureComponent);t.CopyToClipboard=y,h(y,"defaultProps",{onCopy:void 0,options:void 0})},function(e,t,n){"use strict";var r=n(197),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,i,a,c,s,u,l=!1;t||(t={}),n=t.debug||!1;try{if(a=r(),c=document.createRange(),s=document.getSelection(),(u=document.createElement("span")).textContent=e,u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=o[t.format]||o.default;window.clipboardData.setData(i,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(u),c.selectNodeContents(u),s.addRange(c),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),i=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(i,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(c):s.removeAllRanges()),u&&document.body.removeChild(u),a()}return l}},function(e,t){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}}},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"AppLinkHelper",(function(){return A})),n.d(r,"AppLinkUtility",(function(){return C})),n.d(r,"Application",(function(){return oe})),n.d(r,"AppRouter",(function(){return be})),n.d(r,"Behavior",(function(){return Ie})),n.d(r,"Collection",(function(){return De})),n.d(r,"CollectionView",(function(){return Je})),n.d(r,"ComponentCollection",(function(){return Je})),n.d(r,"Error",(function(){return H})),n.d(r,"ErrorHelper",(function(){return K})),n.d(r,"SilentError",(function(){return q})),n.d(r,"LayoutView",(function(){return Ot})),n.d(r,"NestedModel",(function(){return Vt})),n.d(r,"Service",(function(){return Yt})),n.d(r,"Model",(function(){return Lt})),n.d(r,"View",(function(){return mt})),n.d(r,"Component",(function(){return ht})),n.d(r,"EventNames",(function(){return v})),n.d(r,"LayoutService",(function(){return nn})),n.d(r,"Middleware",(function(){return ae})),n.d(r,"LocationUtils",(function(){return g})),n.d(r,"Shell",(function(){return mn}));var o={};n.r(o),n.d(o,"emptyResponse",(function(){return Gr})),n.d(o,"getResponse",(function(){return Wr})),n.d(o,"getFetch",(function(){return Zr})),n.d(o,"fetch",(function(){return Qr})),n.d(o,"useGetFetch",(function(){return Xr})),n.d(o,"useGetResponse",(function(){return eo})),n.d(o,"useBasicFetch",(function(){return to})),n.d(o,"createMiddleware",(function(){return uo})),n.d(o,"FlightReducer",(function(){return go})),n.d(o,"Simulator",(function(){return Lo})),n.d(o,"Actions",(function(){return wr})),n.d(o,"RequestStatus",(function(){return Or})),n.d(o,"ajaxRequest",(function(){return Tr})),n.d(o,"normalize",(function(){return Nr})),n.d(o,"denormalize",(function(){return Ur}));n(137),n(138),n(139),n(140),n(141),n(142),n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(154),n(155),n(156),n(157),n(158),n(159),n(160),n(161),n(162),n(163),n(164),n(165),n(166),n(167),n(168);var i={UPLOAD_IMAGE:"upload:image"},a={Subjects:Object.assign({SUBJECTS:"subjects",NEW_SUBJECT:"new:subject",EDIT_SUBJECT:"edit:subject",EDIT_SUBJECT_PLAYLISTS:"edit:subject:playlists",EDIT_SUBJECT_SERIES:"edit:subject:series",EDIT_SUBJECT_VIDEOS:"edit:subject:videos",SUBJECT_CLASSIFICATIONS:"subject:classifications",DELETE_SUBJECT:"delete:subject",ADD_SUBJECT_MEMBERS:"add:subject:members",REMOVE_SUBJECT_MEMBER:"remove:subject:member",CLASSIFICATIONS:"classifications",PRESENTATION_CLASSIFICATIONS:"presentation:classifications",NEW_CLASSIFICATION:"new:classification",EDIT_CLASSIFICATION:"edit:classification",EDIT_CLASSIFICATION_PLAYLISTS:"edit:classification:playlists",EDIT_CLASSIFICATION_SERIES:"edit:classification:series",EDIT_CLASSIFICATION_VIDEOS:"edit:classification:videos",DELETE_CLASSIFICATION:"delete:classification",REMOVE_CLASSIFICATION_MEMBER:"remove:classification:member",LEVELS:"levels",NEW_LEVEL:"new:level",EDIT_LEVEL:"edit:level",AUDIENCES:"audiences",PRESENTATION_AUDIENCES:"presentation:audiences",NEW_AUDIENCE:"new:audience",EDIT_AUDIENCE:"edit:audience",DELETE_AUDIENCE:"delete:audience",PRESENTATIONS:"presentations",NEW_PRESENTATION:"new:presentation",EDIT_PRESENTATION:"edit:presentation"},i),Playlists:Object.assign({PLAYLISTS:"index",SEARCH_PLAYLISTS:"search:playlists",NEW_PLAYLIST:"new:playlist",EDIT_PLAYLIST:"edit:playlist",EDIT_PLAYLIST_VIDEOS:"edit:playlist:videos",EDIT_PLAYLIST_SUBJECTS:"edit:playlist:subjects",EDIT_PLAYLIST_AUDIENCES:"edit:playlist:audiences",DELETE_PLAYLIST:"delete:playlist",REMOVE_VIDEO:"remove:video",REMOVE_FROM_SUBJECT:"remove:from:subject"},i),Series:Object.assign({EDIT_SERIES:"edit:series",EDIT_SERIES_VIDEOS:"edit:series:videos",EDIT_SERIES_SUBJECTS:"edit:series:subjects",EDIT_SERIES_AUDIENCES:"edit:series:audiences",LEGACY_EDIT_SERIES:"legacy:edit:series"},i),Videos:Object.assign({EDIT_VIDEO:"edit:video",EDIT_VIDEO_AUDIENCES:"edit:video:audiences",EDIT_VIDEO_SUBJECTS:"edit:video:subjects",EDIT_VIDEO_ALIASES:"edit:video:aliases",LEGACY_EDIT_VIDEO:"legacy:edit:video"},i),DomainOptions:{DOMAIN_OPTIONS:"domain:options",NEW_DOMAIN_OPTION:"new:domain:option",EDIT_DOMAIN_OPTION:"edit:domain:option",DELETE_DOMAIN_OPTION:"delete:domain:option"},People:{PEOPLE:"people",NEW_PERSON:"new:person",EDIT_PERSON:"edit:person"},Companies:{COMPANIES:"companies",NEW_COMPANY:"new:company",EDIT_COMPANY:"edit:company"},Themes:Object.assign({THEMES:"themes",NEW_THEME:"new:theme",EDIT_THEME:"edit:theme",DELETE_THEME:"delete:theme"},i),ReleaseNotes:{FORM:"form",GENERATOR:"generator"}},c={SUBJECT:"subject",SUBJECTS:"subjects",UPDATE_SUBJECT:"update:subject",DELETE_SUBJECT:"delete:subject",UPDATE_OBJECT_SUBJECTS:"update:object:subjects",ADD_TO_SUBJECT:"add:to:subject",REMOVE_FROM_SUBJECT:"remove:from:subject",CLASSIFICATION:"classification",CLASSIFICATIONS:"classifications",UPDATE_CLASSIFICATION:"update:classification",DELETE_CLASSIFICATION:"delete:classification",UPDATE_OBJECT_CLASSIFICATIONS:"update:object:classifications",ADD_TO_CLASSIFICATION:"add:to:classification",REMOVE_FROM_CLASSIFICATION:"remove:from:classification",PRESENTATION:"presentation",PRESENTATIONS:"presentations",UPDATE_PRESENTATION:"update:presentation",LEVEL:"level",LEVELS:"levels",UPDATE_LEVEL:"update:level",ADD_TO_LEVEL:"add:to:level",REMOVE_FROM_LEVEL:"remove:from:level",UPDATE_OBJECT_LEVELS:"update:object:levels",AUDIENCE:"audience",AUDIENCES:"audiences",UPDATE_AUDIENCE:"update:audience",DELETE_AUDIENCE:"delete:audience",UPDATE_OBJECT_AUDIENCES:"update:object:audiences",PLAYLIST:"playlist",PLAYLISTS:"playlists",UPDATE_PLAYLIST:"update:playlist",DELETE_PLAYLIST:"delete:playlist",PLAYLIST_VIDEOS:"playlist:videos",REORDER_PLAYLIST_VIDEOS:"reorder:playlist:videos",REMOVE_PLAYLIST_VIDEO:"remove:playlist:video",VIDEO:"video",SERIES:"series",SERIES_BY_ID:"series:by:id",UPDATE_SERIES:"update:series",CURRENT_USER:"current:user",UPLOAD_IMAGE:"upload:image",LOCALE:"locale",PHRASES:"PHRASES"},s={IMAGES:".".concat(["jpg","tif","png","bmp","gif","jpeg"].join(",."))},u={CURATOR_LAYOUT:"CuratorLayout"},l={COMPANIES:"companies:application",DOMAIN_OPTIONS:"domain:options:application",PEOPLE:"people:application",PLAYLISTS:"playlists:application",SERIES:"series:application",SUBJECTS:"subjects:application",THEMES:"themes:application",VIDEOS:"videos:application",RELEASE_NOTES:"release:notes:application"},f={IMAGE_UPLOAD:"image:upload:data:service",SUBJECT:"subject:data:service",LANGUAGE:"language:data:service"},p={IMAGE_UPLOAD:"ImageUploadDataService",SUBJECT:"SubjectDataService",LANGUAGE:"LanguageDataService"},d=n(0),m=n.n(d),h=n(1),y=n(4),v={SHOW_POPUP:"show:popup",ROUTE:"route",LOCK_NAV:"lock:nav",UNLOCK_NAV:"unlock:nav",NAV_IS_LOCKED:"navigation:islocked",NAV_UNLOCKED_BY_USER:"navigation:unlocked:by:user",ROUTING_START:"routing:start",ROUTING_END:"routing:end",HAS_ACTIVE_ROUTE:"has:active:route",ROUTE_LOOKUP:"route:look:up",URL_CHANGE:"url:change",ERROR:"error",CURRENT_ROUTE:"route:current"},b={SHELL:"global:shell",ALERT:"global:alert",POPUP:"global:popup"},g={GetQuery:function(){return g.DeserializeQueryParams(window.location.search.substring(1))},UpdateQuery:function(e){if(e){var t=g.GetQuery(),n=g.SerializeQueryParams(h.extend(t,e));n&&(n="?".concat(n)),g.UpdateUrl("".concat(g.GetCurrentPath()).concat(n),null,{replace:!0,trigger:!1})}},UpdateUrl:function(e,t,n){var r=A.buildRoute(e,t);y.history.navigate(r,n),y.Radio.channel(b.SHELL).trigger(v.URL_CHANGE,t,n)},SerializeQueryParams:function(e){return e?"string"==typeof e?e:$.param(e,!0):""},DeserializeQueryParams:function(e){return e?h.reduce(e.split("&"),(function(e,t){var n=t.split("="),r=n[0],o=n.length>0?decodeURIComponent(n[1]):"";return e[r]?e[r]instanceof Array?(e[r].push(o),e):(e[r]=[e[r],o],e):(e[r]=o,e)}),{}):{}},StartHistory:function(){y.History.started&&y.history.stop(),y.history.start({pushState:!0})},PageLoad:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?window.open(e,"_blank"):window.location.href=e},Redirect:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=function(){return t?window.location.replace(e):window.location.href=e};C.hasActiveRoute()?y.Radio.channel(b.SHELL).once("routing:end",n):n()},Reload:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];window.location.reload(e)},GetCurrentPath:function(){return window.location.pathname},GetCurrentQueryString:function(){return window.location.search},GetCurrentUrl:function(){return window.location.href},GetCurrentReferrer:function(){return document.referrer},SetPageTitle:function(e){document.title=e}},S=/((\(\?)?:\w+)|(\*\w+)/,E=/[\(\)]/g,O=/\(\/\)/g,j=/\/$/,C={routingStarted:function(){y.Radio.channel(b.SHELL).trigger(v.ROUTING_START)},routingEnded:function(){C.hasActiveRoute()&&y.Radio.channel(b.SHELL).trigger(v.ROUTING_END)},hasActiveRoute:function(){return y.Radio.channel(b.SHELL).request(v.HAS_ACTIVE_ROUTE)}},w=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.usedHelper=!0;var n=e.application,r=e.action;y.Radio.channel(n).trigger(r,e,t)},A={getHref:function(e){if(!e)return"";var t=e.application,n=e.action,r=e.args,o=e.params,i=y.Radio.channel(b.SHELL);return"/".concat(i.request(v.ROUTE_LOOKUP,"".concat(t,":").concat(n),r,o))},buildRoute:function(e,t){if(!t)return e;var n=t.args,r=t.params;if(h.each(n,(function(t){e=e.replace(S,t||"")})),e=(e=(e=e.replace(O,"")).replace(E,"")).replace(j,""),!r)return e;var o=g.SerializeQueryParams(r);return o.length?"".concat(e,"?").concat(o):e},trigger:function(e,t){e&&(C.hasActiveRoute()?y.Radio.channel(b.SHELL).once("routing:end",(function(){w(e,t)})):w(e,t))},getCurrentAppLink:function(){return y.Radio.channel(b.SHELL).request(v.CURRENT_ROUTE)}},I=n(7);function T(e,t,n,r){var o=e;return"string"==typeof e&&(o=y.Radio.channel(e)),r.call(this,o,t,n)}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)}}var _=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.variables={}}var t,n,r;return t=e,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"get",value:function(e){return this.variables[e]}},{key:"setUpVariables",value:function(e){this.variables=e}},{key:"name",get:function(){return"EnvironmentVariables"}},{key:"isDevelopment",get:function(){return this.variables.isDevelopment}}])&&k(t.prototype,n),r&&k(t,r),e}().Instance;function L(e){return(L="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 x(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 P(e,t,n){return t&&x(e.prototype,t),n&&x(e,n),e}function N(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R(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&&z(e,t)}function D(e){var t=V();return function(){var n,r=B(e);if(t){var o=B(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return M(this,n)}}function M(e,t){return!t||"object"!==L(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 U(e){var t="function"==typeof Map?new Map:void 0;return(U=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return F(e,arguments,B(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),z(r,e)})(e)}function F(e,t,n){return(F=V()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&z(o,n.prototype),o}).apply(null,arguments)}function V(){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}}function z(e,t){return(z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function B(e){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var H=function(e){R(n,e);var t=D(n);function n(e){return N(this,n),t.call(this,e)}return n}(U(Error)),q=function(e){R(n,e);var t=D(n);function n(){return N(this,n),t.apply(this,arguments)}return P(n,[{key:"name",get:function(){return"SilentError"}}]),n}(H),J=function(e){R(n,e);var t=D(n);function n(){return N(this,n),t.apply(this,arguments)}return P(n,[{key:"name",get:function(){return"CoreError"}}]),n}(U(Error)),K={throw:function(e){if(y.Radio.channel(b.SHELL).trigger(v.ERROR,e),!(e instanceof q||_.isDevelopment))throw e}};function Y(e){return(Y="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 G(e){return function(e){if(Array.isArray(e))return W(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return W(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Q(e,t,n){return(Q="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=re(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function X(e,t){return(X=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ee(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=re(e);if(t){var o=re(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return te(this,n)}}function te(e,t){return!t||"object"!==Y(t)&&"function"!=typeof t?ne(e):t}function ne(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function re(e){return(re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var oe=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&&X(e,t)}(i,e);var t,n,r,o=ee(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).mergeOptions(e,[].concat(G(t.defaultProps),G(t.props||[]))),h.result(ne(t),"name")||K.throw(new J("BaseApplication must define a name")),h.result(ne(t),"channelName")||K.throw(new J("BaseApplication must define a channelName")),t.listenTo(t.getGlobalRadioChannel("popup"),v.SHOW_POPUP,t.onShowPopup),t.listenTo(t.getGlobalRadioChannel("alert"),"show:alert",t.onShowAlert),t}return t=i,(n=[{key:"getGlobalRadioChannel",value:function(e){var t=this.shell.getGlobalRadioChannels()[e.toUpperCase()];return t||K.throw(new J("Global channel ".concat(t," does not exist"))),y.Radio.channel(t)}},{key:"onLoadLayout",value:function(){if(this.layoutOptions&&this.layoutOptions.name){var e=h.extend({},this.layoutOptions.options||{},{store:this.shell.store});this.layout=this.layoutService.getLayout(h.extend(this.layoutOptions,{options:e})),this.layout||K.throw(new J("Layout: ".concat(this.layoutOptions.name," does not exist or was not registered"))),this.shell.showView(this.layout),this.triggerMethod("layout:loaded")}}},{key:"onShowPopup",value:function(e){this.layout.getRegion("popup")||K.throw(new J("Your application layout must define a popup region")),this.layout.showChildView("popup",e)}},{key:"onShowAlert",value:function(e){var t=e.ctor,n=e.collection,r=this.layout.getRegion("alert");r||K.throw(new J("Your application layout must define an alert region")),r.hasView()||this.layout.showChildView("alert",new t({collection:n}))}},{key:"setDefaultQueryParams",value:function(e){this.defaultQueryParams&&(e=h.extend(this.defaultQueryParams,e)),this.defaultQueryParams=e}},{key:"getAndClearDefaultQueryParams",value:function(){var e=this.defaultQueryParams;return delete this.defaultQueryParams,e||{}}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Q(re(i.prototype),"listenTo",this))}},{key:"defaultProps",get:function(){return["shell","layoutService"]}}])&&Z(t.prototype,n),r&&Z(t,r),i}(I.Application);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)}}var ae=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,(n=[{key:"use",value:function(e){var t;this.go=(t=this.go,function(n,r){return t(n,(function(){return e(n,r)}))})}},{key:"go",value:function(e,t){t(e)}}])&&ie(t.prototype,n),r&&ie(t,r),e}();function ce(e){return(ce="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 se(e){return function(e){if(Array.isArray(e))return ue(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ue(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function le(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 fe(e,t,n){return(fe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=he(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function pe(e,t){return(pe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function de(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=he(e);if(t){var o=he(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return me(this,n)}}function me(e,t){return!t||"object"!==ce(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 he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ye=/([A-Z])/g,ve=/(^|:)(\w)/gi,be=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&&pe(e,t)}(i,e);var t,n,r,o=de(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).bindDisposal(),t.processInternalRoutes(),t.processExternalRoutes(),t.processAppLinks(),t}return t=i,(n=[{key:"bindDisposal",value:function(){var e=this;this.listenTo(b.SHELL,v.ROUTE,(function(t){t.application!==e.channelName&&e.destroyApp()}))}},{key:"addRouteLookup",value:function(e,t){var n=this;this.options.shell.addRouteLookup("".concat(this.channelName,":").concat(e),(function(r,o){return A.buildRoute(t,{application:n.channelName,action:e,args:r,params:o})}))}},{key:"processInternalRoutes",value:function(){var e=this;h.each(h.keys(this.appRoutes),(function(t){var n=e.appRoutes[t],r=e.toEventName(n);e.addRouteLookup(r,t),e.listenTo(e.channelName,r,(function(n,r){r&&r.usedHelper||K.throw(new J("Please use Core.AppLinkHelper.trigger({}) to trigger appLinks.")),e.executeRoute(n,{isAppRoute:!0},(function(){var o=h.extend({},e.controller.getAndClearDefaultQueryParams(),n.params);n.params=o,g.UpdateUrl(t,n,r)}))}))}))}},{key:"processExternalRoutes",value:function(){var e=this;this.externalRoutes&&h.each(h.keys(this.externalRoutes),(function(t){var n=e.externalRoutes[t],r=e.toEventName(n);e.addRouteLookup(r,t),e.listenTo(e.channelName,r,(function(e,t){t&&t.usedHelper||K.throw(new J("Please use Core.AppLinkHelper.trigger({}) to trigger appLinks.")),g.PageLoad(A.getHref(e))}))}))}},{key:"processAppLinks",value:function(){var e=this;this.appLinks&&h.each(this.appLinks,(function(t){var n=e.toEventName(t);e.listenTo(e.channelName,n,(function(t,n){n&&n.usedHelper||K.throw(new J("Please use Core.AppLinkHelper.trigger({}) to trigger appLinks.")),e.executeRoute(t,{isAppRoute:!1})}))}))}},{key:"executeRoute",value:function(e,t,n){var r=this;this.validateAppLink(e);var o=this.toMethodName(e.action);C.routingStarted();var i=y.Radio.channel(b.SHELL);if(this.options.shell.isNavLocked())return i.trigger(v.NAV_IS_LOCKED,e),void C.routingEnded();var a=new ae;h.each(this.filters,(function(e){return a.use(e)})),a.go(e,(function(){i.trigger(v.ROUTE,e,t),r.createApp();var a=r.controller;if(h.isFunction(a[o])||(C.routingEnded(),K.throw(new J("".concat(o," does not exist on the ").concat(h.result(a,"name"),".")))),!1===a.triggerMethod("before:action"))return a.triggerMethod("action:cancelled"),void C.routingEnded();a.triggerMethod("load:layout"),a[o].apply(a,[].concat(se(e.args||[]),[e.params||{}])),h.isFunction(n)&&n(),C.routingEnded()}))}},{key:"createApp",value:function(){this.controller||(this.controller=new this.options.appConstructor(this.options.appOptions),this.controller.start())}},{key:"destroyApp",value:function(){this.controller&&(this.controller.destroy(),delete this.controller)}},{key:"_addAppRoute",value:function(e,t,n){var r=this;this.route(t,n,(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];var i={application:r.channelName,action:r.toEventName(n),args:t.slice(0,t.length-1),params:g.DeserializeQueryParams(t[t.length-1])};r.executeRoute(i,{isAppRoute:!0},(function(){g.UpdateQuery(h.extend(r.controller.getAndClearDefaultQueryParams(),i.params))}))}))}},{key:"toEventName",value:function(e){return e.replace(ye,":$1").toLowerCase()}},{key:"toMethodName",value:function(e){var t=e.replace(ve,(function(e,t,n){return n.toUpperCase()}));return t[0].toLowerCase()+t.slice(1,t.length)}},{key:"validateAppLink",value:function(e){e.application&&e.action||(C.routingEnded(),K.throw(new J("Invalid AppLink")))}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],fe(he(i.prototype),"listenTo",this))}}])&&le(t.prototype,n),r&&le(t,r),i}(I.AppRouter);function ge(e){return(ge="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 Se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ee(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 Oe(e,t,n){return(Oe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ae(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function je(e,t){return(je=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ce(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=Ae(e);if(t){var o=Ae(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return we(this,n)}}function we(e,t){return!t||"object"!==ge(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 Ae(e){return(Ae=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ie=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&&je(e,t)}(i,e);var t,n,r,o=Ce(i);function i(){return Se(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Oe(Ae(i.prototype),"listenTo",this))}}])&&Ee(t.prototype,n),r&&Ee(t,r),i}(I.Behavior);function Te(e){return(Te="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 ke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _e(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 Le(e,t,n){return(Le="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Re(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function xe(e,t){return(xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pe(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=Re(e);if(t){var o=Re(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ne(this,n)}}function Ne(e,t){return!t||"object"!==Te(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 Re(e){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var De=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&&xe(e,t)}(i,e);var t,n,r,o=Pe(i);function i(){return ke(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Le(Re(i.prototype),"listenTo",this))}}])&&_e(t.prototype,n),r&&_e(t,r),i}(y.Collection);function Me(e){return(Me="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 Ue(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 Fe(e,t,n){return(Fe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=qe(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function Ve(e,t){return(Ve=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ze(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=qe(e);if(t){var o=qe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Be(this,n)}}function Be(e,t){return!t||"object"!==Me(t)&&"function"!=typeof t?He(e):t}function He(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qe(e){return(qe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Je=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&&Ve(e,t)}(i,e);var t,n,r,o=ze(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,e),h.result(He(t),"name")||K.throw(new J("Error: View with cid:".concat(t.cid," requires a name."))),t}return t=i,(n=[{key:"serializeModel",value:function(){return this.model?this.model.toJSON():{}}},{key:"serializeCollection",value:function(){return this.collection?this.collection.toJSON():[]}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Fe(qe(i.prototype),"listenTo",this))}}])&&Ue(t.prototype,n),r&&Ue(t,r),i}(I.CollectionView);function $e(e){return($e="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 Ke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ye(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 Ge(e,t){return(Ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function We(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=Qe(e);if(t){var o=Qe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ze(this,n)}}function Ze(e,t){return!t||"object"!==$e(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 Qe(e){return(Qe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Xe=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&&Ge(e,t)}(i,e);var t,n,r,o=We(i);function i(){return Ke(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"name",get:function(){return"DevError"}}])&&Ye(t.prototype,n),r&&Ye(t,r),i}(H);function et(e){return(et="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 tt(e){return function(e){if(Array.isArray(e))return nt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return nt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nt(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ot(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 it(e,t,n){return t&&ot(e.prototype,t),n&&ot(e,n),e}function at(e,t,n){return(at="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=pt(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function ct(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&&st(e,t)}function st(e,t){return(st=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ut(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=pt(e);if(t){var o=pt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return lt(this,n)}}function lt(e,t){return!t||"object"!==et(t)&&"function"!=typeof t?ft(e):t}function ft(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pt(e){return(pt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var dt=function(e){ct(n,e);var t=ut(n);function n(e){var r;rt(this,n),r=t.call(this,e);var o=[].concat(tt(r.defaultProps),tt(r.props||[]));return r.mergeOptions(e,o),h.result(ft(r),"name")||K.throw(new J("Error: View with cid:".concat(r.cid," requires a name."))),r}return it(n,[{key:"_setOptions",value:function(e){this.options=h.extend({},h.result(this,"defaults"),e)}},{key:"_setAttributes",value:function(e){var t,n,r;_.isDevelopment&&h.extend(e,(t={},n="cv-classname",r=this.name,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t)),this.$el.attr(e)}},{key:"serializeModel",value:function(){return this.model?this.model.toJSON():{}}},{key:"serializeCollection",value:function(){return this.collection?this.collection.toJSON():[]}},{key:"resetClassName",value:function(){this.$el.attr("class",h.result(this,"className"))}},{key:"serializeData",value:function(){var e=this,t=at(pt(n.prototype),"serializeData",this).call(this),r=h.result(this,"viewOptions"),o=h.extend({},t,{options:r});return n.ViewDataExtensions.length?h.extend.apply(h,[o].concat(tt(h.map(n.ViewDataExtensions,(function(t){return t instanceof Function?t(e):t}))))):o}},{key:"viewOptions",value:function(){return this.options}},{key:"undelegateAppLinks",value:function(){this.$el&&this.$el.off(".appLinks".concat(this.cid))}},{key:"renderAppLinks",value:function(){var e=this,t=this.appLinks;t&&(t=this.normalizeUIKeys(t),this.undelegateAppLinks(),h.each(h.keys(t),(function(n){var r=n,o=t[n],i=A.getHref(o);"[this]"===r&&(r=null);var a=r?e.$el.find(n):e.$el;(a.is("a")||a.is("button"))&&(i&&"/"!==i&&a.attr("href",i),e.delegate("click.appLinks".concat(e.cid),r,(function(e){e.preventDefault(),A.trigger(o)})))})))}},{key:"hasPartialLoadingRegions",value:function(){return void 0!==this._hasPartialLoadingRegions||(this._hasPartialLoadingRegions=h.some(this.regions,(function(e){return h.has(e,"partialLoading")}))),this._hasPartialLoadingRegions}},{key:"renderPartialLoading",value:function(e){y.Radio.channel(b.SHELL).trigger("render:partial:loading",this,e)}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],at(pt(n.prototype),"listenTo",this))}},{key:"render",value:function(){if(this._isDestroyed)return this;var e=this.processRequriedResources(!0);return e&&(e=this.triggerMethod("before:render",this)),!1!==e&&(e=!0),!1===(e=e&&this.processRequriedResources(!1))?(this._partialLoadingRendered||!this.hasPartialLoadingRegions()||(this._partialLoadingRendered=!0,this._reInitRegions(),this._renderTemplate(),this.renderPartialLoading()),this):((this._isRendered||this._partialLoadingRendered)&&this._reInitRegions(),this.setTitle(),this._renderTemplate(),this.bindUIElements(),this.renderAppLinks(),this._partialLoadingRendered=!1,this._isRendered=!0,this.triggerMethod("render",this),this)}},{key:"processRequriedResources",value:function(e){return!0}},{key:"setTitle",value:function(){}},{key:"defaultProps",get:function(){return["shell","layoutService"]}},{key:"ui",get:function(){return this.uiStorage||(this.uiStorage=this.elements),this.uiStorage},set:function(e){this.uiStorage=e}},{key:"elements",get:function(){return null}}],[{key:"AddViewDataExtension",value:function(e){n.ViewDataExtensions.push(e)}}]),n}(I.View);dt.ViewDataExtensions=[];var mt=function(e){ct(n,e);var t=ut(n);function n(e){var r;return rt(this,n),(r=t.call(this,e)).boundListeners={},r.resourceInstances={},r}return it(n,[{key:"processRequriedResources",value:function(e){var t=this,n=h.keys(this.requiredResources);if(!n.length)return!0;var r=this,o=!0;return h.each(n,(function(n){var i=t.requiredResources[n];if(i.beforeOnBeforeRender===e){var a=i.dataServiceName;t.resourceInstances[a]||(t.resourceInstances[a]=i.getInstance(t)),t.boundListeners["".concat(a,":").concat(i.eventName)]||(t.listenTo(t.resourceInstances[a].channelName,i.eventName,t.render),t.boundListeners["".concat(a,":").concat(i.eventName)]=!0),r[n]=i.getData(t.resourceInstances[a]),o=o&&!!r[n]}})),o}},{key:"setTitle",value:function(){h.isString(this.title)||!1===this.title||K.throw(new Xe("Must define a title for ".concat(this.name,"."))),y.Radio.channel(b.SHELL).trigger("set:page:title",this.title)}}]),n}(dt),ht=function(e){ct(n,e);var t=ut(n);function n(){return rt(this,n),t.apply(this,arguments)}return n}(dt);function yt(e){return(yt="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 vt(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 bt(e,t){return(bt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gt(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=Et(e);if(t){var o=Et(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return St(this,n)}}function St(e,t){return!t||"object"!==yt(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 Et(e){return(Et=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ot=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&&bt(e,t)}(i,e);var t,n,r,o=gt(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,r=[{key:"getCacheKey",value:function(e){K.throw(new Xe("Must define getCacheKey for ".concat(this.name,".")))}}],(n=[{key:"unmountRegion",value:function(e){this.trigger("unmount:".concat(e))}}])&&vt(t.prototype,n),r&&vt(t,r),i}(mt);function jt(e){return(jt="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 Ct(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wt(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 At(e,t,n){return(At="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_t(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function It(e,t){return(It=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Tt(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=_t(e);if(t){var o=_t(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return kt(this,n)}}function kt(e,t){return!t||"object"!==jt(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 _t(e){return(_t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Lt=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&&It(e,t)}(i,e);var t,n,r,o=Tt(i);function i(){return Ct(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"mixin",value:function(e){for(var t in e){if(this.hasOwnProperty(t)){var n=this[t];return void(this[t]=h.extend({},n,e[t]))}this[t]=e[t]}}},{key:"addValidation",value:function(e){this.mixin({validation:e})}},{key:"validate",value:function(e,t){At(_t(i.prototype),"validate",this).call(this,e,t)}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],At(_t(i.prototype),"listenTo",this))}}])&&wt(t.prototype,n),r&&wt(t,r),i}(y.Model);function xt(e){return(xt="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 Pt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nt(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 Rt(e,t,n){return(Rt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ft(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function Dt(e,t){return(Dt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mt(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=Ft(e);if(t){var o=Ft(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ut(this,n)}}function Ut(e,t){return!t||"object"!==xt(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 Ft(e){return(Ft=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Vt=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&&Dt(e,t)}(i,e);var t,n,r,o=Mt(i);function i(){return Pt(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"set",value:function(e,t,n){var r,o;if(null===e)return this;for(r in"object"===xt(e)?(o=e,n=t):(o={})[e]=t,n||(n={}),o)h.has(this.associations,r)&&(o[r]=this.setAssociation(r,o[r],n));return Rt(Ft(i.prototype),"set",this).call(this,o,n)}},{key:"get",value:function(e){var t=e.indexOf(".");if(-1===t)return Rt(Ft(i.prototype),"get",this).call(this,e);var n=e.substr(0,t),r=this.attributes[n];if(!r||!h.isFunction(r.get))return Rt(Ft(i.prototype),"get",this).call(this,e);var o=e.substr(t+1);return r.get(o)}},{key:"setAssociation",value:function(e,t,n){var r=this.associations[e],o=this.attributes[e];if(!h.isFunction(r))return t;if(n.unset)return o&&delete o.parent,delete this[e],o;if(o)return o instanceof Lt&&o.set(t,n),o instanceof De&&o.set(t,n),n.silent||this.trigger("change:".concat(e),this,t,n),o;var i=t instanceof Lt?t:new r(t,{parse:!0});return i.parent=this,this[e]=i,i}},{key:"toJSON",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Rt(Ft(i.prototype),"toJSON",this).apply(this,t);return h.each(this.associations,(function(e,t){h.has(r,t)&&h.isFunction(r[t].toJSON)?r[t]=r[t].toJSON():r[t]=(new e).toJSON()})),r}},{key:"toFlatJSON",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.omit(Rt(Ft(i.prototype),"toJSON",this).apply(this,t),h.keys(this.associations))}}])&&Nt(t.prototype,n),r&&Nt(t,r),i}(Lt);function zt(e){return(zt="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 Bt(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 Ht(e,t,n){return(Ht="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Kt(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function qt(e,t){return(qt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jt(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=Kt(e);if(t){var o=Kt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return $t(this,n)}}function $t(e,t){return!t||"object"!==zt(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 Kt(e){return(Kt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Yt=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&&qt(e,t)}(i,e);var t,n,r,o=Jt(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).name||K.throw(new J("Your service must be named.")),t}return t=i,(n=[{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Ht(Kt(i.prototype),"listenTo",this))}}])&&Bt(t.prototype,n),r&&Bt(t,r),i}(I.Object);function Gt(e){return(Gt="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 Wt(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 Zt(e,t,n){return(Zt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=tn(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function Qt(e,t){return(Qt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xt(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=tn(e);if(t){var o=tn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return en(this,n)}}function en(e,t){return!t||"object"!==Gt(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 tn(e){return(tn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var nn=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&&Qt(e,t)}(i,e);var t,n,r,o=Xt(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).layouts={},t.requiredRegions=e.requiredRegions,t}return t=i,(n=[{key:"clearLayout",value:function(){this.currentLayout&&(this.currentLayout.destroy(),delete this.currentLayout,delete this.currentLayoutCacheKey)}},{key:"registerLayout",value:function(e,t){return this.checkRequiredRegions(t),this.layouts[e]=t,this}},{key:"getLayout",value:function(e){var t=e.name,n=e.options,r=void 0===n?{}:n;this.layouts[t]||K.throw(new J("".concat(t," was not registered as a template.")));var o=this.layouts[t].getCacheKey(r);return this.currentLayoutCacheKey===o&&this.currentLayout?(this.currentLayout.triggerMethod("layout:requested",r),this.currentLayout):(this.clearLayout(),this.currentLayoutCacheKey=o,this.currentLayout=new this.layouts[t](r),this.listenToOnce(this.currentLayout,"destroy",this.clearLayout),this.currentLayout)}},{key:"checkRequiredRegions",value:function(e){h.each(this.requiredRegions,(function(t){h.has(h.result(e.prototype,"regions"),t)||K.throw(new J("Layout: ".concat(e.prototype.name," must define an ").concat(t," region.")))}))}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Zt(tn(i.prototype),"listenTo",this))}}])&&Wt(t.prototype,n),r&&Wt(t,r),i}(I.Object);function rn(e){return(rn="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 on(e,t,n){return(on="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=un(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function an(e,t){return(an=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cn(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=un(e);if(t){var o=un(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return sn(this,n)}}function sn(e,t){return!t||"object"!==rn(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 un(e){return(un=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ln(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fn(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 pn(e,t,n){return t&&fn(e.prototype,t),n&&fn(e,n),e}var dn=function(){function e(t,n){ln(this,e),this.application=t,this.options=n||{}}return pn(e,[{key:"Application",get:function(){return this.application}},{key:"Options",get:function(){return this.options}}]),e}(),mn=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&&an(e,t)}(n,e);var t=cn(n);function n(){return ln(this,n),t.apply(this,arguments)}return pn(n,[{key:"initialize",value:function(e){this.mergeOptions(e,["layoutService"]),this.applications=[],this.routeLookup={},this.shellState={navLock:!1,activeRoute:!1,currentAppLink:null},this.errorHandlers=[]}},{key:"bindListeners",value:function(){this.bindRouteLookup(),this.bindNavLockListeners(),this.bindAppLinkListeners(),this.bindErrorHandlers(),this.bindErrorListener()}},{key:"bindNavLockListeners",value:function(){var e=this;this.listenTo(b.SHELL,v.LOCK_NAV,(function(){return e.shellState.navLock=!0})),this.listenTo(b.SHELL,v.UNLOCK_NAV,(function(){return e.shellState.navLock=!1}))}},{key:"bindAppLinkListeners",value:function(){var e=this;this.listenTo(b.SHELL,v.ROUTING_START,(function(){return e.shellState.activeRoute=!0})),this.listenTo(b.SHELL,v.ROUTING_END,(function(){return e.shellState.activeRoute=!1})),this.listenTo(b.SHELL,v.ROUTE,(function(t){return e.shellState.currentAppLink=t}));var t=y.Radio.channel(b.SHELL);t.reply(v.HAS_ACTIVE_ROUTE,h.bind(this.hasActiveRoute,this)),t.reply(v.CURRENT_ROUTE,(function(){return e.shellState.currentAppLink}))}},{key:"bindErrorHandlers",value:function(){window.addEventListener("error",(function(){C.routingEnded()}))}},{key:"bindErrorListener",value:function(){var e=y.Radio.channel(b.SHELL);this.listenTo(e,v.ERROR,this.handleError)}},{key:"bindRouteLookup",value:function(){var e=this;y.Radio.channel(b.SHELL).reply(v.ROUTE_LOOKUP,(function(t,n,r){return e.routeLookup[t]?e.routeLookup[t](n,r):""}),this)}},{key:"addRouteLookup",value:function(e,t){this.routeLookup[e]=t}},{key:"registerApplication",value:function(e,t){return this.applications.push(new dn(e,t)),this}},{key:"getGlobalRadioChannels",value:function(){return b}},{key:"isNavLocked",value:function(){return this.shellState.navLock}},{key:"start",value:function(e){var t=this;e||(e={}),this.runInitializationSteps(this,(function(r,o){t.runStartUpSteps(t,e,(function(r,o,i){on(un(n.prototype),"start",t).call(t,e)}))}))}},{key:"hasActiveRoute",value:function(){return this.shellState.activeRoute}},{key:"onStart",value:function(){var e=this;h.each(this.applications,(function(t){var n={appConstructor:t.Application,shell:e,appOptions:Object.assign({region:"",shell:e,layoutService:e.layoutService},t.Options)};new t.Application.router(n)})),this.bindListeners(),g.StartHistory()}},{key:"addInitializationStep",value:function(e){var t;return this.runInitializationSteps=(t=this.runInitializationSteps,function(n,r){return t(n,(function(){return e(n,r)}))}),this}},{key:"runInitializationSteps",value:function(e,t){t(e)}},{key:"addStartUpStep",value:function(e){var t;return this.runStartUpSteps=(t=this.runStartUpSteps,function(n,r,o){return t(n,r,(function(){return e(n,r,o)}))}),this}},{key:"runStartUpSteps",value:function(e,t,n){n(e,t)}},{key:"registerLayout",value:function(e,t){return this.layoutService.registerLayout(e,t),this}},{key:"registerErrorHandler",value:function(e,t){return e||K.throw(new J("An error must have a name in order to register a handler for it.")),h.any(this.errorHandlers,(function(t){return t.errorType===e}))&&K.throw(new J("An error handler for ".concat(e.prototype.name," has already been defined."))),this.errorHandlers.push({errorType:e,handler:t}),this}},{key:"handleError",value:function(e){var t=h.find(this.errorHandlers,(function(t){return e instanceof t.errorType}));t&&t.handler&&t.handler(e)}},{key:"registerStore",value:function(e){this.store=e}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],on(un(n.prototype),"listenTo",this))}}]),n}(I.Application),hn=function(e){return h.isFunction(e)},yn=function(){return h.identity},vn=n(26),bn=n(5);function gn(e){return(gn="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 Sn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function En(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 On(e,t){return(On=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function jn(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=wn(e);if(t){var o=wn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Cn(this,n)}}function Cn(e,t){return!t||"object"!==gn(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 wn(e){return(wn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var An=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&&On(e,t)}(i,e);var t,n,r,o=jn(i);function i(){return Sn(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"isReactComponent",value:function(e){return d&&d.isValidElement(e)}},{key:"showChildView",value:function(e,t){this.isReactComponent(t)&&this.showChildReactComponent(e,t)}},{key:"showChildReactComponent",value:function(e,t){var n=this;this.isAttached()?this.renderChildReactComponent(e,t):this.listenToOnce(this,"attach",(function(){return n.renderChildReactComponent(e,t)}))}},{key:"renderChildReactComponent",value:function(e,t){var n=this.getRegion(e),r=this.$el.find(n.el);r&&r.length&&(n.trigger("before:show"),vn.render(t,r[0],(function(){return n.trigger("show")})),this.listenToOnce(this,"unmount:".concat(e),(function(){return vn.unmountComponentAtNode(r[0])})),this.listenToOnce(this,"before:destroy",(function(){return vn.unmountComponentAtNode(r[0])})))}},{key:"wrapWithStore",value:function(e){return d.createElement(bn.Provider,{store:this.options.store},e)}}])&&En(t.prototype,n),r&&En(t,r),i}(Ot),In="top:nav",Tn="left:nav",kn="content",_n="popup",Ln="alert",xn=n(126),Pn=n.n(xn),Nn=n(27),Rn=n.n(Nn);function Dn(e){return(Dn="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 Mn(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 Un(e,t,n){return(Un="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Bn(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function Fn(e,t){return(Fn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Vn(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=Bn(e);if(t){var o=Bn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return zn(this,n)}}function zn(e,t){return!t||"object"!==Dn(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 Bn(e){return(Bn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Hn=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&&Fn(e,t)}(a,e);var t,n,o,i=Vn(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).childComponents={},t}return t=a,o=[{key:"getCacheKey",value:function(e){var t="".concat(this.name),n=[];return Object.keys(e).forEach((function(t){n.push("".concat(t,":").concat(e[t]))})),n.length&&(n.sort(),t+=":".concat(n.join(":"))),t}}],(n=[{key:"regions",value:function(){return{layout:".layout-region"}}},{key:"getChildComponents",value:function(){return{topNav:{component:this.childComponents[In],className:Rn.a.topNavRegion},leftNav:{component:this.childComponents[Tn],className:"py-3 ".concat(Rn.a.leftNavRegion)},content:{component:this.childComponents[kn],className:"position-relative container py-3"},popup:{component:this.childComponents[_n]},alert:{component:this.childComponents[Ln]}}}},{key:"unsetRegion",value:function(e){delete this.childComponents[e],this.renderLayout()}},{key:"renderTopNav",value:function(){hn(this.options.getTopNavView)&&(this.childComponents[In]=this.options.getTopNavView(r.AppLinkHelper.getCurrentAppLink()))}},{key:"hideLeftNav",value:function(){this.unsetRegion(Tn)}},{key:"closePopup",value:function(){this.unsetRegion(_n)}},{key:"showChildView",value:function(e,t){this.childComponents[e]=t,this.renderTopNav(),this.renderLayout()}},{key:"renderLayout",value:function(){var e=Object.assign({provider:this.options.provider},this.getChildComponents());Un(Bn(a.prototype),"showChildView",this).call(this,"layout",this.wrapWithStore(d.createElement(Yn,Object.assign({},e))))}},{key:"title",get:function(){return!1}},{key:"name",get:function(){return"CuratorLayoutView"}},{key:"template",get:function(){return Pn.a}},{key:"className",get:function(){return"container-fluid ".concat(Rn.a.curatorLayout)}}])&&Mn(t.prototype,n),o&&Mn(t,o),a}(An),qn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Jn=function(e){var t=e.className,n=e.children;return d.createElement("div",{className:t},n)},$n=function(e,t){return"".concat(e).concat(t?" ".concat(t):"")},Kn=function(e){var t=e.topNav,n=e.leftNav,r=e.content,o=e.popup,i=e.alert;return d.createElement(d.Fragment,null,d.createElement("div",{className:"position-relative"},!!t.component&&d.createElement(Jn,{className:$n("top-nav-region",t.className)},t.component),!!n.component&&d.createElement(Jn,{className:$n("left-nav-region",n.className)},n.component),!!r.component&&d.createElement("div",{className:"content-container"},d.createElement(Jn,{className:$n("content-region",r.className)},r.component))),!!o.component&&d.createElement(Jn,{className:$n("popup-region",o.className)},o.component),!!i.component&&d.createElement(Jn,{className:$n("alert-region",i.className)},i.component))},Yn=function(e){var t=e.provider,n=qn(e,["provider"]);return t?d.createElement(t,null,d.createElement(Kn,Object.assign({},n))):d.createElement(Kn,Object.assign({},n))};function Gn(e){return(Gn="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 Wn(e){return function(e){if(Array.isArray(e))return Zn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Zn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Qn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xn(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 er(e,t){return(er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tr(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=rr(e);if(t){var o=rr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return nr(this,n)}}function nr(e,t){return!t||"object"!==Gn(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 rr(e){return(rr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var or=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&&er(e,t)}(a,e);var t,n,o,i=tr(a);function a(){return Qn(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"initialize",value:function(){this.listenTo(b.SHELL,r.EventNames.ROUTING_END,this.updateNav)}},{key:"updateNav",value:function(){var e=this,t=r.AppLinkHelper.getCurrentAppLink().application;if(t!==this.currentApplication){this.currentApplication=t;var n=this.options.navItemMappings[t];if(n){var o=document.querySelector(this.options.navSelector);o&&o.children&&Wn(o.children).forEach((function(t){var r=t.querySelector("a");r&&(r.classList.remove(e.options.currentItemClassName),r.text===n&&r.classList.add(e.options.currentItemClassName))}))}}}},{key:"name",get:function(){return"CuratorAppNavService"}}])&&Xn(t.prototype,n),o&&Xn(t,o),a}(r.Service);function ir(e){return(ir="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 ar(e){return function(e){if(Array.isArray(e))return cr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return cr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cr(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sr(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 ur(e,t){return(ur=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function lr(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=dr(e);if(t){var o=dr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return fr(this,n)}}function fr(e,t){return!t||"object"!==ir(t)&&"function"!=typeof t?pr(e):t}function pr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dr(e){return(dr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var mr=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&&ur(e,t)}(i,e);var t,n,r,o=lr(i);function i(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,e),h.result(pr(t),"name")||K.throw(new Xe("Must provide a name when extending BaseDataService")),h.result(pr(t),"channelName")||K.throw(new Xe("Must provide a channelName for ".concat(h.result(pr(t),"name"))));var n=[].concat(ar(t.defaultProps),ar(t.props||[]));return t.dataRequestSignatures={},t.mergeOptions(e,n),t}return t=i,(n=[{key:"getCursors",value:function(e){var t=this.cache.get(e);return t?t.cursors:{}}},{key:"clearCacheAndGet",value:function(e){var t=this,n=e.callback,r=e.errorCallback,o=e.eventPrefix,i=this.getEventNames(o),a=i.syncEvent,c=i.errorEvent,s=this.cache.get(o);if(s&&s.openRequest)return this.listenToOnce(this.getChannel(),a,(function(e){h.isFunction(r)&&t.stopListening(t.getChannel(),c,r),h.isFunction(n)&&n(e)})),void this.listenToOnce(this.getChannel(),c,(function(){h.isFunction(n)&&t.stopListening(t.getChannel(),a,n),h.isFunction(r)&&r()}));this.cache.remove(e.eventPrefix),this.get(e)}},{key:"get",value:function(e){var t=this,n=e.callback,r=e.errorCallback,o=e.eventPrefix,i=e.resource,a=e.formatData,c=e.expiryTime,s=e.successHandler,u=e.errorHandler,l=e.bootstrapName,f=this.getEventNames(o),p=f.syncEvent,d=f.requestEvent,m=f.successEvent,y=f.errorEvent,v=this.getChannel(),b=this.currentTimestamp();this.bootstrapData&&this.bootstrapData[l]&&(this.cacheData(o,this.bootstrapData[l],a,{openRequest:!1,timestamp:b}),delete this.bootstrapData[l]);var g,S=this.cache.get(o);S&&(g=S.data);var E=S&&S.openRequest,O=this.isExpired(o,c);if(E&&(this.listenToOnce(v,p,(function(e){h.isFunction(r)&&t.stopListening(t.getChannel(),y,r),h.isFunction(n)&&n(e)})),this.listenToOnce(v,y,(function(){h.isFunction(n)&&t.stopListening(t.getChannel(),p,n),h.isFunction(r)&&r()}))),this.cache.has(o)&&!O||(v.trigger(d),this.listenToResponse({eventPrefix:o,formatData:a,cacheOptions:{timestamp:b},callback:n,errorCallback:r,successHandler:s,errorHandler:u}),this.cacheData(o,null,null,{openRequest:!0,timestamp:b}),this.dataProvider.read(i,{channel:this.getTransportChannel(),successEvent:m,errorEvent:y})),g&&h.isFunction(n)&&!O&&n(g),g)return g}},{key:"create",value:function(e){var t=e.eventPrefix,n=e.resource,r=e.data,o=e.formatData,i=e.callback,a=e.errorCallback,c=e.invalidationKeys,s=e.successHandler,u=e.errorHandler,l=this.getEventNames(e.eventPrefix),f=l.requestEvent,p=l.successEvent,d=l.errorEvent,m=this.getChannel(),h=this.getTransportChannel();m.trigger(f),this.listenToResponse({eventPrefix:t,formatData:o,invalidationKeys:c,callback:i,errorCallback:a,successHandler:s,errorHandler:u}),this.dataProvider.create(n,r,{channel:h,successEvent:p,errorEvent:d})}},{key:"update",value:function(e){var t=e.data,n=e.callback,r=e.errorCallback,o=e.resource,i=e.formatData,a=e.eventPrefix,c=e.invalidationKeys,s=e.errorHandler,u=e.successHandler,l=this.getEventNames(e.eventPrefix),f=l.requestEvent,p=l.successEvent,d=l.errorEvent,m=this.getChannel(),h=this.getTransportChannel();m.trigger(f),this.listenToResponse({eventPrefix:a,formatData:i,invalidationKeys:c,callback:n,errorCallback:r,successHandler:u,errorHandler:s}),this.dataProvider.update(o,t,{channel:h,successEvent:p,errorEvent:d})}},{key:"delete",value:function(e){var t=e.eventPrefix,n=e.resource,r=e.callback,o=e.errorCallback,i=e.invalidationKeys,a=e.successHandler,c=e.errorHandler,s=this.getEventNames(t),u=s.successEvent,l=s.errorEvent,f=this.getTransportChannel();this.listenToResponse({eventPrefix:t,invalidationKeys:i,callback:r,errorCallback:o,cacheOptions:{noCache:!0,clearCacheKey:!0},successHandler:a,errorHandler:c}),this.dataProvider.delete(n,{channel:f,successEvent:u,errorEvent:l})}},{key:"listenToResponse",value:function(e){var t=this,n=e.eventPrefix,r=e.formatData,o=e.callback,i=e.errorCallback,a=e.successHandler,c=e.errorHandler,s=e.invalidationKeys,u=e.cacheOptions,l=void 0===u?{}:u,f=this.getEventNames(n),p=f.syncEvent,d=(f.requestEvent,f.successEvent),m=f.errorEvent,y=f.successAlertEvent,v=f.errorAlertEvent,b=this.getChannel(),g=this.getTransportChannel(),S=this.getAlertChannel();h.isFunction(o)&&this.listenToOnce(b,p,o),h.isFunction(i)&&this.listenToOnce(b,m,i),this.stopListening(S,y),this.stopListening(S,v),h.isFunction(a)&&this.listenToOnce(S,y,a),h.isFunction(c)&&this.listenToOnce(S,v,c),!h.isFunction(c)&&!1!==c&&h.isFunction(this.defaultErrorHandler)&&this.listenToOnce(S,v,this.defaultErrorHandler),this.hasRequestSignature(n)||(this.setRequestSignature(n),this.listenTo(g,d,(function(e){t.stopListening(b,m,i);for(var o=arguments.length,a=new Array(o>1?o-1:0),c=1;c<o;c++)a[c-1]=arguments[c];S.trigger.apply(S,[y,e].concat(a));var u=l.noCache?t.formatData(e,r):t.cacheData(n,e,r);l.clearCacheKey&&t.cache.remove(n),b.trigger(p,u),s&&s.length&&t.cache.invalidate(s,(function(e){return b.trigger("".concat(e,":invalidate"))}))})),this.listenTo(g,m,(function(){var e;t.stopListening(b,p,o);var r=(e=t.dataProvider).parseError.apply(e,arguments);S.trigger(v,r),b.trigger(m,r),l.noCache||t.cacheData(n,null,null)})))}},{key:"cacheData",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.openRequest,i=void 0!==o&&o,a=r.timestamp;a||(a=this.currentTimestamp());var c=this.processPagination(t),s=this.formatData(t,n);return this.cache.set(e,{data:s,timestamp:a,cursors:c,openRequest:i}),s}},{key:"processPagination",value:function(e){if(e){var t=e.pagination;if(t)return t.cursors?t.cursors:h.isUndefined(t.offset)||h.isUndefined(t.pageSize)?t.page?this.convertLegacyPaginationToCursors(t):void 0:this.convertOffsetPaginationToCursors(t)}}},{key:"formatData",value:function(e,t){return h.isFunction(t)?t(e):e}},{key:"chain",value:function(){var e=this,t=[],n=function(e,t){h.isFunction(e)&&e(t)},r=function(r,i){return t.push((function(){var o=r.callback;r.callback=function(e){n(o,e),n(t.shift())},e[i](r)})),o},o={func:function(e){return t.push((function(){e(t.shift()||function(){})})),o},get:function(e){return r(e,"get")},create:function(e){return r(e,"create")},update:function(e){return r(e,"update")},delete:function(e){return r(e,"delete")},run:function(){n(t.shift())}};return o}},{key:"invalidateCache",value:function(e){e&&e.length&&this.cache.invalidate(e)}},{key:"currentTimestamp",value:function(){return(new Date).valueOf()}},{key:"isExpired",value:function(e,t){if(!t)return!1;var n=this.cache.get(e);if(!n||!n.timestamp)return!0;var r=1e3*t;return n.timestamp<this.currentTimestamp()-r}},{key:"getEventNames",value:function(e){return{syncEvent:"".concat(e,":sync"),requestEvent:"".concat(e,":request"),successEvent:"".concat(e,":success"),errorEvent:"".concat(e,":error"),successAlertEvent:"".concat(e,":success:alert"),errorAlertEvent:"".concat(e,":error:alert")}}},{key:"getTransportChannel",value:function(){return y.Radio.channel("".concat(this.channelName,":transport"))}},{key:"getAlertChannel",value:function(){return y.Radio.channel("".concat(this.channelName,":alert"))}},{key:"setRequestSignature",value:function(e){this.dataRequestSignatures[e]=e}},{key:"hasRequestSignature",value:function(e){return!!this.dataRequestSignatures[e]}},{key:"convertOffsetPaginationToCursors",value:function(e){var t=e.offset,n=e.pageSize,r=e.totalItems,o=r>0&&t<r&&t+n,i=r>0&&t>0&&Math.max(t-n,0),a={};if(o&&o<r&&(a.next=o.toString()),h.isNumber(i)&&(a.previous=i.toString()),!h.isEmpty(a))return a}},{key:"convertLegacyPaginationToCursors",value:function(e){var t=e.page,n=e.totalPages,r=h.isNumber(t)&&t>0&&t<n&&t+1,o=h.isNumber(t)&&t>1&&t-1,i={};if(r&&r<=n&&(i.next=r.toString()),o&&(i.previous=o.toString()),!h.isEmpty(i))return i}},{key:"defaultProps",get:function(){return["dataProvider","cache","bootstrapData","defaultErrorHandler","alertService"]}}])&&sr(t.prototype,n),r&&sr(t,r),i}(Yt);function hr(e){return(hr="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 yr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vr(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 br(e,t){return(br=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gr(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=Er(e);if(t){var o=Er(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Sr(this,n)}}function Sr(e,t){return!t||"object"!==hr(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 Er(e){return(Er=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Or,jr,Cr=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&&br(e,t)}(i,e);var t,n,r,o=gr(i);function i(){return yr(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"uploadBase64Image",value:function(e,t,n,r){return this.create({resource:"/api/image/upload?type=".concat(t),eventPrefix:c.UPLOAD_IMAGE,data:e,callback:n,errorCallback:r})}},{key:"name",get:function(){return p.IMAGE_UPLOAD}},{key:"channelName",get:function(){return f.IMAGE_UPLOAD}}])&&vr(t.prototype,n),r&&vr(t,r),i}(mr),wr={API_REQUEST:"API_REQUEST",API_REPONSE:"API_RESPONSE",API_ERROR:"API_ERROR",INVALIDATE:"INVALIDATE",UPDATE:"UPDATE"};function Ar(e){return{getResponseHeader:e.getResponseHeader,responseJSON:e.responseJSON,status:e.status}}!function(e){e.None="None",e.Fetching="Fetching",e.Success="Success",e.Error="Error"}(Or||(Or={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"}(jr||(jr={}));var Ir=[jr.POST,jr.PUT];function Tr(e){var t=e.resource,n=e.type,r=e.success,o=e.error,i=e.always,a={url:t,method:n};Ir.includes(n)&&e.data&&(a.data=JSON.stringify(e.data)),$.ajax(a).done((function(e,t,n){r&&r(e,Ar(n))})).fail((function(e,t,n){o&&o(Ar(e))})).always((function(){i&&i()}))}function kr(e){return(kr="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){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.idAttribute,r=void 0===n?"id":n,o=t.namespace,i=void 0===o?"":o;return e[r]||K.throw(new Xe("There was an issue during normalization. Object did not have an id attribute.")),"".concat(i,"__").concat(e[r])}function Lr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.idAttribute,o=void 0===r?"id":r,i=[];return e.forEach((function(e){e[o]&&i.push(_r(e,n)),Pr(e,t,n)})),i}function xr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.idAttribute,o=void 0===r?"id":r,i=Object.assign({},e);if(Object.keys(e).forEach((function(r){var a=e[r];if(a)if(Array.isArray(a)){var c=Lr(a,t,n);c.length&&(i[r]=c)}else if("object"===kr(a)){var s=xr(a,t,n);a[o]?i[r]=_r(a,n):i[r]=s}})),e[o]){var a=_r(e,n);return t[a]=i,a}return i}function Pr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e)return Array.isArray(e)?Lr(e,t,n):"object"===kr(e)?xr(e,t,n):e}function Nr(e,t){var n={};return{result:Pr(e,n,t),entities:n}}var Rr={isEmpty:function(e){return h.isEmpty(e)},values:function(e){return h.values(e)},keys:function(e){return h.keys(e)},deepClone:function(e){return(h.isArray(e)?h.map:h.mapObject)(e,(function(e){return h.isObject(e)||h.isArray(e)?Rr.deepClone(e):e}))},getEnumKeys:function(e){return Object.keys(e).filter((function(e){return!(parseInt(e)>=0)}))},isObject:function(e){return h.isObject(e)},isEqual:function(e,t){return h.isEqual(e,t)},omit:function(e,t){return h.omit(e,t)}};function Dr(e){return(Dr="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 Mr(e,t,n){if(e){if("string"==typeof e)return function(e,t,n){if(n[e])return n[e];n[e]={};var r=Mr(t[e],t,n);return Object.assign(n[e],r),Rr.isEmpty(n[e])&&delete n[e],n[e]}(e,t,n);if(Array.isArray(e))return e.map((function(e){return Mr(e,t,n)}));if("object"===Dr(e)){var r={};return Object.keys(e).forEach((function(o){r[o]=Mr(e[o],t,n)||e[o]})),r}}}function Ur(e,t){return Mr(e,t,{})}function Fr(e,t){return e===t}function Vr(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}function zr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fr,n=null,r=null;return function(){return Vr(t,n,arguments)||(r=e.apply(null,arguments)),n=arguments,r}}function Br(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function Hr(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=0,a=r.pop(),c=Br(r),s=e.apply(void 0,[function(){return i++,a.apply(null,arguments)}].concat(n)),u=e((function(){for(var e=[],t=c.length,n=0;n<t;n++)e.push(c[n].apply(null,arguments));return s.apply(null,e)}));return u.resultFunc=a,u.dependencies=c,u.recomputations=function(){return i},u.resetRecomputations=function(){return i=0},u}}var qr=Hr(zr);var Jr={currentTimestamp:function(){return(new Date).valueOf()},isExpired:function(e,t){if(!t)return!1;var n=1e3*t;return e<Jr.currentTimestamp()-n},currentTimeOfDay:function(e){e||(e=new Date);var t=e.getHours();return t>=12&&t<18?"afternoon":t>=18?"evening":"morning"}};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)}}var Kr=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.status=t.status,this.requestTime=t.requestTime,this.cacheDuration=t.cacheDuration,this.data=t.data,this.statusCode=t.statusCode}var t,n,r;return t=e,(n=[{key:"shouldFetch",get:function(){return this.status===Or.None||this.isExpired}},{key:"isExpired",get:function(){return Jr.isExpired(this.requestTime,this.cacheDuration)}},{key:"isFetching",get:function(){return this.status===Or.Fetching}},{key:"hasError",get:function(){return this.status===Or.Error}},{key:"isComplete",get:function(){return this.status===Or.Success||this.status===Or.Error}}])&&$r(t.prototype,n),r&&$r(t,r),e}();function Yr(e,t,n){if(!e||!t)return Gr();var r=t.response;return!1!==t.request.normalize&&(r=Ur(t.response,n)),new Kr({status:t.status,statusCode:t.statusCode,requestTime:t.timestamp,cacheDuration:t.request.expiryTime,data:r})}function Gr(){return new Kr({status:Or.None})}function Wr(e,t){return Yr(t,e.flightData.resources[t],e.flightData.entities)}function Zr(e,t){return function(){Qr(e,t)}}function Qr(e,t){e({type:wr.API_REQUEST,request:t})}function Xr(e){return Zr(Object(bn.useDispatch)(),e)}function eo(e,t){var n=Object(d.useMemo)((function(){var n;return(null===(n=t)||void 0===n?void 0:n.optimize)?function(e){return Hr(zr,(function(e,t){var n=["response","request"];return Rr.isEqual(Rr.omit(e,n),Rr.omit(t,n))}))((function(t){return t.flightData.resources[e]}),(function(t){var n,r=t.flightData.resources[e];return(null===(n=r)||void 0===n?void 0:n.entityIds)?r.entityIds.reduce((function(e,n){return e[n]=t.flightData.entities[n],e}),{}):{}}),(function(t,n){return Yr(e,t,n)}))}(e):function(e){return qr((function(t){return t.flightData.resources[e]}),(function(e){return e.flightData.entities}),(function(t,n){return Yr(e,t,n)}))}(e)}),[e]);return Object(bn.useSelector)((function(e){return n(e)}))}function to(e,t){var n=Object(bn.useDispatch)(),r=eo(e&&e.key,t),o=Zr(n,e);return e&&r.shouldFetch&&o(),r}function no(e){return function(e){if(Array.isArray(e))return ro(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ro(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ro(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ro(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var oo,io=function(e,t,n){var r=Array.isArray(t)?t:[t],o=[];return r.forEach((function(t){var n,r=new RegExp(t,"i"),i=Object.keys(e.resources).filter((function(e){return r.test(e)}));(n=o).push.apply(n,no(i))})),n&&(o=o.filter((function(e){return e!==n}))),o.reduce((function(e,t){return e[t]=!0,e}),{})};!function(e){e[e.Ok=200]="Ok",e[e.NoContent=204]="NoContent",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.Conflict=409]="Conflict",e[e.InternalServer=500]="InternalServer"}(oo||(oo={}));var ao=function(e){var t=e;return!!(t.successResponse||t.errorResponse||t.noResponse)},co=function(e,t){var n=e.success,r=e.error,o=e.always,i=t;window.setTimeout((function(){i.noResponse||(i.successResponse?n(i.successResponse(),{status:oo.Ok,getResponseHeader:function(e){return""}}):i.errorResponse&&r(i.errorResponse()),o())}),function(e){var t=e.timeout||300;return t/2+(Math.floor(Math.random()*t/2)+1)}(t))},so=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function uo(e){var t=e.fetchData,n=e.bootstrappedData,r=e.defaultExpiryTime,o=Object.freeze({key:null,url:null,type:jr.GET,normalize:!0,formatData:function(e){return e},expiryTime:r});return function(e){return function(r){return function(i){if(i.type===wr.API_REQUEST){var a=e.getState(),c=Object.assign({},o,i.request),s=c.success,u=c.error,l=c.always,f=c.formatData,p=so(c,["success","error","always","formatData"]),d=a.flightData.resources[p.key];if(r(i),!d||d.status!==Or.Fetching){if(p.bootstrapName&&n[i.request.bootstrapName])return h(n[i.request.bootstrapName]),y(),void delete n[i.request.bootstrapName];var m={resource:p.url,type:p.type,data:p.data,success:h,error:function(t){e.dispatch({type:wr.API_ERROR,errorResponse:t.responseJSON,request:i.request,timestamp:Jr.currentTimestamp(),xhr:t}),p.invalidationKeys&&e.dispatch({type:wr.INVALIDATE,keys:p.invalidationKeys,request:p});u&&u(t)},always:y};return void(ao(p)?co(m,p):t(m))}}else r(i);function h(t,n){var r=f(t),o={result:r,entities:{}};(p.normalize&&(o=Nr(r,p.normalizeOptions)),e.dispatch({type:wr.API_REPONSE,result:o.result,entities:o.entities,request:p,timestamp:Jr.currentTimestamp(),xhr:n}),p.updateState)&&(Array.isArray(p.updateState)?p.updateState:[p.updateState]).forEach((function(t){var n,r,o,i;n=t,r=io(a.flightData,n.keys),o=Object.assign({},Object.keys(a.flightData.resources).filter((function(e){return r[e]})).reduce((function(e,t){var n=a.flightData.resources[t],r=n.response;return n.request.normalize&&(r=Ur(n.response,a.flightData.entities)),e[t]=r,e}),{})),i=n.updateData(o),Object.keys(i).forEach((function(t){var n=a.flightData.resources[t],r=i[t],o={result:r,entities:{}};n.request.normalize&&(o=Nr(r,n.request.normalizeOptions)),e.dispatch({type:wr.UPDATE,result:o.result,entities:o.entities,request:n.request})}))}));if(p.invalidationKeys&&e.dispatch({type:wr.INVALIDATE,keys:p.invalidationKeys,request:p}),s){var i=o.result;p.normalize&&(i=Ur(o.result,Object.assign(Object.assign({},a.flightData.entities),o.entities))),s(i)}}function y(){l&&l()}}}}}function lo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fo(e,t){var n=Object.assign({},e);return Object.keys(t).forEach((function(r){e[r]?n[r]=Object.assign(Object.assign({},e[r]),t[r]):n[r]=t[r]})),n}function po(e,t){var n=e.resources[t.request.key];return{entities:Object.assign({},e.entities),resources:Object.assign(Object.assign({},e.resources),lo({},t.request.key,{request:t.request,status:Or.Fetching,response:n?n.response:null,entityIds:n?n.entityIds:null}))}}function mo(e,t){var n,r=t.entities?Object.keys(t.entities):[];return{entities:fo(e.entities,t.entities),resources:Object.assign(Object.assign({},e.resources),lo({},t.request.key,{request:t.request,status:Or.Success,response:t.result,timestamp:t.timestamp,statusCode:null===(n=t.xhr)||void 0===n?void 0:n.status,entityIds:r}))}}function ho(e,t){var n;return{entities:Object.assign({},e.entities),resources:Object.assign(Object.assign({},e.resources),lo({},t.request.key,{request:t.request,status:Or.Error,errorResponse:t.errorResponse,timestamp:t.timestamp,statusCode:null===(n=t.xhr)||void 0===n?void 0:n.status}))}}function yo(e,t){var n,r=io(e,t.keys,null===(n=t.request)||void 0===n?void 0:n.key);return{entities:Object.assign({},e.entities),resources:Object.assign(Object.assign({},e.resources),Object.keys(e.resources).filter((function(e){return r[e]})).reduce((function(t,n){var r=e.resources[n];return t[n]=Object.assign({},r,{status:Or.None}),t}),{}))}}function vo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bo,t=arguments.length>1?arguments[1]:void 0,n=t.entities?Object.keys(t.entities):[];return{entities:fo(e.entities,t.entities),resources:Object.assign(Object.assign({},e.resources),lo({},t.request.key,Object.assign(Object.assign({},e.resources[t.request.key]),{request:t.request,response:t.result,entityIds:n})))}}var bo={resources:{},entities:{}};function go(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bo,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case wr.API_REQUEST:return po(e,t);case wr.API_REPONSE:return mo(e,t);case wr.API_ERROR:return ho(e,t);case wr.INVALIDATE:return yo(e,t);case wr.UPDATE:return vo(e,t)}return e}function So(e){return function(e){if(Array.isArray(e))return Eo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Eo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Eo(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Eo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Oo=function(e){return h.first(e)},jo=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=e&&e.length?e.slice():[];return t+1>o.length&&(o=[].concat(So(o),So(Array(t+1-o.length).fill(r)))),o.splice(t,1,n),o},Co=function(e,t,n){var r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r},wo=function(e,t){return h.groupBy(e,t)},Ao=function(){return h.intersection.apply(h,arguments)},Io=function(e,t){var n=e.indexOf(t);return-1===n?e.push(t):e.splice(n,1),e};var To="id";function ko(e,t){return localStorage.setItem(e,JSON.stringify(t)),t}function _o(e){var t=localStorage.getItem(e);return t?JSON.parse(t):null}var Lo={getAll:function(e,t){var n=_o(e);return n&&n.length?n:!n&&t?(t.forEach((function(t){return Lo.create(e,t)})),_o(e)):[]},get:function(e,t){var n=Lo.getAll(e);return n.length?n.find((function(e){return e[To]===t})):null},create:function(e,t){var n,r,o,i=Lo.getAll(e),a=Object.assign(Object.assign({},t),(n={},r=To,o=t[To]||(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)+1).toString(),r in n?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,n));return i.push(a),ko(e,i),a},update:function(e,t){var n=Lo.getAll(e);if(!n.length)return t;var r=n.findIndex((function(e){return e[To]===t[To]}));return n[r]=t,ko(e,n),t},delete:function(e,t){var n=Lo.getAll(e);n.length&&(Array.isArray(t)||(t=[t]),t.forEach((function(e){var t=n.findIndex((function(t){return t[To]===e}));n.splice(t,1)})),ko(e,n))},assoc:function(e,t,n,r,o){var i=Array.isArray(o),a=i?o:[o];"string"==typeof Oo(a)&&(a=Lo.getAll(r).filter((function(e){return a.includes(e.id)})));var c=a.map((function(e){return e.id?e:Lo.create(r,e)})),s=Lo.getAll(e);if(s.length){var u=s.find((function(e){return e.id===t}));if(u)return c.forEach((function(e){if(u[n])if(Array.isArray(u[n])){if(u[n].find((function(t){return t.id===e.id})))return;u[n].push(e)}else u[n]=e;else u[n]=i?[e]:e})),ko(e,s=s.map((function(e){return e.id!==u.id?e:u}))),i?c:Oo(c)}},dissoc:function(e,t,n,r){var o=Lo.getAll(e);if(o.length){var i=o.find((function(e){return e.id===t}));if(i){var a=i[n];if(a)return Array.isArray(r)||(r=[r]),Array.isArray(a)||(a=[a]),r.forEach((function(e){var t=a.findIndex((function(t){return t.id===e}));a.splice(t,1)})),i[n]=a,ko(e,o=o.map((function(e){return e.id!==i.id?e:i}))),o}}}},xo=function(e){var t="/api/master/v2/companies";return e?"".concat(t,"?cursor=").concat(e):t},Po=function(e){return"/api/master/v2/objects/".concat(e)},No=function(){return"/api/master/v2/companies"},Ro=function(e){return"/api/master/v2/objects/".concat(e)},Do="companies",Mo="company",Uo="update:company",Fo=function(e){return{key:"".concat(Do).concat(e?":".concat(e):""),url:xo(e)}},Vo=function(e){return{key:"".concat(Mo,":").concat(e),url:Po(e)}},zo=function(e,t,n){return{key:Mo,url:No(),data:e,type:jr.POST,success:t,error:n,invalidationKeys:[Do]}},Bo=function(e,t,n){return{key:"".concat(Uo,":").concat(e),url:Ro(e),data:t,type:jr.PUT,always:n}},Ho=n(12),qo=n.n(Ho),Jo=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===$o}(e)}(e)};var $o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Ko(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Go((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Yo(e,t,n){return e.concat(t).map((function(e){return Ko(e,n)}))}function Go(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Yo,n.isMergeableObject=n.isMergeableObject||Jo;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach((function(t){r[t]=Ko(e[t],n)})),Object.keys(t).forEach((function(o){n.isMergeableObject(t[o])&&e[o]?r[o]=Go(e[o],t[o],n):r[o]=Ko(t[o],n)})),r}(e,t,n):Ko(t,n)}Go.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Go(e,n,t)}),{})};var Wo=Go,Zo=n(6),Qo=Zo.a.Symbol,Xo=Object.prototype,ei=Xo.hasOwnProperty,ti=Xo.toString,ni=Qo?Qo.toStringTag:void 0;var ri=function(e){var t=ei.call(e,ni),n=e[ni];try{e[ni]=void 0;var r=!0}catch(e){}var o=ti.call(e);return r&&(t?e[ni]=n:delete e[ni]),o},oi=Object.prototype.toString;var ii=function(e){return oi.call(e)},ai=Qo?Qo.toStringTag:void 0;var ci=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ai&&ai in Object(e)?ri(e):ii(e)};var si=function(e,t){return function(n){return e(t(n))}},ui=si(Object.getPrototypeOf,Object);var li=function(e){return null!=e&&"object"==typeof e},fi=Function.prototype,pi=Object.prototype,di=fi.toString,mi=pi.hasOwnProperty,hi=di.call(Object);var yi=function(e){if(!li(e)||"[object Object]"!=ci(e))return!1;var t=ui(e);if(null===t)return!0;var n=mi.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&di.call(n)==hi};var vi=function(){this.__data__=[],this.size=0};var bi=function(e,t){return e===t||e!=e&&t!=t};var gi=function(e,t){for(var n=e.length;n--;)if(bi(e[n][0],t))return n;return-1},Si=Array.prototype.splice;var Ei=function(e){var t=this.__data__,n=gi(t,e);return!(n<0)&&(n==t.length-1?t.pop():Si.call(t,n,1),--this.size,!0)};var Oi=function(e){var t=this.__data__,n=gi(t,e);return n<0?void 0:t[n][1]};var ji=function(e){return gi(this.__data__,e)>-1};var Ci=function(e,t){var n=this.__data__,r=gi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function wi(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}wi.prototype.clear=vi,wi.prototype.delete=Ei,wi.prototype.get=Oi,wi.prototype.has=ji,wi.prototype.set=Ci;var Ai=wi;var Ii=function(){this.__data__=new Ai,this.size=0};var Ti=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var ki=function(e){return this.__data__.get(e)};var _i=function(e){return this.__data__.has(e)};var Li=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var xi,Pi=function(e){if(!Li(e))return!1;var t=ci(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Ni=Zo.a["__core-js_shared__"],Ri=(xi=/[^.]+$/.exec(Ni&&Ni.keys&&Ni.keys.IE_PROTO||""))?"Symbol(src)_1."+xi:"";var Di=function(e){return!!Ri&&Ri in e},Mi=Function.prototype.toString;var Ui=function(e){if(null!=e){try{return Mi.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Fi=/^\[object .+?Constructor\]$/,Vi=Function.prototype,zi=Object.prototype,Bi=Vi.toString,Hi=zi.hasOwnProperty,qi=RegExp("^"+Bi.call(Hi).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ji=function(e){return!(!Li(e)||Di(e))&&(Pi(e)?qi:Fi).test(Ui(e))};var $i=function(e,t){return null==e?void 0:e[t]};var Ki=function(e,t){var n=$i(e,t);return Ji(n)?n:void 0},Yi=Ki(Zo.a,"Map"),Gi=Ki(Object,"create");var Wi=function(){this.__data__=Gi?Gi(null):{},this.size=0};var Zi=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Qi=Object.prototype.hasOwnProperty;var Xi=function(e){var t=this.__data__;if(Gi){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Qi.call(t,e)?t[e]:void 0},ea=Object.prototype.hasOwnProperty;var ta=function(e){var t=this.__data__;return Gi?void 0!==t[e]:ea.call(t,e)};var na=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Gi&&void 0===t?"__lodash_hash_undefined__":t,this};function ra(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ra.prototype.clear=Wi,ra.prototype.delete=Zi,ra.prototype.get=Xi,ra.prototype.has=ta,ra.prototype.set=na;var oa=ra;var ia=function(){this.size=0,this.__data__={hash:new oa,map:new(Yi||Ai),string:new oa}};var aa=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ca=function(e,t){var n=e.__data__;return aa(t)?n["string"==typeof t?"string":"hash"]:n.map};var sa=function(e){var t=ca(this,e).delete(e);return this.size-=t?1:0,t};var ua=function(e){return ca(this,e).get(e)};var la=function(e){return ca(this,e).has(e)};var fa=function(e,t){var n=ca(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function pa(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}pa.prototype.clear=ia,pa.prototype.delete=sa,pa.prototype.get=ua,pa.prototype.has=la,pa.prototype.set=fa;var da=pa;var ma=function(e,t){var n=this.__data__;if(n instanceof Ai){var r=n.__data__;if(!Yi||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new da(r)}return n.set(e,t),this.size=n.size,this};function ha(e){var t=this.__data__=new Ai(e);this.size=t.size}ha.prototype.clear=Ii,ha.prototype.delete=Ti,ha.prototype.get=ki,ha.prototype.has=_i,ha.prototype.set=ma;var ya=ha;var va=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},ba=function(){try{var e=Ki(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var ga=function(e,t,n){"__proto__"==t&&ba?ba(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Sa=Object.prototype.hasOwnProperty;var Ea=function(e,t,n){var r=e[t];Sa.call(e,t)&&bi(r,n)&&(void 0!==n||t in e)||ga(e,t,n)};var Oa=function(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var c=t[i],s=r?r(n[c],e[c],c,n,e):void 0;void 0===s&&(s=e[c]),o?ga(n,c,s):Ea(n,c,s)}return n};var ja=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var Ca=function(e){return li(e)&&"[object Arguments]"==ci(e)},wa=Object.prototype,Aa=wa.hasOwnProperty,Ia=wa.propertyIsEnumerable,Ta=Ca(function(){return arguments}())?Ca:function(e){return li(e)&&Aa.call(e,"callee")&&!Ia.call(e,"callee")},ka=Array.isArray,_a=n(21),La=/^(?:0|[1-9]\d*)$/;var xa=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&La.test(e))&&e>-1&&e%1==0&&e<t};var Pa=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Na={};Na["[object Float32Array]"]=Na["[object Float64Array]"]=Na["[object Int8Array]"]=Na["[object Int16Array]"]=Na["[object Int32Array]"]=Na["[object Uint8Array]"]=Na["[object Uint8ClampedArray]"]=Na["[object Uint16Array]"]=Na["[object Uint32Array]"]=!0,Na["[object Arguments]"]=Na["[object Array]"]=Na["[object ArrayBuffer]"]=Na["[object Boolean]"]=Na["[object DataView]"]=Na["[object Date]"]=Na["[object Error]"]=Na["[object Function]"]=Na["[object Map]"]=Na["[object Number]"]=Na["[object Object]"]=Na["[object RegExp]"]=Na["[object Set]"]=Na["[object String]"]=Na["[object WeakMap]"]=!1;var Ra=function(e){return li(e)&&Pa(e.length)&&!!Na[ci(e)]};var Da=function(e){return function(t){return e(t)}},Ma=n(10),Ua=Ma.a&&Ma.a.isTypedArray,Fa=Ua?Da(Ua):Ra,Va=Object.prototype.hasOwnProperty;var za=function(e,t){var n=ka(e),r=!n&&Ta(e),o=!n&&!r&&Object(_a.a)(e),i=!n&&!r&&!o&&Fa(e),a=n||r||o||i,c=a?ja(e.length,String):[],s=c.length;for(var u in e)!t&&!Va.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||xa(u,s))||c.push(u);return c},Ba=Object.prototype;var Ha=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ba)},qa=si(Object.keys,Object),Ja=Object.prototype.hasOwnProperty;var $a=function(e){if(!Ha(e))return qa(e);var t=[];for(var n in Object(e))Ja.call(e,n)&&"constructor"!=n&&t.push(n);return t};var Ka=function(e){return null!=e&&Pa(e.length)&&!Pi(e)};var Ya=function(e){return Ka(e)?za(e):$a(e)};var Ga=function(e,t){return e&&Oa(t,Ya(t),e)};var Wa=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},Za=Object.prototype.hasOwnProperty;var Qa=function(e){if(!Li(e))return Wa(e);var t=Ha(e),n=[];for(var r in e)("constructor"!=r||!t&&Za.call(e,r))&&n.push(r);return n};var Xa=function(e){return Ka(e)?za(e,!0):Qa(e)};var ec=function(e,t){return e&&Oa(t,Xa(t),e)},tc=n(128);var nc=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var rc=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i};var oc=function(){return[]},ic=Object.prototype.propertyIsEnumerable,ac=Object.getOwnPropertySymbols,cc=ac?function(e){return null==e?[]:(e=Object(e),rc(ac(e),(function(t){return ic.call(e,t)})))}:oc;var sc=function(e,t){return Oa(e,cc(e),t)};var uc=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e},lc=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)uc(t,cc(e)),e=ui(e);return t}:oc;var fc=function(e,t){return Oa(e,lc(e),t)};var pc=function(e,t,n){var r=t(e);return ka(e)?r:uc(r,n(e))};var dc=function(e){return pc(e,Ya,cc)};var mc=function(e){return pc(e,Xa,lc)},hc=Ki(Zo.a,"DataView"),yc=Ki(Zo.a,"Promise"),vc=Ki(Zo.a,"Set"),bc=Ki(Zo.a,"WeakMap"),gc=Ui(hc),Sc=Ui(Yi),Ec=Ui(yc),Oc=Ui(vc),jc=Ui(bc),Cc=ci;(hc&&"[object DataView]"!=Cc(new hc(new ArrayBuffer(1)))||Yi&&"[object Map]"!=Cc(new Yi)||yc&&"[object Promise]"!=Cc(yc.resolve())||vc&&"[object Set]"!=Cc(new vc)||bc&&"[object WeakMap]"!=Cc(new bc))&&(Cc=function(e){var t=ci(e),n="[object Object]"==t?e.constructor:void 0,r=n?Ui(n):"";if(r)switch(r){case gc:return"[object DataView]";case Sc:return"[object Map]";case Ec:return"[object Promise]";case Oc:return"[object Set]";case jc:return"[object WeakMap]"}return t});var wc=Cc,Ac=Object.prototype.hasOwnProperty;var Ic=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ac.call(e,"index")&&(n.index=e.index,n.input=e.input),n},Tc=Zo.a.Uint8Array;var kc=function(e){var t=new e.constructor(e.byteLength);return new Tc(t).set(new Tc(e)),t};var _c=function(e,t){var n=t?kc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},Lc=/\w*$/;var xc=function(e){var t=new e.constructor(e.source,Lc.exec(e));return t.lastIndex=e.lastIndex,t},Pc=Qo?Qo.prototype:void 0,Nc=Pc?Pc.valueOf:void 0;var Rc=function(e){return Nc?Object(Nc.call(e)):{}};var Dc=function(e,t){var n=t?kc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var Mc=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return kc(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return _c(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Dc(e,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return xc(e);case"[object Set]":return new r;case"[object Symbol]":return Rc(e)}},Uc=Object.create,Fc=function(){function e(){}return function(t){if(!Li(t))return{};if(Uc)return Uc(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var Vc=function(e){return"function"!=typeof e.constructor||Ha(e)?{}:Fc(ui(e))};var zc=function(e){return li(e)&&"[object Map]"==wc(e)},Bc=Ma.a&&Ma.a.isMap,Hc=Bc?Da(Bc):zc;var qc=function(e){return li(e)&&"[object Set]"==wc(e)},Jc=Ma.a&&Ma.a.isSet,$c=Jc?Da(Jc):qc,Kc={};Kc["[object Arguments]"]=Kc["[object Array]"]=Kc["[object ArrayBuffer]"]=Kc["[object DataView]"]=Kc["[object Boolean]"]=Kc["[object Date]"]=Kc["[object Float32Array]"]=Kc["[object Float64Array]"]=Kc["[object Int8Array]"]=Kc["[object Int16Array]"]=Kc["[object Int32Array]"]=Kc["[object Map]"]=Kc["[object Number]"]=Kc["[object Object]"]=Kc["[object RegExp]"]=Kc["[object Set]"]=Kc["[object String]"]=Kc["[object Symbol]"]=Kc["[object Uint8Array]"]=Kc["[object Uint8ClampedArray]"]=Kc["[object Uint16Array]"]=Kc["[object Uint32Array]"]=!0,Kc["[object Error]"]=Kc["[object Function]"]=Kc["[object WeakMap]"]=!1;var Yc=function e(t,n,r,o,i,a){var c,s=1&n,u=2&n,l=4&n;if(r&&(c=i?r(t,o,i,a):r(t)),void 0!==c)return c;if(!Li(t))return t;var f=ka(t);if(f){if(c=Ic(t),!s)return nc(t,c)}else{var p=wc(t),d="[object Function]"==p||"[object GeneratorFunction]"==p;if(Object(_a.a)(t))return Object(tc.a)(t,s);if("[object Object]"==p||"[object Arguments]"==p||d&&!i){if(c=u||d?{}:Vc(t),!s)return u?fc(t,ec(c,t)):sc(t,Ga(c,t))}else{if(!Kc[p])return i?t:{};c=Mc(t,p,s)}}a||(a=new ya);var m=a.get(t);if(m)return m;a.set(t,c),$c(t)?t.forEach((function(o){c.add(e(o,n,r,o,t,a))})):Hc(t)&&t.forEach((function(o,i){c.set(i,e(o,n,r,i,t,a))}));var h=l?u?mc:dc:u?keysIn:Ya,y=f?void 0:h(t);return va(y||t,(function(o,i){y&&(o=t[i=o]),Ea(c,i,e(o,n,r,i,t,a))})),c};var Gc=function(e){return Yc(e,4)};var Wc=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o};var Zc=function(e){return"symbol"==typeof e||li(e)&&"[object Symbol]"==ci(e)};function Qc(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Qc.Cache||da),n}Qc.Cache=da;var Xc=Qc;var es=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ts=/\\(\\)?/g,ns=function(e){var t=Xc(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(es,(function(e,n,r,o){t.push(r?o.replace(ts,"$1"):n||e)})),t}));var rs=function(e){if("string"==typeof e||Zc(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},os=Qo?Qo.prototype:void 0,is=os?os.toString:void 0;var as=function e(t){if("string"==typeof t)return t;if(ka(t))return Wc(t,e)+"";if(Zc(t))return is?is.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var cs=function(e){return null==e?"":as(e)};var ss=function(e){return ka(e)?Wc(e,rs):Zc(e)?[e]:nc(ns(cs(e)))};var us=function(e,t){},ls=n(32),fs=n(33),ps=n.n(fs);var ds=function(e){return Yc(e,5)};function ms(){return(ms=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function hs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function ys(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function vs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var bs=function(e){return"function"==typeof e},gs=function(e){return null!==e&&"object"==typeof e},Ss=function(e){return String(Math.floor(Number(e)))===e},Es=function(e){return"[object String]"===Object.prototype.toString.call(e)},Os=function(e){return 0===d.Children.count(e)},js=function(e){return gs(e)&&bs(e.then)};function Cs(e,t,n,r){void 0===r&&(r=0);for(var o=ss(t);e&&r<o.length;)e=e[o[r++]];return void 0===e?n:e}function ws(e,t,n){for(var r=Gc(e),o=r,i=0,a=ss(t);i<a.length-1;i++){var c=a[i],s=Cs(e,a.slice(0,i+1));if(s&&(gs(s)||Array.isArray(s)))o=o[c]=Gc(s);else{var u=a[i+1];o=o[c]=Ss(u)&&Number(u)>=0?[]:{}}}return(0===i?e:o)[a[i]]===n?e:(void 0===n?delete o[a[i]]:o[a[i]]=n,0===i&&void 0===n&&delete r[a[i]],r)}function As(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var o=0,i=Object.keys(e);o<i.length;o++){var a=i[o],c=e[a];gs(c)?n.get(c)||(n.set(c,!0),r[a]=Array.isArray(c)?[]:{},As(c,t,n,r[a])):r[a]=t}return r}var Is=Object(d.createContext)(void 0),Ts=Is.Provider,ks=Is.Consumer;function _s(){var e=Object(d.useContext)(Is);return e||us(!1),e}function Ls(e,t){switch(t.type){case"SET_VALUES":return ms({},e,{values:t.payload});case"SET_TOUCHED":return ms({},e,{touched:t.payload});case"SET_ERRORS":return ms({},e,{errors:t.payload});case"SET_STATUS":return ms({},e,{status:t.payload});case"SET_ISSUBMITTING":return ms({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return ms({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return ms({},e,{values:ws(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return ms({},e,{touched:ws(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return ms({},e,{errors:ws(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return ms({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return ms({},e,{touched:As(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return ms({},e,{isSubmitting:!1});default:return e}}var xs={},Ps={};function Ns(e){var t=e.validateOnChange,n=void 0===t||t,r=e.validateOnBlur,o=void 0===r||r,i=e.validateOnMount,a=void 0!==i&&i,c=e.isInitialValid,s=e.enableReinitialize,u=void 0!==s&&s,l=e.onSubmit,f=ys(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=ms({validateOnChange:n,validateOnBlur:o,validateOnMount:a,onSubmit:l},f),m=Object(d.useRef)(p.initialValues),h=Object(d.useRef)(p.initialErrors||xs),y=Object(d.useRef)(p.initialTouched||Ps),v=Object(d.useRef)(p.initialStatus),b=Object(d.useRef)(!1),g=Object(d.useRef)({});Object(d.useEffect)((function(){0}),[]),Object(d.useEffect)((function(){return b.current=!0,function(){b.current=!1}}),[]);var S=Object(d.useReducer)(Ls,{values:p.initialValues,errors:p.initialErrors||xs,touched:p.initialTouched||Ps,status:p.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),E=S[0],O=S[1],j=Object(d.useCallback)((function(e,t){return new Promise((function(n,r){var o=p.validate(e,t);null==o?n(xs):js(o)?o.then((function(e){n(e||xs)}),(function(e){r(e)})):n(o)}))}),[p.validate]),C=Object(d.useCallback)((function(e,t){var n=p.validationSchema,r=bs(n)?n(t):n,o=t&&r.validateAt?r.validateAt(t,e):function(e,t,n,r){void 0===n&&(n=!1);void 0===r&&(r={});var o=function e(t){var n={};for(var r in t)if(t.hasOwnProperty(r)){var o=String(r);!0===Array.isArray(t[o])?n[o]=t[o].map((function(t){return!0===Array.isArray(t)||yi(t)?e(t):""!==t?t:void 0})):yi(t[o])?n[o]=e(t[o]):n[o]=""!==t[o]?t[o]:void 0}return n}(e);return t[n?"validateSync":"validate"](o,{abortEarly:!1,context:r})}(e,r);return new Promise((function(e,t){o.then((function(){e(xs)}),(function(n){"ValidationError"===n.name?e(function(e){var t={};if(e.inner){if(0===e.inner.length)return ws(t,e.path,e.message);var n=e.inner,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var i;if(r){if(o>=n.length)break;i=n[o++]}else{if((o=n.next()).done)break;i=o.value}var a=i;Cs(t,a.path)||(t=ws(t,a.path,a.message))}}return t}(n)):t(n)}))}))}),[p.validationSchema]),w=Object(d.useCallback)((function(e,t){return new Promise((function(n){return n(g.current[e].validate(t))}))}),[]),A=Object(d.useCallback)((function(e){var t=Object.keys(g.current).filter((function(e){return bs(g.current[e].validate)})),n=t.length>0?t.map((function(t){return w(t,Cs(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=ws(e,t[r],n)),e}),{})}))}),[w]),I=Object(d.useCallback)((function(e){return Promise.all([A(e),p.validationSchema?C(e):{},p.validate?j(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return Wo.all([t,n,r],{arrayMerge:Ds})}))}),[p.validate,p.validationSchema,A,j,C]),T=Us((function(e){return void 0===e&&(e=E.values),Object(ls.unstable_runWithPriority)(ls.LowPriority,(function(){return I(e).then((function(e){return b.current&&O({type:"SET_ERRORS",payload:e}),e}))}))})),k=Us((function(e){return void 0===e&&(e=E.values),O({type:"SET_ISVALIDATING",payload:!0}),I(e).then((function(e){return b.current&&(O({type:"SET_ISVALIDATING",payload:!1}),qo()(E.errors,e)||O({type:"SET_ERRORS",payload:e})),e}))}));Object(d.useEffect)((function(){a&&!0===b.current&&T(p.initialValues)}),[p.initialValues,a,T]);var _=Object(d.useCallback)((function(e){var t=e&&e.values?e.values:m.current,n=e&&e.errors?e.errors:h.current?h.current:p.initialErrors||{},r=e&&e.touched?e.touched:y.current?y.current:p.initialTouched||{},o=e&&e.status?e.status:v.current?v.current:p.initialStatus;m.current=t,h.current=n,y.current=r,v.current=o,O({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:o,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})}),[p.initialErrors,p.initialStatus,p.initialTouched]);Object(d.useEffect)((function(){u&&!0===b.current&&!qo()(m.current,p.initialValues)&&(m.current=p.initialValues,_())}),[u,p.initialValues,_]),Object(d.useEffect)((function(){u&&!0===b.current&&!qo()(h.current,p.initialErrors)&&(h.current=p.initialErrors||xs,O({type:"SET_ERRORS",payload:p.initialErrors||xs}))}),[u,p.initialErrors]),Object(d.useEffect)((function(){u&&!0===b.current&&!qo()(y.current,p.initialTouched)&&(y.current=p.initialTouched||Ps,O({type:"SET_TOUCHED",payload:p.initialTouched||Ps}))}),[u,p.initialTouched]),Object(d.useEffect)((function(){u&&!0===b.current&&!qo()(v.current,p.initialStatus)&&(v.current=p.initialStatus,O({type:"SET_STATUS",payload:p.initialStatus}))}),[u,p.initialStatus,p.initialTouched]);var L=Us((function(e){if(bs(g.current[e].validate)){var t=Cs(E.values,e),n=g.current[e].validate(t);return js(n)?(O({type:"SET_ISVALIDATING",payload:!0}),n.then((function(e){return e})).then((function(t){O({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),O({type:"SET_ISVALIDATING",payload:!1})}))):(O({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return Promise.resolve()})),x=Object(d.useCallback)((function(e,t){var n=t.validate;g.current[e]={validate:n}}),[]),P=Object(d.useCallback)((function(e){delete g.current[e]}),[]),N=Us((function(e){return O({type:"SET_TOUCHED",payload:e}),o?T(E.values):Promise.resolve()})),R=Object(d.useCallback)((function(e){O({type:"SET_ERRORS",payload:e})}),[]),D=Us((function(e){return O({type:"SET_VALUES",payload:e}),n?T(e):Promise.resolve()})),M=Object(d.useCallback)((function(e,t){O({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),U=Us((function(e,t,r){return void 0===r&&(r=!0),O({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),n&&r?T(ws(E.values,e,t)):Promise.resolve()})),F=Object(d.useCallback)((function(e,t){var n,r=t,o=e;if(!Es(e)){e.persist&&e.persist();var i=e.target,a=i.type,c=i.name,s=i.id,u=i.value,l=i.checked,f=(i.outerHTML,i.options),p=i.multiple;r=t||(c||s),o=/number|range/.test(a)?(n=parseFloat(u),isNaN(n)?"":n):/checkbox/.test(a)?function(e,t,n){if("true"==n||"false"==n)return!!t;if(t&&n)return Array.isArray(e)?e.concat(n):[n];if(!Array.isArray(e))return!e;var r=e.indexOf(n);if(r<0)return e;return e.slice(0,r).concat(e.slice(r+1))}(Cs(E.values,r),l,u):p?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(f):u}r&&U(r,o)}),[U,E.values]),V=Object(d.useCallback)((function(e){if(Es(e))return function(t){return F(t,e)};F(e)}),[F]),z=Us((function(e,t,n){return void 0===t&&(t=!0),void 0===n&&(n=!0),O({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),o&&n?T(E.values):Promise.resolve()})),B=Object(d.useCallback)((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,o=n.id,i=(n.outerHTML,t||(r||o));z(i,!0)}),[z]),H=Object(d.useCallback)((function(e){if(Es(e))return function(t){return B(t,e)};B(e)}),[B]),q=Object(d.useCallback)((function(e){bs(e)?O({type:"SET_FORMIK_STATE",payload:e}):O({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),J=Object(d.useCallback)((function(e){O({type:"SET_STATUS",payload:e})}),[]),$=Object(d.useCallback)((function(e){O({type:"SET_ISSUBMITTING",payload:e})}),[]),K={resetForm:_,validateForm:k,validateField:L,setErrors:R,setFieldError:M,setFieldTouched:z,setFieldValue:U,setStatus:J,setSubmitting:$,setTouched:N,setValues:D,setFormikState:q},Y=Us((function(){return l(E.values,K)})),G=Us((function(){return O({type:"SUBMIT_ATTEMPT"}),k().then((function(e){if(0===Object.keys(e).length){var t=Y();if(void 0===t)return;return Promise.resolve(t).then((function(){b.current&&O({type:"SUBMIT_SUCCESS"})})).catch((function(e){if(b.current)throw O({type:"SUBMIT_FAILURE"}),e}))}b.current&&O({type:"SUBMIT_FAILURE"})}))})),W=Us((function(e){e&&e.preventDefault&&bs(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&bs(e.stopPropagation)&&e.stopPropagation(),G()})),Z=Us((function(e){if(e&&e.preventDefault&&bs(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&bs(e.stopPropagation)&&e.stopPropagation(),p.onReset){var t=p.onReset(E.values,K);js(t)?t.then(_):_()}else _()})),Q=Object(d.useCallback)((function(e){return{value:Cs(E.values,e),error:Cs(E.errors,e),touched:!!Cs(E.touched,e),initialValue:Cs(m.current,e),initialTouched:!!Cs(y.current,e),initialError:Cs(h.current,e)}}),[E.errors,E.touched,E.values]),X=Object(d.useCallback)((function(e){var t=gs(e),n=t?e.name:e,r=Cs(E.values,n),o={name:n,value:r,onChange:V,onBlur:H};if(t){var i=e.type,a=e.value,c=e.as,s=e.multiple;"checkbox"===i?void 0===a?o.checked=!!r:(o.checked=!(!Array.isArray(r)||!~r.indexOf(a)),o.value=a):"radio"===i?(o.checked=r===a,o.value=a):"select"===c&&s&&(o.value=o.value||[],o.multiple=!0)}return o}),[H,V,E.values]),ee=Object(d.useMemo)((function(){return!qo()(m.current,E.values)}),[E.values]),te=Object(d.useMemo)((function(){return void 0!==c?ee?E.errors&&0===Object.keys(E.errors).length:!1!==c&&bs(c)?c(p):c:E.errors&&0===Object.keys(E.errors).length}),[c,ee,E.errors,p]);return ms({},E,{initialValues:m.current,initialErrors:h.current,initialTouched:y.current,initialStatus:v.current,handleBlur:H,handleChange:V,handleReset:Z,handleSubmit:W,resetForm:_,setErrors:R,setFormikState:q,setFieldTouched:z,setFieldValue:U,setFieldError:M,setStatus:J,setSubmitting:$,setTouched:N,setValues:D,submitForm:G,validateForm:k,validateField:L,isValid:te,dirty:ee,unregisterField:P,registerField:x,getFieldProps:X,getFieldMeta:Q,validateOnBlur:o,validateOnChange:n,validateOnMount:a})}function Rs(e){var t=Ns(e),n=e.component,r=e.children,o=e.render;return Object(d.useEffect)((function(){0}),[]),Object(d.createElement)(Ts,{value:t},n?Object(d.createElement)(n,t):o?o(t):r?bs(r)?r(t):Os(r)?null:d.Children.only(r):null)}function Ds(e,t,n){var r=e.slice();return t.forEach((function(t,o){if(void 0===r[o]){var i=!1!==n.clone&&n.isMergeableObject(t);r[o]=i?Wo(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[o]=Wo(e[o],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var Ms="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d.useLayoutEffect:d.useEffect;function Us(e){var t=Object(d.useRef)(e);return Ms((function(){t.current=e})),Object(d.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current.apply(void 0,n)}),[])}function Fs(e){var t=e.validate,n=e.name,r=e.render,o=e.children,i=e.as,a=e.component,c=ys(e,["validate","name","render","children","as","component"]),s=_s(),u=(s.validate,s.validationSchema,ys(s,["validate","validationSchema"]));Object(d.useEffect)((function(){0}),[]);var l=u.registerField,f=u.unregisterField;Object(d.useEffect)((function(){return l(n,{validate:t}),function(){f(n)}}),[l,f,n,t]);var p=u.getFieldProps(ms({name:n},c)),m=u.getFieldMeta(n),h={field:p,form:u};if(r)return r(ms({},h,{meta:m}));if(bs(o))return o(ms({},h,{meta:m}));if(a){if("string"==typeof a){var y=c.innerRef,v=ys(c,["innerRef"]);return Object(d.createElement)(a,ms({ref:y},p,v),o)}return Object(d.createElement)(a,ms({field:p,form:u},c),o)}var b=i||"input";if("string"==typeof b){var g=c.innerRef,S=ys(c,["innerRef"]);return Object(d.createElement)(b,ms({ref:g},p,S),o)}return Object(d.createElement)(b,ms({},p,c),o)}var Vs=Object(d.forwardRef)((function(e,t){var n=e.action,r=ys(e,["action"]),o=n||"#",i=_s(),a=i.handleReset,c=i.handleSubmit;return Object(d.createElement)("form",Object.assign({onSubmit:c,ref:t,onReset:a,action:o},r))}));function zs(e){var t=function(t){return Object(d.createElement)(ks,null,(function(n){return n||us(!1),Object(d.createElement)(e,Object.assign({},t,{formik:n}))}))},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return t.WrappedComponent=e,t.displayName="FormikConnect("+n+")",ps()(t,e)}Vs.displayName="Form";var Bs=function(e,t,n){var r=Hs(e);return r.splice(t,0,n),r},Hs=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map((function(e){return parseInt(e)})).reduce((function(e,t){return t>e?t:e}),0);return Array.from(ms({},e,{length:t+1}))}return[]},qs=function(e){function t(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var o=n.props,i=o.name,a=o.validateOnChange,c=o.formik,s=c.setFormikState,u=c.validateForm;s((function(n){var o="function"==typeof r?r:e,a="function"==typeof t?t:e;return ms({},n,{values:ws(n.values,i,e(Cs(n.values,i))),errors:r?ws(n.errors,i,o(Cs(n.errors,i))):n.errors,touched:t?ws(n.touched,i,a(Cs(n.touched,i))):n.touched})}),(function(){a&&u()}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat(Hs(t),[ds(e)])}),!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Hs(e),o=r[t];return r[t]=r[n],r[n]=o,r}(n,e,t)}),!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Hs(e),o=r[t];return r.splice(t,1),r.splice(n,0,o),r}(n,e,t)}),!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField((function(n){return Bs(n,e,t)}),(function(t){return Bs(t,e,null)}),(function(t){return Bs(t,e,null)}))},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Hs(e);return r[t]=n,r}(n,e,t)}),!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField((function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n})),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(vs(n)),n.pop=n.pop.bind(vs(n)),n}hs(t,e);var n=t.prototype;return n.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?Hs(n):[];return t||(t=r[e]),bs(r.splice)&&r.splice(e,1),r}),!0,!0),t},n.pop=function(){var e;return this.updateArrayField((function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n}),!0,!0),e},n.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,o=t.children,i=t.name,a=t.formik,c=(a.validate,a.validationSchema,ms({},e,{form:ys(a,["validate","validationSchema"]),name:i}));return n?Object(d.createElement)(n,c):r?r(c):o?"function"==typeof o?o(c):Os(o)?null:d.Children.only(o):null},t}(d.Component);qs.defaultProps={validateOnChange:!0};var Js=zs(function(e){function t(){return e.apply(this,arguments)||this}hs(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return Cs(this.props.formik.errors,this.props.name)!==Cs(e.formik.errors,this.props.name)||Cs(this.props.formik.touched,this.props.name)!==Cs(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,t=e.component,n=e.formik,r=e.render,o=e.children,i=e.name,a=ys(e,["component","formik","render","children","name"]),c=Cs(n.touched,i),s=Cs(n.errors,i);return c&&s?r?bs(r)?r(s):null:o?bs(o)?o(s):null:t?Object(d.createElement)(t,a,s):s:null},t}(d.Component));(function(e){function t(t){var n;n=e.call(this,t)||this;var r=t.render,o=t.children,i=t.component,a=t.as;t.name;return r&&us(!1),i&&r&&us(!1),a&&o&&bs(o)&&us(!1),i&&o&&bs(o)&&us(!1),r&&o&&!Os(o)&&us(!1),n}hs(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e,t,n){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):Cs(this.context.values,this.props.name)!==Cs(n.values,this.props.name)||Cs(this.context.errors,this.props.name)!==Cs(n.errors,this.props.name)||Cs(this.context.touched,this.props.name)!==Cs(n.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length||this.context.isSubmitting!==n.isSubmitting},n.componentDidMount=function(){this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentDidUpdate=function(e){this.props.name!==e.name&&(this.context.unregisterField(e.name),this.context.registerField(this.props.name,{validate:this.props.validate})),this.props.validate!==e.validate&&this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentWillUnmount=function(){this.context.unregisterField(this.props.name)},n.render=function(){var e=this.props,t=(e.validate,e.name),n=e.render,r=e.as,o=e.children,i=e.component,a=(e.shouldUpdate,ys(e,["validate","name","render","as","children","component","shouldUpdate"])),c=this.context,s=(c.validate,c.validationSchema,ys(c,["validate","validationSchema"])),u={value:"radio"===a.type||"checkbox"===a.type?a.value:Cs(c.values,t),name:t,onChange:c.handleChange,onBlur:c.handleBlur},l={field:u,meta:{value:Cs(c.values,t),error:Cs(c.errors,t),touched:!!Cs(c.touched,t),initialValue:Cs(c.initialValues,t),initialTouched:!!Cs(c.initialTouched,t),initialError:Cs(c.initialErrors,t)},form:s};if(n)return n(l);if(bs(o))return o(l);if(i){if("string"==typeof i){var f=a.innerRef,p=ys(a,["innerRef"]);return Object(d.createElement)(i,ms({ref:f},u,p),o)}return Object(d.createElement)(i,ms({field:u,form:c},a),o)}var m=r||"input";if("string"==typeof m){var h=a.innerRef,y=ys(a,["innerRef"]);return Object(d.createElement)(m,ms({ref:h},u,y),o)}return Object(d.createElement)(m,ms({},u,a),o)},t}(d.Component)).contextType=Is;var $s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Ks(e){var t=e.castInitialValues,n=e.castValuesOnSubmit,r=e.initialValues,o=e.onSubmit,i=e.resetOnSubmit,a=$s(e,["castInitialValues","castValuesOnSubmit","initialValues","onSubmit","resetOnSubmit"]),c=t&&e.validationSchema?e.validationSchema.cast(function e(t){var n=Rr.deepClone(t);return Object.keys(n).forEach((function(t){n.hasOwnProperty(t)&&(Rr.isObject(n[t])?n[t]=e(n[t]):null===n[t]&&delete n[t])})),n}(r)):r,s={allowInitialSubmit:e.allowInitialSubmit};return d.createElement(Rs,Object.assign({enableReinitialize:!0},a,{initialValues:c,onSubmit:function(t,r){var a=r.setSubmitting,c=r.resetForm,s=n&&e.validationSchema?e.validationSchema.cast(t):t;o(s,(function(){i&&c(),a(!1)}))},initialStatus:s}),hn(e.children)?function(t){return e.children(t)}:d.Children.count(e.children)?e.children:null)}Ks.defaultProps={castInitialValues:!0,castValuesOnSubmit:!0};var Ys=n(2),Gs=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),Ws=n(3),Zs=function(e,t,n,r){var o="form-control";return Cs(t,n)&&Cs(e,n)&&(o+=" is-invalid"),r&&(o+=" ".concat(r)),o};function Qs(e){var t=_s().values[e.fieldName];return"string"!=typeof t?d.createElement(d.Fragment,null):d.createElement("div",{className:"float-right text-muted"},t.length,"/",e.limit)}var Xs=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function eu(e){var t=e.label,n=Xs(e,["label"]);return d.createElement(Ws.Form.Group,null,d.createElement("div",{className:"custom-control custom-checkbox"},d.createElement(nu,Object.assign({className:"custom-control-input"},n)),d.createElement(Ws.Form.Label,{className:"custom-control-label",htmlFor:n.id},t)))}var tu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function nu(e){var t=e.children,n=tu(e,["children"]);return d.createElement(Fs,Object.assign({},n),hn(t)?function(e){return t(e)}:d.Children.count(t)?t:null)}function ru(e){var t=e.label,n=e.className,r=e.showCharacterCounter,o=tu(e,["label","className","showCharacterCounter"]),i=_s(),a=i.errors,c=i.touched;return"checkbox"===o.type?d.createElement(eu,Object.assign({},e)):d.createElement(Ws.Form.Group,null,!!t&&d.createElement(Ws.Form.Label,{htmlFor:o.id},t),d.createElement(nu,Object.assign({className:Zs(a,c,o.name,n)},o)),!!r&&!!o.maxLength&&d.createElement(Qs,{fieldName:o.name,limit:o.maxLength}),d.createElement(Js,{name:o.name},(function(e){return d.createElement(Ws.Form.Control.Feedback,{type:"invalid"},e)})))}function ou(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return iu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function au(e){var t,n=ou(d.useState(!1),2),r=n[0],o=n[1];return d.useEffect((function(){var t;e.isValid&&(e.dirty||(null===(t=e.initialStatus)||void 0===t?void 0:t.allowInitialSubmit))?o(!0):o(!1)}),[e.isValid,null===(t=e.initialStatus)||void 0===t?void 0:t.allowInitialSubmit,e.dirty,e.values]),d.useEffect((function(){e.isSubmitting&&o(!1)}),[e.isSubmitting]),r}function cu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return su(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return su(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function su(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var uu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function lu(e){var t=e.showSpinner,n=e.children,r=uu(e,["showSpinner","children"]),o=d.useRef(),i=cu(d.useState({}),2),a=i[0],c=i[1];return d.useEffect((function(){var e=a.width,t=a.height;if(!e||!t){var n=o.current,r=n.offsetHeight,i=n.offsetWidth;r&&i&&c({width:i,height:r})}})),d.useEffect((function(){var e=a.width,t=a.height;if(e&&t){var n=o.current;n.style.width="".concat(e+1,"px"),n.style.height="".concat(t+1,"px")}}),[a]),d.createElement(Ws.Button,Object.assign({ref:o,disabled:t},r),t?d.createElement(Ws.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):n)}var fu=n(129),pu=n(22),du="AlertService",mu="LanguageService";function hu(e){return(hu="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 yu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vu(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 bu(e,t){return(bu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gu(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=Eu(e);if(t){var o=Eu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Su(this,n)}}function Su(e,t){return!t||"object"!==hu(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 Eu(e){return(Eu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ou=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&&bu(e,t)}(i,e);var t,n,r,o=gu(i);function i(){return yu(this,i),o.apply(this,arguments)}return t=i,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"setConfig",value:function(e){this.polyglot=new fu({locale:e.locale,phrases:e.phrases.rootElement||e.phrases}),this.cache={}}},{key:"getPhrase",value:function(e,t,n){var r="".concat(e,".").concat(t);if(this.polyglot||K.throw(new Xe("LanguageService config must be set.")),!this.polyglot.has(r)){if(!_.isDevelopment){var o=window.trackJs;return o&&o.console.error("No phrase set for ".concat(r," in language config")),""}K.throw(new Xe("No phrase set for ".concat(r," in language config.")))}if(!n||h.isEmpty(n)){var i=this.cache[r];if(i)return i;var a=this.polyglot.t(r);return this.cache[r]=a,a}var c=h.omit(n,"smartCount"),s={};for(var u in c)s[u]=pu.sanitize(c[u]);h.isNumber(n.smartCount)&&(s.smart_count=n.smartCount);var l="".concat(r,":").concat(h.values(Object.assign({},s)).join(":")),f=this.cache[l];if(f)return f;var p=this.polyglot.t(r,s);return this.cache[l]=p,p}},{key:"encloseNamespace",value:function(e){var t=this;return function(n,r){return t.getPhrase(e,n,r)}}},{key:"name",get:function(){return mu}}])&&vu(t.prototype,n),r&&vu(t,r),i}(Yt).Instance,ju=d.createContext(""),Cu=d.memo((function(e){var t=e.phrase,n=e.namespace,r=e.options,o=d.useContext(ju),i=n||o,a=Ou.getPhrase(i,t,r);return d.createElement("span",{dangerouslySetInnerHTML:{__html:a}})}),(function(e,t){return e.namespace===t.namespace&&e.phrase===t.phrase&&Rr.isEqual(e.options,t.options)}));function wu(e){var t=_s(),n=au(t);d.useEffect((function(){function e(e){13===e.keyCode&&n&&t.validateForm().then((function(e){Object.keys(e).length||t.submitForm()}))}return window.addEventListener("keypress",e),function(){return window.removeEventListener("keypress",e)}}),[n]);var r="save";return e.isNew&&(r="create"),e.hasNext&&(r="next"),d.createElement(lu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},d.createElement(Cu,{namespace:"shared.formButtons",phrase:r}))}function Au(e){var t=_s();return d.createElement(Vs,null,d.createElement(ru,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this company",autoFocus:!0}),d.createElement(wu,{isNew:e.isNew}))}function Iu(e){return d.createElement(Ks,{initialValues:e.company,validationSchema:Gs,onSubmit:e.saveCompany},d.createElement(Au,{isNew:!(e.company&&e.company.id)}))}function Tu(e){var t=Object(bn.useDispatch)(),n=o.useBasicFetch(Vo(e.id));return d.createElement(d.Fragment,null,!!n.data&&d.createElement(Iu,{company:n.data,saveCompany:function(n,r){return o.fetch(t,Bo(e.id,n,r))}}))}function ku(){var e=Object(bn.useDispatch)();return d.createElement(Iu,{saveCompany:function(t,n){o.fetch(e,zo(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.PEOPLE,action:a.Companies.EDIT_COMPANY,args:[e.id]})}),n))}})}var _u,Lu=n(130);function xu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Nu(e){return(Nu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e){e.XS="(max-width: 575px)",e.SM="(min-width: 576px) and (max-width: 767px)",e.MD="(min-width: 768px) and (max-width: 991px)",e.LG="(min-width: 992px)",e.XL="(min-width: 1200px)",e.XXL="(min-width: 1440px)",e.SMDown="(max-width: 576px)",e.MDDown="(max-width: 768px)"}(_u||(_u={}));var Ru,Du={isNumber:function(e){return Du.isType(e,"number")},isString:function(e){return Du.isType(e,"string")},isType:function(e,t){return Nu(e)===t}},Mu=n(14),Uu=n.n(Mu);function Fu(e){return function(e){if(Array.isArray(e))return Vu(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Vu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vu(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bu(e,t){return Rr.isObject(e)&&e.hasOwnProperty(t)&&Du.isString(e[t])}function Hu(e,t,n){return function(r){var i=r.value;if(i.length||n(),!(i.length<e.activationLength)){if(e.local){var a=hn(e.getLocalSuggestions)?e.getLocalSuggestions(i,e.local):(c=i,s=e.local,u=e.valueKey,(l=c.trim().toLowerCase()).length?s.filter((function(e){return!(!Bu(e,u)||!Du.isString(e[u]))&&e[u].trim().toLowerCase().includes(l)})):[]);t((function(e){return Object.assign(Object.assign({},e),zu({},Ru.Local,a))}))}var c,s,u,l;e.getRemoteUrl&&function(e,t,n){var r=hn(e)&&e(t);r&&o.ajaxRequest({resource:r,type:jr.GET,success:n,error:function(){}})}(e.getRemoteUrl,i,(function(n){return t((function(t){return Object.assign(Object.assign({},t),zu({},Ru.Remote,hn(e.formatRemoteSuggestions)?e.formatRemoteSuggestions(n):n))}))}))}}}function qu(e,t,n,r,o,i){var a=function(t){return e[t]||[]},c=t?a(Ru.Recent):[],s=a(Ru.Local),u=a(Ru.Remote),l=[];c.length&&l.push({title:n,data:c});var f=[].concat(Fu(s),Fu(u));return Number.isInteger(i)&&l.length>i&&f.slice(0,i),hn(o)?l.push.apply(l,Fu(o(f))):l.push({title:r,data:f}),l}function Ju(e){return e.data}function $u(e){if(e.title)return d.createElement("strong",null,e.title)}!function(e){e.Local="local",e.Recent="recent",e.Remote="remote"}(Ru||(Ru={}));var Ku={container:"position-relative",suggestionsContainerOpen:"bg-white py-1 border rounded ".concat(Uu.a.suggestionsContainerOpen),suggestionsList:"list-unstyled m-0",suggestion:"cursor-pointer py-1 px-2",suggestionHighlighted:Uu.a.suggestionHighlighted,sectionContainer:"border-bottom py-1 ".concat(Uu.a.sectionContainer)};function Yu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Ku,e)}var Gu,Wu,Zu=n(15),Qu=n(35),Xu=n.n(Qu),el=n(36),tl=n.n(el),nl=n(37),rl=n.n(nl),ol=n(38),il=n.n(ol),al=(n(39),n(40),n(41)),cl=n.n(al),sl=n(42),ul=n.n(sl),ll=n(43),fl=n.n(ll),pl=n(44),dl=n.n(pl),ml=n(45),hl=n.n(ml),yl=n(46),vl=n.n(yl),bl=n(47),gl=n.n(bl),Sl=n(48),El=n.n(Sl),Ol=n(49),jl=n.n(Ol),Cl=n(50),wl=n.n(Cl),Al=n(51),Il=n.n(Al),Tl=n(52),kl=n.n(Tl),_l=n(53),Ll=n.n(_l),xl=n(54),Pl=n.n(xl),Nl=n(55),Rl=n.n(Nl),Dl=n(56),Ml=n.n(Dl),Ul=n(57),Fl=n.n(Ul),Vl=n(58),zl=n.n(Vl),Bl=n(59),Hl=n.n(Bl),ql=n(60),Jl=n.n(ql),$l=(n(61),n(62)),Kl=n.n($l),Yl=n(63),Gl=n.n(Yl),Wl=n(64),Zl=n.n(Wl),Ql=(n(65),n(66),n(67)),Xl=n.n(Ql),ef=n(68),tf=n.n(ef),nf=n(69),rf=n.n(nf),of=n(70),af=n.n(of),cf=n(71),sf=n.n(cf),uf=n(72),lf=n.n(uf),ff=(n(73),n(74)),pf=n.n(ff),df=n(75),mf=n.n(df),hf=n(76),yf=n.n(hf),vf=n(77),bf=n.n(vf),gf=n(78),Sf=n.n(gf),Ef=n(79),Of=n.n(Ef),jf=n(80),Cf=n.n(jf),wf=(n(81),n(82)),Af=n.n(wf),If=n(83),Tf=n.n(If),kf=n(84),_f=n.n(kf),Lf=n(85),xf=n.n(Lf),Pf=n(86),Nf=n.n(Pf),Rf=n(87),Df=n.n(Rf),Mf=n(88),Uf=n.n(Mf),Ff=n(89),Vf=n.n(Ff),zf=n(90),Bf=n.n(zf),Hf=n(91),qf=n.n(Hf),Jf=n(92),$f=n.n(Jf),Kf=n(93),Yf=n.n(Kf),Gf=n(94),Wf=n.n(Gf),Zf=(n(95),n(96),n(97),n(98)),Qf=n.n(Zf),Xf=(n(99),n(100),n(101),n(102),n(103)),ep=n.n(Xf),tp=n(104),np=n.n(tp),rp=(n(105),n(106),n(107),n(108)),op=n.n(rp),ip=n(109),ap=n.n(ip),cp=n(110),sp=n.n(cp),up=n(111),lp=n.n(up),fp=n(112),pp=n.n(fp),dp=n(113),mp=n.n(dp),hp=n(114),yp=n.n(hp),vp=(n(115),n(116),n(117),n(118)),bp=n.n(vp),gp=n(119),Sp=n.n(gp),Ep=[Xu.a,rl.a,il.a,cl.a,dl.a,hl.a,vl.a,gl.a,fl.a,tl.a,El.a,jl.a,wl.a,Il.a,kl.a,ul.a,Ll.a,Pl.a,Rl.a,Jl.a,Ml.a,Fl.a,zl.a,Hl.a,Kl.a,rf.a,Uf.a,Bf.a,Vf.a,Wf.a,qf.a,$f.a,Yf.a,bf.a,Of.a,Sf.a,Gl.a,Zl.a,mf.a,yf.a,pf.a,Xl.a,af.a,Tf.a,_f.a,sf.a,lf.a,xf.a,tf.a,Af.a,Nf.a,Df.a,Cf.a,ep.a,np.a,Qf.a,sp.a,ap.a,op.a,lp.a,mp.a,pp.a,yp.a,Sp.a,bp.a];function Op(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e){e.AddToPlaylists="add-to-playlist",e.Caret="caret",e.Delete="delete",e.Edit="edit",e.NoEdit="no-edit",e.Close="close",e.Folder="folder",e.Resources="resources",e.More="more",e.Bell="bell",e.Plus="plus",e.Search="search",e.Share="share",e.Upload="upload",e.Preview="preview",e.CircleCheck="circle-check",e.Down="down",e.Right="right",e.UpDown="up-down",e.ChevronUp="chevron-up",e.ChevronDown="chevron-down",e.ChevronLeft="chevron-left",e.ChevronRight="chevron-right",e.VisibleOff="visible-off",e.VisibleOn="visible-on",e.PublisherArchive="publisher-archive",e.Play="play",e.PlayCircle="play-circle",e.ArrowLeft="arrow-left",e.CheckCircleOutline="check-circle-o",e.CheckCircle="check-circle",e.Check="check",e.Lock="lock",e.Link="link",e.Info="info",e.Question="question",e.Star="star",e.StarOutline="star-o",e.Archive="archive",e.Warning="warning",e.WarningOutline="warning-o",e.NewWindow="new-window",e.File="file",e.FilePDF="file-pdf",e.FileExcel="file-excel",e.FilePowerpoint="file-ppt",e.FileWord="file-word",e.FileImg="file-img",e.FileZip="file-zip",e.Enter="enter",e.Calendar="calendar",e.CloseCaption="close-caption",e.CloseCaptionBadge="close-caption-badge",e.Playlist="playlist",e.Handle="handle",e.Subject="subject",e.Series="series",e.EditClickView="edit-clickview",e.Heart="heart",e.HeartOutline="heart-outline",e.WhiteWave="white-wave",e.Cog="cog",e.Video="video",e.Compass="compass",e.History="history",e.Tag="tag"}(Gu||(Gu={}));var jp;function Cp(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)}}h.extend(Zu.config,{autoReplaceSvg:!1,autoAddCss:!1,familyPrefix:"cv",autoA11y:!0,observeMutations:!1,replacementClass:"cv-svg",keepOriginalSource:!1}),(Wu=Zu.library).add.apply(Wu,function(e){if(Array.isArray(e))return Op(e)}(jp=Ep)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(jp)||function(e,t){if(e){if("string"==typeof e)return Op(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Op(e,t):void 0}}(jp)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var wp=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"getSvg",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.faIconLookup(e,t),r=this.getIcon(n,t);if(r&&(!r||r.html.length))return r.html.pop()}},{key:"getIcon",value:function(e,t){return Zu.icon(e,t.iconOptions||{})}},{key:"faIconLookup",value:function(e,t){var n=t.prefix,r=void 0===n?"cv":n;return Zu.findIconDefinition({prefix:r,iconName:e})}}])&&Cp(t.prototype,n),r&&Cp(t,r),e}().Instance,Ap=Gu,Ip=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return Math.floor(Math.random()*Math.floor(e))};function Tp(e){var t=e.title,n=e.placement,r=e.trigger,o=e.children;return d.createElement(Ws.OverlayTrigger,{placement:n,overlay:d.createElement(Ws.Tooltip,{id:"".concat(t,"-").concat(Ip())},t),trigger:r},d.createElement("span",null,o))}Tp.defaultProps={trigger:["hover","click","focus"],placement:"top"};var kp;function _p(e){var t=e.svgName,n=e.className,r=void 0===n?"d-inline-block svg-container":n,o=e.tagName,i=void 0===o?"span":o,a=e.size,c=void 0===a?kp.Standard:a,s=e.onClick,u=e.title,l=e.tooltipPlacement,f=void 0===l?"right":l,p=i,m={dangerouslySetInnerHTML:{__html:wp.getSvg(t)},className:"".concat(r," ").concat(c),onClick:hn(s)?s:null};return u?d.createElement(Tp,{title:u,placement:f},d.createElement(p,Object.assign({},m))):d.createElement(p,Object.assign({},m))}!function(e){e.Standard="std",e.Small="sm",e.Medium="md",e.Large="lg",e.ExtraLarge="xlg"}(kp||(kp={}));var Lp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},xp=function(e){var t="d-inline-block svg-container";return hn(e)?t+" cursor-pointer":t};function Pp(e){var t=e.onClickSearchIcon,n=e.searchIconPlacement,r=e.className,o=Lp(e,["onClickSearchIcon","searchIconPlacement","className"]),i="form-control ".concat(Uu.a.input),a="input-group-text bg-white";"right"===n&&(i+=" border-right-0",a+=" pl-0"),"left"===n&&(i+=" border-left-0",a+=" pr-0"),r&&(i+=" ".concat(r));var c=function(){return d.createElement("div",{className:a},d.createElement(_p,{svgName:Ap.Search,size:kp.Small,onClick:t,className:xp(t)}))};return d.createElement("div",{className:"input-group"},"left"===n&&d.createElement("div",{className:"input-group-prepend"},d.createElement(c,null)),d.createElement("input",Object.assign({className:i},o)),"right"===n&&d.createElement("div",{className:"input-group-append"},d.createElement(c,null)))}function Np(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Rp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Dp=hn;function Mp(e){var t,n,r,o=(t=e.initialSuggestions,n=e.recentSearches,zu(r={},Ru.Recent,n),zu(r,Ru.Local,t),zu(r,Ru.Remote,[]),r),i=Np(d.useState(e.initialQuery||""),2),a=i[0],c=i[1],s=Np(d.useState(o),2),u=s[0],l=s[1],f=function(e){var t=xu(Object(d.useState)(window.matchMedia(e).matches),2),n=t[0],r=t[1];return Object(d.useEffect)((function(){var t=window.matchMedia(e);t.matches!==n&&r(t.matches);var o=function(){return r(t.matches)};return t.addListener(o),function(){return t.removeListener(o)}}),[e]),n}(_u.XS),p=function(){l(o)},m=function(t){t.preventDefault(),Dp(e.onSubmit)&&e.onSubmit(a)};return d.createElement("form",{onSubmit:m},d.createElement(Lu,{suggestions:qu(u,!a,e.recentSearchHeading||Ou.getPhrase("shared.searchBar","recentSearchHeading"),e.suggestionsHeading,e.getSections,e.suggestionLimit),onSuggestionsFetchRequested:Hu(e,l,p),onSuggestionsClearRequested:function(){e.alwaysRenderSuggestions||p()},onSuggestionSelected:function(t,n){var r=n.suggestion;e.clearQueryOnSelect&&c(""),e.onSuggestionSelected(r)},getSuggestionValue:function(t){return e.updateQueryOnSelection?function(e,t){return Bu(t,e)?t[e]:""}(e.valueKey,t):a},renderSuggestion:function(t){return Dp(e.getSuggestionComponent)?e.getSuggestionComponent(t):function(e,t){return Bu(t,e)?d.createElement(d.Fragment,null,t[e]):d.createElement(d.Fragment,null)}(e.valueKey,t)},alwaysRenderSuggestions:e.alwaysRenderSuggestions,focusInputOnSuggestionClick:!f,inputProps:{placeholder:e.placeholder||Ou.getPhrase("shared.searchBar","placeholder"),value:a,onChange:function(t,n){var r=n.newValue;c(r),Dp(e.onQueryChange)&&e.onQueryChange(r)},onKeyDown:function(t){8===t.keyCode&&e.onBackspace&&!a&&e.onBackspace()},autoFocus:!!e.autoFocusInput,onClickSearchIcon:!!e.submitOnClickSearchIcon&&m,searchIconPlacement:e.searchIconPlacement},renderInputComponent:Pp,theme:Yu(e.theme),multiSection:!0,renderSectionTitle:$u,getSectionSuggestions:Ju}))}function Up(e){var t=e.appLink,n=e.className,o=e.children,i=e.tag,a=void 0===i?"a":i;if(!t)return d.createElement("span",{className:n||""},o);var c=e.onClick;c||(c=function(e){e.preventDefault(),r.AppLinkHelper.trigger(t)});var s={onClick:c,href:r.AppLinkHelper.getHref(t),className:n};return d.createElement(a,Object.assign({},s),o)}function Fp(e){var t=e.backToName,n=e.appLink;return d.createElement(Up,{appLink:n,className:"d-inline-flex align-items-center"},d.createElement(_p,{svgName:Ap.ArrowLeft,size:kp.Small}),d.createElement("span",{className:"ml-1"},"Back to ".concat(t)))}function Vp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return zp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Mp.defaultProps={updateQueryOnSelection:!0,valueKey:"name",activationLength:3,suggestionLimit:5,recentSearches:[],initialSuggestions:[],searchIconPlacement:"right"};var Bp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Hp(e){var t=e.selected,n=e.onToggle,r=Bp(e,["selected","onToggle"]),o=Vp(d.useState(t),2),i=o[0],a=o[1];d.useEffect((function(){return a(t)}),[t]);return d.createElement(Ws.Form.Check,Object.assign({type:"checkbox",id:"checkbox-".concat(Ip()),checked:i,onChange:function(){a(!i),n(!i)}},r))}var qp,Jp,$p,Kp,Yp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Gp(e){var t=e.onFileSelect,n=e.acceptMultiple,r=e.mimeType,o=e.label,i=e.error,a=e.touched,c=Yp(e,["onFileSelect","acceptMultiple","mimeType","label","error","touched"]),s="custom-file-input cursor-pointer";i&&a&&(s+=" is-invalid");var u=Object.assign({type:"file",className:s,onChange:function(e){var n=e.currentTarget.files;n&&n.length&&hn(t)&&t(n)},autoComplete:"off",value:"",multiple:!!n},r?{accept:r}:{});return d.createElement("div",{className:"form-group"},d.createElement("div",{className:"custom-file"},d.createElement(Fs,Object.assign({},u,c),e.children),d.createElement(Ws.Form.Label,{className:"custom-file-label",htmlFor:c.id},o)))}!function(e){e.Small="small",e.Medium="medium",e.Large="large"}(qp||(qp={})),function(e){e[e.Thumbnails=0]="Thumbnails",e[e.Banners=1]="Banners",e[e.Avatars=2]="Avatars",e[e.Logos=3]="Logos",e[e.Covers=4]="Covers",e[e.Posters=5]="Posters",e[e.TallPosters=6]="TallPosters",e[e.HeroBanners=7]="HeroBanners"}(Jp||(Jp={})),function(e){e[e.Crop=0]="Crop",e[e.Stretched=1]="Stretched",e[e.Cover=2]="Cover"}($p||($p={})),function(e){e[e.None=0]="None",e[e.ImageAPIv1=1]="ImageAPIv1",e[e.FileAPIv1=2]="FileAPIv1",e[e.ImageAPIv2=3]="ImageAPIv2"}(Kp||(Kp={}));var Wp,Zp,Qp=function(e,t){var n=h.map(t,(function(e,t){return t&&Array.isArray(e)?e.map((function(e){return"".concat(t,"=").concat(encodeURIComponent(e))})).join("&"):t&&void 0!==e?"".concat(t,"=").concat(encodeURIComponent(e)):""})),r=h.reduce(n,(function(e,t){return t?e?"".concat(e,"&").concat(t):t:e}));return r?"".concat(e,"?").concat(r):e},Xp=function(e,t){if(e){var n=e;return e.endsWith("/")||(n+="/"),t?n+=t.startsWith("/")?t.slice(1):t:n}};function ed(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.Banner="banner",e.Thumbnail="thumbnail"}(Zp||(Zp={}));var td,nd=(ed(Wp={},Jp.Banners,Zp.Banner),ed(Wp,Jp.Thumbnails,Zp.Thumbnail),Wp),rd=function(e){return"/v1/category-map/".concat(e)},od={createUrl:function(e,t){return od._createUrl(e,t)},createBannerUrl:function(e,t,n){return e&&e.url?od._createUrl(e.url,n):od._createCategoryMappedUrl(t,n)},Rfc3986EncodeURIComponent:function(e){return encodeURIComponent(e).replace(/[!'()*]/g,escape)},_createCategoryMappedUrl:function(e,t){var n=e.fallbackBaseUrl,r=e.fallbackCategoryName,o=e.type,i=Xp(n,"".concat(rd(nd[o]))),a=Object.assign({name:od.Rfc3986EncodeURIComponent(r)},t);return od._createUrl(i,a)},_createUrl:function(e,t){if(e){if(Rr.isEmpty(t))return e;var n=$.param(t),r=-1===e.indexOf("?")?"?":"&";return Xp(e,"".concat(r).concat(n))}},legacyCreateThumbnailUrl:function(e,t){if(!e)return"";var n;if(e&&(n=e instanceof r.Model?e.get("url"):"string"==typeof e?e:e.url)){var o=Object.assign({size:qp.Small,bgColor:"000"},t);return od._createUrl(n,o)}}};function id(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ad=(id(td={},Jp.Thumbnails,{width:1280,height:720}),id(td,Jp.Banners,{width:3600,height:666}),id(td,Jp.Covers,{width:1080,height:1080}),id(td,Jp.Posters,{width:1e3,height:1500}),id(td,Jp.TallPosters,{width:1080,height:1920}),id(td,Jp.HeroBanners,{width:1920,height:640}),td),cd={onFileSelect:function(e,t,n){if(t&&t.length){var r=new FileReader;r.addEventListener("load",(function(){return cd.onReaderLoad(r,e,n)})),r.readAsDataURL(t[0])}},onReaderLoad:function(e,t,n){var r=new Image;r.src=e.result;var o=ad[t].width,i=ad[t].height;r.addEventListener("load",(function(){cd.isImageValid(t,r)&&hn(n)?n(r):alert("Image too small: minimum dimensions are ".concat(o," x ").concat(i))}))},isImageValid:function(e,t){var n=ad[e].width,r=ad[e].height;return!(n&&t.width<n)&&!(r&&t.height<r)}},sd={isItemActive:function(e,t){return t||(t=r.AppLinkHelper.getCurrentAppLink()),t.application===e.appLink.application&&(Array.isArray(e.activeActions)?e.activeActions.includes(t.action):t.action===e.appLink.action)}},ud=function(e){return Object.values(e).every((function(e){return!!e}))},ld=(n(131),function(e,t){return!!e&&!!t&&e.toString()===t.toString()}),fd=function(e){return e.split(" ").map((function(e){return(e[0]?e[0].toUpperCase():"")+(e.substr(1)?e.substr(1).toLowerCase():"")})).join(" ")};function pd(e){return function(e){if(Array.isArray(e))return dd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return dd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dd(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var md={find:function(e,t){if(e&&e.children&&e.children.length)for(var n=function e(n){if(ld(n.id,t))return n;var r=n.children;if(r&&r.length)for(var o=0;o<r.length;o++){var i=e(r[o]);if(i)return i}},r=0;r<e.children.length;r++){var o=n(e.children[r]);if(o)return o}},getPath:function(e,t){for(var n=[t],r=function(e){return e.hasOwnProperty("parentIds")&&Array.isArray(e.parentIds)&&e.parentIds.length?e.parentIds[0]:e.hasOwnProperty("parentId")?e.parentId:null},o=r(t);o;){var i=md.find(e,o);i&&(n=[i].concat(pd(n))),o=i?r(i):null}return n}},hd=function(e){return e&&e.groups?e.groups.map((function(e){return e.name})):[]};function yd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bd,gd=d.createContext(void 0),Sd=function(e){var t=e.children,n=yd(d.useState(),2),r=n[0],o=n[1],i=yd(d.useState(!1),2),a=i[0],c=i[1],s=yd(d.useState(),2),u=s[0],l=s[1],f={getDataUrl:function(){var e=r;return o(null),e},setDataUrl:o,imageUploaded:a,getImage:function(){var e=u;return l(null),c(!1),e},setImage:function(e){l(e),c(!0)}};return d.createElement(gd.Provider,{value:f},t)};function Ed(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Od(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Od(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Od(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Cd=(jd(bd={},Jp.Thumbnails,"Thumbnail"),jd(bd,Jp.Banners,"Banner"),jd(bd,Jp.Avatars,"Avatar"),jd(bd,Jp.Logos,"Logo"),jd(bd,Jp.Covers,"Cover"),jd(bd,Jp.Posters,"Poster"),jd(bd,Jp.TallPosters,"Tall Poster"),jd(bd,Jp.HeroBanners,"Hero Banner"),bd);function wd(e){var t,n=_s(),o=Cs(null===(t=n)||void 0===t?void 0:t.values,e.fieldName),i=d.useContext(gd),a=i.setDataUrl,c=i.getImage,u=i.imageUploaded,l=Ed(d.useState(!1),2),f=l[0],p=l[1],m=Ed(d.useState(o),2),h=m[0],y=m[1],v=Ed(d.useState(!1),2),b=v[0],g=v[1];function S(t){p(!0),a(t.src),r.AppLinkHelper.trigger({application:e.application,action:e.uploadAction,args:[e.imageType]})}d.useEffect((function(){if(f){var t,r=c();if(r)p(!1),y(r),t=r,hn(e.setSelectedImage)?e.setSelectedImage(t):n&&n.setFieldValue(e.fieldName,{fileId:t.id,fileIdType:Kp.ImageAPIv2})}}),[u]);var E=e.label||Cd[e.imageType]||"Image";return d.createElement("div",{className:"form-group"},d.createElement("div",{className:"form-control h-auto py-2"},d.createElement("label",null,E),d.createElement("em",{className:"ml-1 text-muted"},"(Minimum dimensions are ".concat(ad[e.imageType].width,"px")+" x ".concat(ad[e.imageType].height,"px)")),d.createElement(Gp,{label:"Choose a ".concat(E.toLowerCase()),name:"image",mimeType:s.IMAGES,onFileSelect:function(t){return cd.onFileSelect(e.imageType,t,S)}}),!!h&&!!h.url&&d.createElement(d.Fragment,null,!b&&d.createElement("div",{className:"pb-2 ".concat(e.imageType===Jp.Banners?"w-100":"w-50")},d.createElement("img",{src:od.createUrl(h.url),className:"img img-fluid"})),d.createElement("div",{className:"d-flex justify-content-center"},d.createElement(_p,{svgName:b?Ap.ChevronDown:Ap.ChevronUp,size:kp.Large,className:"svg-container cursor-pointer",onClick:function(){return g(!b)},title:b?"Show image":"Hide image",tooltipPlacement:"top"})))))}var Ad,Id=n(132),Td=n.n(Id);function kd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _d(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e){e[e.NoRestrictions=0]="NoRestrictions",e[e.RestrictToCanvas=1]="RestrictToCanvas"}(Ad||(Ad={}));var Ld,xd,Pd,Nd,Rd,Dd,Md,Ud,Fd,Vd,zd,Bd,Hd,qd,Jd,$d,Kd,Yd,Gd,Wd,Zd,Qd,Xd=/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/;function em(e){var t=e.dataUrl,n=e.minHeight,r=e.minWidth,o=e.onCrop,i=e.onCancel,a=d.useRef(),c=d.useRef(),s=kd(d.useState(!1),2),u=s[0],l=s[1],f=kd(d.useState(!1),2),p=f[0],m=f[1];return d.useEffect((function(){var e=new Image;e.src=t;var o=a.current.offsetWidth/e.width;return c.current=new Td.a(a.current,{viewMode:Ad.RestrictToCanvas,autoCropArea:1,aspectRatio:r/n,minCropBoxWidth:r*o,minCropBoxHeight:n*o,ready:function(){return l(!0)}}),function(){return c.current.destroy()}}),[]),d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3"},d.createElement("img",{ref:a,src:t,className:"img img-fluid"})),d.createElement("div",{className:"d-flex justify-content-end border-top pt-3"},d.createElement(Ws.Button,{variant:"link",onClick:i},"Cancel"),d.createElement(lu,{onClick:function(){if(u){m(!0);var e=c.current.getCroppedCanvas().toDataURL(function(e){var t=e.match(Xd);if(t)return t[1]}(t));hn(o)&&o(e)}},disabled:!u,showSpinner:p},"Crop")))}function tm(e){return(tm="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 nm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rm(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 om(e,t){return(om=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function im(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=cm(e);if(t){var o=cm(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return am(this,n)}}function am(e,t){return!t||"object"!==tm(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 cm(e){return(cm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Stream="cv_product_stream",e.StreamRaw="cv_product_stream_raw",e.WebPlayerStream="cv_product_webplayer_stream",e.StreamProgress="cv_product_stream_progress",e.Login="cv_product_login",e.LoginSsoRedirect="cv_product_login_sso_redirect",e.LoginFailed="cv_product_login_failed",e.Search="cv_product_search",e.InstantSearch="cv_product_search",e.SearchEmptyResult="cv_product_search_empty_result",e.Filter="cv_product_search_filter",e.SearchLanding="cv_product_search_landing",e.Share="cv_product_share",e.WorkspaceAdd="cv_product_tv_add",e.Rename="cv_product_rename",e.Move="cv_product_move",e.Sort="cv_product_sort",e.Create="cv_product_create",e.Delete="cv_product_delete",e.Associate="cv_product_associate",e.Dissociate="cv_product_dissociate",e.Edit="cv_product_edit",e.Approve="cv_product_approve",e.Reject="cv_product_reject",e.Disable="cv_product_disable",e.Upload="cv_product_upload",e.Download="cv_product_download",e.Navigate="cv_product_navigate",e.Click="cv_product_click",e.Suggest="cv_product_suggest",e.EditAssoc="cv_product_edit_assoc",e.Play="cv_product_play",e.Favourite="cv_product_favourite",e.Follow="cv_product_follow",e.Prefer="cv_product_prefer",e.SetAccess="cv_product_set_access",e.AddToLocalCache="cv_product_add_to_lc",e.ResolveWarning="cv_product_resolve_warning",e.DismissWarning="cv_product_dismiss_warning"}(Ld||(Ld={})),function(e){e.Folder="folder",e.Video="video",e.Rating="rating",e.Series="series",e.Library="library",e.Resource="resource",e.Tag="tag",e.Subtitle="subtitle",e.Chapter="chapter",e.Restriction="restriction",e.Interactive="interactive",e.PDF="pdf",e.CustomerSetting="customer_setting",e.StaffRequest="staff_request",e.Logo="logo",e.Pagination="pagination",e.Thumbnail="thumbnail",e.Banner="banner",e.Link="link",e.Playlist="playlist",e.Person="person",e.Company="company",e.Classroom="classroom",e.ClassroomGroup="classroom_group",e.Classification="classification",e.ShareLink="share_link",e.Upload="upload",e.SearchResults="search_results",e.Audience="audience",e.User="user"}(xd||(xd={})),function(e){e.TopNav="top_nav",e.LeftNav="left_nav",e.Popup="popup",e.Banner="banner",e.VideoList="video_list",e.VideoListItem="video_list_item",e.VideoListHeader="video_header",e.VideoThumbnail="video_thumbnail",e.VideoItemPreview="video_item_preview",e.VideoDetails="video_details",e.VideoDetailsHeader="video_details_header",e.EditVideoDetails="edit_video_details",e.EditVideoChapters="edit_video_chapters",e.EditVideoResources="edit_video_resources",e.VideoUpload="video_upload",e.VideoRequest="video_request",e.Pagination="pagination",e.SearchBar="search_bar",e.InstantSearch="instant_search",e.SearchFilters="search_filters",e.LibraryHeader="library_header",e.LibraryTiles="library_tiles",e.StaffRequestDetails="staff_request_details",e.SubFolderList="sub_folder_list",e.AwaitingReviewVideoListHeader="awaiting_review_video_list_header",e.AwaitingReviewVideoItem="awaiting_review_video_item",e.PastReleasesHeader="past_releases_header",e.MigrationWarnings="migration_warnings",e.PlaylistListHeader="playlist_list_header",e.PlaylistListItem="playlist_list_item",e.TeacherManager="teacher_manager",e.TeacherManagerListItem="teacher_manager_list_item",e.StudentManager="student_manager",e.StudentManagerListItem="student_manager_list_item",e.ClassroomsList="classrooms_list",e.ClassroomsListItem="classrooms_list_item",e.ClassroomOverview="classroom_overview",e.ClassroomOverviewStudentListItem="classroom_overview_student_list_item",e.ManageClassroomStudents="manage_classroom_students",e.ManageClassroomStudentListItem="manage_classroom_student_list_item",e.ManageClassroomGroups="manage_classroom_groups",e.ManageClassroomGroupListItem="manage_classroom_group_list_item",e.PlayPage="play_page",e.FloatingPlayer="floating_player",e.InteractivePlayer="interactive_player",e.EmbeddedPlayer="embedded_player",e.ContentUpdatesClassificationBanner="content_updates_classification_banner",e.PreferencesSettings="preferences_settings",e.MyUploads="my_uploads"}(Pd||(Pd={})),function(e){e.Start="start",e.Complete="complete",e.Save="save",e.Discard="discard"}(Nd||(Nd={})),function(e){e.PageLoad="page_load"}(Rd||(Rd={})),function(e){e.Single="single",e.Bulk="bulk",e.All="all"}(Dd||(Dd={})),function(e){e.ProductionYear="production_year",e.Alphabetical="alphabetical"}(Md||(Md={})),function(e){e.Content="content",e.Quality="quality",e.Duration="duration",e.Reset="reset"}(Ud||(Ud={})),function(e){e.Submit="submit",e.ShowAll="show_all",e.Recent="recent",e.SearchIcon="search_icon"}(Fd||(Fd={})),function(e){e.Start="start",e.Finish="finish",e.Terminate="terminate",e.Play="play",e.Pause="pause",e.Playback="playback",e.NextChapter="next_chapter",e.PreviousChapter="previous_chapter",e.FullScreenEnter="full_screen_enter",e.FullScreenExit="full_screen_exit"}(Vd||(Vd={})),function(e){e.TogglePreview="toggle_preview",e.NavigateHome="navigate_home",e.OpenInStaffView="open_in_staff_view",e.Thumbnail="thumbnail",e.Title="title",e.ToggleHideValidListings="toggle_hide_valid_listings",e.LaunchImmersiveReader="launch_immersive_reader",e.CopyEmbedHtml="copy_embed_html",e.Close="close",e.Open="open"}(zd||(zd={})),function(e){e.LibraryReview="library_review"}(Bd||(Bd={})),function(e){e.FileSelect="file_select",e.DragDrop="drag_drop"}(Hd||(Hd={})),function(e){e.Edit="edit"}(qd||(qd={})),function(e){e.Image="image",e.User="user"}(Jd||(Jd={})),function(e){e.On="on",e.Off="off"}($d||($d={})),function(e){e.EntityRemoved="cv_entity_removed",e.ValueUpdated="cv_value_updated"}(Kd||(Kd={})),function(e){e.FileSelect="file_select",e.DragDrop="drag_drop"}(Yd||(Yd={})),function(e){e.Video="videos",e.Folder="categories",e.Series="series",e.Tags="tags"}(Gd||(Gd={})),function(e){e[e.V1=1]="V1"}(Wd||(Wd={})),function(e){e.Staff="staff",e.Learner="learner",e.Unknown="unknown"}(Zd||(Zd={})),function(e){e.Analytics="AnalyticsService",e.Context="ContextService"}(Qd||(Qd={}));var sm,um=new(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&&om(e,t)}(a,e);var t,n,o,i=im(a);function a(){var e;return nm(this,a),(e=i.apply(this,arguments)).contextHistory=[],e}return t=a,o=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"initialize",value:function(){this.listenTo(b.SHELL,r.EventNames.ROUTE,this.setContext)}},{key:"setContext",value:function(e){this.contextHistory.length>=5&&this.contextHistory.unshift(),this.contextHistory.push({pageLoad:!this.contextHistory.length,appLink:e})}},{key:"getCurrentContext",value:function(){if(this.contextHistory.length)return this.contextHistory[this.contextHistory.length-1]}},{key:"fromPageLoad",value:function(){return 1===this.contextHistory.length}},{key:"name",get:function(){return Qd.Context}}])&&rm(t.prototype,n),o&&rm(t,o),a}(r.Service));!function(e){e.Inlet="event:inlet",e.Outlet="event:outlet"}(sm||(sm={}));var lm="global:analytics";function fm(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)}}var pm=Wd.V1,dm=function(){function e(t,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=t,this.data=n,this.actionContext=r,this.eventVersion=o||pm}var t,n,o;return t=e,(n=[{key:"isType",value:function(e){return e===this.type}},{key:"enrich",value:function(e,t){this.validateKey(e),this[e]=t}},{key:"get",value:function(e){if(e&&this[e])return this[e]}},{key:"validateKey",value:function(e){"type"!==e&&"data"!==e||r.ErrorHelper.throw(new Xe("".concat(e," is not a valid key"))),this[e]&&r.ErrorHelper.throw(new Xe("Event already contains an enrichment named ".concat(e)))}}])&&fm(t.prototype,n),o&&fm(t,o),e}(),mm=function(e,t,n,r){y.Radio.channel(lm).trigger(sm.Inlet,new dm(e,t,n,r))};function hm(){var e=um.getCurrentContext().appLink;return h.isObject(e)||r.ErrorHelper.throw(new Xe("Applink does not exist. Check current context.")),e.application.replace(":","-")}function ym(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.location,n=e.entity,o=e.workflowPhase,i=void 0===o?null:o,a=e.descriptor,c=void 0===a?null:a;return t||r.ErrorHelper.throw(new Xe("location must be set.")),n||r.ErrorHelper.throw(new Xe("entity must be set.")),{productArea:hm(),location:t,entity:n,descriptor:c,workflowPhase:i}}function vm(){return r.LocationUtils.GetCurrentPath()+r.LocationUtils.GetCurrentQueryString()}var bm={logUserAction:function(e,t){if(function(e){return!(!h.isArray(e)||!h.every(e,(function(e){return h.isObject(e)})))||!!h.isObject(e)}(e)&&h.isObject(t)){var n=bm.buildUserActionEvent(t),r=n.userAction,o=n.action,i=n.eventVersion;mm(r,e,o,i)}},logNavigate:function(e,t){var n=Object.assign({currentLocation:vm(),appLink:e},t);mm(Ld.Navigate,n)},mergeOptions:function(e,t){return h.extend({},e,t)},buildActionContext:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ym(e)},buildUserActionEvent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.actionType,n=e.eventVersion,r=t,o=ym(e);return{userAction:r,action:o,eventVersion:n}},buildCurrentLocation:function(){return vm()},buildSearchEvent:function(e,t){return{data:{query:e},action:ym({entity:xd.Video,location:Pd.SearchBar,descriptor:t})}},buildInstantSearchEvent:function(e,t,n){var r;n===Gd.Series&&(r=xd.Series),n===Gd.Folder&&(r=xd.Folder),n===Gd.Tags&&(r=xd.Tag),n===Gd.Video&&(r=xd.Video);var o={instant:{},query:e};return t.id&&(o.instant.selectedId=t.id),t.name&&(o.instant.selectedName=t.name),{data:o,action:ym({entity:r,location:Pd.SearchBar})}},mapInteractionType:function(e){switch(e){case Yd.DragDrop:return Hd.DragDrop;case Yd.FileSelect:return Hd.FileSelect;default:return}}};function gm(e,t){return t?{application:e.application,action:e.action,args:e.args,params:Object.assign({},e.params,{cursor:t})}:null}function Sm(e){var t=e.appLink,n=e.cursors,r=e.className;function o(e){bm.logUserAction({page:e},{location:Pd.Pagination,entity:xd.Pagination,actionType:Ld.Navigate,workflowPhase:Nd.Complete})}return d.createElement(ju.Provider,{value:"shared.pagination"},d.createElement("div",{className:r},d.createElement(Up,{appLink:gm(t,n.previous),className:"btn btn-secondary mr-1 ".concat(n.previous?"":"disabled"),onClick:function(){return o("previous")}},d.createElement(Cu,{phrase:"previous"})),d.createElement(Up,{appLink:gm(t,n.next),className:"btn btn-secondary ".concat(n.next?"":"disabled"),onClick:function(){return o("next")}},d.createElement(Cu,{phrase:"next"}))))}function Em(e){if(!e.collection)return d.createElement(d.Fragment,null);var t=e.collection,n=t.data,r=t.pagination;return d.createElement(d.Fragment,null,!!n&&d.createElement(xm,{objects:n,getObjectAppLink:e.getObjectAppLink,newObjectAppLink:e.newObjectAppLink,objectName:e.objectName}),!!r&&!!r.cursors&&d.createElement(Sm,{cursors:r.cursors,appLink:e.collectionAppLink}))}Sm.defaultProps={className:"py-2"};var Om=n(23),jm=n.n(Om);function Cm(e){if(!e.actions||!e.actions.length)return d.createElement(d.Fragment,null);var t="actions-dropdown-".concat(Ip()),n="px-0 ".concat(jm.a.dropdownToggle);return e.dropdownToggleClassName&&(n+=" ".concat(e.dropdownToggleClassName)),d.createElement(Ws.Dropdown,{className:e.className?e.className:"",alignRight:!0},d.createElement(Ws.Dropdown.Toggle,{as:"button",type:"button",id:t,className:n},d.createElement(_p,{svgName:Ap.More,size:kp.Small})),d.createElement(Ws.Dropdown.Menu,null,e.actions.map((function(e,t){return d.createElement(Up,{key:t,appLink:e.appLink,onClick:e.onClick,className:(n=e.className,r="dropdown-item",n&&(r+=" ".concat(n)),r)},e.label);var n,r}))))}Cm.defaultProps={dropdownToggleClassName:"btn btn-light"};var wm=n(18),Am=n.n(wm);function Im(e){var t=e.svgName,n=e.children,r=e.appLink,o=e.className,i=e.onClick,a="".concat(o," ").concat(Am.a.iconButton);a+=" ".concat(n?Am.a.iconWithText:Am.a.iconOnly);var c=d.createElement(_p,{svgName:t,className:Am.a.svg});return r?d.createElement(Up,{appLink:r,className:a,onClick:i},c,n):d.createElement("button",{className:a,onClick:i},c,n)}function Tm(e){var t="ml-2";e.className&&(t+=" ".concat(e.className));var n=e.showSpinner?d.createElement(Ws.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):e.children;return e.tooltip?d.createElement(Tp,{title:e.tooltip},d.createElement(Im,{appLink:e.appLink,svgName:e.svgName,onClick:e.onClick,className:t},n)):e.svgName?d.createElement(Im,{onClick:e.onClick,appLink:e.appLink,svgName:e.svgName,className:t},n):e.appLink?d.createElement(Up,{onClick:e.onClick,appLink:e.appLink,className:t},n):d.createElement("button",{onClick:e.onClick,className:t},n)}function km(e){var t=[],n=[];e.actions.forEach((function(e){e.button?t.push(e):n.push(e)}));var r="d-flex";return e.className&&(r+=" ".concat(e.className)),d.createElement("div",{className:r},d.createElement(d.Fragment,null,!!t.length&&d.createElement("span",{className:jm.a.buttonList},t.map((function(e,t){return d.createElement(Tm,{key:t,appLink:e.appLink,onClick:e.onClick,svgName:e.svgName,className:e.className,tooltip:e.tooltip,showSpinner:e.showSpinner},e.label)}))),e.sortComponent?e.sortComponent:"",!!n.length&&d.createElement(Cm,{actions:n,className:!!t.length&&"ml-2",dropdownToggleClassName:e.actionsDropdownClassName})))}function _m(e){var t=e.object,n=e.actions;return d.createElement("div",{className:"d-flex justify-content-between py-2"},!!t&&d.createElement("h5",null,t.name),!!n&&d.createElement("span",null,d.createElement(km,{actions:n})))}function Lm(e){return d.createElement("tr",null,d.createElement("td",null,d.createElement(Up,{appLink:e.appLink},e.object.name)),d.createElement("td",null))}function xm(e){return d.createElement(Ws.Table,{responsive:!0},d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",null,"Name"),d.createElement("th",null,d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(Up,{appLink:e.newObjectAppLink},d.createElement(_p,{svgName:Ap.Plus,size:kp.Small}),d.createElement("span",null,"New ".concat(e.objectName))))))),d.createElement("tbody",null,e.objects.map((function(t){return d.createElement(Lm,{key:t.id,object:t,appLink:e.getObjectAppLink(t)})}))))}function Pm(e){var t=e.objects,n=e.getAppLink,r=e.emptyMessage;return t?t.length?d.createElement("ul",{className:"list-unstyled"},t.map((function(e,t){return d.createElement("li",{key:t,className:"border rounded mb-3"},d.createElement(Up,{appLink:n(e),className:"d-block p-3"},e.name))}))):d.createElement("div",{className:"py-3"},d.createElement("p",null,r)):d.createElement(d.Fragment,null)}Pm.defaultProps={emptyMessage:"There is nothing here."};function Nm(e){var t=_s();return d.createElement(ru,{as:"select",label:"Rating",name:"rating",id:"rating",value:t.values.rating&&t.values.rating.id,onChange:function(e){return t.setFieldValue("rating",e.target.value?{id:e.target.value}:{})},disabled:e.disabled},d.createElement(d.Fragment,null,d.createElement("option",{value:""},"Please select a rating"),e.ratings.map((function(e,t){return d.createElement("option",{key:t,value:e.id},function(e){return"".concat(e.name).concat(e.code?" (".concat(e.code,")"):"")}(e))}))))}function Rm(e){var t=e.tabs,n=e.isItemActive;return d.createElement(Ws.Nav,{fill:!0,variant:"tabs"},t.map((function(e,t){return d.createElement(Ws.Nav.Item,{key:t},d.createElement(Up,{appLink:e.appLink,className:(r=n(e),r?"nav-link active":"nav-link")},e.label));var r})))}Rm.defaultProps={isItemActive:sd.isItemActive};var Dm=n(8),Mm=n.n(Dm);function Um(e){var t=e.name,n=e.appLink,r=e.onSelect,o=e.isDisabled,i=e.className,a=e.actions,c=Mm.a.text;return i&&(c+=" ".concat(i)),o?d.createElement("a",{className:"".concat(c," text-muted ").concat(Mm.a.disabled)},t):d.createElement(d.Fragment,null,n?d.createElement(Up,{appLink:n,className:c},t):d.createElement("a",{onClick:r,className:c},t),!!a&&d.createElement(km,{className:Mm.a.actions,actions:a}))}function Fm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zm(e){var t=e.tree,n=e.selectedIds,r=e.getAppLink,o=e.onSelect,i=e.isDisabled,a=e.actions,c=Array.isArray(n)&&n.some((function(e){return ld(t.id,e)})),s=d.useMemo((function(){return Array.isArray(n)&&n.some((function(e){return md.find(t,e)}))}),[t,n]),u=Fm(d.useState(s),2),l=u[0],f=u[1],p=!!t.children&&!!t.children.length,m={name:t.name,appLink:hn(r)?r(t):null,onSelect:hn(o)?function(){return o(t)}:null,isDisabled:!!hn(i)&&i(t),className:c&&Mm.a.selected||s&&Mm.a.parentOfSelected,actions:!!a&&a.map((function(e){return Object.assign(Object.assign({},e),{appLink:e.getAppLink(t)})}))};return d.createElement("li",{className:"position-relative".concat(l?"":" ".concat(Mm.a.collapsed))},d.createElement("div",{className:"position-relative"},d.createElement("span",{className:Mm.a.node},p&&d.createElement(_p,{svgName:Ap.ChevronDown,size:kp.Small,className:"svg-container ".concat(Mm.a.chevron),onClick:function(){return f(!l)}}),d.createElement(Um,Object.assign({},m))),l&&d.createElement(Hm,Object.assign({},e))))}var Bm=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Hm(e){var t=e.tree,n=Bm(e,["tree"]);return t&&t.children?d.createElement("ul",{className:"m-0 p-0 ".concat(Mm.a.tree)},t.children.map((function(e){return d.createElement(zm,Object.assign({key:e.id,tree:e},n))}))):d.createElement(d.Fragment,null)}var qm={getChord:function(e,t){return md.getPath(e,t).map((function(e){return e.name})).join(" -> ")},getState:function(e,t){var n={};return Array.isArray(e)&&e.forEach((function(e){var r,o,i,a=md.find(t,e);a&&(n=Object.assign((r={},o=e,i=qm.getChord(t,a),o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r),n))})),n}};function Jm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return $m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $m(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Km=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Ym(e){var t=e.onSelect,n=e.label,r=e.hideCollapseBtn,o=e.collapse,i=e.noSelectionMessage,a=e.isNodeDisabled,c=e.getSelectedItemAppLink,s=Km(e,["onSelect","label","hideCollapseBtn","collapse","noSelectionMessage","isNodeDisabled","getSelectedItemAppLink"]),u=s.tree,l=s.selectedIds,f=Jm(d.useState(qm.getState(l,u)),2),p=f[0],m=f[1];d.useEffect((function(){return m(qm.getState(l,u))}),[l,u]);var h=Jm(d.useState(!!o),2),y=h[0],v=h[1];d.useEffect((function(){return v(!!o)}),[o]);var b=!r||!!n;return d.createElement(d.Fragment,null,b&&d.createElement("div",{className:"pb-2"},!!n&&d.createElement("label",{className:"m-0"},n),!r&&d.createElement("a",{className:"float-right cursor-pointer",onClick:function(){return v(!y)}},y?"Expand":"Collapse")),!y&&d.createElement("div",{className:"py-2 border-top"},d.createElement(Hm,Object.assign({onSelect:function(e){return hn(t)&&t(e)},isDisabled:a},s))),(!Rr.isEmpty(p)||!!i)&&d.createElement("div",{className:"py-2 border-top"},d.createElement("label",null,"Selected:"),d.createElement("ul",{className:"m-0"},Rr.isEmpty(p)?d.createElement("li",null,i):Object.keys(p).map((function(e,t){return d.createElement("li",{key:t},hn(c)?d.createElement(Up,{appLink:c(e)},p[e]):p[e])})))))}var Gm=n(24);var Wm=function(e){return e&&!(e.data&&e.data.length)},Zm=function(e){return e&&e.data&&e.data.length},Qm=function(e){var t="bg-white";return e&&(t+=" ".concat(e)),t};function Xm(e){var t=e.video,n=e.getVideoAppLink,r=e.getVideoActions,o=e.className,i=void 0===o?"":o,a=e.itemNumber,c=hn(n)&&n(t);return d.createElement("tr",{className:Qm(i)},!!a&&d.createElement("td",null,d.createElement("span",null,a)),d.createElement("td",null,c?d.createElement(Up,{appLink:c},t.name):t.name),hn(r)&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(km,{actions:r(t)}))))}var eh=Object(Gm.SortableElement)((function(e){return d.createElement(Xm,Object.assign({sortable:!0},e))})),th=n(11),nh=n.n(th),rh=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},oh=function(e){var t=e.sortable,n=e.getVideoActions;return d.createElement("thead",null,d.createElement("tr",null,!!t&&d.createElement("th",null,"#"),d.createElement("th",null,"Name"),!!n&&d.createElement("th",null)))},ih=d.forwardRef((function(e,t){var n=e.videos,r=e.sortable,o=rh(e,["videos","sortable"]);return d.createElement("tbody",{ref:t},!Wm(n)&&n.data.map((function(e,t){return r?d.createElement(eh,Object.assign({key:e.id,index:t,itemNumber:t+1,video:e,className:nh.a.draggableVideoItem},o)):d.createElement(Xm,Object.assign({video:e},o))})))}));var ah=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},ch=Object(Gm.SortableContainer)((function(e){var t=e.forwardedRef,n=ah(e,["forwardedRef"]);return d.createElement(ih,Object.assign({sortable:!0,ref:t},n))})),sh=function(e){return function(t){var n=t.node,r=e.current;if(r){r.classList.add(nh.a.sortingContainer);var o=r.querySelector(".".concat(nh.a.draggedVideoItem));n.childNodes.forEach((function(e,t){return o.childNodes[t].style.width="".concat(e.offsetWidth,"px")}))}}},uh=function(e,t){return function(n){var r=e.current;r&&r.classList.remove(nh.a.sortingContainer),t(n.oldIndex,n.newIndex)}};function lh(e){var t=e.onSortEnd,n=e.emptyMessage,r=ah(e,["onSortEnd","emptyMessage"]),o=d.useRef();return Wm(e.videos)?d.createElement("div",null,n):d.createElement(Ws.Table,{responsive:!0},d.createElement(oh,Object.assign({sortable:!0},e)),d.createElement(ch,Object.assign({forwardedRef:o,onSortStart:sh(o),onSortEnd:uh(o,t),lockAxis:"y",lockToContainerEdges:!0,distance:1,helperClass:nh.a.draggedVideoItem,helperContainer:function(){return o.current}},r)))}function fh(e){var t=e.alias,n=e.onDelete;return d.createElement("li",{className:"list-group-item d-flex justify-content-between"},t.name,d.createElement(_p,{svgName:Ap.Delete,onClick:function(){return n(t.id)}}))}function ph(e){var t=e.aliases,n=e.onDelete;return d.createElement("ul",{className:"list-group mb-3"},t?t.map((function(e){return d.createElement(fh,{key:e.id,alias:e,onDelete:n})})):d.createElement("span",null,"Currently there are no aliases for this object."))}lh.defaultProps={emptyMessage:"There are no videos in this list."};var dh=Object(Ys.object)().shape({name:Object(Ys.string)().trim().max(255,"Name is too long").required("Name is required").default("")});function mh(){var e=_s(),t=au(e);return d.createElement(Vs,null,d.createElement(ru,{label:"Create an alias",name:"name",id:"name",value:e.values.name,placeholder:"Add an alias"}),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(lu,{showSpinner:e.isSubmitting,type:"submit",disabled:!t},"Add")))}function hh(e){var t=e.onSave;return d.createElement(Ks,{initialValues:{name:""},validationSchema:dh,onSubmit:function(e,n){t(e,n)},resetOnSubmit:!0},d.createElement(mh,null))}function yh(e){var t=e.onSave,n=e.aliases,r=e.onDelete;return d.createElement("div",{className:"w-50"},d.createElement("h1",null,"Aliases"),d.createElement(ph,{aliases:n,onDelete:r}),d.createElement(hh,{onSave:t}))}var vh=l.COMPANIES,bh=function(e){return{application:vh,action:a.Companies.EDIT_COMPANY,args:[e.id]}},gh=function(e){return r.AppLinkHelper.trigger(bh(e))};function Sh(e){var t=o.useBasicFetch(Fo(e.cursor));return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3 w-50"},d.createElement(Mp,{placeholder:"Search for a company",onSuggestionSelected:gh,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/companies/instant/raw","?q=").concat(e)},activationLength:2})),d.createElement(Em,{collection:t&&t.data,collectionAppLink:{application:vh,action:a.Companies.COMPANIES},newObjectAppLink:{application:vh,action:a.Companies.NEW_COMPANY},getObjectAppLink:bh,objectName:"Company"}))}function Eh(e){return(Eh="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 Oh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jh(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 Ch(e,t,n){return t&&jh(e.prototype,t),n&&jh(e,n),e}function wh(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&&Ah(e,t)}function Ah(e,t){return(Ah=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ih(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=kh(e);if(t){var o=kh(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Th(this,n)}}function Th(e,t){return!t||"object"!==Eh(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 kh(e){return(kh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _h,Lh,xh=function(e){wh(n,e);var t=Ih(n);function n(){return Oh(this,n),t.apply(this,arguments)}return Ch(n,[{key:"channelName",get:function(){return l.COMPANIES}},{key:"appRoutes",get:function(){return{"manage/companies(/)":"companies","manage/companies/new(/)":"newCompany","manage/companies/:id(/)":"editCompany"}}}]),n}(r.AppRouter),Ph=function(e){wh(n,e);var t=Ih(n);function n(){return Oh(this,n),t.apply(this,arguments)}return Ch(n,[{key:"companies",value:function(e){var t=e.cursor;this.layout.showChildView(kn,d.createElement(Sh,{cursor:t}))}},{key:"newCompany",value:function(){this.layout.showChildView(kn,d.createElement(ku,null))}},{key:"editCompany",value:function(e){this.layout.showChildView(kn,d.createElement(Tu,{id:e}))}},{key:"name",get:function(){return"Companies Application"}},{key:"channelName",get:function(){return l.COMPANIES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return xh}}]),n}(r.Application),Nh=n(34);function Rh(e){return(Rh="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 Dh(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 Mh(e,t){return(Mh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Uh(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=Vh(e);if(t){var o=Vh(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Fh(this,n)}}function Fh(e,t){return!t||"object"!==Rh(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 Vh(e){return(Vh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Success="success",e.Warning="warning",e.Fail="danger",e.Info="info"}(_h||(_h={})),function(e){e.Success="Success! 🙌",e.Warning="Whoops...",e.Fail="Oops...",e.Info="FYI"}(Lh||(Lh={}));var zh=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&&Mh(e,t)}(i,e);var t,n,r,o=Uh(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(){this.alertCollection=new De,this.listenTo(b.ALERT,"remove:alert",this.removeAlert),this.showAlerts()}},{key:"showAlerts",value:function(){var e=y.Radio.channel(b.ALERT),t={collection:this.alertCollection};this.options.alertViewCtor&&(t=h.extend({},t,{ctor:this.options.alertViewCtor})),e.trigger("show:alert",t)}},{key:"removeAlert",value:function(e){this.alertCollection.remove(e),this.showAlerts()}},{key:"createAlert",value:function(e){this.alertCollection.length===this.options.maxAlerts&&this.alertCollection.shift(),e.id||(e=h.extend({},e,{id:this.generateUniqueAlertId()})),this.alertCollection.push(new Lt(e)),this.showAlerts()}},{key:"clearAllAlerts",value:function(){this.alertCollection.reset(null)}},{key:"success",value:function(e){var t=this;return"string"==typeof e?h.bind((function(){return t.createAlert(h.extend({},t.options.defaultSuccessAlert,{message:e}))}),this):e.useXHR?h.bind((function(e,n){return t.createAlert(h.extend({},t.options.defaultSuccessAlert,{message:n}))}),this):h.bind((function(){return t.createAlert(h.extend({},t.options.defaultSuccessAlert,e))}),this)}},{key:"error",value:function(e){var t=this;return"string"==typeof e?h.bind((function(){return t.createAlert(h.extend({},t.options.defaultErrorAlert,{message:e}))}),this):e.useXHR?h.bind((function(e){return t.createAlert(h.extend({},t.options.defaultErrorAlert,{message:e.message}))}),this):h.bind((function(){return t.createAlert(h.extend({},t.options.defaultErrorAlertIL_DEFAULT,e))}),this)}},{key:"generateUniqueAlertId",value:function(){return h.uniqueId("alert_")}},{key:"name",get:function(){return du}},{key:"defaults",get:function(){return{maxAlerts:3}}}])&&Dh(t.prototype,n),r&&Dh(t,r),i}(Yt),Bh=n(9),Hh=n.n(Bh);function qh(e){var t=e.alert,n=e.svgName,r=e.svgClassName,o=e.closeAlert,i=t.message,a=t.heading,c=t.appLink,s=t.appLinkText,u=t.appLinkClassName,l=void 0===u?"":u,f=Object(pu.sanitize)(i);return d.createElement(d.Fragment,null,d.createElement("div",{className:"d-inline-block ".concat(Hh.a.icon)},d.createElement(_p,{svgName:n,className:"svg-container ".concat(r)})),d.createElement("div",{className:"pl-2 d-inline-block ".concat(Hh.a.alertContent)},d.createElement("p",{className:"p-0 m-0 pb-1 ".concat(Hh.a.heading)},a),d.createElement("p",{className:"p-0 m-0 ".concat(Hh.a.message),dangerouslySetInnerHTML:{__html:f}}),!!c&&d.createElement(Up,{className:l,appLink:c},s)),d.createElement("div",{className:"close d-inline-block cursor-pointer",role:"button",onClick:o},"×"))}function Jh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return $h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $h(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Kh=function(e){switch(e.type){case _h.Success:return Ap.CheckCircleOutline;case _h.Fail:case _h.Warning:return Ap.Warning;case _h.Info:default:return Ap.Info}};function Yh(e){var t=e.alert,n=e.closeAlert,r=Jh(d.useState(!0),2),o=r[0],i=r[1],a=d.useRef();d.useEffect((function(){o?a.current=window.setTimeout(n,3e3):clearTimeout(a.current)}),[o]);var c="text-".concat(t.type.toLowerCase());return d.createElement("li",{className:"bg-white mt-2 p-2 show clearfix ".concat(Hh.a.alertItem),onMouseEnter:function(){return i(!1)},onMouseLeave:function(){return i(!0)}},d.createElement(qh,{alert:t,svgName:Kh(t),svgClassName:c,closeAlert:n}))}function Gh(e){var t=e.alerts,n=e.removeAlert;return d.createElement("div",{className:Hh.a.alertBox},d.createElement(Nh.TransitionGroup,{component:"ul",className:"".concat(Hh.a.alertList," list-unstyled")},t&&t.map((function(e,t){return d.createElement(Nh.CSSTransition,{key:t,timeout:200,classNames:"alert"},d.createElement(Yh,{alert:e,closeAlert:function(){return n(e.id)}}))}))))}function Wh(){return d.createElement("div",{className:"text-center p-5"},d.createElement(Ws.Spinner,{as:"div",animation:"border",role:"status"}))}function Zh(e){return d.createElement(Ws.Modal,{show:!0,onHide:e.closePopup,onEntered:e.onEntered,size:e.size},!!e.title&&d.createElement(Ws.Modal.Header,{closeButton:e.closeButton},d.createElement(Ws.Modal.Title,null,e.title)),e.showLoadingSpinner?d.createElement(Wh,null):d.createElement(Ws.Modal.Body,null,e.children))}Zh.defaultProps={closeButton:!0};var Qh,Xh,ey=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function ty(e){var t=e.buttons;return d.createElement("div",{className:"d-flex justify-content-end border-top pt-3 px-3 mx-n3"},t.map((function(e,t){return function(e,t){var n=e.buttonText,r=e.type,o=void 0===r?"button":r,i=e.isSpinnerButton,a=e.showSpinner,c=void 0!==a&&a,s=e.className,u=ey(e,["buttonText","type","isSpinnerButton","showSpinner","className"]),l=Object.assign({key:t,type:o,className:"ml-2".concat(s?" ".concat(s):"")},u);return i?d.createElement(lu,Object.assign({showSpinner:c},l),n):d.createElement(Ws.Button,Object.assign({},l),n)}(e,t)})))}!function(e){e.Boolean="System.Boolean",e.String="System.String",e.StaffRequest="ClickView.DomainApi.Models.Options.Enums.StaffRequestOption, ClickView.DomainApi.Models, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null",e.Long="System.Int64"}(Qh||(Qh={})),function(e){e[e.Permanent=0]="Permanent",e[e.Temporary=1]="Temporary"}(Xh||(Xh={}));var ny={namespace:"domain_options"},ry=function(){return"/api/domain/v3/settings/types"},oy=function(e){return"/api/domain/v3/settings/types/".concat(e)},iy=function(){return"/api/domain/v3/settings/types"},ay=function(e){return"/api/domain/v3/settings/types/".concat(e)},cy=function(e){return"/api/domain/v3/settings/types/".concat(e)},sy="domain:options",uy="domain:option",ly="update:domain:option",fy="delete:domain:option",py=function(){return{key:sy,url:ry(),normalizeOptions:ny}},dy=function(e){return{key:"".concat(uy,":").concat(e),url:oy(e),normalizeOptions:ny}},my=function(e,t,n){return e.type===Qh.String&&(e=vy(e)),{key:uy,url:iy(),data:e,type:jr.POST,success:t,error:n,invalidationKeys:[sy],normalizeOptions:ny}},hy=function(e,t){return e.type===Qh.String&&(e=vy(e)),{key:"".concat(ly,":").concat(e.id),url:ay(e.id),data:e,type:jr.PUT,always:t,formatData:function(){return e},normalizeOptions:ny}},yy=function(e,t){return{key:"".concat(fy,":").concat(e),url:cy(e),type:jr.DELETE,invalidationKeys:[sy],normalizeOptions:ny,success:t}};function vy(e){var t=e.defaultValue;if('"'===t)return Object.assign(Object.assign({},e),{defaultValue:'"'.concat(t,'"')});var n=t.charAt(0),r=t.charAt(t.length-1);return'"'!==n&&(t='"'.concat(t)),'"'!==r&&(t="".concat(t,'"')),Object.assign(Object.assign({},e),{defaultValue:t})}function by(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return gy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gy(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Sy(e){var t=by(d.useState(!1),2),n=t[0],i=t[1],c=o.useBasicFetch(dy(e.optionId)),s=Object(bn.useDispatch)(),u=function(){e.closePopup(),r.AppLinkHelper.trigger({application:l.DOMAIN_OPTIONS,action:a.DomainOptions.DOMAIN_OPTIONS})};return d.createElement(Zh,{title:"Delete Domain Option",closePopup:e.closePopup,showLoadingSpinner:!c.data},c.data&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,c.data.name),"?")),d.createElement(ty,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){i(!0),o.fetch(s,yy(e.optionId,u))},buttonText:"Yes, delete this domain option",isSpinnerButton:!0,showSpinner:n}]})))}var Ey,Oy=function(e){return{application:l.DOMAIN_OPTIONS,action:a.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]}},jy={application:l.DOMAIN_OPTIONS,action:a.DomainOptions.NEW_DOMAIN_OPTION};function Cy(){var e=o.useBasicFetch(py());if(!e.data)return d.createElement(d.Fragment,null);var t=e.data.map((function(e){return e.displayName&&(e.name=e.displayName),e}));return d.createElement(d.Fragment,null,d.createElement("div",{className:"d-flex justify-content-between mb-2"},d.createElement("h5",{className:"d-inline-block m-0"},"Select a domain option type to edit:"),d.createElement(Up,{appLink:jy,className:"d-block"},d.createElement(_p,{svgName:Ap.Plus,size:kp.Small}),d.createElement("span",null,"New Domain Option"))),d.createElement(Pm,{objects:t,getAppLink:Oy}))}!function(e){e[e.Audience=1]="Audience",e[e.Category=2]="Category",e[e.Channel=3]="Channel",e[e.Chapter=4]="Chapter",e[e.Comment=5]="Comment",e[e.OwnerComment=6]="OwnerComment",e[e.Image=7]="Image",e[e.Thumbnail=8]="Thumbnail",e[e.Avatar=9]="Avatar",e[e.Banner=10]="Banner",e[e.Video=11]="Video",e[e.Trailer=12]="Trailer",e[e.Rating=13]="Rating",e[e.Topic=14]="Topic",e[e.Series=15]="Series",e[e.Season=16]="Season",e[e.HostedMediaObjectCollection=17]="HostedMediaObjectCollection",e[e.ExchangeCollection=18]="ExchangeCollection",e[e.CustomMediaObjectCollection=19]="CustomMediaObjectCollection",e[e.Playlist=20]="Playlist",e[e.ClickViewTvCollection=21]="ClickViewTvCollection",e[e.ClickViewProductionsCollection=22]="ClickViewProductionsCollection",e[e.User=23]="User",e[e.SystemUser=24]="SystemUser",e[e.Customer=25]="Customer",e[e.Country=26]="Country",e[e.Organisation=28]="Organisation",e[e.SystemOrganisation=29]="SystemOrganisation",e[e.Group=30]="Group",e[e.SystemGroup=31]="SystemGroup",e[e.FlagReason=32]="FlagReason",e[e.Library=33]="Library",e[e.Interactive=34]="Interactive",e[e.WorkspaceCollection=35]="WorkspaceCollection",e[e.Conversation=36]="Conversation",e[e.Message=37]="Message",e[e.Notification=38]="Notification",e[e.Clip=39]="Clip",e[e.Link=40]="Link",e[e.UserChannel=41]="UserChannel",e[e.Resource=42]="Resource",e[e.VideoStream=43]="VideoStream",e[e.AudioStream=44]="AudioStream",e[e.Tag=45]="Tag",e[e.Subtitle=46]="Subtitle",e[e.LicencedContentCollection=47]="LicencedContentCollection",e[e.PublicCollection=48]="PublicCollection",e[e.CategoryTree=49]="CategoryTree",e[e.Logo=50]="Logo",e[e.Permission=51]="Permission",e[e.Subject=52]="Subject",e[e.Field=53]="Field",e[e.Company=54]="Company",e[e.Person=55]="Person",e[e.Cover=56]="Cover",e[e.Poster=57]="Poster",e[e.SubjectAudience=58]="SubjectAudience"}(Ey||(Ey={}));var wy=Ys.object().shape({id:Ys.string(),name:Ys.string().trim().max(64,"Name is too long").required("Name is required").default(""),displayName:Ys.string().trim().max(255,"Display name is too long").required("Display name is required").default(""),type:Ys.mixed().required("Type is required").default(Qh.Boolean),entityType:Ys.mixed().required("Entity type is required").default(Ey.Customer),kind:Ys.mixed().required("Kind is required").default(Xh.Temporary),defaultValue:Ys.mixed().required("Default value is required").default("false")}).noUnknown();function Ay(e){var t=e.type,n=e.defaultValue;if(!t)return d.createElement(d.Fragment,null);var r={label:"Default Value",name:"defaultValue",id:"defaultValue",value:n};return t===Qh.Boolean?d.createElement(ru,Object.assign({as:"select"},r),d.createElement("option",{value:"true"},"True"),d.createElement("option",{value:"false"},"False")):t===Qh.Long||t===Qh.StaffRequest?d.createElement(ru,Object.assign({as:"input",type:"number"},r)):t===Qh.String?d.createElement(ru,Object.assign({as:"input"},r)):void 0}var Iy=[Ey.Customer,Ey.User];function Ty(e){var t=null===e.id||void 0===e.id,n=_s(),r=au(n);return d.createElement(Vs,null,d.createElement(ru,{label:"Name (snake_case)",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this domain option",autoFocus:!0}),d.createElement(ru,{label:"Display Name",type:"text",name:"displayName",id:"displayName",value:n.values.displayName,placeholder:"Enter a display name for this domain option"}),d.createElement(ru,{as:"select",label:"Kind",name:"kind",id:"kind",value:n.values.kind},Rr.getEnumKeys(Xh).map((function(e){return d.createElement("option",{key:e,value:Xh[e]},e)}))),d.createElement(ru,{as:"select",label:"Entity",name:"entityType",id:"entityType",value:n.values.entityType},Rr.getEnumKeys(Ey).filter((function(e){return Iy.includes(Ey[e])})).map((function(e){return d.createElement("option",{key:e,value:Ey[e]},e)}))),d.createElement(ru,{as:"select",label:"Type",name:"type",id:"type",value:n.values.type},Rr.getEnumKeys(Qh).map((function(e){return d.createElement("option",{key:e,value:Qh[e]},e)}))),d.createElement(Ay,{type:n.values.type,defaultValue:n.values.defaultValue}),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(lu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&d.createElement(Ws.Button,{as:Up,variant:"danger",appLink:{application:l.DOMAIN_OPTIONS,action:a.DomainOptions.DELETE_DOMAIN_OPTION,args:[e.id]}},"Delete")))}function ky(e){return d.createElement(Ks,{initialValues:e.domainOption,validationSchema:wy,onSubmit:e.saveDomainOption},d.createElement(Ty,{id:e.domainOption&&e.domainOption.id}))}function _y(){var e=Object(bn.useDispatch)();return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Create New Domain Option"),d.createElement(ky,{saveDomainOption:function(t,n){o.fetch(e,my(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.DOMAIN_OPTIONS,action:a.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]})}),n))}}))}function Ly(e){var t=e.optionId,n=o.useBasicFetch(dy(t)),r=Object(bn.useDispatch)();return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Edit Domain Option"),n.data&&d.createElement(ky,{domainOption:n.data,saveDomainOption:function(e,t){return o.fetch(r,hy(e,t))}}))}function xy(e){return(xy="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 Py(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ny(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 Ry(e,t,n){return t&&Ny(e.prototype,t),n&&Ny(e,n),e}function Dy(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&&My(e,t)}function My(e,t){return(My=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Uy(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=Vy(e);if(t){var o=Vy(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Fy(this,n)}}function Fy(e,t){return!t||"object"!==xy(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 Vy(e){return(Vy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zy=function(e){Dy(n,e);var t=Uy(n);function n(){return Py(this,n),t.apply(this,arguments)}return Ry(n,[{key:"channelName",get:function(){return l.DOMAIN_OPTIONS}},{key:"appRoutes",get:function(){return{"developer/options(/)":"domainOptions","developer/options/new(/)":"newDomainOption","developer/options/:id(/)":"editDomainOption"}}},{key:"appLinks",get:function(){return["deleteDomainOption"]}}]),n}(r.AppRouter),By=function(e){Dy(n,e);var t=Uy(n);function n(){return Py(this,n),t.apply(this,arguments)}return Ry(n,[{key:"domainOptions",value:function(){this.layout.showChildView(kn,d.createElement(Cy,null))}},{key:"newDomainOption",value:function(){this.layout.showChildView(kn,d.createElement(_y,null))}},{key:"editDomainOption",value:function(e){this.layout.showChildView(kn,d.createElement(Ly,{optionId:e}))}},{key:"deleteDomainOption",value:function(e){this.layout.showChildView(_n,d.createElement(Sy,Object.assign({optionId:e},this.getPopupProps())))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(Ln,d.createElement(Gh,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Domain Options Application"}},{key:"channelName",get:function(){return l.DOMAIN_OPTIONS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return zy}}]),n}(r.Application),Hy=function(e){return e?"".concat("/api/master/v2/people","?cursor=").concat(e):"/api/master/v2/people"},qy=function(e){return"/api/master/v2/objects/".concat(e)},Jy=function(){return"/api/master/v2/people"},$y=function(e){return"/api/master/v2/objects/".concat(e)},Ky="people",Yy="person",Gy="update:person",Wy=function(e){return{key:"".concat(Ky).concat(e?":".concat(e):""),url:Hy(e)}},Zy=function(e){return{key:"".concat(Yy,":").concat(e),url:qy(e)}},Qy=function(e,t,n){return{key:Yy,url:Jy(),data:e,type:jr.POST,success:t,error:n,invalidationKeys:[Ky]}},Xy=function(e,t,n){return{key:"".concat(Gy,":").concat(e),url:$y(e),data:t,type:jr.PUT,always:n}},ev=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown();function tv(e){var t=_s();return d.createElement(Vs,null,d.createElement(ru,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this person",autoFocus:!0}),d.createElement(wu,{isNew:e.isNew}))}function nv(e){return d.createElement(Ks,{initialValues:e.person,validationSchema:ev,onSubmit:e.savePerson},d.createElement(tv,{isNew:!(e.person&&e.person.id)}))}function rv(e){var t=Object(bn.useDispatch)(),n=o.useBasicFetch(Zy(e.id));return d.createElement(d.Fragment,null,!!n.data&&d.createElement(nv,{person:n.data,savePerson:function(n,r){return o.fetch(t,Xy(e.id,n,r))}}))}function ov(){var e=Object(bn.useDispatch)();return d.createElement(nv,{savePerson:function(t,n){o.fetch(e,Qy(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.PEOPLE,action:a.People.EDIT_PERSON,args:[e.id]})}),n))}})}var iv=l.PEOPLE,av=function(e){return{application:iv,action:a.People.EDIT_PERSON,args:[e.id]}},cv=function(e){return r.AppLinkHelper.trigger(av(e))};function sv(e){var t=o.useBasicFetch(Wy(e.cursor));return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3 w-50"},d.createElement(Mp,{placeholder:"Search for a person",onSuggestionSelected:cv,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/people/instant/raw","?q=").concat(e)},activationLength:2})),d.createElement(Em,{collection:t&&t.data,collectionAppLink:{application:iv,action:a.People.PEOPLE},newObjectAppLink:{application:iv,action:a.People.NEW_PERSON},getObjectAppLink:av,objectName:"Person"}))}function uv(e){return(uv="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 lv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fv(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 pv(e,t,n){return t&&fv(e.prototype,t),n&&fv(e,n),e}function dv(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&&mv(e,t)}function mv(e,t){return(mv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function hv(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=vv(e);if(t){var o=vv(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return yv(this,n)}}function yv(e,t){return!t||"object"!==uv(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 vv(e){return(vv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var bv=function(e){dv(n,e);var t=hv(n);function n(){return lv(this,n),t.apply(this,arguments)}return pv(n,[{key:"channelName",get:function(){return l.PEOPLE}},{key:"appRoutes",get:function(){return{"manage/people(/)":"people","manage/people/new(/)":"newPerson","manage/people/:id(/)":"editPerson"}}}]),n}(r.AppRouter),gv=function(e){dv(n,e);var t=hv(n);function n(){return lv(this,n),t.apply(this,arguments)}return pv(n,[{key:"people",value:function(e){var t=e.cursor;this.layout.showChildView(kn,d.createElement(sv,{cursor:t}))}},{key:"newPerson",value:function(){this.layout.showChildView(kn,d.createElement(ov,null))}},{key:"editPerson",value:function(e){this.layout.showChildView(kn,d.createElement(rv,{id:e}))}},{key:"name",get:function(){return"People Application"}},{key:"channelName",get:function(){return l.PEOPLE}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return bv}}]),n}(r.Application);function Sv(e){return(Sv="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 Ev(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 Ov(e,t){return(Ov=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function jv(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=wv(e);if(t){var o=wv(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Cv(this,n)}}function Cv(e,t){return!t||"object"!==Sv(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 wv(e){return(wv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Av=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&&Ov(e,t)}(i,e);var t,n,r,o=jv(i);function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this)).constructors={},e.destructors={},e.instances={},e.singletonInstances={},e.referenceCounts={},e}return t=i,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"registerDataService",value:function(e,t){var n=this;this.validateConstructor(e);var r=e.prototype.name;return this.referenceCounts[r]=0,this.constructors[r]=function(){return new e({dataProvider:n.getInstance(t.dataProvider),cache:n.getInstance(t.cache),bootstrapData:t.bootstrapData,defaultErrorHandler:t.defaultErrorHandler,alertService:t.alertService})},this.destructors[r]=function(){n.instances[r]?n.instances[r].destroy():K.throw(new Xe("Trying to destroy a ".concat(r," instance that has already been destroyed"))),n.releaseInstance(t.dataProvider),n.releaseInstance(t.cache)},this}},{key:"registerInstance",value:function(e,t){var n=this;this.validateConstructor(e);var r=e.prototype.name;return this.referenceCounts[r]=0,this.constructors[r]=function(){return new e(t)},this.destructors[r]=function(){return h.isFunction(n.instances[r].destroy)&&n.instances[r].destroy()},this}},{key:"registerSingleton",value:function(e){var t=e.name;return this.singletonInstances[t]=e,this}},{key:"getInstance",value:function(e,t){var n=this;return this.singletonInstances[e]?this.singletonInstances[e]:(this.constructors[e]||K.throw(new Xe("".concat(e," was not registered with ").concat(this.name))),this.referenceCounts[e]++,t&&this.listenTo(t,"destroy",(function(){return n.releaseInstance(e)})),this.instances[e]||(this.instances[e]=this.constructors[e]()),this.instances[e])}},{key:"releaseInstance",value:function(e){var t=this;if(this.instances[e])return window.setTimeout((function(){t.referenceCounts[e]--,t.referenceCounts[e]<1&&(t.destructors[e](),delete t.instances[e])}),0),this}},{key:"validateConstructor",value:function(e){var t=e.prototype.name;t||K.throw(new Xe("Classes registered with ".concat(this.name," must have a unique name property."))),this.constructors[t]&&K.throw(new Xe("A class with the name: ".concat(t," has already been registered with ").concat(this.name)))}},{key:"name",get:function(){return"InstanceManager"}}])&&Ev(t.prototype,n),r&&Ev(t,r),i}(Yt).Instance;function Iv(e){var t,n;return t=e,n=Av.getInstance(t),d.useEffect((function(){return function(){return Av.releaseInstance(t)}})),n}function Tv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return kv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _v(e){var t=e.imageType,n=e.closePopup,r=d.useContext(gd),o=r.getDataUrl,i=r.setImage,a=Tv(d.useState(o()),1)[0],c=Tv(d.useState(!1),2),s=c[0],u=c[1],l=Iv(p.IMAGE_UPLOAD),f=function(e){i(e),n()},m={dataUrl:a,imageType:t,minWidth:ad[t].width,minHeight:ad[t].height,onCrop:function(e){return l.uploadBase64Image(e,t,f,n)},onCancel:n};return d.createElement(Zh,{title:"Crop Image",size:"lg",closePopup:n,onEntered:function(){return u(!0)}},s&&d.createElement(em,Object.assign({},m)))}var Lv=function(e){var t=e.children;return d.createElement(Sd,null,t)},xv=function(){var e=Iv(du);return{success:function(t){e.success(t)()},error:function(t){e.error(t)()},warning:function(t){e.createAlert({type:_h.Warning,heading:Lh.Warning,message:t})}}};function Pv(e){var t=e.page,n=e.totalPages,r=Du.isNumber(t)&&t>0&&t<n&&t+1,o=Du.isNumber(t)&&t>1&&t-1,i={};if(r&&r<=n&&(i.next=r.toString()),o&&(i.previous=o.toString()),!Rr.isEmpty(i))return i}var Nv,Rv={convertLegacyPaginatedCollection:function(e){if(e)return{data:e.data,pagination:{cursors:Pv(e.pagination),limit:e.pagination.pageSize}}}};!function(e){e.Developer="Curator Devs",e.Content="Content",e.Curator="Curators",e.Support="Support",e.SalesSupport="Sales Support"}(Nv||(Nv={}));var Dv=function(){return[{value:"protected",access:"r"}]},Mv=function(e){return[Nv.Developer,Nv.Content].some((function(t){return hd(e).includes(t)}))},Uv=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1";return{key:"playlists:".concat(e),url:"/ajax/playlists/curators?page=".concat(e),formatData:Rv.convertLegacyPaginatedCollection}},Fv=function(e,t){var n="/api/domain/v1/search/playlists?query=".concat(e);return t&&(n+="&filter={page:".concat(t,"}")),{key:"playlists:search:".concat(e).concat(t?":".concat(t):""),url:n,formatData:Rv.convertLegacyPaginatedCollection}},Vv=function(e){return{key:"playlist:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=cover,banner")}},zv=function(e){var t=e.slice().sort();return{key:"playlists:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},Bv=function(e,t,n,r,o){return{url:"/api/master/v2/objects/".concat(t,"/playlists"),key:"playlist",data:Object.assign(Object.assign({},e),{permissions:Dv()}),type:jr.POST,invalidationKeys:"playlists",success:n,error:r,always:o}},Hv=function(e,t,n,r,o){return{url:"/api/master/v2/objects/".concat(e),key:"update:playlist:".concat(e),data:t,type:jr.PUT,success:n,error:r,always:o}},qv=function(e,t,n,r){return{url:"/api/master/v1/playlists/".concat(e),key:"delete:playlist:".concat(e),type:jr.DELETE,invalidationKeys:"playlists",success:t,error:n,always:r}},Jv=function(e){return{key:"playlist:".concat(e,":videos"),url:"/api/master/v2/objects/".concat(e,"/videos?query={orderBy:orderindex,limit:100}")}},$v=function(e,t,n,r){return{key:"reorder:playlist",url:"/api/master/v1/objects/".concat(e,"/videos/reorder"),data:t,type:jr.PUT,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r}},Kv=function(e,t,n,r,o){return{key:"remove:playlist:video",url:"/api/master/v1/playlists/".concat(e,"/dissociate/").concat(t),type:jr.DELETE,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r,always:o}};function Yv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Gv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Wv(e){var t=Object(bn.useDispatch)(),n=xv(),i=Yv(d.useState(!1),2),c=i[0],s=i[1],u=o.useBasicFetch(Vv(e.playlistId));var f=[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){s(!0),o.fetch(t,qv(e.playlistId,(function(){n.success("Successfully deleted playlist."),r.AppLinkHelper.trigger({application:l.PLAYLISTS,action:a.Playlists.PLAYLISTS})}),(function(){s(!1),n.error("Failed to delete playlist.")}),e.closePopup))},buttonText:"Yes, delete playlist",isSpinnerButton:!0,showSpinner:c}],p=!!u.data;return d.createElement(Zh,{title:"Delete Playlist",closePopup:e.closePopup,showLoadingSpinner:!p},p&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,u.data.name),"?"),d.createElement("p",null,"Please ensure it is not being used in any widgets.")),d.createElement(ty,{buttons:f})))}var Zv={url:"/api/currentUser",key:"currentuser"},Qv=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Ys.string().trim().max(65535,"Description is too long").default(""),cover:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown(),banner:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown()}).noUnknown(),Xv=function(e,t){var n=l.PLAYLISTS,r=a.Playlists,o=[{label:"Edit Playlist Details",appLink:{application:n,action:r.EDIT_PLAYLIST,args:[t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_PLAYLIST_VIDEOS,args:[t]}}];return Mv(e)&&o.push.apply(o,[{label:"Subjects",appLink:{application:n,action:r.EDIT_PLAYLIST_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_PLAYLIST_AUDIENCES,args:[t]}}]),o};function eb(e){var t=_s(),n=au(t);return d.createElement(Vs,null,d.createElement(ru,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this playlist",autoFocus:!0}),d.createElement(ru,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this playlist here"}),d.createElement(wd,{imageType:Jp.Covers,fieldName:"cover",application:l.PLAYLISTS,uploadAction:a.Playlists.UPLOAD_IMAGE}),d.createElement(wd,{imageType:Jp.Banners,fieldName:"banner",application:l.PLAYLISTS,uploadAction:a.Playlists.UPLOAD_IMAGE}),d.createElement("div",{className:"d-flex justify-content-between align-items-center"},d.createElement(lu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.id?"Save":"Create"),!!e.actions&&d.createElement(km,{actions:e.actions})))}function tb(e){var t,n=e.playlist&&e.playlist.id;return d.createElement(Ks,{initialValues:e.playlist,validationSchema:Qv,onSubmit:e.savePlaylist},d.createElement(eb,{id:n,actions:!!n&&(t=n,[{label:"Delete playlist",appLink:{application:l.PLAYLISTS,action:a.Playlists.DELETE_PLAYLIST,args:[t]},className:"text-danger"}])}))}function nb(e){return d.createElement("div",{className:"py-2"},d.createElement(Rm,{tabs:Xv(e.currentUser,e.playlistId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function rb(e){var t=Object(bn.useDispatch)(),n=xv(),r=o.useBasicFetch(Vv(e.playlistId)),i=o.useBasicFetch(Zv);return d.createElement(d.Fragment,null,!!i.data&&d.createElement(nb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST,currentUser:i.data}),!!r.data&&d.createElement(tb,{playlist:r.data,savePlaylist:function(r,i){o.fetch(t,Hv(e.playlistId,r,(function(){n.success("Successfully updated playlist.")}),(function(){n.error("Failed to update playlist.")}),i))}}))}var ob=function(e,t){var n=e.dataServiceName,r=e.eventPrefix,o=e.fetchData,i=e.setData,a=e.onError,c=e.deleteEventPrefix;if(hn(o)){if(hn(i)){var s=a&&hn(a),u=Av.getInstance(n),l=y.Radio.channel(u.channelName),f="".concat(r,":request"),p="".concat(r,":sync"),d="".concat(r,":error"),m="".concat(r,":invalidate"),h=c&&"".concat(c,":sync"),v=function(){return t(!1)},b=function(){return t(!0)},g=function(){return t(!1)},S=function(){return l.off(m,g)};l.once(f,v),l.once(p,b),l.once(m,g),s&&l.once(d,a),h&&l.once(h,S);var E=o(u);return E&&(t(!0),e.setData(E)),function(){Av.releaseInstance(n),l.off(f,v),l.off(p,b),l.off(m,g),s&&l.off(d,a),h&&l.off(h,S)}}K.throw(new Xe("A setData function must be passed to fetch"))}else K.throw(new Xe("A fetchData function must be passed to fetch"))};function ib(e){return function(e){if(Array.isArray(e))return sb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||cb(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ab(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||cb(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cb(e,t){if(e){if("string"==typeof e)return sb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sb(e,t):void 0}}function sb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ub=function(e){return Array(Array.isArray(e)?e.length:0).fill(!1)};function lb(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=d.useState(ub(e)),o=ab(r,2),i=o[0],a=o[1];d.useEffect((function(){a(ub(e))}),ib(t)),d.useEffect((function(){if(n){var t=[];return e&&e.forEach((function(e,n){t.push(ob(e,(function(e){e!==i[n]&&a(jo(i,n,e))})))})),function(){return t.forEach((function(e){return e()}))}}}),[i,n])}function fb(e){return function(e){if(Array.isArray(e))return mb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||db(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||db(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function db(e,t){if(e){if("string"==typeof e)return mb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mb(e,t):void 0}}function mb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hb(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=d.useState(!1),o=pb(r,2),i=o[0],a=o[1];d.useEffect((function(){a(!1)}),fb(t)),d.useEffect((function(){if(n)return ob(e,a)}),[i,n])}var yb,vb,bb,gb,Sb=function(e,t,n){return function(r){return e((function(e){var o=hn(n)?n:yn();return Object.assign(Object.assign({},e),function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,o(r,e)))}))}},Eb={SHORT:120,STANDARD:600};!function(e){e[e.Subject=0]="Subject",e[e.Classification=1]="Classification"}(yb||(yb={})),function(e){e.Playlists="playlists",e.Series="series",e.Videos="videos"}(vb||(vb={})),function(e){e.Root="0"}(bb||(bb={})),function(e){e.Root="root"}(gb||(gb={}));var Ob,jb=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default(""),levelIds:Ys.array().of(Ys.string()).required("A level is required").default([])}).noUnknown();!function(e){e.Subject="Subject",e.Topic="Topic"}(Ob||(Ob={}));var Cb=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentIds:Ys.array().of(Ys.string()).default([gb.Root]),subjectIds:Ys.array().of(Ys.string()).min(1,"A classification must be mapped to at least one subject").required("A classification must be mapped to at least one subject").default([]),type:Ys.mixed().required("Type is required").default(Ob.Subject),emphasize:Ys.boolean().default(!1),comingSoon:Ys.boolean().default(!0),canBePreferred:Ys.boolean().default(!1),cover:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown(),banner:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown()}).noUnknown(),wb=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),Ab=Ys.object().shape({name:Ys.string().max(255,"Name is too long").required("Name is required"),description:Ys.string().max(65535,"Description is too long").required("Description is required")}),Ib=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentId:Ys.string().default(bb.Root)}).noUnknown(),Tb={singularizeMemberType:function(e){switch(e){case vb.Playlists:return"playlist";case vb.Series:return"series";case vb.Videos:return"video"}},getMemberAppLink:function(e,t){var n=[t];switch(e){case vb.Playlists:return{application:l.PLAYLISTS,action:a.Playlists.EDIT_PLAYLIST,args:n};case vb.Series:return{application:l.SERIES,action:a.Series.EDIT_SERIES,args:n};case vb.Videos:return{application:l.VIDEOS,action:a.Videos.EDIT_VIDEO,args:n}}},getMemberActions:function(e,t,n,r){return[{label:"Remove ".concat(Tb.singularizeMemberType(n)),appLink:{application:l.SUBJECTS,action:t===yb.Subject?a.Subjects.REMOVE_SUBJECT_MEMBER:a.Subjects.REMOVE_CLASSIFICATION_MEMBER,args:[e,r,n]},className:"text-danger"}]}},kb=function(){var e=l.SUBJECTS,t=a.Subjects;return[{label:"Classifications",appLink:{application:e,action:t.CLASSIFICATIONS},activeActions:[t.CLASSIFICATIONS,t.PRESENTATION_CLASSIFICATIONS,t.NEW_CLASSIFICATION,t.EDIT_CLASSIFICATION,t.EDIT_CLASSIFICATION_PLAYLISTS,t.EDIT_CLASSIFICATION_SERIES,t.EDIT_CLASSIFICATION_VIDEOS,t.DELETE_CLASSIFICATION,t.REMOVE_CLASSIFICATION_MEMBER]},{label:"Subjects",appLink:{application:e,action:t.SUBJECTS},activeActions:[t.SUBJECTS,t.NEW_SUBJECT,t.EDIT_SUBJECT,t.EDIT_SUBJECT_PLAYLISTS,t.EDIT_SUBJECT_SERIES,t.EDIT_SUBJECT_VIDEOS,t.SUBJECT_CLASSIFICATIONS,t.DELETE_SUBJECT,t.ADD_SUBJECT_MEMBERS,t.REMOVE_SUBJECT_MEMBER]},{label:"Audiences",appLink:{application:e,action:t.AUDIENCES},activeActions:[t.AUDIENCES,t.PRESENTATION_AUDIENCES,t.NEW_AUDIENCE,t.EDIT_AUDIENCE]},{label:"Levels",appLink:{application:e,action:t.LEVELS},activeActions:[t.LEVELS,t.NEW_LEVEL,t.EDIT_LEVEL]},{label:"Presentations",appLink:{application:e,action:t.PRESENTATIONS},activeActions:[t.PRESENTATIONS,t.NEW_PRESENTATION,t.EDIT_PRESENTATION]}]},_b=function(e){var t=l.SUBJECTS,n=a.Subjects;return[{label:"Edit Subject Details",appLink:{application:t,action:n.EDIT_SUBJECT,args:[e]}},{label:"Classifications",appLink:{application:t,action:n.SUBJECT_CLASSIFICATIONS,args:[e]}},{label:"Playlists",appLink:{application:t,action:n.EDIT_SUBJECT_PLAYLISTS,args:[e]}},{label:"Series",appLink:{application:t,action:n.EDIT_SUBJECT_SERIES,args:[e]}},{label:"Videos",appLink:{application:t,action:n.EDIT_SUBJECT_VIDEOS,args:[e]}}]},Lb=function(e,t){var n=l.SUBJECTS,r=a.Subjects;return[{label:"Edit Classification Details",appLink:{application:n,action:r.EDIT_CLASSIFICATION,args:[e,t]}},{label:"Playlists",appLink:{application:n,action:r.EDIT_CLASSIFICATION_PLAYLISTS,args:[e,t]}},{label:"Series",appLink:{application:n,action:r.EDIT_CLASSIFICATION_SERIES,args:[e,t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_CLASSIFICATION_VIDEOS,args:[e,t]}}]};function xb(e){return(xb="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 Pb(e){return function(e){if(Array.isArray(e))return Nb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Nb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nb(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Rb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Db(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 Mb(e,t){return(Mb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ub(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=Vb(e);if(t){var o=Vb(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Fb(this,n)}}function Fb(e,t){return!t||"object"!==xb(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 Vb(e){return(Vb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zb=function(){return"/api/subjects/v1/subjects/tree"},Bb=function(e){return"/api/subjects/v1/subjects/".concat(e)},Hb=function(e,t){return"/api/subjects/v1/subjects/".concat(e,"/").concat(t,"?query={limit:100}")},qb=function(e,t,n){var r="/api/subjects/v1/subjects/".concat(e,"/classifications"),o=[];return t&&o.push("presentationId=".concat(t)),n&&o.push("query=".concat(n,"{limit:100}")),o.length?"".concat(r,"?").concat(o.join("&")):r},Jb=function(){return"/api/subjects/v1/subjects"},$b=function(e){return"/api/subjects/v1/subjects/".concat(e)},Kb=function(e){return"/api/subjects/v1/subjects/".concat(e)},Yb=function(e){return"/api/subjects/v1/objects/".concat(e,"/subjects")},Gb=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/subjects?addToClassifications=").concat(!!t)},Wb=function(e,t){return"/api/subjects/v1/subjects/".concat(e,"/objects?addToClassifications=").concat(!!t)},Zb=function(e,t){return"/api/subjects/v1/subjects/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},Qb=function(){return"/api/subjects/v1/presentations"},Xb=function(e){return"/api/subjects/v1/presentations/".concat(e)},eg=function(){return"/api/subjects/v1/presentations"},tg=function(e){return"/api/subjects/v1/presentations/".concat(e)},ng=function(e){return"/api/subjects/v1/presentations/".concat(e,"/classifications/tree")},rg=function(e){return"/api/subjects/v1/classifications/".concat(e,"?query=cover,banner,followers")},og=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/").concat(t,"?query={limit:100}")},ig=function(){return"/api/subjects/v1/classifications"},ag=function(e){return"/api/subjects/v1/classifications/".concat(e)},cg=function(e){return"/api/subjects/v1/classifications/".concat(e)},sg=function(e){return"/api/subjects/v1/objects/".concat(e,"/classifications")},ug=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/classifications?presentationId=").concat(t)},lg=function(e){return"/api/subjects/v1/classifications/".concat(e,"/objects")},fg=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},pg=function(){return"/api/subjects/v1/levels"},dg=function(e){return"/api/subjects/v1/levels/".concat(e)},mg=function(){return"/api/subjects/v1/levels"},hg=function(e){return"/api/subjects/v1/levels/".concat(e)},yg=function(e){return"/api/subjects/v1/objects/".concat(e,"/levels")},vg=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/levels?addToAudiences=").concat(!!t)},bg=function(e){return"/api/subjects/v1/presentations/".concat(e,"/audiences")},gg=function(e){return"/api/subjects/v1/audiences/".concat(e)},Sg=function(){return"/api/subjects/v1/audiences"},Eg=function(e){return"/api/subjects/v1/audiences/".concat(e)},Og=function(e){return"/api/subjects/v1/audiences/".concat(e)},jg=function(e){return"/api/subjects/v1/objects/".concat(e,"/audiences")},Cg=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/audiences?presentationId=").concat(t)},wg=function(e,t,n){var r="".concat(c.SUBJECT,":").concat(e);return t&&(r+=":".concat(t)),r+=":".concat(c.CLASSIFICATIONS),n&&(r+=":".concat(n)),r},Ag=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&&Mb(e,t)}(i,e);var t,n,r,o=Ub(i);function i(){return Rb(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"getPresentations",value:function(e,t){return this.get({resource:Qb(),eventPrefix:c.PRESENTATIONS,expiryTime:Eb.STANDARD,callback:e,errorCallback:t})}},{key:"getPresentation",value:function(e,t,n){return this.get({resource:Xb(e),eventPrefix:"".concat(c.PRESENTATION,":").concat(e),expiryTime:Eb.STANDARD,callback:t,errorCallback:n})}},{key:"createPresentation",value:function(e,t,n){return this.create({resource:eg(),data:e,callback:t,errorCallback:n,eventPrefix:c.PRESENTATION,invalidationKeys:[c.PRESENTATIONS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully created presentation."),errorHandler:this.alertService.error("Failed to create presentation.")})}},{key:"updatePresentation",value:function(e,t,n,r){return this.update({resource:tg(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_PRESENTATION,":").concat(e),invalidationKeys:["".concat(c.PRESENTATION,":").concat(e),c.PRESENTATIONS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully updated presentation."),errorHandler:this.alertService.error("Failed to update presentation.")})}},{key:"getSubjectTree",value:function(e,t){return this.get({resource:zb(),formatData:function(e){return{children:e,name:bb.Root,id:null}},eventPrefix:c.SUBJECTS,expiryTime:Eb.STANDARD,callback:e,errorCallback:t})}},{key:"getSubject",value:function(e,t,n){return this.get({resource:Bb(e),eventPrefix:"".concat(c.SUBJECT,":").concat(e),expiryTime:Eb.STANDARD,callback:t,errorCallback:n})}},{key:"getSubjectMemberIds",value:function(e,t,n,r){return this.get({resource:Hb(e,t),eventPrefix:"".concat(c.SUBJECT,":").concat(e,":").concat(t),expiryTime:Eb.STANDARD,callback:n,errorCallback:r})}},{key:"getSubjectClassifications",value:function(e,t,n,r,o){return this.get({resource:qb(e,t,n),eventPrefix:wg(e,t,n),expiryTime:Eb.STANDARD,callback:r,errorCallback:o})}},{key:"createSubject",value:function(e,t,n){return this.create({resource:Jb(),data:e,callback:t,errorCallback:n,eventPrefix:c.SUBJECT,invalidationKeys:[c.SUBJECTS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully created subject."),errorHandler:this.alertService.error("Failed to create subject.")})}},{key:"updateSubject",value:function(e,t,n,r){return this.update({resource:$b(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_SUBJECT,":").concat(e),invalidationKeys:["".concat(c.SUBJECT,":").concat(e),c.SUBJECTS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully updated subject."),errorHandler:this.alertService.error("Failed to save subject.")})}},{key:"deleteSubject",value:function(e,t,n){var r=this;return this.delete({resource:Kb(e),callback:t,errorCallback:n,eventPrefix:c.DELETE_SUBJECT,invalidationKeys:["".concat(c.SUBJECT,":").concat(e),c.SUBJECTS],successHandler:this.alertService.success("Successfully deleted subject."),errorHandler:function(e){var t,n=(null===(t=e)||void 0===t?void 0:t.code)===oo.Conflict?"Cannot delete a subject with child subjects and/or classifications.":"Failed to delete subject.";r.alertService.error(n)()}})}},{key:"getObjectSubjects",value:function(e,t,n,r){return this.get({resource:Yb(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.SUBJECTS),expiryTime:Eb.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectSubjects",value:function(e,t,n,r,o,i){var a=Tb.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(c.SUBJECTS)];return r&&s.push("".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)),s.push.apply(s,Pb(t.map((function(e){return"".concat(c.SUBJECTS,":").concat(e,":").concat(n)})))),this.update({resource:Gb(e,r),data:t,callback:o,errorCallback:i,eventPrefix:"".concat(c.UPDATE_OBJECT_SUBJECTS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(a," subjects.")),errorHandler:this.alertService.error("Failed to update ".concat(a," subjects."))})}},{key:"addObjectsToSubject",value:function(e,t,n,r,o,i){var a=1===t.length?Tb.singularizeMemberType(n):n,s=["".concat(c.SUBJECT,":").concat(e,":").concat(n)].concat(Pb(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.SUBJECTS)}))),Pb(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)}))));return this.create({resource:Wb(e,r),data:t,callback:o,errorCallback:i,eventPrefix:"".concat(c.ADD_TO_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:s,expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(a," to subject.")),errorHandler:this.alertService.error("Failed to add ".concat(a," to subject."))})}},{key:"removeObjectsFromSubject",value:function(e,t,n,r,o){var i=1===t.length?Tb.singularizeMemberType(n):n,a=["".concat(c.SUBJECT,":").concat(e,":").concat(n)].concat(Pb(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.SUBJECTS)}))));return this.delete({resource:Zb(e,t),callback:r,errorCallback:o,eventPrefix:"".concat(c.REMOVE_FROM_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:a,expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(i," from subject.")),errorHandler:this.alertService.error("Failed to remove ".concat(i," from subject."))})}},{key:"getClassificationTree",value:function(e,t,n){return this.get({resource:ng(e),formatData:function(e){return{children:e,name:gb.Root,id:null}},eventPrefix:"".concat(c.CLASSIFICATIONS,":").concat(e),expiryTime:Eb.STANDARD,callback:t,errorCallback:n})}},{key:"getClassification",value:function(e,t,n){return this.get({resource:rg(e),eventPrefix:"".concat(c.CLASSIFICATION,":").concat(e),expiryTime:Eb.STANDARD,callback:t,errorCallback:n})}},{key:"getClassificationMembers",value:function(e,t,n,r){return this.get({resource:og(e,t),eventPrefix:"".concat(c.CLASSIFICATION,":").concat(e,":").concat(t),expiryTime:Eb.STANDARD,callback:n,errorCallback:r})}},{key:"createClassification",value:function(e,t,n){return this.create({resource:ig(),data:e,callback:t,errorCallback:n,eventPrefix:c.CLASSIFICATION,invalidationKeys:[c.CLASSIFICATIONS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully created classification."),errorHandler:this.alertService.error("Failed to create classification.")})}},{key:"updateClassification",value:function(e,t,n,r){return this.update({resource:ag(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_CLASSIFICATION,":").concat(e),invalidationKeys:["".concat(c.CLASSIFICATION,":").concat(e),c.CLASSIFICATIONS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully updated classification."),errorHandler:this.alertService.error("Failed to save classification.")})}},{key:"deleteClassification",value:function(e,t,n){return this.delete({resource:cg(e),callback:t,errorCallback:n,eventPrefix:c.DELETE_CLASSIFICATION,invalidationKeys:["".concat(c.CLASSIFICATION,":").concat(e),c.CLASSIFICATIONS],successHandler:this.alertService.success("Successfully deleted classification"),errorHandler:this.alertService.error("Failed to delete classification")})}},{key:"getObjectClassifications",value:function(e,t,n,r){return this.get({resource:sg(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.CLASSIFICATIONS),expiryTime:Eb.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectClassifications",value:function(e,t,n,r,o,i){var a=Tb.singularizeMemberType(r),s=["".concat(r,":").concat(e,":").concat(c.CLASSIFICATIONS)];return s.push.apply(s,Pb(n.map((function(e){return"".concat(c.CLASSIFICATION,":").concat(e,":").concat(r)})))),this.update({resource:ug(e,t),data:n,callback:o,errorCallback:i,eventPrefix:"".concat(c.UPDATE_OBJECT_CLASSIFICATIONS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(a," classifications.")),errorHandler:this.alertService.error("Failed to update ".concat(a," classifications."))})}},{key:"addObjectsToClassification",value:function(e,t,n,r,o,i,a){var s=1===t.length?Tb.singularizeMemberType(n):n,u=["".concat(c.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(wg(r,o,n)),u.push.apply(u,Pb(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)})))),this.create({resource:lg(e),data:t,callback:i,errorCallback:a,eventPrefix:"".concat(c.ADD_TO_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(s," to classification.")),errorHandler:this.alertService.error("Failed to add ".concat(s," to classification."))})}},{key:"removeObjectsFromClassification",value:function(e,t,n,r,o,i,a){var s=1===t.length?Tb.singularizeMemberType(n):n,u=["".concat(c.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(wg(r,o,n)),u.push.apply(u,Pb(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)})))),this.delete({resource:fg(e,t),callback:i,errorCallback:a,eventPrefix:"".concat(c.REMOVE_FROM_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(s," from classification.")),errorHandler:this.alertService.error("Failed to remove ".concat(s," from classification."))})}},{key:"getLevels",value:function(e,t){return this.get({resource:pg(),eventPrefix:c.LEVELS,expiryTime:Eb.STANDARD,callback:e,errorCallback:t})}},{key:"getLevel",value:function(e,t,n){return this.get({resource:dg(e),eventPrefix:"".concat(c.LEVEL,":").concat(e),expiryTime:Eb.STANDARD,callback:t,errorCallback:n})}},{key:"createLevel",value:function(e,t,n){return this.create({resource:mg(),data:e,callback:t,errorCallback:n,eventPrefix:c.LEVEL,invalidationKeys:[c.LEVELS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully created level."),errorHandler:this.alertService.error("Failed to create level.")})}},{key:"updateLevel",value:function(e,t,n,r){return this.update({resource:hg(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_LEVEL,":").concat(e),invalidationKeys:["".concat(c.LEVEL,":").concat(e),c.LEVELS],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully updated level."),errorHandler:this.alertService.error("Failed to save level.")})}},{key:"getObjectLevels",value:function(e,t,n,r){return this.get({resource:yg(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.LEVELS),expiryTime:Eb.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectLevels",value:function(e,t,n,r,o,i){var a=Tb.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(c.LEVELS)];return r&&s.push("".concat(n,":").concat(e,":").concat(c.AUDIENCES)),this.update({resource:vg(e,r),data:t,callback:o,errorCallback:i,eventPrefix:"".concat(c.UPDATE_OBJECT_LEVELS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(a," levels.")),errorHandler:this.alertService.error("Failed to update ".concat(a," levels."))})}},{key:"getAudiences",value:function(e,t,n){return this.get({resource:bg(e),callback:t,errorCallback:n,eventPrefix:"".concat(c.AUDIENCES,":").concat(e),expiryTime:Eb.STANDARD})}},{key:"getAudience",value:function(e,t,n){return this.get({resource:gg(e),callback:t,errorCallback:n,eventPrefix:"".concat(c.AUDIENCE,":").concat(e),expiryTime:Eb.STANDARD})}},{key:"createAudience",value:function(e,t,n){return this.create({resource:Sg(),data:e,callback:t,errorCallback:n,eventPrefix:c.AUDIENCE,invalidationKeys:[c.AUDIENCES],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully created audience."),errorHandler:this.alertService.error("Failed to create audience.")})}},{key:"updateAudience",value:function(e,t,n,r){return this.update({resource:Eg(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_AUDIENCE,":").concat(e),invalidationKeys:["".concat(c.AUDIENCE,":").concat(e),c.AUDIENCES],expiryTime:Eb.STANDARD,successHandler:this.alertService.success("Successfully updated audience."),errorHandler:this.alertService.error("Failed to update audience.")})}},{key:"deleteAudience",value:function(e,t,n){return this.delete({resource:Og(e),callback:t,errorCallback:n,eventPrefix:c.DELETE_AUDIENCE,invalidationKeys:["".concat(c.AUDIENCE,":").concat(e),c.AUDIENCES],successHandler:this.alertService.success("Successfully deleted audience"),errorHandler:this.alertService.error("Failed to delete audience")})}},{key:"getObjectAudiences",value:function(e,t,n,r){return this.get({resource:jg(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.AUDIENCES),expiryTime:Eb.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectAudiences",value:function(e,t,n,r,o,i){var a=Tb.singularizeMemberType(r);return this.update({resource:Cg(e,t),data:n,callback:o,errorCallback:i,eventPrefix:"".concat(c.UPDATE_OBJECT_AUDIENCES,":").concat(e),invalidationKeys:["".concat(r,":").concat(e,":").concat(c.AUDIENCES)],successHandler:this.alertService.success("Successfully updated ".concat(a," audiences.")),errorHandler:this.alertService.error("Failed to update ".concat(a," audiences."))})}},{key:"name",get:function(){return p.SUBJECT}},{key:"channelName",get:function(){return f.SUBJECT}}])&&Db(t.prototype,n),r&&Db(t,r),i}(mr),Ig={dataServiceName:p.SUBJECT,dataChannelName:f.SUBJECT},Tg={getSubjectTreeFetchOptions:function(e,t){return Object.assign(Object.assign({},Ig),{eventPrefix:c.SUBJECTS,fetchData:function(e){return e.getSubjectTree()},setData:e,onError:t})},getSubjectFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.SUBJECT,":").concat(e),fetchData:function(t){return t.getSubject(e)},setData:t,onError:n,deleteEventPrefix:c.DELETE_SUBJECT})},getSubjectMemberIdsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.SUBJECT,":").concat(e,":").concat(t),fetchData:function(n){return n.getSubjectMemberIds(e,t)},setData:n,onError:r})},getSubjectClassificationFetchOptions:function(e,t,n,r,o){return Object.assign(Object.assign({},Ig),{eventPrefix:wg(e,n,r),fetchData:function(t){return t.getSubjectClassifications(e,n,r)},setData:t,onError:o})},getObjectSubjectsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.SUBJECTS),fetchData:function(n){return n.getObjectSubjects(e,t)},setData:n,onError:r})},getPresentationsFetchOptions:function(e,t){return Object.assign(Object.assign({},Ig),{eventPrefix:c.PRESENTATIONS,fetchData:function(e){return e.getPresentations()},setData:e,onError:t})},getPresentationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.PRESENTATION,":").concat(e),fetchData:function(t){return t.getPresentation(e)},setData:t,onError:n})},getClassificationTreeFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.CLASSIFICATIONS,":").concat(e),fetchData:function(t){return t.getClassificationTree(e)},setData:t,onError:n})},getClassificationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.CLASSIFICATION,":").concat(e),fetchData:function(t){return t.getClassification(e)},setData:t,onError:n,deleteEventPrefix:c.DELETE_CLASSIFICATION})},getClassificationMembersFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.CLASSIFICATION,":").concat(e,":").concat(t),fetchData:function(n){return n.getClassificationMembers(e,t)},setData:n,onError:r})},getObjectClassificationsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.CLASSIFICATIONS),fetchData:function(n){return n.getObjectClassifications(e,t)},setData:n,onError:r})},getLevelsFetchOptions:function(e,t){return Object.assign(Object.assign({},Ig),{eventPrefix:c.LEVELS,fetchData:function(e){return e.getLevels()},setData:e,onError:t})},getLevelFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.LEVEL,":").concat(e),fetchData:function(t){return t.getLevel(e)},setData:t,onError:n})},getObjectLevelsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.LEVELS),fetchData:function(n){return n.getObjectLevels(e,t)},setData:n,onError:r})},getAudiencesFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.AUDIENCES,":").concat(e),fetchData:function(t){return t.getAudiences(e)},setData:t,onError:n})},getAudienceFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(c.AUDIENCE,":").concat(e),fetchData:function(t){return t.getAudience(e)},setData:t,onError:n})},getObjectAudiencesFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Ig),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.AUDIENCES),fetchData:function(n){return n.getObjectAudiences(e,t)},setData:n,onError:r})}},kg=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[e.id]}},_g=function(e,t){var n=e.levelIds;return t.filter((function(e){return n.includes(e.id)}))};function Lg(e){var t=e.showLevels;return d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",null,"Audiences"),!!t&&d.createElement("th",null,"Mapped Level(s)")))}function xg(e){var t,n=e.audience,r=e.levels;return d.createElement("tr",null,d.createElement("td",null,d.createElement(Up,{appLink:(t=n,{application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[t.presentationId,t.masterId]})},n.name)),d.createElement("td",null,r.map((function(e){return d.createElement(Up,{key:e.id,appLink:kg(e),className:"mr-2"},e.name)}))))}function Pg(e){var t=e.audiences,n=e.levels;return d.createElement(Ws.Table,{responsive:!0,bordered:!0},d.createElement(Lg,{showLevels:!!t.length}),d.createElement("tbody",null,t.length?t.map((function(e){return d.createElement(xg,{key:e.masterId,audience:e,levels:_g(e,n)})})):d.createElement("tr",null,d.createElement("td",null,"This presentation has no audiences."))))}function Ng(e){var t=null===e.masterId||void 0===e.masterId,n=_s(),r=au(n);return d.createElement(Vs,null,d.createElement(ru,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this audience",autoFocus:!0}),d.createElement(ru,{label:"Mapped Level(s)",as:"select",name:"levelIds",id:"level-ids",multiple:!0,size:e.levels.length,value:n.values.levelIds},e.levels.map((function(e){return d.createElement("option",{key:e.id,value:e.id},e.name)}))),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(lu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&d.createElement(Ws.Button,{as:Up,variant:"danger",appLink:{application:l.SUBJECTS,action:a.Subjects.DELETE_AUDIENCE,args:[e.presentationId,e.masterId]}},"Delete")))}function Rg(e){return d.createElement(Ks,{initialValues:e.audience,validationSchema:jb,onSubmit:e.saveAudience},d.createElement(Ng,{masterId:e.audience&&e.audience.masterId,presentationId:e.presentationId,levels:e.levels}))}function Dg(e){var t=e.objectAudiences,n=e.presentationAudiences;return t.filter((function(e){return n.some((function(t){return t.masterId===e.masterId}))}))}function Mg(e){var t,n,r,o,i,a=Tb.singularizeMemberType(e.memberType),c=(n=(t=e).presentationAudiences,r=t.objectLevels,o=t.objectAudiences,i=r.map((function(e){return e.id})),n.filter((function(e){return Ao(e.levelIds,i).length||o.some((function(t){return t.masterId===e.masterId}))})));return d.createElement(d.Fragment,null,d.createElement("div",{className:"border-bottom pb-3 mb-3"},d.createElement("h6",null,"Levels"),d.createElement("p",null,"Select which levels this ".concat(a," is mapped to.")),d.createElement("p",null,"To see how levels correspond to audiences, scroll down to the audience-level mappings table."),d.createElement(oS,{initialValues:{levelIds:e.objectLevels.map((function(e){return e.id})),addToAudiences:!0},saveLevels:e.saveLevels,levels:e.levels,memberType:e.memberType})),d.createElement("h6",null,"Audiences"),d.createElement("p",null,"Select a presentation to view its audiences and map them to this ".concat(a,".")),d.createElement("div",{className:"w-50 pb-3"},d.createElement(cS,{presentations:e.presentations,currentPresentation:e.currentPresentation,setCurrentPresentation:e.setCurrentPresentation})),d.createElement("p",null,"Audience to level mappings for this presentation are displayed below."),d.createElement(Pg,{levels:e.levels,audiences:e.presentationAudiences}),d.createElement("p",null,"Only the audiences which are mapped to a level that this"+" ".concat(a," is mapped to are displayed below.")),!!c.length&&d.createElement(Fg,{initialValues:{audienceIds:Dg(e).map((function(e){return e.masterId}))},saveAudiences:e.saveAudiences,audiences:c}))}function Ug(e){var t=_s(),n=au(t);return d.createElement(Vs,null,d.createElement(ru,{label:"Audience(s)",as:"select",name:"audienceIds",id:"audience-ids",multiple:!0,size:e.audiences.length,value:t.values.audienceIds},e.audiences.map((function(e){return d.createElement("option",{key:e.masterId,value:e.masterId},e.name)}))),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(lu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Audiences")))}function Fg(e){return d.createElement(Ks,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.audienceIds;return e.saveAudiences(r,n)},enableReinitialize:!0},d.createElement(Ug,{audiences:e.audiences}))}function Vg(e){var t=e.item,n=e.getItemAppLink,r=e.actions,o=e.pinState;return d.createElement("tr",null,d.createElement("td",null,d.createElement(Up,{appLink:n(t)},t.name)),o.isPinnable&&d.createElement("td",null,d.createElement(Hp,{selected:parseInt(t.id)===parseInt(o.currentPinnedVideo),onToggle:function(e){return o.onChange(e,t.id)},id:t.id})),r&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(km,{actions:r}))))}function zg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Bg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Hg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Jg(e){var t=e.items,n=e.memberType,r=e.classification,o=e.getItemAppLink,i=e.getActions,a=e.updatePinnedVideo,c=Hg(d.useState(!1),2),s=c[0],u=c[1],l=function(e,t){var n=e.pinnedVideoMasterId||null,r=zg(d.useState(n),2),o=r[0],i=r[1];return{currentPinnedVideo:o,onChange:function(e,t){i(e?t:null)},canSubmit:n!==o,isPinnable:t===vb.Videos}}(r,n);if(!t.length)return d.createElement("div",{className:"py-5"},"No ".concat(n," in this classification."));var f="".concat(fd(Tb.singularizeMemberType(n))," Name");return d.createElement(d.Fragment,null,d.createElement(Ws.Table,{responsive:!0},d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",null,f),l.isPinnable&&d.createElement("th",null,"Pinned"),hn(i)&&d.createElement("th",null))),d.createElement("tbody",null,t.map((function(e){return d.createElement(Vg,{item:e,key:e.id,getItemAppLink:o,actions:hn(i)&&i(e),pinState:l})})))),l.isPinnable&&d.createElement(lu,{showSpinner:s,onClick:function(){u(!0),a(l.currentPinnedVideo,(function(){return u(!1)}))},disabled:!l.canSubmit||s},"Save"))}function $g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Yg=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[e]}};function Gg(e){var t,n,r,o,i,c,s=_s(),u=au(s),f=null===(null===(t=e.classification)||void 0===t?void 0:t.id)||void 0===(null===(n=e.classification)||void 0===n?void 0:n.id),p=!f||!(!s.values.parentIds||!s.values.parentIds.length),m=$g(d.useState(p),2),h=m[0],y=m[1];d.useEffect((function(){return y(p)}),[null===(r=e.classification)||void 0===r?void 0:r.id,s.values.parentIds]),d.useEffect((function(){s.values.subjectIds.length&&!s.touched.subjectIds&&s.setFieldTouched("subjectIds",!0)}),[s.values.subjectIds]);var v=function(e){return s.setFieldValue("parentIds",Io(s.values.parentIds.map((function(e){return e.toString()})),e.id.toString()))},b=function(e){return s.setFieldValue("subjectIds",Io(s.values.subjectIds.map((function(e){return e.toString()})),e.id.toString()))},g=function(e){return"".concat(Zs(s.errors,s.touched,e)," h-auto py-2")};return d.createElement(Vs,null,d.createElement(ru,{label:"Name",name:"name",id:"name",value:s.values.name,placeholder:"Enter a name for this classification",autoFocus:!0}),d.createElement(ru,{as:"select",label:"Type",name:"type",id:"type",value:s.values.type},Rr.getEnumKeys(Ob).map((function(e){return d.createElement("option",{key:e,value:Ob[e]},e)}))),d.createElement(ru,{label:"Coming Soon",name:"comingSoon",id:"comingSoon",type:"checkbox",checked:s.values.comingSoon}),d.createElement(ru,{label:"Emphasize",name:"emphasize",id:"emphasize",type:"checkbox",checked:s.values.emphasize}),d.createElement(ru,{label:"Can Be Preferred",name:"canBePreferred",id:"canBePreferred",type:"checkbox",checked:s.values.canBePreferred}),!f&&d.createElement(d.Fragment,null,d.createElement("label",null,"Total Followers:")," ",null===(i=null===(o=e.classification.followers)||void 0===o?void 0:o.data)||void 0===i?void 0:i.length),d.createElement(ru,{name:"parentIds"},(function(){var t,n,r;return d.createElement("div",{className:g("parentIds")},d.createElement(Ym,{label:"Parent Classification(s)",tree:e.classificationTree,selectedIds:s.values.parentIds,onSelect:v,collapse:h,noSelectionMessage:"No parent selected, this will be a root classification.",isNodeDisabled:(n=e.classificationTree,r=null===(t=e.classification)||void 0===t?void 0:t.id,function(e){if(e.id===r)return!0;var t=md.find(n,r);return!!md.find(t,e.id)})}))})),d.createElement(ru,{name:"subjectIds"},(function(){return d.createElement("div",{className:g("subjectIds")},d.createElement(Ym,{label:"Mapped Subject(s)",tree:e.subjectTree,selectedIds:s.values.subjectIds,onSelect:b,collapse:!f,getSelectedItemAppLink:Yg}))})),d.createElement(wd,{imageType:Jp.Covers,fieldName:"cover",application:l.SUBJECTS,uploadAction:a.Subjects.UPLOAD_IMAGE}),d.createElement(wd,{imageType:Jp.Banners,fieldName:"banner",application:l.SUBJECTS,uploadAction:a.Subjects.UPLOAD_IMAGE}),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(lu,{showSpinner:s.isSubmitting,type:"submit",disabled:!u},f?"Create":"Save"),!f&&d.createElement(Ws.Button,{as:Up,variant:"danger",appLink:{application:l.SUBJECTS,action:a.Subjects.DELETE_CLASSIFICATION,args:[e.presentationId,null===(c=e.classification)||void 0===c?void 0:c.id]}},"Delete")))}function Wg(e){return d.createElement(Ks,{initialValues:e.classification,validationSchema:Cb,onSubmit:e.saveClassification},d.createElement(Gg,{presentationId:e.presentationId,classificationTree:e.classificationTree,subjectTree:e.subjectTree,classification:e.classification}))}var Zg=function(e){return function(t){if(!e)return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION;switch(e){case vb.Playlists:return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;case vb.Series:return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION_SERIES;case vb.Videos:return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION_VIDEOS}}};function Qg(e){var t=e.presentation,n=e.classificationId,r=e.memberType;return t?d.createElement(d.Fragment,null,d.createElement("h6",null,"Presentation: ".concat(!!t&&t.name)),d.createElement("div",{className:"py-2"},d.createElement(Rm,{tabs:Lb(t.id,n),isItemActive:Zg(r)}))):d.createElement(d.Fragment,null)}function Xg(e){var t=_s(),n=au(t),r=function(e){return t.setFieldValue("classificationIds",Io(t.values.classificationIds.map((function(e){return e.toString()})),e.id.toString()))},o="".concat(Zs(t.errors,t.touched,"classificationIds")," h-auto py-2");return d.createElement(Vs,null,d.createElement(ru,{name:"classificationIds"},(function(){return d.createElement("div",{className:o},d.createElement(Ym,{label:"Mapped Classification(s)",tree:e.classificationTree,selectedIds:t.values.classificationIds,onSelect:r,getSelectedItemAppLink:(n=e.presentationId,function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[n,e]}}),isNodeDisabled:e.isClassificationDisabled}));var n})),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(lu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Classifications")))}function eS(e){return d.createElement(Ks,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.classificationIds;return e.saveClassifications(r,n)},enableReinitialize:!0},d.createElement(Xg,{presentationId:e.presentationId,classificationTree:e.classificationTree,isClassificationDisabled:e.isClassificationDisabled}))}function tS(e){var t=null===e.id||void 0===e.id,n=_s(),r=au(n);return d.createElement(Vs,null,d.createElement(ru,{label:"Name",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this level",autoFocus:!0}),d.createElement(lu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"))}function nS(e){return d.createElement(Ks,{initialValues:e.level,validationSchema:wb,onSubmit:e.saveLevel},d.createElement(tS,{id:e.level&&e.level.id}))}function rS(e){var t=Tb.singularizeMemberType(e.memberType),n=_s(),r=au(n);return d.createElement(Vs,null,d.createElement(ru,{label:"Level(s)",as:"select",name:"levelIds",id:"level-ids",multiple:!0,size:e.levels.length,value:n.values.levelIds},e.levels.map((function(e){return d.createElement("option",{key:e.id,value:e.id},e.name)}))),d.createElement(ru,{label:"Automatically add to audiences*",name:"addToAudiences",id:"add-to-audiences",type:"checkbox",checked:n.values.addToAudiences}),d.createElement("p",null,d.createElement("em",null,"*If selected, when adding a ".concat(t," to a level, all of that level's")+" audiences across all presentations will also be added to.")),d.createElement("p",null,d.createElement("strong",null,"Note:")," When removing a ".concat(t," from a level, that level's audiences "),d.createElement("strong",null,"will not")," be automatically removed from."),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(lu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},"Save Levels")))}function oS(e){return d.createElement(Ks,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.levelIds,o=t.addToAudiences;return e.saveLevels(r,o,n)}},d.createElement(rS,{levels:e.levels,memberType:e.memberType}))}function iS(e){var t=e.values,n=t.name,r=t.description,o=e.id,i=e.isSubmitting,a=!o;return d.createElement(Vs,null,d.createElement(ru,{label:"Name",type:"text",name:"name",id:"name",value:n,placeholder:"Enter a name for this presentation",autoFocus:!0}),d.createElement(ru,{label:"Description",as:"textarea",name:"description",id:"description",value:r,placeholder:"Describe this presentation here"}),d.createElement(lu,{showSpinner:i,type:"submit"},a?"Create":"Save"))}function aS(e){var t=e.presentation,n=(t=void 0===t?{}:t).id,r=void 0===n?null:n,o=t.name,i=void 0===o?"":o,a=t.description,c=void 0===a?"":a,s=e.savePresentation;return d.createElement(Rs,{initialValues:{name:i,description:c},validationSchema:Ab,onSubmit:s},(function(e){return d.createElement(iS,Object.assign({id:r},e))}))}function cS(e){var t=e.presentations,n=e.currentPresentation,r=e.setCurrentPresentation,o=e.label,i=function(e){var n=function(e,t){return Oo(t.filter((function(t){return t.id.toString()===e.toString()})))}(e,t);r(n)};return d.useEffect((function(){t&&!n&&r(t[0])}),[t]),d.createElement(d.Fragment,null,!!n&&d.createElement(d.Fragment,null,d.createElement(Ws.Form.Label,null,o),d.createElement(Ws.Form.Control,{as:"select",value:n.id,onChange:function(e){return i(e.target.value)},className:"cursor-pointer"},t.map((function(e){return d.createElement("option",{value:e.id,key:e.id},e.name)})))))}function sS(e){return d.createElement(d.Fragment,null,d.createElement("h4",null,"".concat(fd(e.memberType))),d.createElement(Ws.Table,{responsive:!0},d.createElement("tbody",null,e.objects&&e.objects.map((function(t){return d.createElement("tr",{key:t.id},d.createElement("td",null,d.createElement(Up,{appLink:Tb.getMemberAppLink(e.memberType,t.id)},t.name)))})))),d.createElement(SS,{initialValues:{subjectIds:[],addToClassifications:!0},subjectTree:e.subjectTree,saveSubjects:e.onClickAddToSubject,memberType:e.memberType,saveBtnText:"Add to subject",subjectRequired:!0}))}function uS(e){return function(e){if(Array.isArray(e))return lS(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return lS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lS(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fS(e){var t=Tb.singularizeMemberType(e.memberType),n=[].concat(uS(e.objectClassifications),uS(e.objectSubjectClassifications)).map((function(e){return e.id}));return d.createElement(d.Fragment,null,d.createElement("div",{className:"border-bottom pb-3 mb-3"},d.createElement("h6",null,"Subjects"),d.createElement("p",null,"Select which subjects this ".concat(t," is mapped to.")),d.createElement(SS,{initialValues:{subjectIds:e.objectSubjects.map((function(e){return e.id}))},subjectTree:e.subjectTree,saveSubjects:e.saveSubjects,memberType:e.memberType,saveBtnText:"Save Subjects",allowMultiple:!0})),d.createElement("h6",null,"Classifications"),d.createElement("p",null,"Select a presentation to view its classifications and map them to this ".concat(t,".")),d.createElement("div",{className:"w-50 pb-3"},d.createElement(cS,{presentations:e.presentations,currentPresentation:e.currentPresentation,setCurrentPresentation:e.setCurrentPresentation})),e.currentPresentation&&e.classificationTree&&e.classificationTree.children.length?d.createElement(d.Fragment,null,d.createElement("p",null,"Only classifications which are mapped to one of the subjects selected above can be selected."),d.createElement(eS,{initialValues:{classificationIds:e.objectClassifications.map((function(e){return e.id}))},presentationId:e.currentPresentation.id,classificationTree:e.classificationTree,saveClassifications:e.saveClassifications,isClassificationDisabled:function(e){return!n.includes(e.id)}})):d.createElement("p",null,"This presentation has no classifications."))}function pS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return dS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}cS.defaultProps={label:"Presentation"};function mS(e){var t=!e.id,n=_s(),r=au(n),o=!t||!!n.values.parentId,i=pS(d.useState(o),2),c=i[0],s=i[1];d.useEffect((function(){return s(o)}),[e.id,n.values.parentId]);var u=function(e){var t=e.id===n.values.parentId?null:e.id;n.setFieldValue("parentId",t)},f="".concat(Zs(n.errors,n.touched,"parentId")," h-auto py-2");return d.createElement(Vs,null,d.createElement(ru,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this subject",autoFocus:!0}),d.createElement(ru,{name:"parentId"},(function(){return d.createElement("div",{className:f},d.createElement(Ym,{label:"Parent Subject",tree:e.subjectTree,selectedIds:[n.values.parentId],onSelect:u,collapse:c,noSelectionMessage:"No parent selected, this will be a root subject.",isNodeDisabled:(t=e.subjectTree,r=e.id,function(e){if(e.id===r)return!0;var n=md.find(t,r);return!!md.find(n,e.id)})}));var t,r})),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(lu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&d.createElement(Ws.Button,{as:Up,variant:"danger",appLink:{application:l.SUBJECTS,action:a.Subjects.DELETE_SUBJECT,args:[e.id]}},"Delete")))}function hS(e){return d.createElement(Ks,{initialValues:e.subject,validationSchema:Ib,onSubmit:e.saveSubject},d.createElement(mS,{id:e.subject&&e.subject.id,subjectTree:e.subjectTree}))}var yS=function(e){return function(t){return t.appLink.action===e}};function vS(e){var t=e.subjectId,n=e.activeAction;return d.createElement(d.Fragment,null,d.createElement(Ws.Alert,{variant:"danger"},"Warning: You are editing the backbone subjects."),d.createElement("div",{className:"py-2"},d.createElement(Rm,{tabs:_b(t),isItemActive:yS(n)})))}var bS=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[e]}};function gS(e){var t=_s(),n=au(t),r=function(n){var r=e.allowMultiple?Io(t.values.subjectIds.map((function(e){return e.toString()})),n.id.toString()):[n.id];t.setFieldValue("subjectIds",r)},o=Tb.singularizeMemberType(e.memberType),i="".concat(Zs(t.errors,t.touched,"subjectIds")," h-auto py-2");return d.createElement(Vs,null,d.createElement(ru,{name:"subjectIds"},(function(){return d.createElement("div",{className:i},d.createElement(Ym,{label:"Mapped Subject".concat(e.allowMultiple?"(s)":""),tree:e.subjectTree,selectedIds:t.values.subjectIds,onSelect:r,collapse:!!t.initialValues.subjectIds.length,getSelectedItemAppLink:bS}))})),d.createElement(ru,{label:"Automatically add to classifications*",name:"addToClassifications",id:"add-to-classifications",type:"checkbox",checked:t.values.addToClassifications}),d.createElement("p",null,d.createElement("em",null,"*If selected, when adding a ".concat(o," to a subject, all of that subject's")+" mapped classifications across all presentations will also be added to.")),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(lu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.saveBtnText)))}function SS(e){var t;return d.createElement(Ks,{initialValues:e.initialValues,validationSchema:(t=e.subjectRequired,Ys.object().shape({subjectIds:t?Ys.array().of(Ys.string()).min(1,"A subject is required").required("A subject is required"):Ys.array().of(Ys.string()),addToClassifications:Ys.boolean().default(!0)}).noUnknown()),onSubmit:function(t,n){var r=t.subjectIds,o=t.addToClassifications;return e.saveSubjects(r,o,n)}},d.createElement(gS,{subjectTree:e.subjectTree,memberType:e.memberType,allowMultiple:e.allowMultiple,saveBtnText:e.saveBtnText}))}gS.defaultProps={saveBtnText:"Save"};var ES=function(e){return d.createElement("div",{className:"border rounded p-2 mb-3"},d.createElement("h6",{className:"border-bottom pb-1"},e.presentation.name),e.classifications&&e.classifications.length?d.createElement("ul",{className:"list-unstyled mb-0"},e.classifications.map((function(t){return d.createElement("li",{key:t.id,className:"py-1"},d.createElement(Up,{appLink:(n=e.presentation.id,r=t.id,{application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[n,r]})},t.name));var n,r}))):d.createElement("p",null,d.createElement("em",null,"There are no classifications mapped to this subject in this presentation.")))},OS=function(e){return d.createElement(d.Fragment,null,!!e.presentations&&!!e.classificationDictionary&&e.presentations.map((function(t){return d.createElement(ES,{key:t.id,presentation:t,classifications:e.classificationDictionary[t.id]})})))},jS=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function CS(e){return d.createElement(d.Fragment,null,e.classifications.map((function(t){return d.createElement("th",{key:t.id},d.createElement("span",{className:"d-inline-block"},d.createElement(Hp,{selected:e.getIsClassificationSelected(t),onToggle:function(n){return e.onToggleClassification(t.id,n)}})),d.createElement(Up,{appLink:e.getClassificationAppLink(t.id)},function(e,t){return t?e.name:"Classification: ".concat(e.name)}(t,e.showClassificationSubHeader)))})))}function wS(e){var t=e.memberType,n=e.hasActions,r=e.classifications,o=jS(e,["memberType","hasActions","classifications"]),i="".concat(fd(Tb.singularizeMemberType(t))," Name"),a=!!r&&!!r.length,c=a&&r.length>1,s=a?2:1,u=Object.assign({classifications:r,showClassificationSubHeader:c},o);return d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",{rowSpan:s},i),a&&(c?d.createElement("th",{colSpan:r.length,className:"text-center"},"Classifications"):d.createElement(CS,Object.assign({},u))),n&&d.createElement("th",{rowSpan:s})),a&&c&&d.createElement("tr",null,d.createElement(CS,Object.assign({},u))))}function AS(e){var t=e.member,n=t.id,o=t.name,i=t.classifications,a=void 0===i?[]:i,c=e.getMemberAppLink,s=e.onToggleClassification,u=e.actions,l=hn(c)&&c(n);return a.length&&!hn(s)&&r.ErrorHelper.throw(new Xe("onToggleClassification must be passed to SubjectMemberItem")),d.createElement("tr",null,d.createElement("td",null,l?d.createElement(Up,{appLink:c(n)},o):o),!!a.length&&a.map((function(e){return d.createElement("td",{key:e.id},d.createElement(Hp,{selected:e.selected,onToggle:function(t){return s(e.id,t,n)}}))})),u&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(km,{actions:u}))))}var IS=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function TS(e,t){return function(n){var r=n[e],o=Zm(r);return!!o&&o===t.length}}function kS(e){var t=e.members,n=e.memberType,r=e.getActions,o=e.classifications,i=e.getClassificationAppLink,a=e.onToggleClassification,c=IS(e,["members","memberType","getActions","classifications","getClassificationAppLink","onToggleClassification"]);if(!t.length)return d.createElement("div",{className:"py-5"},"No ".concat(n," in this subject."));var s=hn(r),u={memberType:n,classifications:o,getClassificationAppLink:i,getIsClassificationSelected:TS(n,t),onToggleClassification:a,hasActions:s};return d.createElement(Ws.Table,{responsive:!0,bordered:!0},d.createElement(wS,Object.assign({},u)),d.createElement("tbody",null,t.map((function(e,t){return d.createElement(AS,Object.assign({key:t,member:e,actions:s&&r(e.id),onToggleClassification:a},c))}))))}function _S(e){var t=e.navItems,n=e.currentAppLink;return d.createElement(Ws.Container,null,d.createElement(Ws.Navbar,{className:"justify-content-between align-items-center"},d.createElement(Ws.Nav,null,!!t&&t.map((function(e,t){return d.createElement(Ws.Nav.Item,{key:t},d.createElement(Up,{appLink:e.appLink,className:"nav-link".concat(sd.isItemActive(e,n)?" text-primary":"")},e.label))})))))}function LS(e,t){d.useEffect((function(){e.presentations&&!e.currentPresentation&&Sb(t,"currentPresentation")(Oo(e.presentations))}),[e.presentations])}function xS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return PS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NS(e){var t=o.useBasicFetch(Vv(e.playlistId)),n=o.useBasicFetch(Zv),r=xS(d.useState({}),2),i=r[0],c=r[1],s=Iv(p.SUBJECT);!function(e,t,n){var r=function(e){return Sb(n,e)};lb([Tg.getObjectLevelsFetchOptions(e,vb.Playlists,r("playlistLevels"))],[e]),hb(Tg.getObjectAudiencesFetchOptions(e,vb.Playlists,r("playlistAudiences")),[e,t.playlistLevels]),lb([Tg.getPresentationsFetchOptions(r("presentations")),Tg.getLevelsFetchOptions(r("levels"))],[]),hb(!!t.currentPresentation&&Tg.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.playlistId,i,c),LS(i,c);var u=!!(i.presentations&&i.levels&&i.presentationAudiences&&i.playlistLevels&&i.playlistAudiences);return d.createElement(d.Fragment,null,!!n.data&&d.createElement(nb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST_AUDIENCES,currentUser:n.data}),d.createElement(_m,{object:t.data}),!!u&&d.createElement(Mg,{objectLevels:i.playlistLevels,objectAudiences:i.playlistAudiences,presentations:i.presentations,currentPresentation:i.currentPresentation,setCurrentPresentation:Sb(c,"currentPresentation"),levels:i.levels,presentationAudiences:i.presentationAudiences,memberType:vb.Playlists,saveLevels:function(t,n,r){return s.updateObjectLevels(e.playlistId,t,vb.Playlists,n,r,r)},saveAudiences:function(t,n){return s.updateObjectAudiences(e.playlistId,i.currentPresentation.id,t,vb.Playlists,n,n)}}))}function RS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||MS(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function DS(e){return function(e){if(Array.isArray(e))return US(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||MS(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function MS(e,t){if(e){if("string"==typeof e)return US(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?US(e,t):void 0}}function US(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function FS(e){var t=o.useBasicFetch(Vv(e.playlistId)),n=o.useBasicFetch(Zv),r=RS(d.useState({}),2),i=r[0],c=r[1],s=Iv(p.SUBJECT);!function(e,t,n){var r=function(e){return Sb(n,e)};lb([Tg.getSubjectTreeFetchOptions(r("subjectTree")),Tg.getPresentationsFetchOptions(r("presentations"))],[]),lb([Tg.getObjectSubjectsFetchOptions(e,vb.Playlists,r("playlistSubjects"))],[e]),hb(!!t.currentPresentation&&Tg.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),d.useEffect((function(){return r("subjectClassifications")([])}),[t.playlistSubjects]);var o=function(e,t){return[].concat(DS(t.subjectClassifications||[]),DS(e))},i=t.playlistSubjects&&t.playlistSubjects.map((function(e){return Tg.getSubjectClassificationFetchOptions(e.id,Sb(n,"subjectClassifications",o))}));lb(i,[t.playlistSubjects],!!i),hb(Tg.getObjectClassificationsFetchOptions(e,vb.Playlists,r("playlistClassifications")),[e,t.playlistSubjects])}(e.playlistId,i,c),LS(i,c);var u=!!(i.playlistSubjects&&i.subjectTree&&i.presentations&&i.classificationTree&&i.playlistClassifications&&i.subjectClassifications);return d.createElement(d.Fragment,null,!!n.data&&d.createElement(nb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST_SUBJECTS,currentUser:n.data}),d.createElement(_m,{object:t.data}),u&&d.createElement(fS,{objectSubjects:i.playlistSubjects,subjectTree:i.subjectTree,memberType:vb.Playlists,presentations:i.presentations,currentPresentation:i.currentPresentation,setCurrentPresentation:Sb(c,"currentPresentation"),objectClassifications:i.playlistClassifications,objectSubjectClassifications:i.subjectClassifications,classificationTree:i.classificationTree,saveSubjects:function(t,n,r){return s.updateObjectSubjects(e.playlistId,t,vb.Playlists,n,r,r)},saveClassifications:function(t,n){return s.updateObjectClassifications(e.playlistId,i.currentPresentation.id,t,vb.Playlists,n,n)}}))}var VS=function(e,t,n){if(t===n)return{reorderedItems:e,reorderRequest:null};var r=Co(e,t,n),o=n<e.length-1?r[n+1].id:null;return{reorderedItems:r,reorderRequest:{sourceMemberId:r[n].id,destinationMemberId:o}}};function zS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return BS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return BS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function BS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function HS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var JS=function(e){return{application:l.VIDEOS,action:a.Videos.EDIT_VIDEO,args:[e.id]}};function $S(e){var t,n,r,i,c,s,u=Object(bn.useDispatch)(),f=xv(),p=o.useBasicFetch(Vv(e.playlistId)),m=o.useBasicFetch(Jv(e.playlistId)),h=o.useBasicFetch(Zv),y=HS((n=null===(t=m.data)||void 0===t?void 0:t.data,r=zS(Object(d.useState)(),2),i=r[0],c=r[1],Object(d.useEffect)((function(){i&&(n.length!==i.length||function(e,t){var n=!0;if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r].id!==t[r].id){n=!1;break}return n}(n,i))&&c(null)}),[n]),[i,c]),2),v=y[0],b=y[1],g=v?{data:v,pagination:null}:m.data;return d.createElement(d.Fragment,null,!!h.data&&d.createElement(nb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST_VIDEOS,currentUser:h.data}),d.createElement(_m,{object:p.data}),!!g&&d.createElement(lh,{onSortEnd:function(t,n){if(t!==n){var r=VS(m.data.data,t,n),i=r.reorderRequest,a=r.reorderedItems;b(a);o.fetch(u,$v(e.playlistId,i,null,(function(){f.error("Failed to update playlist order."),b(null)})))}},videos:g,getVideoAppLink:JS,getVideoActions:(s=e.playlistId,function(e){return[{label:"Remove video",appLink:{application:l.PLAYLISTS,action:a.Playlists.REMOVE_VIDEO,args:[s.toString(),e.id.toString()]},className:"text-danger"}]}),emptyMessage:"There are no videos in this playlist."}))}function KS(){var e=Object(bn.useDispatch)(),t=xv(),n=o.useBasicFetch(Zv);return d.createElement(d.Fragment,null,!!n.data&&d.createElement(tb,{savePlaylist:function(i,c){o.fetch(e,Bv(i,n.data.id,(function(e){t.success("Successfully created playlist."),function(e){e&&e.id&&r.AppLinkHelper.trigger({application:l.PLAYLISTS,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]})}(e)}),(function(){t.error("Failed to create playlist.")}),c))}}))}var YS="rating,thumbnail,glance,herobanner",GS=function(e){return{url:"/api/master/v2/objects/".concat(e,"?query=").concat(YS),key:"videos:".concat(e)}},WS=function(e){var t=e.slice().sort();return{key:"videos:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},ZS=function(e){return{url:"/ajax/hostedlibraries/rightsline/programs/".concat(e),key:"rightsline:videos:".concat(e),normalizeOptions:{namespace:"rightsline"}}},QS=function(e,t,n,r,o){return{key:"videos:".concat(e),url:"/api/master/v2/objects/".concat(e),data:t,type:jr.PUT,success:n,error:r,always:o}};function XS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tE(e){var t=Object(bn.useDispatch)(),n=xv(),r=o.useBasicFetch(Vv(e.playlistId)),i=o.useBasicFetch(GS(e.videoId)),a=XS(d.useState(!1),2),c=a[0],s=a[1];var u=!!r.data&&!!i.data;return d.createElement(Zh,{title:"Remove Video",closePopup:e.closePopup,showLoadingSpinner:!u},!!u&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,i.data.name)," from ",d.createElement("strong",null,r.data.name),"?")),d.createElement(ty,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){s(!0),o.fetch(t,Kv(e.playlistId,e.videoId,(function(){n.success("Successfully removed video from playlist")}),(function(){n.error("Failed to remove video from playlist")}),e.closePopup))},buttonText:"Yes, remove video",isSpinnerButton:!0,showSpinner:c}]})))}function nE(e){return r.AppLinkHelper.trigger(function(e){return{application:l.PLAYLISTS,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]}}(e))}function rE(e){var t=e?{application:l.PLAYLISTS,action:a.Playlists.SEARCH_PLAYLISTS,params:{query:e}}:{application:l.PLAYLISTS,action:a.Playlists.PLAYLISTS};r.AppLinkHelper.trigger(t)}function oE(e){return d.createElement("div",{className:"pb-3 w-50"},d.createElement(Mp,{initialQuery:e.query,placeholder:"Search for a playlist",onSuggestionSelected:nE,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/playlists/instant/raw","?query=").concat(e)},activationLength:2,onSubmit:rE}))}var iE=l.PLAYLISTS,aE=function(e){return{application:iE,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]}};function cE(e){var t=o.useBasicFetch(Uv(e.cursor));return d.createElement(d.Fragment,null,d.createElement(oE,null),d.createElement(Em,{collection:t&&t.data,collectionAppLink:{application:iE,action:a.Playlists.PLAYLISTS},newObjectAppLink:{application:iE,action:a.Playlists.NEW_PLAYLIST},getObjectAppLink:aE,objectName:"Playlist"}))}var sE=l.PLAYLISTS,uE=function(e){return{application:sE,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]}};function lE(e){var t=o.useBasicFetch(Fv(e.query,e.cursor));return d.createElement(d.Fragment,null,d.createElement(oE,{query:e.query}),!!t.data&&(t.data.data.length?d.createElement(Em,{collection:t.data,collectionAppLink:{application:sE,action:a.Playlists.SEARCH_PLAYLISTS,params:{query:e.query}},newObjectAppLink:{application:sE,action:a.Playlists.NEW_PLAYLIST},getObjectAppLink:uE,objectName:"Playlist"}):d.createElement("p",null,"No playlists found, please try a different search query.")))}function fE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var dE=function(e,t,n){return[{variant:"link",onClick:t,buttonText:"Cancel"},{variant:"danger",onClick:e,buttonText:"Yes, delete this audience",isSpinnerButton:!0,showSpinner:n}]};function mE(e){var t=e.id,n=e.routeToOnDelete,o=e.closePopup,i=fE(d.useState(),2),a=i[0],c=i[1],s=fE(d.useState(!1),2),u=s[0],l=s[1],f=Iv(p.SUBJECT);hb(Tg.getAudienceFetchOptions(t,c),[t]);return d.createElement(Zh,{title:"Delete Audience",closePopup:o,showLoadingSpinner:!a},!!a&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,a.name),"?")),d.createElement(ty,{buttons:dE((function(){l(!0);f.deleteAudience(t,(function(){o(),n&&r.AppLinkHelper.trigger(n)}),o)}),o,u)})))}function hE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var vE=function(e){return{application:l.SUBJECTS,action:a.Subjects.PRESENTATION_AUDIENCES,args:[e]}};function bE(e){var t=e.presentationId,n=e.audienceId,r=hE(d.useState(),2),o=r[0],i=r[1],a=hE(d.useState(),2),c=a[0],s=a[1],u=hE(d.useState(),2),l=u[0],f=u[1],m=Iv(p.SUBJECT);hb(Tg.getAudienceFetchOptions(n,i),[n]),hb(Tg.getLevelsFetchOptions(s),[]),hb(Tg.getPresentationFetchOptions(t,f),[t]);return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3"},d.createElement(Fp,{appLink:vE(t),backToName:"audiences"})),!!l&&d.createElement("h6",null,"Presentation: ".concat(l.name)),!!o&&!!c&&d.createElement(Rg,{audience:o,levels:c,saveAudience:function(e,r){return m.updateAudience(n,Object.assign(Object.assign({},e),{presentationId:t}),r,r)},presentationId:t}))}function gE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return SE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return SE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function SE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var EE=function(e){return function(t){return{application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[e,t.masterId]}}},OE=function(e){return{application:l.SUBJECTS,action:a.Subjects.NEW_AUDIENCE,args:[e]}},jE={application:l.SUBJECTS,action:a.Subjects.AUDIENCES};function CE(e){var t=e.presentationId,n=gE(d.useState(),2),r=n[0],o=n[1];return hb(Tg.getAudiencesFetchOptions(t,o),[]),d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3"},d.createElement(Fp,{appLink:jE,backToName:"presentations"})),d.createElement("div",{className:"d-flex justify-content-between mb-2"},d.createElement("h5",{className:"d-inline-block m-0"},"Select an audience to edit:"),d.createElement(Up,{appLink:OE(t),className:"d-block"},d.createElement(_p,{svgName:Ap.Plus,size:kp.Small}),d.createElement("span",null,"New Audience"))),d.createElement(Pm,{objects:r,getAppLink:EE(e.presentationId),emptyMessage:"There are no audiences in this presentation yet. Click '+ New Audience' to create one."}))}function wE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return AE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return AE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function AE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var IE=function(e){return{application:l.SUBJECTS,action:a.Subjects.PRESENTATION_AUDIENCES,args:[e]}};function TE(e){var t=e.presentationId,n=wE(d.useState(),2),o=n[0],i=n[1],c=wE(d.useState(),2),s=c[0],u=c[1],f=Iv(p.SUBJECT);hb(Tg.getLevelsFetchOptions(i),[]),hb(Tg.getPresentationFetchOptions(t,u),[t]);return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-2"},d.createElement(Fp,{appLink:IE(t),backToName:"audiences"})),!!s&&d.createElement("h6",null,"Presentation: ".concat(s.name)),!!o&&d.createElement(Rg,{levels:o,presentationId:t,saveAudience:function(e,n){return f.createAudience(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[e,n.masterId]})}}(t,n),n)}}))}function kE(e){return{application:l.SUBJECTS,action:a.Subjects.NEW_CLASSIFICATION,args:[e]}}function _E(e){return[{label:"Add child",getAppLink:function(t){return Object.assign(Object.assign({},kE(e)),{args:[e],params:{parentId:t.id}})}},{label:"Delete classification",getAppLink:function(t){return{application:l.SUBJECTS,action:a.Subjects.DELETE_CLASSIFICATION,args:[e,t.id]}},className:"text-danger"}]}var LE=n(133),xE=n.n(LE);function PE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return NE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return NE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function NE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function RE(e){var t=e.presentationId,n=e.selectedClassificationId,r=PE(d.useState(),2),o=r[0],i=r[1],c=PE(d.useState(),2),s=c[0],u=c[1];return function(e,t,n){lb([Tg.getClassificationTreeFetchOptions(e,t),Tg.getPresentationFetchOptions(e,n)],[e])}(t,i,u),d.createElement("div",{className:"".concat(xE.a.navContainer," h-auto pr-2 border-right")},!!s&&d.createElement("h6",{className:"border-bottom pb-2"},"Classifications (".concat(s.name,")")),d.createElement(Up,{appLink:kE(t),className:"d-inline-block pb-2"},d.createElement(_p,{svgName:Ap.Plus,size:kp.Small}),d.createElement("span",null,"New Classification")),!!o&&d.createElement("div",{className:"border-top pt-1"},d.createElement(Hm,{tree:o,getAppLink:function(e){return function(e,t){return{application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[e,t.id]}}(t,e)},selectedIds:[n],actions:_E(t)})))}function DE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ME(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ME(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ME(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function UE(e){var t=e.classificationId,n=e.routeToOnDelete,o=e.closePopup,i=DE(d.useState(),2),a=i[0],c=i[1],s=DE(d.useState(!1),2),u=s[0],l=s[1];hb(Tg.getClassificationFetchOptions(t,c),[]);var f=Iv(p.SUBJECT),m=[{variant:"link",onClick:o,buttonText:"Cancel"},{variant:"danger",onClick:function(){l(!0);f.deleteClassification(t,(function(){o(),n&&r.AppLinkHelper.trigger(n)}),o)},buttonText:"Yes, delete this classification",isSpinnerButton:!0,showSpinner:u}];return d.createElement(Zh,{title:"Delete Classification",closePopup:o,showLoadingSpinner:!a},!!a&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,a.name),"?")),d.createElement(ty,{buttons:m})))}function FE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return VE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function VE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zE(e){var t=e.presentationId,n=e.classificationId,r=FE(d.useState(),2),o=r[0],i=r[1],a=FE(d.useState(),2),c=a[0],s=a[1],u=FE(d.useState(),2),l=u[0],f=u[1],m=FE(d.useState(),2),h=m[0],y=m[1],v=Iv(p.SUBJECT),b=Tg.getClassificationFetchOptions(n,i),g=Tg.getPresentationFetchOptions(t,s),S=Tg.getClassificationTreeFetchOptions(t,f);hb(Tg.getSubjectTreeFetchOptions(y),[]),hb(b,[n]),lb([g,S],[t]);return d.createElement("div",null,d.createElement(Qg,{presentation:c,classificationId:n}),!!o&&!!l&&!!h&&d.createElement(Wg,{classification:o,presentationId:t,subjectTree:h,classificationTree:l,saveClassification:function(e,t){return v.updateClassification(n,e,t,t)}}))}function BE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return HE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function HE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qE(e){var t=e.presentationId,n=e.classificationId,r=e.memberType,o=BE(d.useState(),2),i=o[0],a=o[1],c=BE(d.useState(),2),s=c[0],u=c[1],l=BE(d.useState(),2),f=l[0],m=l[1];hb(Tg.getPresentationFetchOptions(t,a),[]),hb(Tg.getClassificationFetchOptions(n,u),[n]),hb(Tg.getClassificationMembersFetchOptions(n,r,m),[n,r]);var h=Iv(p.SUBJECT),y={items:f&&f.data,memberType:r,classification:s,updatePinnedVideo:function(e,t){var r=Object.assign(Object.assign({},s),{pinnedVideoMasterId:e});h.updateClassification(n,r,t)},getItemAppLink:function(e){return Tb.getMemberAppLink(r,e.id)},getActions:function(e){return Tb.getMemberActions(n,yb.Classification,r,e.id)}},v={presentation:i,classificationId:n},b=ud(y);return d.createElement(d.Fragment,null,d.createElement(Qg,Object.assign({},v,{memberType:r})),b&&d.createElement(Jg,Object.assign({},y)))}function JE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return $E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $E(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function KE(e){var t=e.presentationId,n=e.parentId,o=JE(d.useState(),2),i=o[0],c=o[1],s=JE(d.useState(),2),u=s[0],f=s[1],m=Iv(p.SUBJECT),h=Tg.getClassificationTreeFetchOptions(t,c);hb(Tg.getSubjectTreeFetchOptions(f),[]),hb(h,[t]);return d.createElement("div",null,d.createElement("h4",{className:"py-2"},"Create New Classification"),!!u&&!!i&&d.createElement(Wg,{classification:n?{parentIds:[n]}:{},presentationId:t,subjectTree:u,classificationTree:i,saveClassification:function(e,n){return m.createClassification(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),n&&n.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]})}}(t,n),n)}}))}var YE=function(e){return{key:"series:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=thumbnail,tallPoster,banner,rating")}},GE=function(e){var t=e.slice().sort();return{key:"series:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},WE=function(e,t,n,r){return{url:"/api/master/v2/series",key:"series",data:e,type:jr.POST,success:t,error:n,always:r}},ZE=function(e,t,n,r,o){return{url:"/api/master/v2/objects/".concat(e),key:"update:series:".concat(e),data:t,type:jr.PUT,success:n,error:r,always:o}};function QE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return XE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return XE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function XE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eO(e){var t=QE(d.useState(),2),n=t[0],r=t[1],i=QE(d.useState(!1),2),a=i[0],c=i[1],s=o.useBasicFetch(function(e,t){switch(e){case vb.Playlists:return Vv(t);case vb.Series:return YE(t);case vb.Videos:return GS(t)}}(e.memberType,e.memberId)),u=Iv(p.SUBJECT);hb(Tg.getClassificationFetchOptions(e.classificationId,r),[e.classificationId]);var l=!!n&&!!s.data,f="Remove ".concat(fd(Tb.singularizeMemberType(e.memberType)));return d.createElement(Zh,{title:f,closePopup:e.closePopup,showLoadingSpinner:!l},l&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,s.data.name)," from ",d.createElement("strong",null,n.name),"?"),d.createElement("p",null,"This will not remove it from the backbone subject.")),d.createElement(ty,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),u.removeObjectsFromClassification(e.classificationId,[e.memberId],e.memberType,null,null,e.closePopup,e.closePopup),n.pinnedVideoMasterId===e.memberId&&u.updateClassification(e.classificationId,Object.assign(Object.assign({},n),{pinnedVideoMasterId:null}))},buttonText:"Yes, remove this ".concat(Tb.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function tO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rO(e){var t=e.id,n=tO(d.useState(),2),r=n[0],o=n[1],i=Iv(p.SUBJECT);hb(Tg.getLevelFetchOptions(t,o),[t]);return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Edit Level"),!!r&&d.createElement(nS,{level:r,saveLevel:function(e,n){return i.updateLevel(t,e,n,n)}}))}function oO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return iO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var aO=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[e.id]}},cO={application:l.SUBJECTS,action:a.Subjects.NEW_LEVEL};function sO(){var e=oO(d.useState(),2),t=e[0],n=e[1];return hb(Tg.getLevelsFetchOptions(n),[]),d.createElement("div",null,d.createElement("div",{className:"d-flex justify-content-between mb-2"},d.createElement("h5",{className:"d-inline-block m-0"},"Select a level to edit:"),d.createElement(Up,{appLink:cO,className:"d-block"},d.createElement(_p,{svgName:Ap.Plus,size:kp.Small}),d.createElement("span",null,"New Level"))),d.createElement(Pm,{objects:t,getAppLink:aO}))}function uO(){var e=Iv(p.SUBJECT);return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Create New Level"),d.createElement(nS,{saveLevel:function(t,n){return e.createLevel(t,function(e){return function(t){e(),t&&t.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[t.id]})}}(n),n)}}))}function lO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pO(e){var t=e.id,n=lO(d.useState(),2),r=n[0],o=n[1],i=Iv(p.SUBJECT);hb(Tg.getPresentationFetchOptions(t,o),[t]);var a={presentation:r,savePresentation:function(e,n){var r=n.setSubmitting;return i.updatePresentation(t,e,(function(){return r(!1)}),(function(){return r(!1)}))}},c=ud(a);return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Edit Presentation"),!!c&&d.createElement(aS,Object.assign({},a)))}function dO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return mO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var hO=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_PRESENTATION,args:[e.id]}},yO={application:l.SUBJECTS,action:a.Subjects.NEW_PRESENTATION};function vO(){var e=dO(d.useState(),2),t=e[0],n=e[1];return hb(Tg.getPresentationsFetchOptions(n),[]),d.createElement("div",null,d.createElement("div",{className:"d-flex justify-content-between mb-2"},d.createElement("h5",{className:"d-inline-block m-0"},"Select a presentation to edit:"),d.createElement(Up,{appLink:yO,className:"d-block"},d.createElement(_p,{svgName:Ap.Plus,size:kp.Small}),d.createElement("span",null,"New Presentation"))),d.createElement(Pm,{objects:t,getAppLink:hO}))}function bO(){var e=Iv(p.SUBJECT);return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Create New Presentation"),d.createElement(aS,{savePresentation:function(t,n){var o=n.setSubmitting;e.createPresentation(t,(function(e){return function(e,t){t(!1),e&&e.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_PRESENTATION,args:[e.id]})}(e,o)}),(function(){return o(!1)}))}}))}function gO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return SO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return SO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function SO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function EO(e){var t=e.objectType,n=e.getAppLink,r=gO(d.useState(),2),o=r[0],i=r[1];return hb(Tg.getPresentationsFetchOptions(i),[]),d.createElement("div",null,d.createElement("h5",null,d.createElement(Cu,{namespace:"subjects.selectPresentation",phrase:"heading",options:{objectType:t}})),d.createElement(Pm,{objects:o,getAppLink:n}))}function OO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return jO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function CO(e){var t=e.title,n=e.onClickConfirm,r=e.confirmButtonText,o=e.cancelButtonText,i=e.closePopup,a=OO(d.useState(!1),2),c=a[0],s=a[1],u=[{variant:"link",onClick:i,buttonText:o},{variant:"primary",onClick:function(){s(!0),n()},buttonText:r,isSpinnerButton:!0,showSpinner:c}];return d.createElement(Zh,{title:t,closePopup:i},d.createElement(d.Fragment,null,e.children,d.createElement(ty,{buttons:u})))}function wO(e,t){return Sb(e,t)}function AO(e,t,n,o,i){var c=o.selectedSubject,s=function(){return wO(i,"showConfirmationPopup")(!1)};t.addObjectsToSubject(c.id,e.map((function(e){return e.id})),n.memberType,o.addToClassifications,(function(){s(),r.AppLinkHelper.trigger(function(e,t){var n={application:l.SUBJECTS,args:[e]};switch(t){case vb.Playlists:return Object.assign(Object.assign({},n),{action:a.Subjects.EDIT_SUBJECT_PLAYLISTS});case vb.Series:return Object.assign(Object.assign({},n),{action:a.Subjects.EDIT_SUBJECT_SERIES});case vb.Videos:return Object.assign(Object.assign({},n),{action:a.Subjects.EDIT_SUBJECT_VIDEOS})}}(c.id,n.memberType))}),s)}function IO(e,t,n){if(t&&n){var r=1===t.length?"this ".concat(Tb.singularizeMemberType(e)):"these ".concat(e);return"Add ".concat(r," to ").concat(n.name)}}function TO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return kO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _O(e,t){return function(n,r,o){o(),wO(t,"selectedSubject")(md.find(e.subjectTree,Oo(n))),wO(t,"addToClassifications")(r),wO(t,"showConfirmationPopup")(!0)}}function LO(e){var t=TO(d.useState({}),2),n=t[0],r=t[1],i=o.useBasicFetch(function(e,t){switch(e){case vb.Playlists:return zv(t);case vb.Series:return GE(t);case vb.Videos:return WS(t)}}(e.memberType,e.objectIds)),a=Iv(p.SUBJECT);!function(e,t){e.memberType,e.objectIds,hb(Tg.getSubjectTreeFetchOptions(wO(t,"subjectTree")),[])}(e,r);var c;return d.createElement(d.Fragment,null,!!i.data&&!!n.subjectTree&&d.createElement(sS,{memberType:e.memberType,objects:i.data,subjectTree:n.subjectTree,onClickAddToSubject:_O(n,r)}),n.showConfirmationPopup&&d.createElement(CO,{title:IO(e.memberType,i.data,n.selectedSubject),onClickConfirm:function(){return AO(i.data,a,e,n,r)},closePopup:function(){return e=!1,wO(r,"showConfirmationPopup")(e);var e}},d.createElement("p",null,"The following ".concat(e.memberType," will be added to "),d.createElement("strong",null,n.selectedSubject.name),n.addToClassifications?" and its mapped classifications:":":"),d.createElement("ul",null,i.data.map((function(e){return d.createElement("li",{key:e.id},e.name)}))),!n.addToClassifications&&d.createElement("p",null,"".concat(1===i.data.length?"It":"They"," will not be added to its mapped classifications.")),d.createElement("p",null,"".concat((c=e.memberType,fd(Tb.singularizeMemberType(c)))," to classification mappings can be managed from the "),d.createElement("strong",null,"Edit Subject ".concat(fd(e.memberType)," ")),"page.")))}function xO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return PO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NO(e){var t=e.subjectId,n=e.routeToOnDelete,o=e.closePopup,i=xO(d.useState(),2),a=i[0],c=i[1],s=xO(d.useState(!1),2),u=s[0],l=s[1];hb(Tg.getSubjectFetchOptions(t,c),[]);var f=Iv(p.SUBJECT),m=[{variant:"link",onClick:o,buttonText:"Cancel"},{variant:"danger",onClick:function(){l(!0);f.deleteSubject(t,(function(){o(),n&&r.AppLinkHelper.trigger(n)}),o)},buttonText:"Yes, delete this subject",isSpinnerButton:!0,showSpinner:u}];return d.createElement(Zh,{title:"Delete Subject",closePopup:o,showLoadingSpinner:!a},!!a&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,a.name),"?"),d.createElement("p",null,"Subjects that have mapped classifications cannot be deleted.")),d.createElement(ty,{buttons:m})))}function RO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return DO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function DO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function MO(e){var t=e.subjectId,n=RO(d.useState(),2),r=n[0],o=n[1],i=RO(d.useState(),2),c=i[0],s=i[1],u=Iv(p.SUBJECT),l=Tg.getSubjectFetchOptions(t,o);hb(Tg.getSubjectTreeFetchOptions(s),[]),hb(l,[t]);return d.createElement(d.Fragment,null,d.createElement(vS,{subjectId:t,activeAction:a.Subjects.EDIT_SUBJECT}),!!r&&!!c&&d.createElement(hS,{subject:r,subjectTree:c,saveSubject:function(e,n){return u.updateSubject(t,e,n,n)}}))}function UO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return FO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return FO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function FO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}CO.defaultProps={confirmButtonText:"Confirm",cancelButtonText:"Cancel"};var VO=d.createContext(void 0);function zO(e){var t=e.children,n=UO(d.useState(),2),r=n[0],o=n[1];return d.createElement(VO.Provider,{value:[r,o]},t)}var BO=function(e){var t=e.children;return d.createElement(zO,null,d.createElement(Sd,null,t))};function HO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function JO(e,t){return Sb(e,t)}function $O(e){switch(e){case vb.Playlists:return a.Subjects.EDIT_SUBJECT_PLAYLISTS;case vb.Series:return a.Subjects.EDIT_SUBJECT_SERIES;case vb.Videos:return a.Subjects.EDIT_SUBJECT_VIDEOS}}function KO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return YO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return YO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function YO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function GO(e){var t=KO(d.useState({}),2),n=t[0],r=t[1],i=n.presentations,c=n.classifications,s=n.memberIds,u=n.membersWithClassifications,f=o.useBasicFetch(Array.isArray(s)&&function(e,t){switch(e){case vb.Playlists:return zv(t);case vb.Series:return GE(t);case vb.Videos:return WS(t)}}(e.memberType,s)),m=KO(d.useContext(VO),2),h=m[0],y=m[1],v=Iv(p.SUBJECT);!function(e,t,n){var r=e.subjectId,o=e.memberType,i=HO(d.useContext(VO),1)[0];hb(Tg.getPresentationsFetchOptions(JO(n,"presentations")),[]),hb(Tg.getSubjectMemberIdsFetchOptions(r,o,JO(n,"memberIds")),[r,o]),hb(!!i&&Tg.getSubjectClassificationFetchOptions(r,JO(n,"classifications"),i.id,o),[r,o,i],!!i)}(e,0,r),function(e,t,n,r){var o=n.classifications;d.useEffect((function(){JO(r,"membersWithClassifications")(function(e,t,n){if(!t||!n)return;return t.map((function(t){return{id:t.id,name:t.name,classifications:n.map((function(n){return{id:n.id,selected:(r=t,o=n,!!o[e]&&!!o[e].data.filter((function(e){return e.id===r.id})).length)};var r,o}))}}))}(t.memberType,e,o))}),[e,o])}(f.data,e,n,r);var b,g,S=!!h&&!!c;return d.createElement(d.Fragment,null,d.createElement(vS,{subjectId:e.subjectId,activeAction:$O(e.memberType)}),d.createElement(Ws.Alert,{variant:"info",className:"m-0"},"Select which ".concat(e.memberType," are shown for each classification in this subject.")+" Change the selected presentation to view different classifications."),d.createElement("div",{className:"w-50 py-2"},!!i&&d.createElement(cS,{presentations:i,currentPresentation:h,setCurrentPresentation:y})),S&&d.createElement(kS,{members:u||[],memberType:e.memberType,getMemberAppLink:function(t){return Tb.getMemberAppLink(e.memberType,t)},getActions:function(t){return Tb.getMemberActions(e.subjectId,yb.Subject,e.memberType,t)},classifications:c,getClassificationAppLink:h&&(b=e.memberType,g=h.id,function(e){var t,n=l.SUBJECTS,r=[g,e];switch(b){case vb.Playlists:t=a.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;break;case vb.Series:t=a.Subjects.EDIT_CLASSIFICATION_SERIES;break;case vb.Videos:t=a.Subjects.EDIT_CLASSIFICATION_VIDEOS}return{application:n,action:t,args:r}}),onToggleClassification:function(t,n,r){return function(e,t,n,r,o,i,a){(a?e.addObjectsToClassification.bind(e):e.removeObjectsFromClassification.bind(e))(i,n,t,r,o)}(v,e.memberType,r?[r]:s,e.subjectId,h&&h.id,t,n)}}))}function WO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ZO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ZO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ZO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function QO(e){var t=e.parentId,n=WO(d.useState(),2),o=n[0],i=n[1],c=Iv(p.SUBJECT);hb(Tg.getSubjectTreeFetchOptions(i),[]);var s={application:l.SUBJECTS,action:a.Subjects.PRESENTATIONS};return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-2 border-bottom"},d.createElement(Fp,{backToName:"Presentations",appLink:s})),d.createElement("h4",{className:"py-2"},"Create New Subject"),!!o&&d.createElement(hS,{subject:{parentId:t},subjectTree:o,saveSubject:function(e,t){return c.createSubject(e,function(e){return function(t){e(),t&&t.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[t.id]})}}(t),t)}}))}function XO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ej(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ej(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ej(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tj(e){var t=XO(d.useState(),2),n=t[0],r=t[1],i=XO(d.useState(!1),2),a=i[0],c=i[1],s=o.useBasicFetch(function(e,t){switch(e){case vb.Playlists:return Vv(t);case vb.Series:return YE(t);case vb.Videos:return GS(t)}}(e.memberType,e.memberId)),u=Iv(p.SUBJECT);hb(Tg.getSubjectFetchOptions(e.subjectId,r),[e.subjectId]);var l=!!n&&!!s.data,f="Remove ".concat(fd(Tb.singularizeMemberType(e.memberType)));return d.createElement(Zh,{title:f,closePopup:e.closePopup,showLoadingSpinner:!l},l&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,s.data.name)," from ",d.createElement("strong",null,n.name),"?"),d.createElement("p",null,"Please ensure that it is not in any classifications before removing.")),d.createElement(ty,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),u.removeObjectsFromSubject(e.subjectId,[e.memberId],e.memberType,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(Tb.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function nj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return rj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rj(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oj(e){var t=e.subjectId,n=nj(d.useState({}),2),r=n[0];return function(e,t){var n=function(e){return Sb(t,e)};hb(Tg.getSubjectClassificationFetchOptions(e,n("classifications")),[e]),hb(Tg.getPresentationsFetchOptions(n("presentations")),[])}(t,n[1]),d.createElement(d.Fragment,null,d.createElement(vS,{subjectId:t,activeAction:a.Subjects.SUBJECT_CLASSIFICATIONS}),d.createElement(OS,{presentations:r.presentations,classificationDictionary:wo(r.classifications,"presentationId")}))}var ij=n(134),aj=n.n(ij);function cj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sj(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uj(e){var t=e.selectedSubjectId,n=cj(d.useState(),2),r=n[0],o=n[1];hb(Tg.getSubjectTreeFetchOptions(o),[]);var i=d.useCallback((function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[e.id]}}),[]),c={application:l.SUBJECTS,action:a.Subjects.NEW_SUBJECT},s=[{label:"Add child",getAppLink:function(e){return Object.assign(Object.assign({},c),{params:{parentId:e.id}})}},{label:"Delete subject",getAppLink:function(e){return{application:l.SUBJECTS,action:a.Subjects.DELETE_SUBJECT,args:[e.id]}},className:"text-danger"}];return d.createElement("div",{className:"".concat(aj.a.navContainer," h-auto pr-2 border-right")},d.createElement("h5",{className:"border-bottom pb-2"},"Subjects"),d.createElement(Up,{appLink:c,className:"d-inline-block pb-2"},d.createElement(_p,{svgName:Ap.Plus,size:kp.Small}),d.createElement("span",null,"New Subject")),!!r&&d.createElement("div",{className:"border-top pt-1"},d.createElement(Hm,{tree:r,getAppLink:i,selectedIds:[t],actions:s})))}function lj(e){var t=e.currentAppLink;return d.createElement(_S,{navItems:kb(),currentAppLink:t})}function fj(e){return(fj="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 pj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dj(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 mj(e,t,n){return t&&dj(e.prototype,t),n&&dj(e,n),e}function hj(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&&yj(e,t)}function yj(e,t){return(yj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vj(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=gj(e);if(t){var o=gj(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return bj(this,n)}}function bj(e,t){return!t||"object"!==fj(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 gj(e){return(gj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Sj=function(e){hj(n,e);var t=vj(n);function n(){return pj(this,n),t.apply(this,arguments)}return mj(n,[{key:"channelName",get:function(){return l.PLAYLISTS}},{key:"appRoutes",get:function(){return{"manage/playlists(/)":"index","manage/playlists/new(/)":"newPlaylist","manage/playlists/search(/)":"searchPlaylists","manage/playlists/:id(/)":"editPlaylist","manage/playlists/:id/videos(/)":"editPlaylistVideos","manage/playlists/:id/subjects(/)":"editPlaylistSubjects","manage/playlists/:id/audiences(/)":"editPlaylistAudiences"}}},{key:"appLinks",get:function(){return["deletePlaylist","removeVideo","uploadImage","removeFromSubject"]}}]),n}(r.AppRouter),Ej=function(e){hj(n,e);var t=vj(n);function n(){return pj(this,n),t.apply(this,arguments)}return mj(n,[{key:"initialize",value:function(){var e=this;Rr.values(p).forEach((function(t){return Av.getInstance(t,e)}))}},{key:"index",value:function(e){var t;this.layout.showChildView(kn,d.createElement(cE,{cursor:null===(t=e)||void 0===t?void 0:t.cursor}))}},{key:"searchPlaylists",value:function(e){var t,n;this.layout.showChildView(kn,d.createElement(lE,{query:null===(t=e)||void 0===t?void 0:t.query,cursor:null===(n=e)||void 0===n?void 0:n.cursor}))}},{key:"newPlaylist",value:function(){this.layout.showChildView(kn,d.createElement(KS,null))}},{key:"editPlaylist",value:function(e){this.layout.showChildView(kn,d.createElement(rb,{key:e,playlistId:e}))}},{key:"editPlaylistVideos",value:function(e){this.layout.showChildView(kn,d.createElement($S,{key:e,playlistId:e}))}},{key:"editPlaylistSubjects",value:function(e){this.layout.showChildView(kn,d.createElement(FS,{key:e,playlistId:e}))}},{key:"editPlaylistAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(NS,{key:e,playlistId:e}))}},{key:"deletePlaylist",value:function(e){var t=Object.assign({playlistId:e},this.getPopupProps());this.layout.showChildView(_n,d.createElement(Wv,Object.assign({},t)))}},{key:"removeVideo",value:function(e,t){var n=Object.assign({playlistId:e,videoId:t},this.getPopupProps());this.layout.showChildView(_n,d.createElement(tE,Object.assign({},n)))}},{key:"removeFromSubject",value:function(e,t){var n=Object.assign({subjectId:t,memberId:e,memberType:vb.Playlists},this.getPopupProps());this.layout.showChildView(_n,d.createElement(tj,Object.assign({},n)))}},{key:"uploadImage",value:function(e){var t=Object.assign({imageType:e},this.getPopupProps());this.layout.showChildView(_n,d.createElement(_v,Object.assign({},t)))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(Ln,d.createElement(Gh,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Playlists Application"}},{key:"channelName",get:function(){return l.PLAYLISTS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:Lv}}}}],[{key:"router",get:function(){return Sj}}]),n}(r.Application),Oj=function(e){var t=e.children;return d.createElement(Sd,null,t)},jj=function(){return"/api/domain/v2/me/ratings"},Cj="ratings",wj=function(){return{url:jj(),key:Cj}},Aj=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Ys.string().trim().max(350,"Description is too long").default(""),rating:Ys.object().shape({id:Ys.string()}).default({}).noUnknown(),tallPoster:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown(),banner:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown()}).noUnknown(),Ij=function(e,t){var n=l.SERIES,r=a.Series,o=[{label:"Edit Series Details",appLink:{application:n,action:r.EDIT_SERIES,args:[t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_SERIES_VIDEOS,args:[t]}}];return Mv(e)&&o.push.apply(o,[{label:"Subjects",appLink:{application:n,action:r.EDIT_SERIES_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_SERIES_AUDIENCES,args:[t]}}]),o};function Tj(e){var t=_s(),n=au(t);return d.createElement(Vs,null,d.createElement(ru,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this series",autoFocus:!0}),d.createElement(ru,{label:"Description",as:"textarea",name:"description",id:"description",maxLength:350,value:t.values.description,placeholder:"Describe this series here",showCharacterCounter:!0}),d.createElement(Nm,{ratings:e.ratings}),d.createElement(wd,{imageType:Jp.TallPosters,fieldName:"tallPoster",application:l.SERIES,uploadAction:a.Series.UPLOAD_IMAGE}),d.createElement(wd,{imageType:Jp.Banners,fieldName:"banner",application:l.SERIES,uploadAction:a.Playlists.UPLOAD_IMAGE}),d.createElement("div",{className:"d-flex justify-content-between align-items-center"},d.createElement(lu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.id?"Save":"Create"),!!e.actions&&d.createElement(km,{actions:e.actions})))}function kj(e){return d.createElement(Ks,{initialValues:e.series,validationSchema:Aj,onSubmit:e.saveSeries},d.createElement(Tj,{id:e.series&&e.series.id,ratings:e.ratings}))}function _j(e){return d.createElement("div",{className:"py-2"},d.createElement(Rm,{tabs:Ij(e.currentUser,e.seriesId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function Lj(e){var t,n=Object(bn.useDispatch)(),r=xv(),i=o.useBasicFetch(YE(e.seriesId)),c=o.useBasicFetch(wj()),s=o.useBasicFetch(Zv);return d.createElement(d.Fragment,null,!!s.data&&d.createElement(_j,{seriesId:e.seriesId,activeAction:a.Series.EDIT_SERIES,currentUser:s.data}),!!i.data&&!!c.data&&d.createElement(kj,{series:i.data,saveSeries:function(t,i){o.fetch(n,ZE(e.seriesId,t,(function(){r.success("Successfully updated series.")}),(function(){r.error("Failed to update series.")}),i))},ratings:c.data}),d.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit series page ",d.createElement(Up,{className:"info-link",appLink:(t=e.seriesId,{application:l.SERIES,action:a.Series.LEGACY_EDIT_SERIES,args:[t]})},"here"),"."))}function xj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pj(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Nj(e){var t=xj(d.useState({}),2),n=t[0],r=t[1],i=o.useBasicFetch(YE(e.seriesId)),c=o.useBasicFetch(Zv),s=Iv(p.SUBJECT);!function(e,t,n){var r=function(e){return Sb(n,e)};hb(Tg.getObjectLevelsFetchOptions(e,vb.Series,r("seriesLevels")),[e]),hb(Tg.getObjectAudiencesFetchOptions(e,vb.Series,r("seriesAudiences")),[e,t.seriesLevels]),lb([Tg.getPresentationsFetchOptions(r("presentations")),Tg.getLevelsFetchOptions(r("levels"))],[]),hb(!!t.currentPresentation&&Tg.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.seriesId,n,r),LS(n,r);var u=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.seriesLevels&&n.seriesAudiences);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(_j,{seriesId:e.seriesId,activeAction:a.Series.EDIT_SERIES_AUDIENCES,currentUser:c.data}),d.createElement(_m,{object:i.data}),!!u&&d.createElement(Mg,{objectLevels:n.seriesLevels,objectAudiences:n.seriesAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Sb(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:vb.Series,saveLevels:function(t,n,r){return s.updateObjectLevels(e.seriesId,t,vb.Series,n,r,r)},saveAudiences:function(t,r){return s.updateObjectAudiences(e.seriesId,n.currentPresentation.id,t,vb.Series,r,r)}}))}function Rj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||Mj(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dj(e){return function(e){if(Array.isArray(e))return Uj(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Mj(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mj(e,t){if(e){if("string"==typeof e)return Uj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uj(e,t):void 0}}function Uj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Fj(e){var t=Rj(d.useState({}),2),n=t[0],r=t[1],i=o.useBasicFetch(YE(e.seriesId)),c=o.useBasicFetch(Zv),s=Iv(p.SUBJECT);!function(e,t,n){var r=function(e){return Sb(n,e)};lb([Tg.getSubjectTreeFetchOptions(r("subjectTree")),Tg.getPresentationsFetchOptions(r("presentations"))],[]),hb(Tg.getObjectSubjectsFetchOptions(e,vb.Series,r("seriesSubjects")),[e]),hb(!!t.currentPresentation&&Tg.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),d.useEffect((function(){return r("subjectClassifications")([])}),[t.seriesSubjects]);var o=function(e,t){return[].concat(Dj(t.subjectClassifications||[]),Dj(e))},i=t.seriesSubjects&&t.seriesSubjects.map((function(e){return Tg.getSubjectClassificationFetchOptions(e.id,Sb(n,"subjectClassifications",o))}));lb(i,[t.seriesSubjects],!!i),hb(Tg.getObjectClassificationsFetchOptions(e,vb.Series,r("seriesClassifications")),[e,t.seriesSubjects])}(e.seriesId,n,r),LS(n,r);var u=!!(n.seriesSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.seriesClassifications&&n.subjectClassifications);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(_j,{seriesId:e.seriesId,activeAction:a.Series.EDIT_SERIES_SUBJECTS,currentUser:c.data}),d.createElement(_m,{object:i.data}),u&&d.createElement(fS,{objectSubjects:n.seriesSubjects,subjectTree:n.subjectTree,memberType:vb.Series,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Sb(r,"currentPresentation"),objectClassifications:n.seriesClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return s.updateObjectSubjects(e.seriesId,t,vb.Series,n,r,r)},saveClassifications:function(t,r){return s.updateObjectClassifications(e.seriesId,n.currentPresentation.id,t,vb.Series,r,r)}}))}function Vj(){var e=Object(bn.useDispatch)(),t=xv(),n=o.useBasicFetch(wj());return d.createElement(d.Fragment,null,!!n.data&&d.createElement(kj,{saveSeries:function(n,i){var c=function(){t.error("Failed to create series.")},s=function(e){t.success("Successfully created series."),function(e){r.AppLinkHelper.trigger({application:l.SERIES,action:a.Series.EDIT_SERIES,args:[e.id]})}(e)};o.fetch(e,WE(n,(function(t){var n={permissions:Dv()};o.fetch(e,ZE(t.id,n,s,c,i))}),c))},ratings:n.data}))}function zj(e){return(zj="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 Bj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hj(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 qj(e,t,n){return t&&Hj(e.prototype,t),n&&Hj(e,n),e}function Jj(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&&$j(e,t)}function $j(e,t){return($j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Kj(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=Gj(e);if(t){var o=Gj(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Yj(this,n)}}function Yj(e,t){return!t||"object"!==zj(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 Gj(e){return(Gj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Wj=function(e){Jj(n,e);var t=Kj(n);function n(){return Bj(this,n),t.apply(this,arguments)}return qj(n,[{key:"channelName",get:function(){return l.SERIES}},{key:"appRoutes",get:function(){return{"manage/series/new(/)":"newSeries","manage/series/:id(/)":"editSeries","manage/series/:id/videos(/)":"editSeriesVideos","manage/series/:id/subjects(/)":"editSeriesSubjects","manage/series/:id/audiences(/)":"editSeriesAudiences","manage/legacy/series/:id(/)":"legacyEditSeries"}}},{key:"appLinks",get:function(){return["uploadImage"]}}]),n}(r.AppRouter),Zj=function(e){Jj(n,e);var t=Kj(n);function n(){return Bj(this,n),t.apply(this,arguments)}return qj(n,[{key:"initialize",value:function(){var e=this;Rr.values(p).forEach((function(t){return Av.getInstance(t,e)}))}},{key:"newSeries",value:function(){this.layout.showChildView(kn,d.createElement(Vj,null))}},{key:"editSeries",value:function(e){this.layout.showChildView(kn,d.createElement(Lj,{seriesId:e}))}},{key:"editSeriesVideos",value:function(e){this.legacyEditSeries(e)}},{key:"editSeriesSubjects",value:function(e){this.layout.showChildView(kn,d.createElement(Fj,{seriesId:e}))}},{key:"editSeriesAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(Nj,{seriesId:e}))}},{key:"legacyEditSeries",value:function(e){r.LocationUtils.Redirect("/manage/legacy/series/".concat(e),!0)}},{key:"uploadImage",value:function(e){var t=Object.assign({imageType:e},this.getPopupProps());this.layout.showChildView(_n,d.createElement(_v,Object.assign({},t)))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(Ln,d.createElement(Gh,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Series Application"}},{key:"channelName",get:function(){return l.SERIES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:Oj}}}}],[{key:"router",get:function(){return Wj}}]),n}(r.Application);function Qj(e){return(Qj="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 Xj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eC(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 tC(e,t,n){return t&&eC(e.prototype,t),n&&eC(e,n),e}function nC(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&&rC(e,t)}function rC(e,t){return(rC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oC(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=aC(e);if(t){var o=aC(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return iC(this,n)}}function iC(e,t){return!t||"object"!==Qj(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 aC(e){return(aC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var cC=function(e){nC(n,e);var t=oC(n);function n(){return Xj(this,n),t.apply(this,arguments)}return tC(n,[{key:"channelName",get:function(){return l.SUBJECTS}},{key:"appRoutes",get:function(){return{"manage/subjects(/)":"subjects","manage/subjects/add-objects(/)":"addSubjectMembers","manage/subjects/new(/)":"newSubject","manage/subjects/:id/edit(/)":"editSubject","manage/subjects/:id/edit/playlists(/)":"editSubjectPlaylists","manage/subjects/:id/edit/series(/)":"editSubjectSeries","manage/subjects/:id/edit/videos(/)":"editSubjectVideos","manage/subjects/:id/classifications(/)":"subjectClassifications","manage/subjects/classifications(/)":"classifications","manage/subjects/presentations/:id/classifications(/)":"presentationClassifications","manage/subjects/presentations/:id/classifications/new(/)":"newClassification","manage/subjects/presentations/:id/classifications/:id/edit(/)":"editClassification","manage/subjects/presentations/:id/classifications/:id/edit/playlists(/)":"editClassificationPlaylists","manage/subjects/presentations/:id/classifications/:id/edit/series(/)":"editClassificationSeries","manage/subjects/presentations/:id/classifications/:id/edit/videos(/)":"editClassificationVideos","manage/subjects/levels(/)":"levels","manage/subjects/levels/new(/)":"newLevel","manage/subjects/levels/:id(/)":"editLevel","manage/subjects/audiences(/)":"audiences","manage/subjects/presentations/:id/audiences(/)":"presentationAudiences","manage/subjects/presentations/:id/audiences/new(/)":"newAudience","manage/subjects/presentations/:id/audiences/:id/edit(/)":"editAudience","manage/subjects/presentations(/)":"presentations","manage/subjects/presentations/new":"newPresentation","manage/subjects/presentations/:id(/)":"editPresentation"}}},{key:"appLinks",get:function(){return["deleteClassification","removeClassificationMember","deleteSubject","removeSubjectMember","deleteAudience","uploadImage"]}}]),n}(r.AppRouter),sC=function(e){nC(n,e);var t=oC(n);function n(){return Xj(this,n),t.apply(this,arguments)}return tC(n,[{key:"initialize",value:function(){var e=this;this.subjectDataService=Av.getInstance(p.SUBJECT,this),Rr.values(p).forEach((function(t){return Av.getInstance(t,e)}))}},{key:"subjects",value:function(){this.subjectDataService.getSubjectTree((function(e){var t=!!e.children&&e.children[0];t?r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[t.id]},{replace:!0}):r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.NEW_SUBJECT},{replace:!0})}))}},{key:"newSubject",value:function(e){var t={parentId:e.parentId};this.layout.showChildView(kn,d.createElement(QO,Object.assign({key:e.parentId},t))),this.renderSubjectsLeftNav()}},{key:"editSubject",value:function(e){this.layout.showChildView(kn,d.createElement(MO,{key:e,subjectId:e})),this.renderSubjectsLeftNav(e)}},{key:"editSubjectPlaylists",value:function(e){var t={subjectId:e,memberType:vb.Playlists};this.layout.showChildView(kn,d.createElement(GO,Object.assign({key:"".concat(e,":playlists")},t))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectSeries",value:function(e){var t={subjectId:e,memberType:vb.Series};this.layout.showChildView(kn,d.createElement(GO,Object.assign({key:"".concat(e,":series")},t))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectVideos",value:function(e){var t={subjectId:e,memberType:vb.Videos};this.layout.showChildView(kn,d.createElement(GO,Object.assign({key:"".concat(e,":videos")},t))),this.renderSubjectsLeftNav(e)}},{key:"subjectClassifications",value:function(e){this.layout.showChildView(kn,d.createElement(oj,{key:e,subjectId:e})),this.renderSubjectsLeftNav(e)}},{key:"addSubjectMembers",value:function(e){var t=e.memberType,n=e.objectIds;if(t&&n){var r={memberType:t,objectIds:Array.isArray(n)?n:[n]};this.layout.showChildView(kn,d.createElement(LO,Object.assign({},r))),this.hideLeftNav()}}},{key:"removeSubjectMember",value:function(e,t,n){var r=Object.assign({subjectId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(_n,d.createElement(tj,Object.assign({},r)))}},{key:"deleteSubject",value:function(e){var t=e.toString()===this.currentLeftNavId.toString()?{application:l.SUBJECTS,action:a.Subjects.NEW_SUBJECT}:null,n=Object.assign({subjectId:e,routeToOnDelete:t||null},this.getPopupProps());this.layout.showChildView(_n,d.createElement(NO,Object.assign({},n)))}},{key:"classifications",value:function(){var e={objectType:"classifications",getAppLink:function(e){return{application:l.SUBJECTS,action:a.Subjects.PRESENTATION_CLASSIFICATIONS,args:[e.id]}}};this.layout.showChildView(kn,d.createElement(EO,Object.assign({},e))),this.hideLeftNav()}},{key:"presentationClassifications",value:function(e){this.subjectDataService.getClassificationTree(e,(function(t){var n=!!t.children&&t.children[0];n?r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]},{replace:!0}):r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.NEW_CLASSIFICATION,args:[e]},{replace:!0})}))}},{key:"newClassification",value:function(e,t){var n={presentationId:e,parentId:t.parentId};this.layout.showChildView(kn,d.createElement(KE,Object.assign({key:t.parentId},n))),this.renderClassificationLeftNav(e)}},{key:"editClassification",value:function(e,t){var n={presentationId:e,classificationId:t};this.layout.showChildView(kn,d.createElement(zE,Object.assign({key:t},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationPlaylists",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:vb.Playlists};this.layout.showChildView(kn,d.createElement(qE,Object.assign({key:"".concat(t,":playlists")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationSeries",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:vb.Series};this.layout.showChildView(kn,d.createElement(qE,Object.assign({key:"".concat(t,":series")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationVideos",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:vb.Videos};this.layout.showChildView(kn,d.createElement(qE,Object.assign({key:"".concat(t,":videos")},n))),this.renderClassificationLeftNav(e,t)}},{key:"removeClassificationMember",value:function(e,t,n){var r=Object.assign({classificationId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(_n,d.createElement(eO,Object.assign({},r)))}},{key:"deleteClassification",value:function(e,t){var n=t===this.currentLeftNavId?{application:l.SUBJECTS,action:a.Subjects.NEW_CLASSIFICATION,args:[e]}:null,r=Object.assign({classificationId:t,routeToOnDelete:n||null},this.getPopupProps());this.layout.showChildView(_n,d.createElement(UE,Object.assign({},r)))}},{key:"levels",value:function(){this.layout.showChildView(kn,d.createElement(sO,null)),this.hideLeftNav()}},{key:"newLevel",value:function(){this.layout.showChildView(kn,d.createElement(uO,null)),this.hideLeftNav()}},{key:"editLevel",value:function(e){this.layout.showChildView(kn,d.createElement(rO,{key:e,id:e})),this.hideLeftNav()}},{key:"audiences",value:function(){var e={objectType:"audiences",getAppLink:function(e){return{application:l.SUBJECTS,action:a.Subjects.PRESENTATION_AUDIENCES,args:[e.id]}}};this.layout.showChildView(kn,d.createElement(EO,Object.assign({},e))),this.hideLeftNav()}},{key:"presentationAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(CE,{presentationId:e})),this.hideLeftNav()}},{key:"newAudience",value:function(e){this.layout.showChildView(kn,d.createElement(TE,{presentationId:e})),this.hideLeftNav()}},{key:"editAudience",value:function(e,t){var n={presentationId:e,audienceId:t};this.layout.showChildView(kn,d.createElement(bE,Object.assign({key:t},n))),this.hideLeftNav()}},{key:"deleteAudience",value:function(e,t){var n={application:l.SUBJECTS,action:a.Subjects.PRESENTATION_AUDIENCES,args:[e]},r=Object.assign({id:t,routeToOnDelete:n},this.getPopupProps());this.layout.showChildView(_n,d.createElement(mE,Object.assign({},r)))}},{key:"presentations",value:function(){this.layout.showChildView(kn,d.createElement(vO,null)),this.hideLeftNav()}},{key:"newPresentation",value:function(){this.layout.showChildView(kn,d.createElement(bO,null))}},{key:"editPresentation",value:function(e){this.layout.showChildView(kn,d.createElement(pO,{key:e,id:e})),this.hideLeftNav()}},{key:"uploadImage",value:function(e){var t=Object.assign({imageType:e},this.getPopupProps());this.layout.showChildView(_n,d.createElement(_v,Object.assign({},t)))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(Ln,d.createElement(Gh,{alerts:n,removeAlert:r}))}},{key:"renderClassificationLeftNav",value:function(e,t){this.setCurrentLeftNavItem(t);var n={presentationId:e,selectedClassificationId:t};this.layout.showChildView(Tn,d.createElement(RE,Object.assign({},n)))}},{key:"renderSubjectsLeftNav",value:function(e){this.setCurrentLeftNavItem(e),this.layout.showChildView(Tn,d.createElement(uj,{selectedSubjectId:e}))}},{key:"setCurrentLeftNavItem",value:function(e){this.currentLeftNavId=e||null}},{key:"hideLeftNav",value:function(){this.setCurrentLeftNavItem(),this.layout.hideLeftNav()}},{key:"getTopNav",value:function(e){return d.createElement(lj,{currentAppLink:e})}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Subjects Application"}},{key:"channelName",get:function(){return l.SUBJECTS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:BO,getTopNavView:this.getTopNav}}}}],[{key:"router",get:function(){return cC}}]),n}(r.Application);function uC(e){return(uC="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 lC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fC(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 pC(e,t){return(pC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dC(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=hC(e);if(t){var o=hC(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return mC(this,n)}}function mC(e,t){return!t||"object"!==uC(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 hC(e){return(hC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var yC,vC=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&&pC(e,t)}(i,e);var t,n,r,o=dC(i);function i(){return lC(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"onShowAlert",value:function(e){if(this.layoutOptions.options.alertRegion){var t=e.ctor,n=e.collection,r=n?n.toJSON():[];this.layout.showChildView(this.layoutOptions.options.alertRegion,d.createElement(t,{alerts:r,removeAlert:function(e){return y.Radio.channel(b.ALERT).trigger("remove:alert",e)}}))}}}])&&fC(t.prototype,n),r&&fC(t,r),i}(oe),bC=function(e){return{url:"/api/domain/v1/themes/".concat(e),key:"themes:".concat(e)}},gC=function(e){var t="/api/domain/v1/themes",n="themes";return e&&(t+="?type=".concat(e),n+=":type:".concat(e)),{url:t,key:n}},SC=function(e,t,n,r){return{url:"/api/domain/v1/themes",key:"theme",data:e,type:jr.POST,invalidationKeys:"themes",success:t,error:n,always:r}},EC=function(e,t,n,r,o){return{url:"/api/domain/v1/themes/".concat(e),key:"update:theme:".concat(e),data:t,type:jr.PUT,success:n,error:r,always:o}},OC=function(e,t,n,r){return{url:"/api/domain/v1/themes/".concat(e),key:"delete:theme:".concat(e),type:jr.DELETE,invalidationKeys:"themes",success:t,error:n,always:r}},jC=function(e){return{application:l.THEMES,action:a.Themes.EDIT_THEME,args:[e.id]}};function CC(){var e=o.useBasicFetch(gC());return e.data?d.createElement(xm,{objects:e.data,getObjectAppLink:jC,newObjectAppLink:{application:l.THEMES,action:a.Themes.NEW_THEME},objectName:"Theme"}):d.createElement(d.Fragment,null)}!function(e){e.Glance="glance"}(yC||(yC={}));var wC=[{key:"topLeft",label:"Top Left"},{key:"topRight",label:"Top Right"},{key:"bottomLeft",label:"Bottom Left"},{key:"bottomRight",label:"Bottom Right"}];function AC(){var e=_s();return d.createElement("div",{className:"form-group"},wC.map((function(t){var n="data.".concat(t.key);return d.createElement(wd,{label:t.label,imageType:Jp.HeroBanners,fieldName:n,application:l.THEMES,uploadAction:a.Videos.UPLOAD_IMAGE,setSelectedImage:function(t){e.setFieldValue(n,{fileId:t.id,url:t.url,fileIdType:Kp.ImageAPIv2})}})})))}var IC=Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown(),TC=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default(""),type:Ys.mixed().required("Type is required"),data:Ys.mixed().when("type",{is:yC.Glance,then:Ys.object().shape({topLeft:IC,topRight:IC,bottomLeft:IC,bottomRight:IC}).noUnknown(),otherwise:Ys.mixed().strip(!0)}).default({})}).noUnknown();function kC(e){var t=_s(),n=function(e){switch(e){case yC.Glance:return AC;default:return}}(t.values.type);return d.createElement(Vs,null,d.createElement(ru,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this theme",autoFocus:!0}),d.createElement(ru,{as:"select",label:"Type",name:"type",id:"type",value:t.values.type},d.createElement("option",{value:null},"Select a type..."),Rr.getEnumKeys(yC).map((function(e){return d.createElement("option",{key:e,value:yC[e]},e)}))),!!n&&d.createElement(n,null),d.createElement("div",{className:"d-flex justify-content-between align-items-center"},d.createElement(wu,{isNew:e.isNew}),!!e.actions&&d.createElement(km,{actions:e.actions})))}function _C(e){var t;return d.createElement(Ks,{initialValues:e.theme,validationSchema:TC,onSubmit:e.saveTheme},d.createElement(kC,{isNew:!(null===(t=e.theme)||void 0===t?void 0:t.id),actions:e.actions}))}function LC(){var e=Object(bn.useDispatch)();return d.createElement(_C,{saveTheme:function(t,n){o.fetch(e,SC(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.THEMES,action:a.Themes.EDIT_THEME,args:[e.id]})}),null,n))}})}function xC(e){var t=Object(bn.useDispatch)(),n=xv(),r=o.useBasicFetch(bC(e.id));return r.data?d.createElement(_C,{theme:r.data,saveTheme:function(r,i){o.fetch(t,EC(e.id,r,(function(){n.success("Successfully updated theme")}),(function(){n.error("Failed to update theme")}),i))},actions:[{label:"Delete theme",className:"btn btn-danger",button:!0,appLink:{application:l.THEMES,action:a.Themes.DELETE_THEME,args:[e.id]}}]}):d.createElement(d.Fragment,null)}function PC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return NC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return NC(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function NC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function RC(e){var t=Object(bn.useDispatch)(),n=xv(),i=PC(d.useState(!1),2),c=i[0],s=i[1],u=o.useBasicFetch(bC(e.id));return d.createElement(Zh,{title:"Delete Theme",closePopup:e.closePopup,showLoadingSpinner:!u.data},d.createElement(d.Fragment,null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,u.data.name),"?"),d.createElement(ty,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){s(!0),o.fetch(t,OC(e.id,(function(){n.success("Successfully deleted theme"),r.AppLinkHelper.trigger({application:l.THEMES,action:a.Themes.THEMES})}),(function(){n.error("Failed to delete theme")})))},buttonText:"Yes, delete this theme",isSpinnerButton:!0,showSpinner:c}]})))}var DC=function(e){var t=e.children;return d.createElement(Sd,null,t)};function MC(e){return(MC="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 UC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FC(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 VC(e,t,n){return t&&FC(e.prototype,t),n&&FC(e,n),e}function zC(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&&BC(e,t)}function BC(e,t){return(BC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function HC(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=JC(e);if(t){var o=JC(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return qC(this,n)}}function qC(e,t){return!t||"object"!==MC(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 JC(e){return(JC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $C=function(e){zC(n,e);var t=HC(n);function n(){return UC(this,n),t.apply(this,arguments)}return VC(n,[{key:"channelName",get:function(){return l.THEMES}},{key:"appRoutes",get:function(){return{"manage/themes(/)":"themes","manage/themes/new(/)":"newTheme","manage/themes/:id(/)":"editTheme"}}},{key:"appLinks",get:function(){return["deleteTheme","uploadImage"]}}]),n}(r.AppRouter),KC=function(e){zC(n,e);var t=HC(n);function n(){return UC(this,n),t.apply(this,arguments)}return VC(n,[{key:"themes",value:function(){this.layout.showChildView(kn,d.createElement(CC,null))}},{key:"newTheme",value:function(){this.layout.showChildView(kn,d.createElement(LC,null))}},{key:"editTheme",value:function(e){this.layout.showChildView(kn,d.createElement(xC,{id:e}))}},{key:"deleteTheme",value:function(e){var t=this;this.layout.showChildView(_n,d.createElement(RC,{id:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(_n,d.createElement(_v,{imageType:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"name",get:function(){return"Themes Application"}},{key:"channelName",get:function(){return l.THEMES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:DC}}}}],[{key:"router",get:function(){return $C}}]),n}(vC),YC=function(e){var t=e.children;return d.createElement(Sd,null,t)},GC=function(e,t){var n=l.VIDEOS,r=a.Videos,o=[{label:"Edit Video Details",appLink:{application:n,action:r.EDIT_VIDEO,args:[t]}}];return Mv(e)?[].concat(o,[{label:"Subjects",appLink:{application:n,action:r.EDIT_VIDEO_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_VIDEO_AUDIENCES,args:[t]}},{label:"Aliases",appLink:{application:n,action:r.EDIT_VIDEO_ALIASES,args:[t]}}]):o};function WC(e){var t,n=GC(e.currentUser,e.videoId);return n.length<2?d.createElement(d.Fragment,null):d.createElement("div",{className:"py-2"},d.createElement(Rm,{tabs:n,isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}))}var ZC,QC=Ys.object().shape({name:Ys.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Ys.string().trim().default(""),status:Ys.mixed().required("Status is required"),productionYear:Ys.number().min(1900),rating:Ys.object().shape({id:Ys.string()}).default({}).noUnknown(),thumbnail:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown(),heroBanner:Ys.object().shape({fileId:Ys.string(),fileIdType:Ys.mixed(),url:Ys.string()}).default({}).noUnknown(),glance:Ys.object().shape({theme:Ys.string(),format:Ys.mixed(),content:Ys.string()}).default({}).noUnknown()}).noUnknown();!function(e){e[e.Draft=0]="Draft",e[e.Published=1]="Published",e[e.Archived=2]="Archived",e[e.Pending=3]="Pending",e[e.Rejected=4]="Rejected",e[e.Processing=5]="Processing"}(ZC||(ZC={}));var XC,ew=n(25),tw=n.n(ew);function nw(e){var t,n,r,o,i,a=_s();return d.createElement("div",{className:"form-group p-2 border"},d.createElement("div",{className:"border-bottom mb-2"},d.createElement("label",null,"Summary")),d.createElement(ru,{as:"select",label:"Theme",name:"glance.theme",id:"type",value:null===(t=a.values.glance)||void 0===t?void 0:t.theme},d.createElement("option",{value:null},"Select a theme..."),e.themes.map((function(e){return d.createElement("option",{key:e.id,value:e.name},e.name)}))),d.createElement(ru,{as:"select",label:"Format",name:"glance.format",id:"type",value:null===(n=a.values.glance)||void 0===n?void 0:n.format},d.createElement("option",{value:null},"Select a format..."),Rr.getEnumKeys(XC).map((function(e){return d.createElement("option",{key:e,value:XC[e]},e)}))),d.createElement(ru,{label:"Content",as:"textarea",name:"glance.content",id:"content",value:null===(r=a.values.glance)||void 0===r?void 0:r.content}),(null===(o=a.values.glance)||void 0===o?void 0:o.format)===XC.Markdown&&d.createElement("div",{className:"form-group"},d.createElement("label",null,"Content Preview"),d.createElement("div",{className:"border rounded py-2",dangerouslySetInnerHTML:{__html:ew(null===(i=a.values.glance)||void 0===i?void 0:i.content)}})))}function rw(e){switch(e){case ZC.Published:return"badge-success";case ZC.Archived:return"badge-danger";case ZC.Draft:return"badge-warning";case ZC.Pending:return"badge-info";case ZC.Rejected:return"badge-dark";default:return"badge-secondary"}}function ow(e){var t=_s(),n=!!e.rightslineId,r=Mv(e.currentUser);return d.createElement(Vs,null,n&&d.createElement(ru,{label:"Rightsline ID",name:"rightslineId",id:"rightslineId",value:e.rightslineId,disabled:!0}),d.createElement(ru,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this video",disabled:n,autoFocus:!0}),d.createElement("div",{className:"form-group"},d.createElement("label",null,"Status"),d.createElement("div",null,d.createElement("span",{className:"badge ".concat(rw(t.values.status))},ZC[t.values.status]))),d.createElement(ru,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this video here",disabled:n,showCharacterCounter:!0}),d.createElement(ru,{label:"Production Year",type:"number",name:"productionYear",id:"productionYear",value:t.values.productionYear,disabled:n}),d.createElement(Nm,{ratings:e.ratings,disabled:n}),d.createElement(wd,{imageType:Jp.Thumbnails,fieldName:"thumbnail",application:l.VIDEOS,uploadAction:a.Videos.UPLOAD_IMAGE}),d.createElement(wd,{imageType:Jp.HeroBanners,fieldName:"heroBanner",application:l.VIDEOS,uploadAction:a.Videos.UPLOAD_IMAGE}),r&&d.createElement(nw,{themes:e.themes}),d.createElement(wu,{isNew:!e.id}))}function iw(e,t){if(e)return t?Object.assign(Object.assign({},e),t):e}function aw(e){return d.createElement(Ks,{initialValues:iw(e.video,e.rightslineVideo),validationSchema:QC,onSubmit:e.saveVideo,allowInitialSubmit:!!e.rightslineVideo},d.createElement(ow,{id:e.video&&e.video.id,ratings:e.ratings,themes:e.themes,currentUser:e.currentUser,rightslineId:e.rightslineId}))}function cw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sw(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uw(e){var t,n=Object(bn.useDispatch)(),r=cw(d.useState(!1),2),i=r[0],c=r[1],s=o.useBasicFetch(GS(e.videoId)),u=o.useBasicFetch(ZS(e.videoId)),f=o.useBasicFetch(wj()),p=o.useBasicFetch(gC(yC.Glance)),m=o.useBasicFetch(Zv);var h,y=!!s.data&&!!f.data&&!!p.data&&!!m.data&&u.isComplete;return d.createElement(d.Fragment,null,!!m.data&&d.createElement(WC,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO,currentUser:m.data}),!!u.data&&d.createElement("div",{className:"pt-3 text-right"},d.createElement(Ws.Button,{variant:"outline-dark",size:"sm",onClick:function(){u.isFetching||(c(!0),o.fetch(n,ZS(e.videoId)))}},"Sync from Rightsline")),y&&d.createElement(aw,{video:s.data,saveVideo:function(t,r){o.fetch(n,QS(e.videoId,t,null,null,r))},ratings:f.data,themes:p.data,currentUser:m.data,rightslineId:null===(t=u.data)||void 0===t?void 0:t.rightslineId,rightslineVideo:i&&u.data}),d.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit video page ",d.createElement(Up,{className:"info-link",appLink:(h=e.videoId,{application:l.VIDEOS,action:a.Videos.LEGACY_EDIT_VIDEO,args:[h]})},"here"),"."))}function lw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fw(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pw(e){var t=lw(d.useState({}),2),n=t[0],r=t[1],i=o.useBasicFetch(GS(e.videoId)),c=o.useBasicFetch(Zv),s=Iv(p.SUBJECT);!function(e,t,n){var r=function(e){return Sb(n,e)};hb(Tg.getObjectLevelsFetchOptions(e,vb.Videos,r("videoLevels")),[e]),hb(Tg.getObjectAudiencesFetchOptions(e,vb.Videos,r("videoAudiences")),[e,t.videoLevels]),lb([Tg.getPresentationsFetchOptions(r("presentations")),Tg.getLevelsFetchOptions(r("levels"))],[]),hb(!!t.currentPresentation&&Tg.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.videoId,n,r),LS(n,r);var u=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.videoLevels&&n.videoAudiences);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(WC,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO_AUDIENCES,currentUser:c.data}),d.createElement(_m,{object:i.data}),!!u&&d.createElement(Mg,{objectLevels:n.videoLevels,objectAudiences:n.videoAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Sb(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:vb.Videos,saveLevels:function(t,n,r){return s.updateObjectLevels(e.videoId,t,vb.Videos,n,r,r)},saveAudiences:function(t,r){return s.updateObjectAudiences(e.videoId,n.currentPresentation.id,t,vb.Videos,r,r)}}))}function dw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||hw(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mw(e){return function(e){if(Array.isArray(e))return yw(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||hw(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hw(e,t){if(e){if("string"==typeof e)return yw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yw(e,t):void 0}}function yw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vw(e){var t=dw(d.useState({}),2),n=t[0],r=t[1],i=o.useBasicFetch(GS(e.videoId)),c=o.useBasicFetch(Zv),s=Iv(p.SUBJECT);!function(e,t,n){var r=function(e){return Sb(n,e)};lb([Tg.getSubjectTreeFetchOptions(r("subjectTree")),Tg.getPresentationsFetchOptions(r("presentations"))],[]),hb(Tg.getObjectSubjectsFetchOptions(e,vb.Videos,r("videoSubjects")),[e]),hb(!!t.currentPresentation&&Tg.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),d.useEffect((function(){return r("subjectClassifications")([])}),[t.videoSubjects]);var o=function(e,t){return[].concat(mw(t.subjectClassifications||[]),mw(e))},i=t.videoSubjects&&t.videoSubjects.map((function(e){return Tg.getSubjectClassificationFetchOptions(e.id,Sb(n,"subjectClassifications",o))}));lb(i,[t.videoSubjects],!!i),hb(Tg.getObjectClassificationsFetchOptions(e,vb.Videos,r("videoClassifications")),[e,t.videoSubjects])}(e.videoId,n,r),LS(n,r);var u=!!(n.videoSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.videoClassifications&&n.subjectClassifications);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(WC,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO_SUBJECTS,currentUser:c.data}),d.createElement(_m,{object:i.data}),u&&d.createElement(fS,{objectSubjects:n.videoSubjects,subjectTree:n.subjectTree,memberType:vb.Videos,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Sb(r,"currentPresentation"),objectClassifications:n.videoClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return s.updateObjectSubjects(e.videoId,t,vb.Videos,n,r,r)},saveClassifications:function(t,r){return s.updateObjectClassifications(e.videoId,n.currentPresentation.id,t,vb.Videos,r,r)}}))}!function(e){e.Markdown="text/markdown"}(XC||(XC={}));var bw=function(e){return{key:"aliases:".concat(e),url:"/api/master/v2/objects/".concat(e,"/aliases")}},gw=function(e,t,n,r){return{key:"create:alias",url:"/api/master/v2/objects/".concat(e,"/aliases"),type:jr.POST,invalidationKeys:"aliases:".concat(e),data:t,success:n,error:r}},Sw=function(e,t,n,r){return{key:"delete:alias",url:"/api/domain/v2/objects/".concat(e,"/aliases/").concat(t),type:jr.DELETE,invalidationKeys:"aliases:".concat(e),success:n,error:r}};function Ew(e){var t=Object(bn.useDispatch)(),n=xv(),r=o.useBasicFetch(bw(e.videoId)),i=o.useBasicFetch(Zv);return r.data?d.createElement(d.Fragment,null,!!i.data&&d.createElement(WC,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO_ALIASES,currentUser:i.data}),d.createElement(yh,{aliases:r.data.data,onSave:function(r,i){o.fetch(t,gw(e.videoId,r,(function(){n.success("Successfully created alias"),i()}),(function(){n.error("Something went wrong creating your alias")})))},onDelete:function(r){o.fetch(t,Sw(e.videoId,r,(function(){n.success("Successfully deleted alias")}),(function(){n.error("Something went wrong deleting your alias")})))}})):d.createElement(d.Fragment,null,"Loading...")}function Ow(e){return(Ow="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 jw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cw(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 ww(e,t,n){return t&&Cw(e.prototype,t),n&&Cw(e,n),e}function Aw(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&&Iw(e,t)}function Iw(e,t){return(Iw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Tw(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 o=_w(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return kw(this,n)}}function kw(e,t){return!t||"object"!==Ow(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 Lw=function(e){Aw(n,e);var t=Tw(n);function n(){return jw(this,n),t.apply(this,arguments)}return ww(n,[{key:"channelName",get:function(){return l.VIDEOS}},{key:"appRoutes",get:function(){return{"manage/videos/:id(/)":"editVideo","manage/videos/:id/audiences(/)":"editVideoAudiences","manage/videos/:id/subjects(/)":"editVideoSubjects","manage/videos/:id/aliases(/)":"editVideoAliases","tools/programlookup/:id":"legacyEditVideo"}}},{key:"appLinks",get:function(){return["uploadImage"]}}]),n}(r.AppRouter),xw=function(e){Aw(n,e);var t=Tw(n);function n(){return jw(this,n),t.apply(this,arguments)}return ww(n,[{key:"initialize",value:function(){var e=this;Rr.values(p).forEach((function(t){return Av.getInstance(t,e)}))}},{key:"editVideo",value:function(e){this.layout.showChildView(kn,d.createElement(uw,{videoId:e}))}},{key:"editVideoAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(pw,{videoId:e}))}},{key:"editVideoSubjects",value:function(e){this.layout.showChildView(kn,d.createElement(vw,{videoId:e}))}},{key:"editVideoAliases",value:function(e){this.layout.showChildView(kn,d.createElement(Ew,{videoId:e}))}},{key:"legacyEditVideo",value:function(e){r.LocationUtils.Redirect("/tools/programlookup/".concat(e))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(_n,d.createElement(_v,{imageType:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"name",get:function(){return"Videos Application"}},{key:"channelName",get:function(){return l.VIDEOS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:YC,alertRegion:Ln}}}}],[{key:"router",get:function(){return Lw}}]),n}(vC),Pw="UPDATE_VIEW_MODEL",Nw=function(e,t){var n=Object(bn.useDispatch)(),r=Object(bn.useSelector)((function(t){return t.viewModelData[e]}));function o(t,r){n({type:Pw,payload:{viewModelKey:e,dataOrKey:t,keyData:r}})}return void 0!==t&&void 0===r&&o(t),[r,o]},Rw="release:notes:config",Dw=[{id:"798",name:"Monorepo"},{id:"109",name:"Online"},{id:"822",name:"Lite"},{id:"534",name:"Library Editor"},{id:"62",name:"Curator"}];function Mw(e){var t=_s(),n=au(t),r="798"===t.values.project;return m.a.useEffect((function(){e.getMilestones(t.values.project),r&&e.getBranchNames(t.values.project)}),[t.values.project]),m.a.useEffect((function(){t.setFieldValue("milestone",Oo(e.milestones))}),[e.milestones]),m.a.useEffect((function(){t.setFieldValue("branchName",Oo(e.branchNames))}),[e.branchNames]),m.a.createElement(Vs,null,m.a.createElement(ru,{as:"select",label:"Project",name:"project",id:"project",value:t.values.project},Dw.map((function(e){return m.a.createElement("option",{key:e.id,value:e.id},e.name)}))),m.a.createElement(ru,{as:"select",label:"Milestone",name:"milestone",id:"milestone",value:t.values.milestone,disabled:!e.milestones.length},e.milestones.map((function(e){return m.a.createElement("option",{key:e,value:e},e)}))),r&&m.a.createElement(ru,{as:"select",label:"Branch Name",name:"branchName",id:"branchName",value:t.values.branchName,disabled:!e.branchNames.length},e.branchNames.map((function(e){return m.a.createElement("option",{key:e,value:e},e)}))),m.a.createElement("div",{className:"d-flex justify-content-between"},m.a.createElement(lu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Generate")))}var Uw="U_Jxes3Htv-xiaDX5wfn",Fw="https://gitlab.cvinternal.net/api/v4",Vw=function(e,t){return{key:"milestones:".concat(e),url:Qp("".concat(Fw,"/projects/").concat(e,"/milestones"),{private_token:Uw}),normalize:!1,formatData:function(e){return e.map((function(e){return e.title}))},success:t}},zw=function(e,t){return{key:"branch:names:".concat(e),url:Qp("".concat(Fw,"/projects/").concat(e,"/repository/branches"),{private_token:Uw}),normalize:!1,formatData:function(e){return e.map((function(e){return e.name}))},success:t}},Bw=function(e,t,n,r){return{key:"merge:requests:".concat(e,":").concat(t,":").concat(n),url:Qp("".concat(Fw,"/projects/").concat(e,"/merge_requests"),{private_token:Uw,milestone:t,state:"merged",per_page:50,page:n}),success:r}},Hw=function(e,t,n){return{key:"file:paths:".concat(t,":").concat(e),url:Qp("".concat(Fw,"/projects/").concat(e,"/search"),{scope:"blobs",search:t,private_token:Uw}),normalize:!1,formatData:function(e){return e.filter((function(e){return e.filename.includes(t)}))},success:n}},qw=function(e,t,n,r){return{key:"file:".concat(e,":").concat(t,":").concat(n),url:Qp("".concat(Fw,"/projects/").concat(e,"/repository/files/").concat(encodeURIComponent(t),"/raw"),{ref:n,private_token:Uw}),normalize:!1,formatData:function(e){return JSON.parse(e)},success:r}},Jw=Ys.object().shape({project:Ys.string().required("Project is required").default(""),milestone:Ys.string().required("Milestone is required").default(""),branchName:Ys.string().when("project",(function(e,t){return"798"===e?t.required("Branch name is required"):t})).default("")}).noUnknown();function $w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kw(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Yw={project:Oo(Dw).id};function Gw(){var e=$w(m.a.useState([]),2),t=e[0],n=e[1],i=$w(m.a.useState([]),2),c=i[0],s=i[1],u=$w(Nw(Rw),2)[1],f=Object(bn.useDispatch)();return m.a.createElement(m.a.Fragment,null,m.a.createElement("h4",{className:"py-2"},"Generate Release Notes"),m.a.createElement(Ks,{initialValues:Yw,onSubmit:function(e){u(e),r.AppLinkHelper.trigger({application:l.RELEASE_NOTES,action:a.ReleaseNotes.GENERATOR})},validationSchema:Jw},m.a.createElement(Mw,{getMilestones:function(e){n([]),o.fetch(f,Vw(e,n))},milestones:t,getBranchNames:function(e){s([]),o.fetch(f,zw(e,s))},branchNames:c})))}var Ww=n(135),Zw=/#*/;function Qw(e){return e=e.replace("-"," "),e="## "+(e=(e=fd(e)).replace(Zw,"").trim())}function Xw(e){var t=e.toLowerCase();return"## notes"===t||"## dependencies"===t}function eA(e){return e=e.replace("-"," "),e=fd(e)}function tA(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return nA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function nA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rA=["# online","# curator","# library editor","# lite","# styles","# tooling","# analytics","# common","# shared"];function oA(e){for(var t={name:"",changes:""},n=0;t.name||n<e.length;n++){var r=e[n];if(!r)break;if("#"===r){var o=e.indexOf("\n",n),i=e.slice(n,o);rA.includes(i.toLowerCase().trim())&&(t.name=fd(i.replace("#","").trim()),e=e.slice(o))}}for(var a=0;!t.changes&&a<e.length;a++){if(a+1===e.length){t.changes=e,e="";break}if("#"===e[a]&&"#"!==e[a+1]){var c=e.indexOf("\n",a),s=e.slice(a,c);rA.includes(s.toLowerCase().trim())&&(t.changes=e.slice(0,a),e=e.slice(a))}}return{section:t,remainingDescription:e}}function iA(e){var t,n={},r=tA(e);try{for(r.s();!(t=r.n()).done;)for(var o=t.value;o;){var i=oA(o),a=i.section;if(o=i.remainingDescription,!a.name)break;n[a.name]||(n[a.name]=[]),n[a.name].push(a.changes)}}catch(e){r.e(e)}finally{r.f()}var c={};return Object.keys(n).forEach((function(e){var t,r;c[e]=(t=n[e],r={},t.forEach((function(e){for(var t=e.split("");t&&t.length;){for(var n=0;n<t.length&&t.length!==n+1;n++)if("#"===t[n]&&"#"===t[n+1]){var o=t.indexOf("\n",n),i=eA(t.slice(n,o).join(""));r[i]||(r[i]="");for(var a=o;a<t.length;a++){if(t.length===a+1){var c=t.slice(o+1).join("");r[i]+=c,t=[];break}if("#"===t[a]&&"#"===t[a+1]){var s=t.slice(o+1,a).join("");if(!s.length){t=t.slice(a);break}r[i]+=s,t=t.slice(a);break}}r[i]+="\n"}break}})),Object.keys(r).reduce((function(e,t){return e+=t+"\n",e+=r[t]+"\n"}),""))})),Object.keys(c).reduce((function(e,t){return e+="\n",e+="\n# ".concat(t),e+="\n".concat(c[t])}),"")}var aA=n(136),cA=n.n(aA);function sA(e){return function(e){if(Array.isArray(e))return fA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||lA(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||lA(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lA(e,t){if(e){if("string"==typeof e)return fA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fA(e,t):void 0}}function fA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pA(){var e=uA(m.a.useState(!0),2),t=e[0],n=e[1],i=uA(m.a.useState(1),2),c=i[0],s=i[1],u=uA(m.a.useState([]),2),f=u[0],p=u[1],d=uA(m.a.useState([]),2),h=d[0],y=d[1],v=uA(m.a.useState(!0),2),b=v[0],g=v[1],S=uA(m.a.useState(""),2),E=S[0],O=S[1],j=uA(m.a.useState("Copy"),2),C=j[0],w=j[1],A=uA(Nw(Rw),1)[0],I=A&&"798"===A.project,T=Object(bn.useDispatch)();return m.a.useEffect((function(){if(A){var e=A.project,t=A.milestone;o.fetch(T,Bw(e,t,c,(function(e){p([].concat(sA(f),sA(e))),50===e.length?s(c+1):n(!1)})))}}),[c]),m.a.useEffect((function(){if(!(t||I&&b)){var e=f.map((function(e){return e.description.replace("\r\n","\n").replace("\r","")})),n=I?function(e,t){var n=function(e){var t="# Final Package Versions\n\n| Package | Version |\n| ------------------------- | ------------------------ |\n| @clickview/analytics | <analytics-version> |\n| @clickview/styles | <styles-version> |\n| @clickview/tooling | <tooling-version> |\n| @clickview/curator | <curator-version> |\n| @clickview/library-editor | <library-editor-version> |\n| @clickview/lite | <lite-version> |\n| @clickview/online | <online-version> |\n";return e.forEach((function(e){var n=e.name,r=e.version;r&&(t=t.replace("<".concat(n.replace("@clickview/",""),"-version>"),r))})),t}(t),r=iA(e);return"".concat(n,"\n").concat(r)}(e,h):function(e){var t={};return e.forEach((function(e){for(var n=e.split("");;){var r=!1;if(!n||!n.length)break;for(var o=0;o<n.length&&n.length!==o+1;o++)if("#"===n[o]){var i=n.indexOf("\n",o),a=Qw(n.slice(o,i).join(""));t[a]||(Xw(a)?r=!0:t[a]="");for(var c=i;c<n.length;c++){if(n.length===c+1){if(r){r=!1,n=[];break}var s=n.slice(i+1).join("");t[a]+=s,n=[];break}if("#"===n[c]){if(r){r=!1,n=n.slice(c);break}var u=n.slice(i+1,c).join("");if(!u.length){n=n.slice(c);break}t[a]+=u,n=n.slice(c);break}}t[a]?t[a]+="\n":delete t[a]}break}})),Object.keys(t).reduce((function(e,n){return t[n]?(e+=n+"\n",e+=t[n]+"\n"):e}),"")}(e);O(n)}}),[t,b]),m.a.useEffect((function(){if(A&&I){var e=[];o.fetch(T,Hw(A.project,"package.json",(function(t){var n,r=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=lA(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;o.fetch(T,qw(A.project,i.path,A.branchName,(function(n){e.push(n),e.length===t.length&&(y(e),g(!1))})))}}catch(e){r.e(e)}finally{r.f()}})))}}),[]),A?m.a.createElement(m.a.Fragment,null,E?m.a.createElement("div",{className:"position-relative border rounded p-3"},m.a.createElement(Ww,{onCopy:function(){return w("Copied")},text:E},m.a.createElement("button",{className:"btn btn-white ".concat(cA.a.copyBtn)},C)),m.a.createElement("div",{dangerouslySetInnerHTML:{__html:tw()(E)}})):t?"Fetching merge requests..":"Merging descriptions.."):(r.AppLinkHelper.trigger({application:l.RELEASE_NOTES,action:a.ReleaseNotes.FORM}),m.a.createElement(m.a.Fragment,null))}function dA(e){return(dA="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 mA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hA(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 yA(e,t,n){return t&&hA(e.prototype,t),n&&hA(e,n),e}function vA(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&&bA(e,t)}function bA(e,t){return(bA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gA(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=EA(e);if(t){var o=EA(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return SA(this,n)}}function SA(e,t){return!t||"object"!==dA(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 EA(e){return(EA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var OA,jA=function(e){vA(n,e);var t=gA(n);function n(){return mA(this,n),t.apply(this,arguments)}return yA(n,[{key:"channelName",get:function(){return l.RELEASE_NOTES}},{key:"appRoutes",get:function(){return{"developer/release-notes(/)":"index","developer/release-notes/generate(/)":"form","developer/release-notes/generator(/)":"generator"}}}]),n}(r.AppRouter),CA=function(e){vA(n,e);var t=gA(n);function n(){return mA(this,n),t.apply(this,arguments)}return yA(n,[{key:"index",value:function(){r.AppLinkHelper.trigger({application:l.RELEASE_NOTES,action:a.ReleaseNotes.GENERATOR},{replace:!0})}},{key:"form",value:function(){this.layout.showChildView(kn,d.createElement(Gw,null))}},{key:"generator",value:function(){this.layout.showChildView(kn,d.createElement(pA,null))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(Ln,d.createElement(Gh,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Release Notes Application"}},{key:"channelName",get:function(){return l.RELEASE_NOTES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return jA}}]),n}(r.Application);function wA(e){return(wA="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 AA(e){return function(e){if(Array.isArray(e))return IA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return IA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IA(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function TA(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 kA(e,t){return(kA=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=xA(e);if(t){var o=xA(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return LA(this,n)}}function LA(e,t){return!t||"object"!==wA(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 xA(e){return(xA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Fifo="FifoMemoryCache"}(OA||(OA={}));var PA,NA=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&&kA(e,t)}(i,e);var t,n,r,o=_A(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this)).size=e.size,t.cache={},t.cachedkeys=[],t}return t=i,(n=[{key:"removeCacheKey",value:function(e){this.cachedkeys=h.without(this.cachedkeys,e)}},{key:"has",value:function(e){return!!this.cache[e]}},{key:"get",value:function(e){return this.cache[e]}},{key:"set",value:function(e,t){e&&t||K.throw(new Xe("Must provide a cache key and a value to cache in FifoMemoryCache.")),this.has(e)&&this.removeCacheKey(e),this.cachedkeys.push(e),this.cache[e]=t,this.cachedkeys.length>this.size&&delete this.cache[this.cachedkeys.shift()]}},{key:"getOrSet",value:function(e,t){if(this.has(e))return this.get(e);var n=t();return this.set(e,n),n}},{key:"remove",value:function(e){return!!this.has(e)&&(delete this.cache[e],this.removeCacheKey(e),!0)}},{key:"invalidate",value:function(e,t){var n=this,r=h.object(this.cachedkeys,this.cachedkeys),o=[];h.each(e,(function(e){var t;r[e]&&o.push(e);var n=new RegExp(e,"i"),i=h.filter(r,(function(e){return n.test(e)}));(t=o).push.apply(t,AA(i))})),o.length&&(o=h.uniq(o),h.each(o,(function(e){delete n.cache[e],h.isFunction(t)&&t(e)})),this.cachedkeys=h.without.apply(h,[this.cachedkeys].concat(AA(o))))}},{key:"name",get:function(){return OA.Fifo}}])&&TA(t.prototype,n),r&&TA(t,r),i}(Yt);!function(e){e[e.Unknown=0]="Unknown",e[e.BadRequest=1]="BadRequest",e[e.Unauthorized=2]="Unauthorized",e[e.Forbidden=3]="Forbidden",e[e.NotFound=4]="NotFound",e[e.InternalServer=5]="InternalServer"}(PA||(PA={}));var RA,DA={type:PA.Unknown,message:"",code:0};!function(e){e.Ajax="AjaxDataProvider",e.Notifications="NotificationsSignalRDataProvider"}(RA||(RA={}));var MA=function(e,t,n){if(!n||!n.errorCode)return e[t];var r="".concat(n.errorCode);return n.errorSubCode&&(r+=".".concat(n.errorSubCode)),e[r]||e[t]};function UA(e){return(UA="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 FA(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 VA(e,t){return(VA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function zA(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=HA(e);if(t){var o=HA(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return BA(this,n)}}function BA(e,t){return!t||"object"!==UA(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 HA(e){return(HA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var qA=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&&VA(e,t)}(i,e);var t,n,r,o=zA(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,e),$.ajaxSetup({cache:!1,contentType:"application/json; charset=utf-8"}),t.successMiddleware={},t.errorMiddleware={},t.dataServiceErrorMessageMappings=e.dataServiceErrorMessageMappings,t.defaultErrorMessageKey=e.defaultErrorMessageKey,t}return t=i,(n=[{key:"parseUrl",value:function(e){var t=document.createElement("a");return t.href=e,""===t.host&&(t.href=t.href),t}},{key:"makeHttps",value:function(e){var t=this.parseUrl(e);return"http:"===t.protocol&&(t.protocol="https:"),t.href}},{key:"base",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n||(n=jr.GET);var o=h.defaults(r,{forceHttps:!1}),i={url:e,method:n,type:n};t&&(i.data=n===jr.POST||n===jr.PUT?JSON.stringify(t):t),o.forceHttps&&(i.url=this.makeHttps(i.url)),o.traditional&&(i.traditional=o.traditional);var a=$.ajax(i);return h.keys(this.successMiddleware).length&&a.done(h.values(this.successMiddleware)),h.keys(this.errorMiddleware).length&&a.fail(h.values(this.errorMiddleware)),a}},{key:"create",value:function(e,t,n){var r=n.channel,o=n.successEvent,i=n.errorEvent;this.base(e,t,jr.POST).done((function(e,t,n){return r.trigger(o,e,t,n)})).fail((function(e,t,n){return r.trigger(i,e,t,n)}))}},{key:"read",value:function(e,t){var n=t.channel,r=t.successEvent,o=t.errorEvent;this.base(e,null,jr.GET).done((function(e,t,o){n.trigger(r,e,t,o)})).fail((function(e,t,r){n.trigger(o,e,t,r)}))}},{key:"update",value:function(e,t,n){var r=n.channel,o=n.successEvent,i=n.errorEvent;this.base(e,t,jr.PUT).done((function(e,t,n){return r.trigger(o,e,t,n)})).fail((function(e,t,n){return r.trigger(i,e,t,n)}))}},{key:"delete",value:function(e,t){var n=t.channel,r=t.successEvent,o=t.errorEvent;this.base(e,null,jr.DELETE).done((function(e,t,o){return n.trigger(r,e,t,o)})).fail((function(e,t,r){return n.trigger(o,e,t,r)}))}},{key:"useMiddleware",value:function(e,t){this.successMiddleware[e]||(this.successMiddleware[e]=t)}},{key:"useErrorMiddleware",value:function(e,t){this.errorMiddleware[e]||(this.errorMiddleware[e]=t)}},{key:"parseError",value:function(e,t,n){var r=e.responseJSON,o=DA;switch(o.code=e.status,o.message=MA(this.dataServiceErrorMessageMappings,this.defaultErrorMessageKey,r),e.status){case 400:o.type=PA.BadRequest;break;case 401:o.type=PA.Unauthorized;break;case 403:o.type=PA.Forbidden;break;case 404:o.type=PA.NotFound;break;case 500:o.type=PA.InternalServer}return o}},{key:"name",get:function(){return RA.Ajax}}])&&FA(t.prototype,n),r&&FA(t,r),i}(I.Object);function JA(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $A(e,t){return"string"==typeof t.payload.dataOrKey&&void 0!==t.payload.keyData?Object.assign(Object.assign({},e),JA({},t.payload.viewModelKey,Object.assign(Object.assign({},e[t.payload.viewModelKey]),JA({},t.payload.dataOrKey,t.payload.keyData)))):Object.assign(Object.assign({},e),JA({},t.payload.viewModelKey,t.payload.dataOrKey))}function KA(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Pw:return $A(e,t)}return e}var YA="LanguageDataService",GA="locale",WA="phrases",ZA="language:data:service",QA="locale",XA="phrases";function eI(e){return(eI="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 tI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nI(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 rI(e,t){return(rI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oI(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=aI(e);if(t){var o=aI(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return iI(this,n)}}function iI(e,t){return!t||"object"!==eI(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 aI(e){return(aI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var cI=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&&rI(e,t)}(i,e);var t,n,r,o=oI(i);function i(){return tI(this,i),o.apply(this,arguments)}return t=i,(n=[{key:"getLanguageConfig",value:function(e){var t={locale:"",phrases:null};this.get({resource:"/api/locale",eventPrefix:GA,expiryTime:Eb.STANDARD,bootstrapName:QA,callback:function(n){t.locale=n,t.phrases&&h.isFunction(e)&&e(t)}}),this.get({resource:"/api/phrases",eventPrefix:WA,expiryTime:Eb.STANDARD,bootstrapName:XA,callback:function(n){t.phrases=n,t.locale&&h.isFunction(e)&&e(t)}})}},{key:"name",get:function(){return YA}},{key:"channelName",get:function(){return ZA}}])&&nI(t.prototype,n),r&&nI(t,r),i}(mr);n.d(t,"Actions",(function(){return a})),n.d(t,"DataPrefixes",(function(){return c})),n.d(t,"FileExtensions",(function(){return s})),n.d(t,"Layouts",(function(){return u})),n.d(t,"AppChannels",(function(){return l})),n.d(t,"DataChannels",(function(){return f})),n.d(t,"DataServices",(function(){return p})),n.d(t,"CuratorLayoutView",(function(){return Hn})),n.d(t,"LayoutComponent",(function(){return Yn})),n.d(t,"CuratorAppNavService",(function(){return or})),n.d(t,"ImageUploadDataService",(function(){return Cr})),n.d(t,"CompaniesApplication",(function(){return Ph})),n.d(t,"DomainOptionsApplication",(function(){return By})),n.d(t,"PeopleApplication",(function(){return gv})),n.d(t,"PlaylistsApplication",(function(){return Ej})),n.d(t,"SeriesApplication",(function(){return Zj})),n.d(t,"SubjectDataService",(function(){return Ag})),n.d(t,"SubjectDataServiceHelper",(function(){return Tg})),n.d(t,"SubjectsApplication",(function(){return sC})),n.d(t,"ThemesApplication",(function(){return KC})),n.d(t,"VideosApplication",(function(){return xw})),n.d(t,"DomainOptionsApplication",(function(){return By})),n.d(t,"ReleaseNotesApplication",(function(){return CA})),n.d(t,"Core",(function(){return r})),n.d(t,"InstanceManager",(function(){return Av})),n.d(t,"FifoMemoryCache",(function(){return NA})),n.d(t,"AjaxDataProvider",(function(){return qA})),n.d(t,"AlertList",(function(){return Gh})),n.d(t,"AlertType",(function(){return _h})),n.d(t,"BaseAlertService",(function(){return zh})),n.d(t,"LanguageService",(function(){return Ou})),n.d(t,"Flight",(function(){return o})),n.d(t,"CacheDurations",(function(){return Eb})),n.d(t,"ViewModelReducer",(function(){return KA})),n.d(t,"LanguageDataService",(function(){return cI}))}])}));
|