From f14a00f68a54c6fe160364e751690efe70d65a14 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Wed, 18 Dec 2024 12:00:21 +1300 Subject: [PATCH] DEP Replace react-dnd with dnd-kit --- client/dist/js/TinyMCE_ssembed.js | 623 +- client/dist/js/TinyMCE_sslink-file.js | 25452 ++++++++++++- client/dist/js/TinyMCE_ssmedia.js | 25804 ++++++++++++- client/dist/js/bundle.js | 29893 +++++++++++++++- client/dist/styles/bundle.css | 1939 +- .../src/components/BackButton/BackButton.js | 2 +- .../src/components/GalleryItem/GalleryItem.js | 5 +- .../components/GalleryItem/GalleryItem.scss | 11 +- .../GalleryItem/GalleryItemDragLayer.js | 100 +- client/src/components/GalleryItem/README.md | 4 +- .../src/components/GalleryItem/draggable.js | 98 +- .../src/components/GalleryItem/droppable.js | 67 +- client/src/containers/Gallery/Gallery.js | 2 +- client/src/containers/Gallery/GalleryDND.js | 96 +- package.json | 3 + yarn.lock | 33 +- 16 files changed, 83883 insertions(+), 249 deletions(-) diff --git a/client/dist/js/TinyMCE_ssembed.js b/client/dist/js/TinyMCE_ssembed.js index dd69988d1..4548d7455 100644 --- a/client/dist/js/TinyMCE_ssembed.js +++ b/client/dist/js/TinyMCE_ssembed.js @@ -1 +1,622 @@ -!function(){"use strict";var e={4333:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=f(n(5815)),o=p(n(1594)),i=n(9367),s=n(9040),a=f(n(8737)),d=p(n(2811)),l=f(n(6935)),c=n(5125);function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function p(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function f(e){return e&&e.__esModule?e:{default:e}}class m extends o.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this)}componentDidMount(){this.setOverrides(this.props)}componentDidUpdate(e){this.props.isOpen&&!e.isOpen&&this.setOverrides(this.props)}componentWillUnmount(){this.clearOverrides()}setOverrides(e){if(this.props.schemaUrl!==e.schemaUrl&&this.clearOverrides(),e.schemaUrl){const t=Object.assign({},e.fileAttributes);delete t.ID;const n={fields:Object.entries(t).map((e=>{const[t,n]=e;return{name:t,value:n}}))};this.props.actions.schema.setSchemaStateOverrides(e.schemaUrl,n)}}getModalProps(){const e=Object.assign({onSubmit:this.handleSubmit,onLoadingError:this.handleLoadingError,showErrorMessage:!0,responseClassBad:"alert alert-danger",identifier:"AssetAdmin.InsertEmbedModal"},this.props,{className:`insert-embed-modal ${this.props.className}`,size:"lg",onClosed:this.props.onClosed,title:this.props.targetUrl?r.default._t("AssetAdmin.EditTitle","Media from the web"):r.default._t("AssetAdmin.CreateTitle","Insert new media from the web")});return delete e.sectionConfig,delete e.onInsert,delete e.fileAttributes,e}clearOverrides(){this.props.actions.schema.setSchemaStateOverrides(this.props.schemaUrl,null)}handleLoadingError(e){"function"==typeof this.props.onLoadingError&&this.props.onLoadingError(e)}handleSubmit(e,t){switch(t){case"action_addmedia":this.props.onCreate(e);break;case"action_insertmedia":this.props.onInsert(e);break;case"action_cancel":this.props.onClosed()}return Promise.resolve()}render(){const{FormBuilderModalComponent:e}=this.props;return o.default.createElement(e,this.getModalProps())}}t.Component=m,m.propTypes={sectionConfig:l.default.shape({url:l.default.string,form:l.default.object}),isOpen:l.default.bool,onInsert:l.default.func.isRequired,onCreate:l.default.func.isRequired,fileAttributes:l.default.shape({Url:l.default.string,CaptionText:l.default.string,PreviewUrl:l.default.string,Placement:l.default.string,Width:l.default.number,Height:l.default.number}),onClosed:l.default.func.isRequired,className:l.default.string,actions:l.default.object,schemaUrl:l.default.string.isRequired,targetUrl:l.default.string,onLoadingError:l.default.func,FormBuilderModalComponent:l.default.oneOfType([l.default.object,l.default.func])},m.defaultProps={className:"",fileAttributes:{},FormBuilderModalComponent:a.default};t.default=(0,s.connect)((function(e,t){const n=e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name)),r=t.fileAttributes?t.fileAttributes.Url:"",o=n.form.remoteEditForm.schemaUrl,i=r&&(0,c.joinUrlPaths)(o,`/?embedurl=${encodeURIComponent(r)}`),s=n.form.remoteCreateForm.schemaUrl;return{sectionConfig:n,schemaUrl:i||s,targetUrl:r}}),(function(e){return{actions:{schema:(0,i.bindActionCreators)(d,e)}}}))(m)},8737:function(e){e.exports=FormBuilderModal},5207:function(e){e.exports=Injector},6935:function(e){e.exports=PropTypes},1594:function(e){e.exports=React},5145:function(e){e.exports=ReactDomClient},9040:function(e){e.exports=ReactRedux},9367:function(e){e.exports=Redux},2811:function(e){e.exports=SchemaActions},2121:function(e){e.exports=ShortcodeSerialiser},5815:function(e){e.exports=i18n},1669:function(e){e.exports=jQuery},5125:function(e){e.exports=ssUrlLib}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}var r=u(n(1669)),o=u(n(1594)),i=n(5145),s=n(5207),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(2121)),d=u(n(4333)),l=u(n(5815));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function u(e){return e&&e.__esModule?e:{default:e}}const p=(0,s.loadComponent)(d.default),f='div[data-shortcode="embed"]';(()=>{const e=e=>{const t=l.default._t("AssetAdmin.INSERT_VIA_URL","Insert media via URL"),n=l.default._t("AssetAdmin.EDIT_MEDIA","Edit media"),o=l.default._t("AssetAdmin.DELETE_MEDIA","Delete media"),i=l.default._t("AssetAdmin.MEDIA","Media");return e.addCommand("ssembed",(()=>{(0,r.default)(`#${e.id}`).entwine("ss").openEmbedDialog()})),e.addCommand("ssembed-delete",(()=>{const t=e.selection.getNode();e.dom.is(t,f)?t.remove():e.dom.is(t.parentNode,f)?t.parentNode.remove():console.error({error:"Unexpected selection - expected embed",selectedNode:t})})),e.ui.registry.addButton("ssembed",{tooltip:t,icon:"embed",onAction:()=>e.execCommand("ssembed"),stateSelector:f}),e.ui.registry.addMenuItem("ssembed",{text:i,icon:"embed",onAction:()=>e.execCommand("ssembed")}),e.ui.registry.addButton("ssembededit",{tooltip:n,icon:"edit-block",onAction:()=>e.execCommand("ssembed")}),e.ui.registry.addButton("ssembeddelete",{tooltip:o,icon:"remove",onAction:()=>e.execCommand("ssembed-delete")}),e.ui.registry.addContextToolbar("ssembed",{predicate:t=>e.dom.is(t,f),position:"node",scope:"node",items:"alignleft aligncenter alignright | ssembededit ssembeddelete"}),e.on("BeforeExecCommand",(t=>{const n=t.command,r=t.ui,o=t.value;"mceMedia"===n&&(t.preventDefault(),e.execCommand("ssembed",r,o))})),e.on("GetContent",(e=>{const t=(0,r.default)(`
${e.content}
`);t.find(f).each((function(){const e=(0,r.default)(this),t=e.find("img.placeholder");if(0===t.length)return e.removeAttr("data-url"),void e.removeAttr("data-shortcode");const n=e.find(".caption").text(),o=parseInt(t.attr("width"),10),i=parseInt(t.attr("height"),10),s=e.data("url"),d=(0,a.sanitiseShortCodeProperties)({url:s,thumbnail:t.prop("src"),class:e.prop("class"),width:isNaN(o)?null:o,height:isNaN(i)?null:i,caption:n}),l=a.default.serialise({name:"embed",properties:d,wrapped:!0,content:d.url});e.replaceWith(l)})),e.content=t.html()})),e.on("BeforeSetContent",(e=>{let t=e.content,n=a.default.match("embed",!0,t);for(;n;){const e=n.properties,o=(0,r.default)("
").attr("data-url",e.url||n.content).attr("data-shortcode","embed").addClass(e.class).addClass("ss-htmleditorfield-file embed"),i=(0,r.default)("").attr("src",e.thumbnail).addClass("placeholder");if(e.width&&i.attr("width",e.width),e.height&&i.attr("height",e.height),o.append(i),e.caption){const t=(0,r.default)("

").addClass("caption").text(e.caption);o.append(t)}t=t.replace(n.original,(0,r.default)("

").append(o).html()),n=a.default.match("embed",!0,t)}e.content=t})),{getMetadata(){return{name:"Silverstripe Embed",url:"https://docs.silverstripe.org/en/4/developer_guides/forms/field_types/htmleditorfield"}}}};tinymce.PluginManager.add("ssembed",(t=>e(t)))})(),r.default.entwine("ss",(e=>{e(".js-injector-boot #insert-embed-react__dialog-wrapper").entwine({Element:null,Data:{},ReactRoot:null,onunmatch(){this._clearModal()},_clearModal(){const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))},open(){this._renderModal(!0)},close(){this.setData({}),this._renderModal(!1)},_renderModal(e){var t=this;const n=this.getOriginalAttributes();let r=this.getReactRoot();r||(r=(0,i.createRoot)(this[0])),r.render(o.default.createElement(p,{isOpen:e,onCreate:function(){return t._handleCreate(...arguments)},onInsert:function(){return t._handleInsert(...arguments)},onClosed:()=>this.close(),onLoadingError:function(){return t._handleLoadingError(...arguments)},bodyClassName:"modal__dialog",className:"insert-embed-react__dialog-wrapper",fileAttributes:n})),this.setReactRoot(r)},_handleLoadingError(){this.setData({}),this.open()},_handleInsert(e){const t=this.getData();this.setData(Object.assign({Url:t.Url},e)),this.insertRemote(),this.close()},_handleCreate(e){this.setData(Object.assign({},this.getData(),e)),this.open()},getOriginalAttributes(){const t=this.getData(),n=this.getElement();if(!n)return t;const r=e(n.getEditor().getSelectedNode());if(!r.length)return t;const o=r.closest(f).add(r.filter(f));if(!o.length)return t;const i=o.find("img.placeholder");if(0===i.length)return t;const s=o.find(".caption").text(),a=parseInt(i.width(),10),d=parseInt(i.height(),10);return{Url:o.data("url")||t.Url,CaptionText:s,PreviewUrl:i.attr("src"),Width:isNaN(a)?null:a,Height:isNaN(d)?null:d,Placement:this.findPosition(o.prop("class"))}},findPosition(e){if("string"!=typeof e)return"";const t=e.split(" ");return["leftAlone","center","rightAlone","left","right"].find((e=>t.indexOf(e)>-1))},insertRemote(){const t=this.getElement();if(!t)return!1;const n=t.getEditor();if(!n)return!1;const o=this.getData(),i=(0,r.default)("
").attr("data-url",o.Url).attr("data-shortcode","embed").addClass(o.Placement).addClass("ss-htmleditorfield-file embed"),s=(0,r.default)("").attr("src",o.PreviewUrl).addClass("placeholder");if(o.Width&&s.attr("width",o.Width),o.Height&&s.attr("height",o.Height),i.append(s),o.CaptionText){const e=(0,r.default)("

").addClass("caption").text(o.CaptionText);i.append(e)}const a=e(n.getSelectedNode());let d=e(null);return a.length&&(d=a.filter(f),0===d.length&&(d=a.closest(f)),0===d.length&&(d=a.filter("img.placeholder"))),d.length?d.replaceWith(i):(n.repaint(),n.insertContent(e("

").append(i.clone()).html(),{skip_undo:1})),n.addUndo(),n.repaint(),!0}})}))}(); \ No newline at end of file +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "./client/src/components/InsertEmbedModal/InsertEmbedModal.js": +/*!********************************************************************!*\ + !*** ./client/src/components/InsertEmbedModal/InsertEmbedModal.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _FormBuilderModal = _interopRequireDefault(__webpack_require__(/*! components/FormBuilderModal/FormBuilderModal */ "components/FormBuilderModal/FormBuilderModal")); +var schemaActions = _interopRequireWildcard(__webpack_require__(/*! state/schema/SchemaActions */ "state/schema/SchemaActions")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _urls = __webpack_require__(/*! lib/urls */ "lib/urls"); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const sectionConfigKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; +class InsertEmbedModal extends _react.Component { + constructor(props) { + super(props); + this.handleSubmit = this.handleSubmit.bind(this); + } + componentDidMount() { + this.setOverrides(this.props); + } + componentDidUpdate(prevProps) { + if (this.props.isOpen && !prevProps.isOpen) { + this.setOverrides(this.props); + } + } + componentWillUnmount() { + this.clearOverrides(); + } + setOverrides(props) { + if (this.props.schemaUrl !== props.schemaUrl) { + this.clearOverrides(); + } + if (props.schemaUrl) { + const attrs = Object.assign({}, props.fileAttributes); + delete attrs.ID; + const overrides = { + fields: Object.entries(attrs).map(field => { + const [name, value] = field; + return { + name, + value + }; + }) + }; + this.props.actions.schema.setSchemaStateOverrides(props.schemaUrl, overrides); + } + } + getModalProps() { + const props = Object.assign({ + onSubmit: this.handleSubmit, + onLoadingError: this.handleLoadingError, + showErrorMessage: true, + responseClassBad: 'alert alert-danger', + identifier: 'AssetAdmin.InsertEmbedModal' + }, this.props, { + className: `insert-embed-modal ${this.props.className}`, + size: 'lg', + onClosed: this.props.onClosed, + title: this.props.targetUrl ? _i18n.default._t('AssetAdmin.EditTitle', 'Media from the web') : _i18n.default._t('AssetAdmin.CreateTitle', 'Insert new media from the web') + }); + delete props.sectionConfig; + delete props.onInsert; + delete props.fileAttributes; + return props; + } + clearOverrides() { + this.props.actions.schema.setSchemaStateOverrides(this.props.schemaUrl, null); + } + handleLoadingError(error) { + if (typeof this.props.onLoadingError === 'function') { + this.props.onLoadingError(error); + } + } + handleSubmit(data, action) { + switch (action) { + case 'action_addmedia': + { + this.props.onCreate(data); + break; + } + case 'action_insertmedia': + { + this.props.onInsert(data); + break; + } + case 'action_cancel': + { + this.props.onClosed(); + break; + } + default: + {} + } + return Promise.resolve(); + } + render() { + const { + FormBuilderModalComponent + } = this.props; + return _react.default.createElement(FormBuilderModalComponent, this.getModalProps()); + } +} +exports.Component = InsertEmbedModal; +InsertEmbedModal.propTypes = { + sectionConfig: _propTypes.default.shape({ + url: _propTypes.default.string, + form: _propTypes.default.object + }), + isOpen: _propTypes.default.bool, + onInsert: _propTypes.default.func.isRequired, + onCreate: _propTypes.default.func.isRequired, + fileAttributes: _propTypes.default.shape({ + Url: _propTypes.default.string, + CaptionText: _propTypes.default.string, + PreviewUrl: _propTypes.default.string, + Placement: _propTypes.default.string, + Width: _propTypes.default.number, + Height: _propTypes.default.number + }), + onClosed: _propTypes.default.func.isRequired, + className: _propTypes.default.string, + actions: _propTypes.default.object, + schemaUrl: _propTypes.default.string.isRequired, + targetUrl: _propTypes.default.string, + onLoadingError: _propTypes.default.func, + FormBuilderModalComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +InsertEmbedModal.defaultProps = { + className: '', + fileAttributes: {}, + FormBuilderModalComponent: _FormBuilderModal.default +}; +function mapStateToProps(state, ownProps) { + const sectionConfig = state.config.sections.find(section => section.name === sectionConfigKey); + const targetUrl = ownProps.fileAttributes ? ownProps.fileAttributes.Url : ''; + const baseEditUrl = sectionConfig.form.remoteEditForm.schemaUrl; + const editUrl = targetUrl && (0, _urls.joinUrlPaths)(baseEditUrl, `/?embedurl=${encodeURIComponent(targetUrl)}`); + const createUrl = sectionConfig.form.remoteCreateForm.schemaUrl; + const schemaUrl = editUrl || createUrl; + return { + sectionConfig, + schemaUrl, + targetUrl + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + schema: (0, _redux.bindActionCreators)(schemaActions, dispatch) + } + }; +} +var _default = exports["default"] = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(InsertEmbedModal); + +/***/ }), + +/***/ "components/FormBuilderModal/FormBuilderModal": +/*!***********************************!*\ + !*** external "FormBuilderModal" ***! + \***********************************/ +/***/ (function(module) { + +module.exports = FormBuilderModal; + +/***/ }), + +/***/ "lib/Injector": +/*!***************************!*\ + !*** external "Injector" ***! + \***************************/ +/***/ (function(module) { + +module.exports = Injector; + +/***/ }), + +/***/ "prop-types": +/*!****************************!*\ + !*** external "PropTypes" ***! + \****************************/ +/***/ (function(module) { + +module.exports = PropTypes; + +/***/ }), + +/***/ "react": +/*!************************!*\ + !*** external "React" ***! + \************************/ +/***/ (function(module) { + +module.exports = React; + +/***/ }), + +/***/ "react-dom/client": +/*!*********************************!*\ + !*** external "ReactDomClient" ***! + \*********************************/ +/***/ (function(module) { + +module.exports = ReactDomClient; + +/***/ }), + +/***/ "react-redux": +/*!*****************************!*\ + !*** external "ReactRedux" ***! + \*****************************/ +/***/ (function(module) { + +module.exports = ReactRedux; + +/***/ }), + +/***/ "redux": +/*!************************!*\ + !*** external "Redux" ***! + \************************/ +/***/ (function(module) { + +module.exports = Redux; + +/***/ }), + +/***/ "state/schema/SchemaActions": +/*!********************************!*\ + !*** external "SchemaActions" ***! + \********************************/ +/***/ (function(module) { + +module.exports = SchemaActions; + +/***/ }), + +/***/ "lib/ShortcodeSerialiser": +/*!**************************************!*\ + !*** external "ShortcodeSerialiser" ***! + \**************************************/ +/***/ (function(module) { + +module.exports = ShortcodeSerialiser; + +/***/ }), + +/***/ "i18n": +/*!***********************!*\ + !*** external "i18n" ***! + \***********************/ +/***/ (function(module) { + +module.exports = i18n; + +/***/ }), + +/***/ "jquery": +/*!*************************!*\ + !*** external "jQuery" ***! + \*************************/ +/***/ (function(module) { + +module.exports = jQuery; + +/***/ }), + +/***/ "lib/urls": +/*!***************************!*\ + !*** external "ssUrlLib" ***! + \***************************/ +/***/ (function(module) { + +module.exports = ssUrlLib; + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk. +!function() { +/*!***********************************************!*\ + !*** ./client/src/entwine/TinyMCE_ssembed.js ***! + \***********************************************/ + + +var _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ "jquery")); +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _client = __webpack_require__(/*! react-dom/client */ "react-dom/client"); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _ShortcodeSerialiser = _interopRequireWildcard(__webpack_require__(/*! lib/ShortcodeSerialiser */ "lib/ShortcodeSerialiser")); +var _InsertEmbedModal = _interopRequireDefault(__webpack_require__(/*! components/InsertEmbedModal/InsertEmbedModal */ "./client/src/components/InsertEmbedModal/InsertEmbedModal.js")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const InjectableInsertEmbedModal = (0, _Injector.loadComponent)(_InsertEmbedModal.default); +const filter = 'div[data-shortcode="embed"]'; +(() => { + const ssembed = { + init: editor => { + const insertTitle = _i18n.default._t('AssetAdmin.INSERT_VIA_URL', 'Insert media via URL'); + const editTitle = _i18n.default._t('AssetAdmin.EDIT_MEDIA', 'Edit media'); + const deleteTitle = _i18n.default._t('AssetAdmin.DELETE_MEDIA', 'Delete media'); + const contextTitle = _i18n.default._t('AssetAdmin.MEDIA', 'Media'); + editor.addCommand('ssembed', () => { + (0, _jquery.default)(`#${editor.id}`).entwine('ss').openEmbedDialog(); + }); + editor.addCommand('ssembed-delete', () => { + const node = editor.selection.getNode(); + if (editor.dom.is(node, filter)) { + node.remove(); + } else if (editor.dom.is(node.parentNode, filter)) { + node.parentNode.remove(); + } else { + console.error({ + error: 'Unexpected selection - expected embed', + selectedNode: node + }); + } + }); + editor.ui.registry.addButton('ssembed', { + tooltip: insertTitle, + icon: 'embed', + onAction: () => editor.execCommand('ssembed'), + stateSelector: filter + }); + editor.ui.registry.addMenuItem('ssembed', { + text: contextTitle, + icon: 'embed', + onAction: () => editor.execCommand('ssembed') + }); + editor.ui.registry.addButton('ssembededit', { + tooltip: editTitle, + icon: 'edit-block', + onAction: () => editor.execCommand('ssembed') + }); + editor.ui.registry.addButton('ssembeddelete', { + tooltip: deleteTitle, + icon: 'remove', + onAction: () => editor.execCommand('ssembed-delete') + }); + editor.ui.registry.addContextToolbar('ssembed', { + predicate: node => editor.dom.is(node, filter), + position: 'node', + scope: 'node', + items: 'alignleft aligncenter alignright | ssembededit ssembeddelete' + }); + editor.on('BeforeExecCommand', e => { + const cmd = e.command; + const ui = e.ui; + const val = e.value; + if (cmd === 'mceMedia') { + e.preventDefault(); + editor.execCommand('ssembed', ui, val); + } + }); + editor.on('GetContent', o => { + const content = (0, _jquery.default)(`
${o.content}
`); + content.find(filter).each(function replaceWithShortCode() { + const embed = (0, _jquery.default)(this); + const placeholder = embed.find('img.placeholder'); + if (placeholder.length === 0) { + embed.removeAttr('data-url'); + embed.removeAttr('data-shortcode'); + return; + } + const caption = embed.find('.caption').text(); + const width = parseInt(placeholder.attr('width'), 10); + const height = parseInt(placeholder.attr('height'), 10); + const url = embed.data('url'); + const properties = (0, _ShortcodeSerialiser.sanitiseShortCodeProperties)({ + url, + thumbnail: placeholder.prop('src'), + class: embed.prop('class'), + width: isNaN(width) ? null : width, + height: isNaN(height) ? null : height, + caption + }); + const shortCode = _ShortcodeSerialiser.default.serialise({ + name: 'embed', + properties, + wrapped: true, + content: properties.url + }); + embed.replaceWith(shortCode); + }); + o.content = content.html(); + }); + editor.on('BeforeSetContent', o => { + let content = o.content; + let match = _ShortcodeSerialiser.default.match('embed', true, content); + while (match) { + const data = match.properties; + const base = (0, _jquery.default)('
').attr('data-url', data.url || match.content).attr('data-shortcode', 'embed').addClass(data.class).addClass('ss-htmleditorfield-file embed'); + const placeholder = (0, _jquery.default)('').attr('src', data.thumbnail).addClass('placeholder'); + if (data.width) { + placeholder.attr('width', data.width); + } + if (data.height) { + placeholder.attr('height', data.height); + } + base.append(placeholder); + if (data.caption) { + const caption = (0, _jquery.default)('

').addClass('caption').text(data.caption); + base.append(caption); + } + content = content.replace(match.original, (0, _jquery.default)('

').append(base).html()); + match = _ShortcodeSerialiser.default.match('embed', true, content); + } + o.content = content; + }); + return { + getMetadata() { + return { + name: 'Silverstripe Embed', + url: 'https://docs.silverstripe.org/en/4/developer_guides/forms/field_types/htmleditorfield' + }; + } + }; + } + }; + tinymce.PluginManager.add('ssembed', editor => ssembed.init(editor)); +})(); +_jquery.default.entwine('ss', $ => { + $('.js-injector-boot #insert-embed-react__dialog-wrapper').entwine({ + Element: null, + Data: {}, + ReactRoot: null, + onunmatch() { + this._clearModal(); + }, + _clearModal() { + const root = this.getReactRoot(); + if (root) { + root.unmount(); + this.setReactRoot(null); + } + }, + open() { + this._renderModal(true); + }, + close() { + this.setData({}); + this._renderModal(false); + }, + _renderModal(isOpen) { + var _this = this; + const handleHide = () => this.close(); + const handleInsert = function () { + return _this._handleInsert(...arguments); + }; + const handleCreate = function () { + return _this._handleCreate(...arguments); + }; + const handleLoadingError = function () { + return _this._handleLoadingError(...arguments); + }; + const attrs = this.getOriginalAttributes(); + let root = this.getReactRoot(); + if (!root) { + root = (0, _client.createRoot)(this[0]); + } + root.render(_react.default.createElement(InjectableInsertEmbedModal, { + isOpen: isOpen, + onCreate: handleCreate, + onInsert: handleInsert, + onClosed: handleHide, + onLoadingError: handleLoadingError, + bodyClassName: "modal__dialog", + className: "insert-embed-react__dialog-wrapper", + fileAttributes: attrs + })); + this.setReactRoot(root); + }, + _handleLoadingError() { + this.setData({}); + this.open(); + }, + _handleInsert(data) { + const oldData = this.getData(); + this.setData(Object.assign({ + Url: oldData.Url + }, data)); + this.insertRemote(); + this.close(); + }, + _handleCreate(data) { + this.setData(Object.assign({}, this.getData(), data)); + this.open(); + }, + getOriginalAttributes() { + const data = this.getData(); + const $field = this.getElement(); + if (!$field) { + return data; + } + const node = $($field.getEditor().getSelectedNode()); + if (!node.length) { + return data; + } + const element = node.closest(filter).add(node.filter(filter)); + if (!element.length) { + return data; + } + const image = element.find('img.placeholder'); + if (image.length === 0) { + return data; + } + const caption = element.find('.caption').text(); + const width = parseInt(image.width(), 10); + const height = parseInt(image.height(), 10); + return { + Url: element.data('url') || data.Url, + CaptionText: caption, + PreviewUrl: image.attr('src'), + Width: isNaN(width) ? null : width, + Height: isNaN(height) ? null : height, + Placement: this.findPosition(element.prop('class')) + }; + }, + findPosition(cssClass) { + const alignments = ['leftAlone', 'center', 'rightAlone', 'left', 'right']; + if (typeof cssClass !== 'string') { + return ''; + } + const classes = cssClass.split(' '); + return alignments.find(alignment => classes.indexOf(alignment) > -1); + }, + insertRemote() { + const $field = this.getElement(); + if (!$field) { + return false; + } + const editor = $field.getEditor(); + if (!editor) { + return false; + } + const data = this.getData(); + const base = (0, _jquery.default)('
').attr('data-url', data.Url).attr('data-shortcode', 'embed').addClass(data.Placement).addClass('ss-htmleditorfield-file embed'); + const placeholder = (0, _jquery.default)('').attr('src', data.PreviewUrl).addClass('placeholder'); + if (data.Width) { + placeholder.attr('width', data.Width); + } + if (data.Height) { + placeholder.attr('height', data.Height); + } + base.append(placeholder); + if (data.CaptionText) { + const caption = (0, _jquery.default)('

').addClass('caption').text(data.CaptionText); + base.append(caption); + } + const node = $(editor.getSelectedNode()); + let replacee = $(null); + if (node.length) { + replacee = node.filter(filter); + if (replacee.length === 0) { + replacee = node.closest(filter); + } + if (replacee.length === 0) { + replacee = node.filter('img.placeholder'); + } + } + if (replacee.length) { + replacee.replaceWith(base); + } else { + editor.repaint(); + editor.insertContent($('

').append(base.clone()).html(), { + skip_undo: 1 + }); + } + editor.addUndo(); + editor.repaint(); + return true; + } + }); +}); +}(); +/******/ })() +; +//# sourceMappingURL=TinyMCE_ssembed.js.map \ No newline at end of file diff --git a/client/dist/js/TinyMCE_sslink-file.js b/client/dist/js/TinyMCE_sslink-file.js index 3f8d6a421..5ae65557d 100644 --- a/client/dist/js/TinyMCE_sslink-file.js +++ b/client/dist/js/TinyMCE_sslink-file.js @@ -1 +1,25451 @@ -!function(){var e={853:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=u(n(5815)),i=u(n(4600)),s=u(n(1669)),l=n(5716),a=u(n(6935));function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}let c=0;class p extends r.Component{constructor(e){super(e),this.dropzone=null,this.dragging=!1,this.handleAccept=this.handleAccept.bind(this),this.handleAddedFile=this.handleAddedFile.bind(this),this.handleDragEnter=this.handleDragEnter.bind(this),this.handleDragLeave=this.handleDragLeave.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleUploadComplete=this.handleUploadComplete.bind(this),this.handleError=this.handleError.bind(this),this.handleSending=this.handleSending.bind(this),this.handleSuccess=this.handleSuccess.bind(this),this.handleQueueComplete=this.handleQueueComplete.bind(this),this.loadImage=this.loadImage.bind(this),this.handleMaxFilesExceeded=this.handleMaxFilesExceeded.bind(this)}componentDidMount(){this.dropzone=new i.default(this.dropzoneRef,Object.assign({},this.getDefaultOptions(),this.props.options));const{name:e}=this.props;e&&this.dropzone.hiddenFileInput&&this.dropzone.hiddenFileInput.classList.add(`dz-input-${e}`),void 0!==this.props.promptOnRemove&&this.setPromptOnRemove(this.props.promptOnRemove)}componentDidUpdate(e){const{name:t}=this.props;t&&this.dropzone.hiddenFileInput&&this.dropzone.hiddenFileInput.classList.add(`dz-input-${t}`),this.props.canUpload&&e.options!==this.props.options&&this.dropzone&&(this.dropzone.enable(),this.dropzone.options=Object.assign({},this.getDefaultOptions(),this.dropzone.options,this.props.options))}componentWillUnmount(){this.dropzone.files=[],this.dropzone.destroy()}getDefaultOptions(){let e=null,t=this.props.uploadSelector;if(!t&&this.props.uploadButton&&(t=".asset-dropzone__upload-button"),t){const n=(0,s.default)(this.dropzoneRef).find(t);n&&n.length&&(e=n.toArray())}return{accept:this.handleAccept,addedfile:this.handleAddedFile,dragenter:this.handleDragEnter,dragleave:this.handleDragLeave,drop:this.handleDrop,maxfilesexceeded:this.handleMaxFilesExceeded,uploadprogress:this.handleUploadProgress,complete:this.handleUploadComplete,dictDefaultMessage:o.default._t("AssetAdmin.DROPZONE_DEFAULT_MESSAGE","Drop files here to upload"),dictFallbackMessage:o.default._t("AssetAdmin.DROPZONE_FALLBACK_MESSAGE","Your browser does not support drag'n'drop file uploads."),dictFallbackText:o.default._t("AssetAdmin.DROPZONE_FALLBACK_TEXT","Please use the fallback form below to upload your files like in the olden days."),dictInvalidFileType:o.default._t("AssetAdmin.DROPZONE_INVALID_FILE_TYPE","You can't upload files of this type."),dictResponseError:o.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error."),dictCancelUpload:o.default._t("AssetAdmin.DROPZONE_CANCEL_UPLOAD","Cancel upload"),dictCancelUploadConfirmation:o.default._t("AssetAdmin.DROPZONE_CANCEL_UPLOAD_CONFIRMATION","Are you sure you want to cancel this upload?"),dictRemoveFile:o.default._t("AssetAdmin.DROPZONE_REMOVE_FILE","Remove file"),dictMaxFilesExceeded:o.default._t("AssetAdmin.DROPZONE_MAX_FILES_EXCEEDED","You can not upload any more files."),error:this.handleError,sending:this.handleSending,success:this.handleSuccess,queuecomplete:this.handleQueueComplete,thumbnailHeight:150,thumbnailWidth:200,timeout:0,clickable:e}}getFileCategory(e){return e.split("/")[0]}getLoadPreview(e){return new Promise((t=>{const n=new FileReader;n.onload=n=>{if("image"===this.getFileCategory(e.type)){const e=new Image;t(this.loadImage(e,n.target.result))}else t({})},n.readAsDataURL(e)}))}getFileTitle(e){return e.replace(/[.][^.]+$/,"").replace(/-_/," ")}setPromptOnRemove(e){this.dropzone.options.dictRemoveFileConfirmation=e}handleDragEnter(e){this.props.canUpload&&(this.dragging=!0,this.forceUpdate(),"function"==typeof this.props.onDragEnter&&this.props.onDragEnter(e))}handleDragLeave(e){const t=this.dropzoneRef;this.props.canUpload&&e.target===t&&(this.dragging=!1,this.forceUpdate(),"function"==typeof this.props.onDragLeave&&this.props.onDragLeave(e,t))}handleUploadProgress(e,t,n){"function"==typeof this.props.onUploadProgress&&this.props.onUploadProgress(e,t,n)}handleUploadComplete(e){"function"==typeof this.props.onUploadComplete&&this.props.onUploadComplete(e.status)}handleDrop(e){this.dragging=!1,this.forceUpdate(),"function"==typeof this.props.onDrop&&this.props.onDrop(e)}handleSending(e,t,n){"function"==typeof this.props.updateFormData&&this.props.updateFormData(n),n.append("SecurityID",this.props.securityID),n.append("ParentID",this.props.folderId);const r=Object.assign({},t,{abort:()=>{this.dropzone.cancelUpload(e),t.abort()}});"function"==typeof this.props.onSending&&this.props.onSending(e,r,n)}handleMaxFilesExceeded(e){return"function"!=typeof this.props.onMaxFilesExceeded||this.props.onMaxFilesExceeded(e)}generateQueuedId(){return c+=1,c}handleAccept(e,t){return("function"!=typeof this.props.canFileUpload||this.props.canFileUpload(e))&&this.props.canUpload?t():t(o.default._t("AssetAdmin.DROPZONE_CANNOT_UPLOAD","Uploading not permitted."))}handleAddedFile(e){e._queuedId=this.generateQueuedId();const t={category:this.getFileCategory(e.type),filename:e.name,queuedId:e._queuedId,size:e.size,title:this.getFileTitle(e.name),extension:(0,l.getFileExtension)(e.name),type:e.type,uploadedToFolderId:this.props.folderId};this.props.onAddedFile(t);return this.getLoadPreview(e).then((e=>{const n={height:e.height,width:e.width,url:e.thumbnailURL,thumbnail:e.thumbnailURL,smallThumbnail:e.thumbnailURL};return"function"==typeof this.props.onPreviewLoaded&&this.props.onPreviewLoaded(t,n),{...t,...n}}))}loadImage(e,t){return new Promise((n=>{const r=document.createElement("canvas"),o=r.getContext("2d");e.onload=()=>{const t=2*this.props.preview.width,i=2*this.props.preview.height,s=e.naturalWidth/e.naturalHeight;e.naturalWidth{this.dropzoneRef=e}},this.props.uploadButton&&r.default.createElement("button",t,o.default._t("AssetAdmin.DROPZONE_UPLOAD")),this.props.children)}}p.propTypes={folderId:a.default.number.isRequired,onAccept:a.default.func,onAddedFile:a.default.func.isRequired,onDragEnter:a.default.func,onDragLeave:a.default.func,onDrop:a.default.func,onError:a.default.func.isRequired,onPreviewLoaded:a.default.func,onSending:a.default.func,onSuccess:a.default.func.isRequired,onMaxFilesExceeded:a.default.func,updateFormData:a.default.func,canFileUpload:a.default.func,onQueueComplete:a.default.func,options:a.default.shape({url:a.default.string.isRequired}),promptOnRemove:a.default.string,securityID:a.default.string.isRequired,uploadButton:a.default.bool,uploadSelector:a.default.string,canUpload:a.default.bool.isRequired,preview:a.default.shape({width:a.default.number,height:a.default.number}),className:a.default.string},p.defaultProps={uploadButton:!0};t.default=p},3229:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=c(n(5815)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),i=n(9040),s=n(5207),l=n(3556),a=c(n(6923)),u=c(n(6935));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function c(e){return e&&e.__esModule?e:{default:e}}class p extends o.Component{constructor(e){super(e),this.handleChangeValue=this.handleChangeValue.bind(this),this.renderChild=this.renderChild.bind(this)}getOptionByValue(e){return this.props.actions.find((t=>t.value===e))}handleChangeValue(e){let t=null;const n=this.getOptionByValue(e.target.value);return null===n?null:(t="function"==typeof n.confirm?n.confirm(this.props.items).then((()=>n.callback(e,this.props.items))).catch((e=>{if("cancelled"!==e)throw e})):n.callback(e,this.props.items)||Promise.resolve(),t)}renderChild(e,t){const n=(0,a.default)("bulk-actions__action",e.className||"font-icon-info-circled",{btn:t<2,"bulk-actions__action--more":t>2});return t<2?o.default.createElement(l.Button,{className:n,key:e.value,onClick:this.handleChangeValue,value:e.value,color:e.color},e.label):o.default.createElement(l.DropdownItem,{type:"button",className:n,key:e.value,onClick:this.handleChangeValue,value:e.value},e.label)}render(){if(!this.props.items.length)return null;let e=this.props.actions.filter((e=>!e.canApply||e.canApply(this.props.items)));if(e=e.map(this.renderChild),!e.length)return null;const{ActionMenu:t,showCount:n}=this.props,i=r.default._t("AssetAdmin.BULK_ACTIONS_SELECT_ALL","Select all"),s=r.default.sprintf(r.default._t("AssetAdmin.BULK_ACTIONS_SELECTED","%s selected"),this.props.items.length),a=r.default._t("AssetAdmin.BULK_ACTIONS_CLEAR_SELECTION","Clear selection");return o.default.createElement("div",{className:"bulk-actions fieldholder-small"},n&&o.default.createElement(o.default.Fragment,null,o.default.createElement(l.Button,{className:"bulk-actions-counter font-icon-cross-mark",onClick:this.props.onClearSelection,title:a},s),o.default.createElement("div",{className:"bulk-actions-select-all"},o.default.createElement(l.Button,{onClick:this.props.onSelectAll},i))),e.slice(0,2),e.length>2&&t?o.default.createElement(t,{id:"BulkActions",className:"bulk-actions__more-actions-menu"},e.slice(2)):e.slice(2))}}t.Component=p,p.propTypes={items:u.default.array,actions:u.default.arrayOf(u.default.shape({value:u.default.string.isRequired,label:u.default.string.isRequired,className:u.default.string,destructive:u.default.bool,callback:u.default.func,canApply:u.default.func,confirm:u.default.func})),ActionMenu:u.default.elementType,showCount:u.default.bool,onClearSelection:u.default.func.isRequired,onSelectAll:u.default.func.isRequired},p.defaultProps={items:[],actions:[],ActionMenu:null,total:null,showCount:!0,totalReachedMessage:r.default._t("")};const h=(0,i.connect)((function(e){return{gallery:e.assetAdmin.gallery}}))(p);t.default=(0,s.inject)(["ActionMenu"],(e=>({ActionMenu:e})),(()=>"BulkActions"))(h)},1037:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Folder=t.File=t.Component=void 0;var r=S(n(5815)),o=C(n(1594)),i=S(n(6923)),s=S(n(6379)),l=S(n(6022)),a=S(n(2063)),u=S(n(2932)),d=S(n(2926)),c=S(n(1990)),p=S(n(4350)),h=n(9040),f=n(9367),m=n(4172),g=C(n(769)),y=S(n(1838)),v=S(n(6935));function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}function C(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function S(e){return e&&e.__esModule?e:{default:e}}function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t{e.preventDefault()};class x extends o.Component{constructor(e){super(e),this.handleSelect=this.handleSelect.bind(this),this.handleActivate=this.handleActivate.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancelUpload=this.handleCancelUpload.bind(this)}componentDidUpdate(){_(this.props)&&this.props.actions.imageLoad.loadImage(this.props.item.thumbnail,this.props.sectionConfig.imageRetry)}getThumbnailStyles(){const{item:{thumbnail:e,version:t},bustCache:n}=this.props;if(!this.isImage()||!e||this.missing())return{};const r=!1===n||!t||e.startsWith("data:image/")?e:`${e}?vid=${t}`;switch(this.props.loadState){case y.default.SUCCESS:case y.default.DISABLED:return{backgroundImage:`url(${r})`};default:return{}}}getErrorMessage(){let e=null;const{item:t,loadState:n}=this.props;if(this.hasError()?e=t.message.value:this.missing()?e=r.default._t("AssetAdmin.FILE_MISSING","File cannot be found"):n===y.default.FAILED&&(e=r.default._t("AssetAdmin.FILE_LOAD_ERROR","Thumbnail not available")),null!==e){return e=this.getItemFunction("updateErrorMessage")(e,this.props),o.default.createElement("span",{className:"gallery-item__error-message"},e)}return null}getThumbnailClassNames(){const e=["gallery-item__thumbnail"];switch(this.isImageSmallerThanThumbnail()&&e.push("gallery-item__thumbnail--small"),!this.props.item.thumbnail&&this.isImage()&&e.push("gallery-item__thumbnail--no-preview"),this.props.loadState){case y.default.LOADING:case y.default.WAITING:e.push("gallery-item__thumbnail--loading");break;case y.default.FAILED:e.push("gallery-item__thumbnail--error")}return e.join(" ")}getItemClassNames(){const e=this.props.item.category||"false",t=this.props.selectable&&(this.props.item.selected||this.props.isDragging);return(0,i.default)({"gallery-item":!0,[`gallery-item--${e}`]:!0,"gallery-item--max-selected":this.props.maxSelected&&!t,"gallery-item--missing":this.missing(),"gallery-item--selectable":this.props.selectable,"gallery-item--selected":t,"gallery-item--dropping":this.props.isDropping,"gallery-item--highlighted":this.props.item.highlighted,"gallery-item--error":this.hasError(),"gallery-item--dragging":this.props.isDragging})}getItemFunction(e){const{item:t}=this.props;return"function"==typeof t[e]?t[e]:this.props[e]}getStatusFlags(){let e=[];const{item:t}=this.props;"folder"!==t.type&&(t.draft?e.push({key:"status-draft",title:r.default._t("File.DRAFT","Draft"),className:"gallery-item--draft"}):t.modified&&e.push({key:"status-modified",title:r.default._t("File.MODIFIED","Modified"),className:"gallery-item--modified"}));return e=this.getItemFunction("updateStatusFlags")(e,this.props),o.default.createElement("div",{className:"gallery-item__status-flags"},e.map((e=>o.default.createElement("span",e))))}getStatusIcons(){const{item:e}=this.props,t=[];return e.hasRestrictedAccess&&t.push({key:"status-restricted",fileID:e.id,hasRestrictedAccess:!0,placement:"top",disableTooltip:"folder"===e.type,includeBackground:"folder"!==e.type}),e.isTrackedFormUpload&&"folder"!==e.type&&t.push({key:"status-tracked-form-upload",fileID:e.id,isTrackedFormUpload:!0,hasRestrictedAccess:e.hasRestrictedAccess,placement:"top",includeBackground:!0}),o.default.createElement("div",{className:"gallery-item__status-icons"},t.map((e=>o.default.createElement(c.default,e))))}getProgressBar(){let e=null;const{item:t}=this.props,n={className:"gallery-item__progress-bar",style:{width:`${t.progress}%`}};this.hasError()||!this.uploading()||this.complete()||(e=o.default.createElement("div",{className:"gallery-item__upload-progress"},o.default.createElement("div",n)));return e=this.getItemFunction("updateProgressBar")(e,this.props),e}isImageSmallerThanThumbnail(){if(!this.isImage()||this.missing())return!1;const e=this.props.item.width,t=this.props.item.height;return t&&e&&t0}missing(){return!this.exists()&&this.saved()}uploading(){return this.props.item.queuedId&&!this.saved()}exists(){return this.props.item.exists}isImage(){return"image"===this.props.item.category}canBatchSelect(){return this.props.selectable&&this.props.item.canEdit}hasError(){let e=!1;return this.props.item.message&&(e="error"===this.props.item.message.type),e}handleActivate(e){e.stopPropagation(),"function"==typeof this.props.onActivate&&this.saved()&&this.props.onActivate(e,this.props.item)}handleSelect(e){e.stopPropagation(),e.preventDefault(),"function"==typeof this.props.onSelect&&this.props.onSelect(e,this.props.item)}handleKeyDown(e){s.default.SPACE_KEY_CODE===e.keyCode&&(e.preventDefault(),this.canBatchSelect()&&this.handleSelect(e)),s.default.RETURN_KEY_CODE===e.keyCode&&this.handleActivate(e)}handleCancelUpload(e){e.stopPropagation(),e.preventDefault(),this.hasError()?this.props.onRemoveErroredUpload(this.props.item):this.props.onCancelUpload&&this.props.onCancelUpload(this.props.item)}render(){let e=null,t=null,n=null;const{id:i,queuedId:s}=this.props.item,l=i?`item-${i}`:`queued-${s}`;if(this.props.selectable&&(this.canBatchSelect()&&(e=this.handleSelect),t="font-icon-tick"),this.uploading())e=this.handleCancelUpload,t="font-icon-cancel";else if(this.exists()){const e=r.default._t("AssetAdmin.VIEW","View");n=o.default.createElement("div",{className:"gallery-item--overlay font-icon-eye"},e)}const a=this.props.badge,u={className:"gallery-item__checkbox",type:"checkbox",title:r.default._t("AssetAdmin.SELECT","Select"),tabIndex:-1,onMouseDown:w,id:l},c=["gallery-item__checkbox-label",t];this.canBatchSelect()||(u.disabled=!0,c.push("gallery-item__checkbox-label--disabled"));const p={className:c.join(" "),onClick:e};return o.default.createElement("div",{className:this.getItemClassNames(),"data-id":this.props.item.id,tabIndex:0,role:"button",onKeyDown:this.handleKeyDown,onClick:this.handleActivate},!!a&&o.default.createElement(d.default,{className:"gallery-item__badge",status:a.status,message:a.message}),o.default.createElement("div",{ref:e=>{this.thumbnail=e},className:this.getThumbnailClassNames(),style:this.getThumbnailStyles()},n,this.getStatusFlags(),this.getStatusIcons()),this.getProgressBar(),this.getErrorMessage(),this.props.children,o.default.createElement("div",{className:"gallery-item__title",ref:e=>{this.title=e}},o.default.createElement("label",E({},p,{htmlFor:l}),o.default.createElement("input",u)),this.props.item.title))}}t.Component=x,x.propTypes={sectionConfig:p.default,item:l.default,loadState:v.default.oneOf(Object.values(y.default)),bustCache:v.default.bool,highlighted:v.default.bool,selected:v.default.bool,isDropping:v.default.bool,isDragging:v.default.bool,message:v.default.shape({value:v.default.string,type:v.default.string}),selectable:v.default.bool,onActivate:v.default.func,onSelect:v.default.func,onCancelUpload:v.default.func,onRemoveErroredUpload:v.default.func,badge:v.default.shape({status:v.default.string,message:v.default.string}),updateStatusFlags:v.default.func,updateProgressBar:v.default.func,updateErrorMessage:v.default.func},x.defaultProps={item:{},sectionConfig:{imageRetry:{}},updateStatusFlags:e=>e,updateProgressBar:e=>e,updateErrorMessage:e=>e,bustCache:!0};const F=(0,h.connect)((function(e,t){const{bustCache:n}=e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));let r=y.default.DISABLED;if(_(t)){const n=e.assetAdmin.imageLoad.files.find((e=>t.item.thumbnail===e.url));r=n&&n.status||y.default.NONE}return{bustCache:n,loadState:r}}),(function(e){return{actions:{imageLoad:(0,f.bindActionCreators)(g,e)}}}))(x),A="GalleryItem",O=t.File=(0,m.createSelectable)((0,a.default)(A)(F));t.Folder=(0,m.createSelectable)((0,u.default)(A)(O));t.default=F},2914:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=a(n(6935)),i=n(1820),s=a(n(2926)),l=a(n(1037));function a(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?r.default.createElement("div",{key:"1",className:"gallery-item__drag-shadow"}):null,t>2?r.default.createElement("div",{key:"2",className:"gallery-item__drag-shadow gallery-item__drag-shadow--second"}):null];return r.default.createElement("div",{className:"gallery-item__drag-layer"},r.default.createElement("div",{className:"gallery-item__drag-layer-item",style:this.getOffset()},r.default.createElement("div",{className:"gallery-item__drag-layer-preview"},n,r.default.createElement(l.default,d({},e.props,{isDragging:!0}))),t>1?r.default.createElement(s.default,{className:"gallery-item__drag-layer-count",status:"info",message:`${t}`}):null))}}c.propTypes={item:o.default.object,offset:o.default.shape({x:o.default.number.isRequired,y:o.default.number.isRequired}),isDragging:o.default.bool.isRequired};t.default=(0,i.DragLayer)((e=>({item:e.getItem(),offset:e.getInitialClientOffset(),dragged:e.getDifferenceFromInitialOffset(),isDragging:e.isDragging()})))(c)},2063:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t={canDrag(e){return e.canDrag},beginDrag(e){const{id:t}=e.item;"function"==typeof e.onDrag&&e.onDrag(!0,t);const n=e.selectedFiles.concat([]);return n.includes(t)||n.push(t),{selected:n,props:e}},endDrag(e){const{id:t}=e.item;"function"==typeof e.onDrag&&e.onDrag(!1,t)}},n=(0,s.DragSource)(e,t,((e,t)=>({connectDragPreview:e.dragPreview(),connectDragSource:e.dragSource(),isDragging:t.isDragging()})));return e=>{class t extends o.Component{componentDidMount(){this.props.connectDragPreview((0,l.getEmptyImage)(),{captureDraggingState:!0})}render(){const{connectDragSource:t}=this.props,n=o.default.createElement(e,this.props);return"string"==typeof n.type?t(n):t(o.default.createElement("div",{className:"gallery-item__draggable"},n))}}return t.propTypes={connectDragSource:i.default.func.isRequired,connectDragPreview:i.default.func.isRequired,item:i.default.shape({id:i.default.number.isRequired}).isRequired,onDrag:i.default.func,selectedFiles:i.default.arrayOf(i.default.number)},n(t)}};var r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),i=(r=n(6935))&&r.__esModule?r:{default:r},s=n(1820),l=n(8724);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}},2932:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t={drop(e,t){if(t.canDrop()){const n=t.getItem();e.onDropFiles(e.item.id,n.selected)}},canDrop(e,t){return!t.getItem().selected.includes(e.item.id)}},n=(0,s.DropTarget)(e,t,((e,t)=>{const n=t.isOver();return{isDropping:n&&t.canDrop(),connectDropTarget:e.dropTarget(),isOver:n}}));return e=>{class t extends o.Component{render(){const{connectDropTarget:t}=this.props,n=o.default.createElement(e,this.props);return"string"==typeof n.type?t(n):t(o.default.createElement("div",{className:"gallery-item__droppable"},n))}}return t.propTypes={connectDropTarget:i.default.func.isRequired,item:i.default.shape({id:i.default.number.isRequired}).isRequired},n(t)}};var r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),i=(r=n(6935))&&r.__esModule?r:{default:r},s=n(1820);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}},6379:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(5815))&&r.__esModule?r:{default:r};t.default={ACTIONS:{CREATE_FOLDER:"create-folder",EDIT_FILE:"edit"},MOVE_SUCCESS_DURATION:3e3,CSS_TRANSITION_TIME:300,SMALL_THUMBNAIL_HEIGHT:60,SMALL_THUMBNAIL_WIDTH:60,THUMBNAIL_HEIGHT:150,THUMBNAIL_WIDTH:200,BULK_ACTIONS:[{value:"delete",label:o.default._t("AssetAdmin.BULK_ACTIONS_DELETE","Delete"),className:"font-icon-trash",destructive:!0,callback:null,canApply:e=>e.every((e=>e&&e.canDelete))},{value:"archive",label:o.default._t("AssetAdmin.BULK_ACTIONS_ARCHIVE","Archive"),className:"font-icon-box",destructive:!0,callback:null,canApply:e=>e.every((e=>e&&e.canDelete))},{value:"edit",label:o.default._t("AssetAdmin.BULK_ACTIONS_EDIT","Edit"),className:"font-icon-edit",destructive:!1,canApply:e=>1===e.length,callback:null},{value:"move",label:o.default._t("AssetAdmin.BULK_ACTIONS_MOVE","Move"),className:"font-icon-folder-move",canApply:e=>e.every((e=>e&&e.canEdit)),destructive:!1,callback:null},{value:"publish",label:o.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH","Publish"),className:"font-icon-rocket",destructive:!1,callback:null,canApply:e=>e.some((e=>e&&e.modified))&&e.every((e=>e.canEdit&&"folder"!==e.type)),confirm:null},{value:"unpublish",label:o.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH","Unpublish"),className:"font-icon-cancel-circled",destructive:!1,callback:null,canApply:e=>e.some((e=>e.published))&&e.every((e=>e.canEdit&&"folder"!==e.type)),confirm:null},{value:"insert",label:o.default._t("AssetAdmin.BULK_ACTIONS_INSERT","Insert"),className:"font-icon-plus-circled btn-primary",destructive:!1,callback:null,canApply:e=>e.length,confirm:null}],BULK_ACTIONS_PLACEHOLDER:o.default._t("AssetAdmin.BULK_ACTIONS_PLACEHOLDER"),SPACE_KEY_CODE:32,RETURN_KEY_CODE:13,DEFAULT_PREVIEW:"framework/client/dist/images/app_icons/generic_92.png",MODAL_MOVE:"MODAL_MOVE"}},7917:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=I(n(1594)),o=A(n(6935)),i=n(9040),s=n(9367),l=A(n(5609)),a=A(n(5815)),u=A(n(6923)),d=I(n(4201)),c=I(n(8918)),p=I(n(1369)),h=I(n(9517)),f=A(n(1869)),m=A(n(5789)),g=A(n(2294)),y=I(n(6303)),v=A(n(6175)),b=A(n(6379)),C=A(n(4350)),S=A(n(6177)),E=I(n(4461)),_=A(n(8268)),w=A(n(4014)),x=A(n(175)),F=A(n(2308));function A(e){return e&&e.__esModule?e:{default:e}}function O(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(O=function(e){return e?n:t})(e)}function I(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=O(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}class D extends r.Component{constructor(e){super(e),this.handleOpenFile=this.handleOpenFile.bind(this),this.handleCloseFile=this.handleCloseFile.bind(this),this.handleDelete=this.handleDelete.bind(this),this.doPublish=this.doPublish.bind(this),this.doUnpublish=this.doUnpublish.bind(this),this.handleUnpublish=this.handleUnpublish.bind(this),this.handleDoSearch=this.handleDoSearch.bind(this),this.handleClearSearch=this.handleClearSearch.bind(this),this.handleSubmitEditor=this.handleSubmitEditor.bind(this),this.handleOpenFolder=this.handleOpenFolder.bind(this),this.handleSort=this.handleSort.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.createEndpoint=this.createEndpoint.bind(this),this.handleBackButtonClick=this.handleBackButtonClick.bind(this),this.handleFolderIcon=this.handleFolderIcon.bind(this),this.handleBrowse=this.handleBrowse.bind(this),this.handleViewChange=this.handleViewChange.bind(this),this.handleUpload=this.handleUpload.bind(this),this.handleUploadQueue=this.handleUploadQueue.bind(this),this.handleCreateFolder=this.handleCreateFolder.bind(this),this.handleMoveFilesSuccess=this.handleMoveFilesSuccess.bind(this),this.refetchFolder=this.refetchFolder.bind(this),this.state={loading:!1,folder:null,files:[],totalCount:0,forceRefetch:!1}}componentDidMount(){this.refetchFolder()}componentDidUpdate(e){(this.props.folderId!==e.folderId||this.props.fileId!==e.fileId&&0!==this.props.fileId||this.state.forceRefetch)&&this.refetchFolder(),this.state.forceRefetch&&this.setState({forceRefetch:!1})}getFolderId(){return null!==this.props.folderId?this.props.folderId:this.state.folder?this.state.folder.id:0}refetchFolder(){const e=this.getFolderId(),t=new URLSearchParams(window.location.search),n=[];t.forEach(((e,t)=>{"page"!==t&&"filter"!==t.substring(0,6)&&"sort"!==t.substring(0,4)||n.push(`${t}=${e}`)}));let r="";n.length&&(r=`?${n.join("&")}`);const o=`${S.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdminOpen").endpoints.read.url}/${e}${r}`;l.default.get(o).then((async e=>{const t=await e.json();this.setState({loading:!1,folder:t,files:t.children.nodes,totalCount:t.children.pageInfo.totalCount})})).catch((async e=>{this.setState({loading:!1,folder:null,files:[],totalCount:0});const t=await(0,w.default)(e);this.props.actions.toasts.error(t)}))}getFiles(){const{queuedFiles:e,folderId:t}=this.props,n=this.state.files,r=[...e.items.filter((e=>!(e.id&&n.find((t=>t.id===e.id))||e.hasOwnProperty("uploadedToFolderId")&&e.uploadedToFolderId!==t))),...n],o=r.filter((e=>"folder"===e.type)),i=r.filter((e=>"folder"!==e.type));return o.concat(i)}handleBrowse(e,t,n){"function"==typeof this.props.onBrowse&&(this.props.onBrowse(e,t,n),this.setState({forceRefetch:!0})),e!==this.getFolderId()&&this.props.actions.gallery.deselectFiles()}handleSetPage(e){this.handleBrowse(this.getFolderId(),this.props.fileId,Object.assign({},this.props.query,{page:e})),this.setState({forceRefetch:!0})}handleDoSearch(e){this.props.actions.gallery.deselectFiles(),this.props.actions.queuedFiles.purgeUploadQueue(),this.handleBrowse(e.currentFolderOnly?this.getFolderId():0,null,{filter:e,view:this.props.query.view})}handleClearSearch(e){this.props.actions.displaySearch.closeSearch(),this.props.actions.gallery.deselectFiles(),this.props.actions.queuedFiles.purgeUploadQueue(),this.refetchFolder();const t=this.state.folder;this.handleOpenFolder(e,t)}handleSort(e){this.handleBrowse(this.getFolderId(),this.props.fileId,{...this.props.query,sort:e,limit:void 0,page:void 0}),this.setState({forceRefetch:!0})}handleViewChange(e){this.handleBrowse(this.getFolderId(),this.props.fileId,Object.assign({},this.props.query,{view:e}))}createEndpoint(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return l.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:this.props.securityId}}:{}))}handleBackButtonClick(e){e.preventDefault(),this.props.actions.gallery.deselectFiles();const t=this.state.folder;t?this.handleOpenFolder(t.parentId||0):this.handleOpenFolder(0)}resetFile(e){e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId),this.props.fileId===e.id&&this.props.resetFileDetails(this.getFolderId(),e.id,this.props.query)}handleFolderIcon(){this.handleOpenFile(this.getFolderId())}handleOpenFile(e){this.handleBrowse(this.getFolderId(),e,this.props.query)}handleSubmitEditor(e,t,n){let r=null;if("action_insert"===t&&"select"===this.props.type){const t=this.getFiles().find((t=>t.id===parseInt(e.ID,10)));return this.props.onInsertMany(null,[t]),this.setState({forceRefetch:!0}),Promise.resolve()}if("function"==typeof this.props.onSubmitEditor){const o=this.findFile(this.props.fileId);r=this.props.onSubmitEditor(e,t,n,o)}else r=n();if(!r)throw new Error("Promise was not returned for submitting");return this.setState({forceRefetch:!0}),r.then((e=>("action_createfolder"===t?"admin"===this.props.type?this.handleOpenFile(e.record.id):this.handleOpenFolder(this.getFolderId()):"action_save"!==t&&"action_publish"!==t||this.getFolderId()===e.record.parent.id||this.handleBrowse(e.record.parent.id,e.record.id,null),e)))}handleCloseFile(){this.handleBrowse(this.getFolderId(),null,this.props.query)}handleOpenFolder(e){const{page:t,filter:n,...r}=this.props.query;this.handleBrowse(e,null,r)}handleDelete(e){this.props.actions.confirmDeletion.deleting();const t=e.map((e=>{const t=this.findFile(e);if(!t)throw new Error(`File selected for deletion cannot be found: ${e}`);return t.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(t.queuedId),t})).map((e=>e.id)),n=this.state.folder,r=n?n.id:0,o=this.props.sectionConfig.endpoints.delete.url;return l.default.post(o,{ids:t},{"X-SecurityID":S.default.get("SecurityID")}).then((()=>{this.handleBrowse(r,null,this.props.query);this.props.queuedFiles.items.filter((e=>t.includes(e.id))).forEach((e=>{e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}));let e="AssetAdmin.BULK_ACTIONS_DELETE_SUCCESS_02",n="%s folders/files were successfully deleted.";this.props.sectionConfig.filesAreVersioned&&this.props.sectionConfig.archiveFiles&&(e="AssetAdmin.BULK_ACTIONS_ARCHIVE_SUCCESS_02",n="%s folders/files were successfully archived."),this.props.actions.toasts.success(a.default.sprintf(a.default._t(e,n),t.length)),this.props.actions.gallery.deselectFiles(),this.refetchFolder()})).catch((async e=>{const t=await(0,w.default)(e);this.props.actions.toasts.error(t)})).finally((()=>this.props.actions.confirmDeletion.reset()))}doUnpublish(e){const t=e.map((e=>{const t=this.findFile(e);if(!t)throw new Error(`File selected for unpublishing cannot be found: ${e}`);if("folder"===t.type)throw new Error("Cannot unpublish folders");return t})),n=t.map((e=>e.id)),r=n.map((e=>`ids[]=${e}`)).join("&");let o=`${this.props.sectionConfig.endpoints.readLiveOwnerCounts.url}?${r}`;return l.default.get(o).then((async e=>{const t=(await e.json()).filter((e=>e.count>0)),n=t.slice(0,4).map((e=>e.message)),r=t.slice(5).length;let o="";if(r>0&&(o=a.default.inject(a.default._t("AssetAdmin.BULK_OWNED_WARNING_REMAINING","And {count} other file(s)"),{count:r})),n.length){const e=[a.default.inject(a.default._t("AssetAdmin.BULK_OWNED_WARNING_HEADING","{count} file(s) are being used by other published content."),{count:n.length}),...n,o,a.default._t("AssetAdmin.BULK_OWNED_WARNING_FOOTER","Unpublishing will only remove files from the published version of the content. They will remain on the draft version. Unpublish anyway?")].filter((e=>e)).join("\n\n");if(!confirm(e))return Promise.reject()}return Promise.resolve()})).then((()=>(o=this.props.sectionConfig.endpoints.unpublish.url,l.default.post(o,{ids:n},{"X-SecurityID":S.default.get("SecurityID")}).catch((async e=>{const t=await(0,w.default)(e);this.props.actions.toasts.error(t)}))))).then((()=>(this.refetchFolder(),t))).catch((async e=>{const t=await(0,w.default)(e);return this.props.actions.toasts.error(t),[]}))}handleUnpublish(e){return this.doUnpublish(e).then((e=>{const{fileId:t}=this.props;this.refetchFolder().then((()=>{t&&e.find((e=>e.id===t))&&this.props.resetFileDetails(this.getFolderId(),t,this.props.query)}))}))}doPublish(e){const t=e.map((e=>{const t=this.findFile(e);if(!t)throw new Error(`File selected for publishing cannot be found: ${e}`);if("folder"===t.type)throw new Error("Cannot publish folders");return t})),n=t.map((e=>e.id)),r=this.props.sectionConfig.endpoints.publish.url;return l.default.post(r,{ids:n},{"X-SecurityID":S.default.get("SecurityID")}).then((()=>(t.forEach((e=>this.resetFile(e))),this.refetchFolder(),t))).catch((async e=>{const t=await(0,w.default)(e);this.props.actions.toasts.error(t)}))}findFile(e){return this.getFiles().find((t=>t.id===parseInt(e,10)))}handleUpload(){}handleUploadQueue(){this.props.fileId&&this.refetchFolder()}handleCreateFolder(){this.props.onBrowse(this.getFolderId(),null,this.props.query,b.default.ACTIONS.CREATE_FOLDER)}handleMoveFilesSuccess(e,t){this.props.queuedFiles.items.filter((e=>t.includes(e.id))).forEach((e=>{e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)})),this.props.actions.gallery.deselectFiles(),this.refetchFolder()}renderGallery(){const{GalleryComponent:e}=this.props,t=this.props.sectionConfig,n=t.endpoints.createFile.url,o=t.endpoints.createFile.method,i=this.props.query&&parseInt(this.props.query.limit||t.limit,10),s=this.props.query&&parseInt(this.props.query.page||1,10),l=this.props.query&&this.props.query.sort,a=this.props.query&&this.props.query.view,u=this.props.query.filter||{},d=this.state.folder,c=this.state.loading;return r.default.createElement(e,{files:this.getFiles(),fileId:this.props.fileId,folderId:this.getFolderId(),folder:d,type:this.props.type,limit:i,page:s,totalCount:this.state.totalCount,view:a,filters:u,createFileApiUrl:n,createFileApiMethod:o,onInsertMany:this.props.onInsertMany,onPublish:this.doPublish,onUnpublish:this.doUnpublish,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSuccessfulUpload:this.handleUpload,onSuccessfulUploadQueue:this.handleUploadQueue,onCreateFolder:this.handleCreateFolder,onMoveFilesSuccess:this.handleMoveFilesSuccess,onClearSearch:this.handleClearSearch,onSort:this.handleSort,onSetPage:this.handleSetPage,onViewChange:this.handleViewChange,sort:l,sectionConfig:t,loading:c,maxFilesSelect:this.props.maxFiles,dialog:this.props.dialog})}renderEditor(){const{sectionConfig:e,viewAction:t,type:n,fileId:o,dialog:i,requireLinkText:s,fileSelected:l,EditorComponent:a}=this.props,{schemaUrl:u,targetId:d}=(0,_.default)({config:e,viewAction:t,folderId:this.getFolderId(),type:n,fileId:o});if(!u)return null;const c=[];s&&c.push({name:"requireLinkText",value:!0}),l&&c.push({name:"fileSelected",value:!0});const p={dialog:i,fileId:d,schemaUrl:u,schemaUrlQueries:c,onClose:this.handleCloseFile,onSubmit:this.handleSubmitEditor,onUnpublish:this.handleUnpublish};return r.default.createElement(a,p)}render(){const{folderId:e,query:t,getUrl:n,type:o,maxFiles:i,toolbarChildren:s,SearchComponent:l,BulkDeleteConfirmationComponent:a}=this.props;if(null===this.state.folder)return null;const d=Boolean(e||(0,y.hasFilters)(t.filter)),c=this.props.sectionConfig.form.fileSearchForm.schemaUrl,p=t.filter||{},h=(0,u.default)("fill-height asset-admin","select"===o&&{"asset-admin--single-select":1===i,"asset-admin--multi-select":1!==i}),f=(0,y.hasFilters)(t.filter)||this.props.showSearch,m=this.props.actions.displaySearch?this.props.actions.displaySearch.toggleSearch:void 0,b=this.state.folder,C={folder:b,query:t,getUrl:n,onBrowse:this.handleBrowse,onFolderIcon:this.handleFolderIcon};return r.default.createElement("div",{className:h},r.default.createElement(g.default,{showBackButton:d,onBackButtonClick:this.handleBackButtonClick},b&&r.default.createElement(F.default,C),r.default.createElement("div",{className:"asset-admin__toolbar-extra pull-xs-right fill-width vertical-align-items"},r.default.createElement(v.default,{toggled:f,onToggle:m}),s)),f&&r.default.createElement(l,{onSearch:this.handleDoSearch,id:"AssetSearchForm",formSchemaUrl:c,onHide:this.handleClearSearch,displayBehavior:"HIDEABLE",filters:p,name:"name"}),r.default.createElement("div",{className:"flexbox-area-grow fill-width fill-height gallery"},this.renderGallery(),this.renderEditor()),r.default.createElement(a,{onConfirm:this.handleDelete,filesAreVersioned:this.props.sectionConfig.filesAreVersioned,archiveFiles:this.props.sectionConfig.archiveFiles}))}}t.Component=D,D.propTypes={dialog:o.default.bool,sectionConfig:C.default,fileId:o.default.number,folderId:o.default.number,resetFileDetails:o.default.func,onBrowse:o.default.func,onReplaceUrl:o.default.func,onInsertMany:o.default.func,getUrl:o.default.func,query:o.default.shape({sort:o.default.string,limit:o.default.oneOfType([o.default.number,o.default.string]),page:o.default.oneOfType([o.default.number,o.default.string]),filter:o.default.object}),onSubmitEditor:o.default.func,type:o.default.oneOf(["insert-media","insert-link","select","admin"]),queuedFiles:o.default.shape({items:o.default.array.isRequired}),filesTotalCount:o.default.number,loading:o.default.bool,actions:o.default.object,maxFiles:o.default.number,fileSelected:o.default.bool,EditorComponent:o.default.oneOfType([o.default.object,o.default.func]),GalleryComponent:o.default.oneOfType([o.default.object,o.default.func]),SearchComponent:o.default.oneOfType([o.default.object,o.default.func]),BulkDeleteConfirmationComponent:o.default.oneOfType([o.default.object,o.default.func])},D.defaultProps={type:"admin",query:{sort:"",limit:null,page:0,filter:{}},maxFiles:null,EditorComponent:f.default,GalleryComponent:m.default,SearchComponent:y.default,BulkDeleteConfirmationComponent:x.default};t.default=(0,s.compose)((0,i.connect)((function(e,t){const{formSchema:n}=e.assetAdmin.modal;return{securityId:e.config.SecurityID,queuedFiles:e.assetAdmin.queuedFiles,showSearch:e.assetAdmin.displaySearch.isOpen,type:n&&n.type||t.type}}),(function(e){return{actions:{gallery:(0,s.bindActionCreators)(d,e),toasts:(0,s.bindActionCreators)(c,e),displaySearch:(0,s.bindActionCreators)(h,e),queuedFiles:(0,s.bindActionCreators)(p,e),confirmDeletion:(0,s.bindActionCreators)(E,e)}}})))(D)},2308:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(1594)),o=a(n(6935)),i=a(n(5815)),s=n(6418),l=n(6303);function a(e){return e&&e.__esModule?e:{default:e}}const u=e=>{let{folder:t,query:n,getUrl:o,onBrowse:s,onFolderIcon:a,PlainBreadcrumbComponent:u}=e;const d=function(){for(var e=arguments.length,t=new Array(e),n=0;n{e.preventDefault(),s(...t)}},c=function(){return o&&o(...arguments)},p=[{text:i.default._t("AssetAdmin.FILES","Files"),href:c(0,null,n),onClick:d(0,null,n)}];if(t&&t.id){t.ancestors&&t.ancestors.forEach((e=>{p.push({text:e.title,href:c(e.id,null,n),onClick:d(e.id,null,n)})}));const e=[{className:"icon font-icon-edit-list",onClick:e=>{e.preventDefault(),a()}}];t.hasRestrictedAccess&&e.push({nodeName:"FileStatusIcon",hasRestrictedAccess:!0}),p.push({text:t.title,href:c(t.id,null,n),onClick:d(t.id,null,n),icons:e})}return(0,l.hasFilters)(n.filter)&&p.push({text:i.default._t("LeftAndMain.SEARCHRESULTS","Search results")}),r.default.createElement(u,{multiline:!0,crumbs:p})};u.propTypes={onBrowse:o.default.func,onFolderIcon:o.default.func,getUrl:o.default.func,query:o.default.shape({sort:o.default.string,limit:o.default.oneOfType([o.default.number,o.default.string]),page:o.default.oneOfType([o.default.number,o.default.string]),filter:o.default.object,view:o.default.string}),folder:o.default.shape({id:o.default.number,title:o.default.string,ancestors:o.default.array,parentId:o.default.number,canView:o.default.bool,canEdit:o.default.bool}),PlainBreadcrumbComponent:o.default.oneOfType([o.default.object,o.default.func])},u.defaultProps={PlainBreadcrumbComponent:s.Component};t.default=u},4736:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0,t.buildUrl=v,t.default=void 0;var r=g(n(1594)),o=n(8926),i=n(9040),s=g(n(6478)),l=f(n(7917)),a=n(5716),u=f(n(7675)),d=f(n(6379)),c=f(n(4350)),p=n(5125),h=f(n(6935));function f(e){return e&&e.__esModule?e:{default:e}}function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}function g(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}const y=Object.keys(d.default.ACTIONS).map((e=>d.default.ACTIONS[e]));function v(e){let{base:t,folderId:n,fileId:r,query:o,action:i}=e;if(i&&-1===y.indexOf(i))throw new Error(`Invalid action provided: ${i}`);let s=null;s=r?(0,p.joinUrlPaths)(t,`show/${n}/${d.default.ACTIONS.EDIT_FILE}/${r}`):n?(0,p.joinUrlPaths)(t,`show/${n}`):t,i===d.default.ACTIONS.CREATE_FOLDER&&(s=(0,p.joinUrlPaths)(t,`show/${n||0}/${i}`));return o&&Object.keys(o).length>0&&(s=`${s}?${u.default.stringify(o)}`),s}class b extends r.Component{constructor(e){super(e),this.handleBrowse=this.handleBrowse.bind(this),this.handleReplaceUrl=this.handleReplaceUrl.bind(this),this.handleResetDetails=this.handleResetDetails.bind(this),this.getUrl=this.getUrl.bind(this)}getUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.default.ACTIONS.EDIT_FILE;const o=parseInt(e||0,10),i=parseInt(t||0,10),s=o!==this.getFolderId(),l=Object.assign({},n);return(s||l.page<=1)&&delete l.page,v({base:`/${this.props.sectionConfig.reactRoutePath}`,folderId:o,fileId:i,query:l,action:r})}getFolderId(){return this.props.router.params&&this.props.router.params.folderId?parseInt(this.props.router.params.folderId,10):0}getFileId(){return this.props.router.params&&this.props.router.params.fileId?parseInt(this.props.router.params.fileId,10):0}getViewAction(){return this.props.router.params&&this.props.router.params.viewAction?this.props.router.params.viewAction:d.default.ACTIONS.EDIT_FILE}getSectionProps(){return{sectionConfig:this.props.sectionConfig,type:"admin",folderId:this.getFolderId(),viewAction:this.getViewAction(),fileId:this.getFileId(),query:this.getQuery(),getUrl:this.getUrl,onBrowse:this.handleBrowse,onReplaceUrl:this.handleReplaceUrl,resetFileDetails:this.handleResetDetails}}getQuery(){return(0,a.decodeQuery)(this.props.router.location.search)}handleBrowse(e,t,n,r){const o=this.getUrl(e,t,n,r);this.props.router.navigate(o)}handleReplaceUrl(e,t,n,r){const o=this.getUrl(e,t,n,r);this.props.router.navigate(o,{replace:!0})}handleResetDetails(e,t,n){const r=this.getUrl(e,t,n),o=this.getUrl(e,null,n);this.props.router.navigate(o,{replace:!0,state:{reset:!0,resetPath:r}})}render(){const{AssetAdminComponent:e}=this.props,t=this.props.router.location.state;return t&&t&&t.reset?r.default.createElement(o.Navigate,{to:t.resetPath,replace:!0}):this.props.sectionConfig?r.default.createElement(e,this.getSectionProps()):null}}t.Component=b,b.propTypes={sectionConfig:c.default,router:s.routerPropTypes,AssetAdminComponent:h.default.oneOfType([h.default.object,h.default.func])},b.defaultProps={AssetAdminComponent:l.default};t.default=(0,s.default)((0,i.connect)((function(e){return{sectionConfig:e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name))}}))(b))},2908:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.AssetAdminStateRouter=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=u(n(6935)),i=n(9040),s=n(4736),l=u(n(6379)),a=n(1021);function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}const c={folderId:null,fileId:null,query:{},action:l.default.ACTIONS.EDIT_FILE};class p extends r.Component{constructor(e){super(e),this.handleBrowse=this.handleBrowse.bind(this),this.getUrl=this.getUrl.bind(this),this.state=Object.assign({},c,{folderId:e.folderId})}getUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.default.ACTIONS.EDIT_FILE;const o=parseInt(e||0,10),i=parseInt(t||0,10),a=this.getFolderId(),u=o!==a&&null!==a,d=Object.assign({},n);return(u||d.page<=1)&&delete d.page,(0,s.buildUrl)({base:this.props.sectionConfig.reactRoutePath,folderId:o,fileId:i,query:d,action:r})}getFolderId(){return null===this.state.folderId?null:parseInt(this.state.folderId||0,10)}getFileId(){return parseInt(this.state.fileId||this.props.fileId||0,10)}getViewAction(){return this.state.action||l.default.ACTIONS.EDIT_FILE}getSectionProps(){const e=Object.assign({},this.props,{folderId:this.getFolderId(),fileId:this.getFileId(),viewAction:this.getViewAction(),query:this.state.query,getUrl:this.getUrl,onBrowse:this.handleBrowse});return delete e.Component,e}handleBrowse(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.default.ACTIONS.EDIT_FILE;if(r&&-1===Object.values(l.default.ACTIONS).indexOf(r))throw new Error(`Invalid action provided: ${r}`);this.state.fileId!==t&&this.props.actions.resetFormStack(),this.setState({folderId:e,fileId:t,query:n,action:r})}render(){const e=this.getSectionProps(),t=this.props.Component;return r.default.createElement(t,e)}}function h(e){return{actions:{resetFormStack:()=>e((0,a.resetFormStack)())}}}t.AssetAdminStateRouter=p,p.propTypes={Component:o.default.elementType,sectionConfig:o.default.shape({url:o.default.string.isRequired}).isRequired,fileId:o.default.number};t.default=function(e){return(0,i.connect)((function(t){const n=t.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));return{Component:e,sectionConfig:n}}),h)(p)}},175:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=C(n(1594)),o=n(9367),i=n(9040),s=v(n(6935)),l=n(5207),a=C(n(4461)),u=C(n(762)),d=C(n(8918)),c=v(n(5815)),p=v(n(6022)),h=v(n(5609)),f=v(n(6177)),m=v(n(4014)),g=v(n(134)),y=v(n(7871));function v(e){return e&&e.__esModule?e:{default:e}}function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}function C(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{LoadingComponent:t,transition:n,files:o,onModalClose:i,onCancel:s,onConfirm:l,filesAreVersioned:a,archiveFiles:d,actions:p}=e;const[v,b]=(0,r.useState)(!0),[C,S]=(0,r.useState)({});(0,r.useEffect)((()=>{const e=f.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"),t=o.map((e=>e.id)).map((e=>`ids[]=${e}`)).join("&"),n=`${e.endpoints.readDescendantCounts.url}?${t}`;b(!0),h.default.get(n).then((async e=>{const t=await e.json();b(!1),S(t)})).catch((async e=>{const t=await(0,m.default)(e);p.toasts.error(t)}))}),[o]);let E=null;const _=a&&d?"AssetAdmin.ARCHIVE":"AssetAdmin.DELETE",w=a&&d?"Archive":"Delete";let x=[{label:c.default._t(_,w),handler:()=>l(o.map((e=>{let{id:t}=e;return t}))),color:"danger"},{label:c.default._t("AssetAdmin.CANCEL","Cancel"),handler:s}];if(v)E=r.default.createElement(t,null);else{const e=C.filter((e=>"folder"===e.type)).length,t=C.filter((e=>"file"===e.type)).length,n=C.reduce(((e,t)=>e+t.count),0),i={topLevelFolderCount:e,topLevelFileCount:t,descendantFileCount:n,filesAreVersioned:a,archiveFiles:d};E=r.default.createElement(y.default,i),t+n>0&&(x=[{label:c.default._t("AssetAdmin.CANCEL","Cancel"),handler:s,color:"primary"},{label:c.default._t(_,w),handler:()=>l(o.map((e=>{let{id:t}=e;return t}))),color:"danger"}])}const F=![u.CANCELING,u.DELETING].includes(n);return r.default.createElement(g.default,{body:E,isOpen:F,actions:x,onCancel:s,onClosed:i,filesAreVersioned:a,archiveFiles:d})};t.Component=E,E.propTypes={LoadingComponent:s.default.elementType,transition:s.default.oneOf(["canceling","deleting",!1]),files:s.default.arrayOf(p.default),descendantFileCounts:s.default.object,onCancel:s.default.func.isRequired,onModalClose:s.default.func.isRequired,onConfirm:s.default.func.isRequired,filesAreVersioned:s.default.bool.isRequired,archiveFiles:s.default.bool.isRequired,actions:s.default.object.isRequired};const _=(0,o.compose)((0,l.inject)(["Loading"],(e=>({LoadingComponent:e}))))(E);t.default=(0,o.compose)((0,i.connect)((e=>{let{assetAdmin:{confirmDeletion:t}}=e;return t}),(e=>({onCancel:()=>e(a.cancel()),onModalClose:()=>e(a.modalClose()),actions:{toasts:(0,o.bindActionCreators)(d,e),confirmation:(0,o.bindActionCreators)(a,e)}}))))((e=>{let{showConfirmation:t,files:n,...o}=e;return t&&n.length>0?r.default.createElement(_,S({},o,{files:n})):null}))},7871:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(5815)),o=s(n(1594)),i=s(n(6935));function s(e){return e&&e.__esModule?e:{default:e}}const l=e=>{let{topLevelFolderCount:t,topLevelFileCount:n,descendantFileCount:i,filesAreVersioned:s,archiveFiles:l}=e,a="AssetAdmin.BULK_ACTIONS_DELETE_WARNING",u="Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.";s&&l&&(a="AssetAdmin.BULK_ACTIONS_ARCHIVE_WARNING",u="Ensure files are removed from content areas prior to archiving them, otherwise they will appear as broken links.");const d=((e,t,n,o,i)=>{const s=t+n;if(s>0){let e="AssetAdmin.BULK_ACTIONS_DELETE_ITEMS_CONFIRM",t=["You're about to delete %s file(s) which may be used in your site's content.","Carefully check the file usage on the files before deleting the file(s)."].join(" ");return o&&i&&(e="AssetAdmin.BULK_ACTIONS_ARCHIVE_ITEMS_CONFIRM",t=["You're about to archive %s file(s) which may be used in your site's content.","Carefully check the file usage on the files before archiving the file(s)."].join(" ")),r.default.sprintf(r.default._t(e,t),s)}if(1===e){let e="AssetAdmin.BULK_ACTIONS_DELETE_FOLDER_CONFIRM",t="Are you sure you want to delete this folder?";return o&&i&&(e="AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDER_CONFIRM",t="Are you sure you want to archive this folder?"),r.default._t(e,t)}let l="AssetAdmin.BULK_ACTIONS_DELETE_FOLDERS_CONFIRM",a="Are you sure you want to delete these folders?";return o&&i&&(l="AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDERS_CONFIRM",a="Are you sure you want to archive these folders?"),r.default._t(l,a)})(t,n,i,s,l);return o.default.createElement(o.default.Fragment,null,o.default.createElement("p",null,d),n+i>0&&o.default.createElement("p",null,r.default._t(a,u)))};l.propTypes={topLevelFolderCount:i.default.number,topLevelFileCount:i.default.number,descendantFileCount:i.default.number},l.defaultProps={topLevelFolderCount:0,topLevelFileCount:0,descendantFileCount:0};t.default=l},134:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(5815)),o=l(n(1594)),i=l(n(6935)),s=n(3556);function l(e){return e&&e.__esModule?e:{default:e}}const a=e=>{let{isOpen:t,body:n,onCancel:i,actions:l,filesAreVersioned:a,archiveFiles:u}=e,d="AssetAdmin.CONFIRM_FILE_DELETION",c="Confirm deletion";return a&&u&&(d="AssetAdmin.CONFIRM_FILE_ARCHIVE",c="Confirm archive"),o.default.createElement(s.Modal,{isOpen:t,toggle:i},o.default.createElement(s.ModalHeader,{toggle:i},r.default._t(d,c)),o.default.createElement(s.ModalBody,null,n),o.default.createElement(s.ModalFooter,null,l.map((e=>{let{label:t,handler:n,color:r}=e;return o.default.createElement(s.Button,{key:t,color:r,onClick:n},t)}))))};a.propTypes={isOpen:i.default.bool.isRequired,body:i.default.node.isRequired,onCancel:i.default.func.isRequired,actions:i.default.arrayOf(i.default.shape({label:i.default.string.isRequired,handler:i.default.func,color:i.default.string})),filesAreVersioned:i.default.bool.isRequired,archiveFiles:i.default.bool.isRequired};t.default=a},1869:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=E(n(5815)),o=n(9040),i=n(9367),s=S(n(1594)),l=E(n(6379)),a=E(n(55)),u=S(n(9077)),d=E(n(6935)),c=n(5207),p=E(n(6177)),h=E(n(5609)),f=S(n(4461)),m=S(n(1021)),g=E(n(6923)),y=E(n(7008)),v=E(n(7675)),b=S(n(1584));function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(C=function(e){return e?n:t})(e)}function S(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=C(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function E(e){return e&&e.__esModule?e:{default:e}}function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;te.json())).then((e=>{this.setState({file:e})}))}getFormSchemaUrl(){const{schemaUrlQueries:e,schemaUrl:t,fileId:n}=this.props,r=y.default.parse(t),o=e.reduce(((e,t)=>{let{name:n,value:r}=t;return{...e,[n]:r}}),{});return y.default.format({...r,pathname:`${r.path}/${n}`,search:v.default.stringify(o)})}handleAction(e){const t=this.state.file;switch(e.currentTarget.name){case"action_replacefile":this.replaceFile(),e.preventDefault();break;case"action_downloadfile":this.downloadFile(),e.preventDefault();break;case"action_delete":this.props.actions.confirmDeletion.confirm([t]),e.preventDefault()}}handleCancelKeyDown(e){e.keyCode!==l.default.SPACE_KEY_CODE&&e.keyCode!==l.default.RETURN_KEY_CODE||this.handleClose(e)}handleSubmit(e,t,n){const{showingSubForm:r,actions:o}=this.props;return"function"==typeof this.props.onSubmit?this.props.onSubmit(e,t,n).finally((()=>{r&&-1!==["action_save","action_publish"].indexOf(t)&&o.modal.popFormStackEntry()})):n()}handleClose(e){const{showingSubForm:t,onClose:n,actions:r}=this.props;t?r.modal.popFormStackEntry():n(),e&&e.preventDefault()}replaceFile(){const e=document.querySelector(".dz-input-PreviewImage");e&&e.click()}downloadFile(){const e=this.state.file;!function(e,t){const n=document.createElement("a");n.download=t,n.href=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}(e.url,e.name),document.getElementById("Form_fileEditForm_PopoverActions").focus()}handleLoadingError(e){this.setState({loadingForm:!1,loadingError:e.errors[0]})}handleLoadingSuccess(){this.setState({loadingForm:!1,loadingError:null})}handleFetchingSchema(){this.setState({loadingForm:!0})}editorHeader(e){let{SchemaComponent:t,...n}=e;const{dialog:r,nextType:o,showingSubForm:i,actions:l,EditorHeaderComponent:a}=this.props,u=this.getFormSchemaUrl(),d=this.state.file;let c=b.buttonStates.SWITCH;r&&d&&"folder"!==d.type&&(c=i?b.buttonStates.ALWAYS_BACK:b.buttonStates.ONLY_BACK);const{formid:p}=n,h=o&&d&&"folder"!==d.type?()=>{l.modal.stashFormValues(p,u),l.modal.pushFormStackEntry(o)}:void 0,f={onCancel:this.handleClose,showButton:c,onDetails:h};return s.default.createElement(a,f,s.default.createElement(t,n))}createFn(e,t){if("AssetEditorHeaderFieldGroup"===t.name){const n=this.editorHeader,r={key:t.id,SchemaComponent:e,...t};return s.default.createElement(n,r)}return s.default.createElement(e,_({key:t.id},t))}render(){if(!this.state.file)return null;const{FormBuilderLoaderComponent:e}=this.props,t=this.getFormSchemaUrl(),n=(0,g.default)("panel","form--no-dividers","editor",{"editor--asset-dropzone--disable":!this.props.enableDropzone},this.props.className);let o=null;if(this.state.loadingError){let e=this.state.loadingError.value;404===this.state.loadingError.code&&(e=r.default._t("AssetAdmin.FILE_MISSING","File cannot be found")),e||(e=r.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")),o=s.default.createElement("div",{className:"editor__file-preview-message--file-missing"},e)}const i=this.props.loadingComponent;return s.default.createElement("div",{className:n},s.default.createElement("div",{className:"editor__details fill-height"},s.default.createElement(e,{identifier:"AssetAdmin.EditForm",schemaUrl:t,onSubmit:this.handleSubmit,onAction:this.handleAction,onLoadingSuccess:this.handleLoadingSuccess,onLoadingError:this.handleLoadingError,onFetchingSchema:this.handleFetchingSchema,createFn:this.createFn,file:this.state.file}),o,this.state.loadingForm&&s.default.createElement(i,null)))}}t.Component=w,w.propTypes={className:d.default.string,fileId:d.default.number.isRequired,enableDropzone:d.default.bool,dialog:d.default.bool,onClose:d.default.func.isRequired,onSubmit:d.default.func.isRequired,schemaUrl:d.default.string.isRequired,schemaUrlQueries:d.default.arrayOf(d.default.shape({name:d.default.string,value:d.default.any})),actions:d.default.object,showingSubForm:d.default.bool,nextType:d.default.string,EditorHeaderComponent:d.default.oneOfType([d.default.object,d.default.func]),FormBuilderLoaderComponent:d.default.oneOfType([d.default.object,d.default.func])},w.defaultProps={EditorHeaderComponent:b.default,FormBuilderLoaderComponent:a.default};t.default=(0,i.compose)((0,c.inject)(["Loading"],(e=>({loadingComponent:e})),(()=>"AssetAdmin.Editor")),(0,o.connect)((function(e){let{assetAdmin:{gallery:t,modal:n}}=e;return{enableDropzone:t.enableDropzone,nextType:n.formSchema&&n.formSchema.nextType,showingSubForm:n.formSchemaStack&&n.formSchemaStack.length>1}}),(function(e){return{actions:{unsavedForms:(0,i.bindActionCreators)(u,e),confirmDeletion:(0,i.bindActionCreators)(f,e),modal:(0,i.bindActionCreators)(m,e)}}})))(w)},1584:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.buttonStates=void 0;var r=u(n(1594)),o=u(n(5815)),i=u(n(551)),s=u(n(2164)),l=u(n(6935)),a=u(n(6923));function u(e){return e&&e.__esModule?e:{default:e}}const d=e=>t=>{t.preventDefault(),e&&e()},c="ALWAYS_BACK",p="ALWAYS_CANCEL",h="SWITCH",f="ONLY_BACK",m="ONLY_CANCEL",g=t.buttonStates={ALWAYS_BACK:c,ALWAYS_CANCEL:p,SWITCH:h,ONLY_BACK:f,ONLY_CANCEL:m,NONE:"NONE"},y=e=>{let{onCancel:t,onDetails:n,showButton:l,children:u}=e;const g=d(t),y=[c,h,f].indexOf(l)>=0,v=[p,h,m].indexOf(l)>=0,b=(0,a.default)("editor-header__back-button","btn--icon-xl",{"editor-header__back-button--md-below":[h,f].indexOf(l)>=0}),C=(0,a.default)("editor-header__cancel-button","btn--icon-xl",{"editor-header__cancel-button--lg-above":[h,m].indexOf(l)>=0});return r.default.createElement("div",{className:"editor-header"},y&&r.default.createElement(s.default,{className:b,onClick:g}),r.default.createElement("div",{className:"editor-header__field"},u),n&&r.default.createElement(i.default,{onClick:d(n),icon:"edit-list",className:"editor-header__edit",outline:!0},o.default._t("AssetAdmin.DETAILS","Details")),v&&r.default.createElement("div",null,r.default.createElement(i.default,{icon:"cancel",className:C,noText:!0,onClick:g},o.default._t("AssetAdmin.CANCEL"))))};y.propTypes={onCancel:l.default.func,onDetails:l.default.func,showButton:l.default.oneOf(Object.keys(g).map((e=>g[e]))),children:l.default.node};t.default=y},5789:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.galleryViewPropTypes=t.galleryViewDefaultProps=t.default=t.Component=void 0;var r=I(n(1669)),o=I(n(5815)),i=O(n(1594)),s=n(9040),l=n(9367),a=I(n(853)),u=I(n(3229)),d=I(n(2853)),c=I(n(6609)),p=I(n(6379)),h=I(n(6621)),f=O(n(4201)),m=O(n(8918)),g=O(n(1369)),y=O(n(4461)),v=n(4172),b=I(n(4350)),C=I(n(6177)),S=I(n(9247)),E=n(5207),_=I(n(6935)),w=I(n(5609)),x=I(n(5769)),F=I(n(3863));function A(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(A=function(e){return e?n:t})(e)}function O(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=A(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function I(e){return e&&e.__esModule?e:{default:e}}const D={DELETE:"delete",ARCHIVE:"archive",EDIT:"edit",MOVE:"move",PUBLISH:"publish",UNPUBLISH:"unpublish",INSERT:"insert",ADMIN:"admin",SELECT:"select"};class N extends i.Component{constructor(e){super(e),this.handleOpenFolder=this.handleOpenFolder.bind(this),this.handleOpenFile=this.handleOpenFile.bind(this),this.handleSelect=this.handleSelect.bind(this),this.handleAddedFile=this.handleAddedFile.bind(this),this.handlePreviewLoaded=this.handlePreviewLoaded.bind(this),this.handleCancelUpload=this.handleCancelUpload.bind(this),this.handleRemoveErroredUpload=this.handleRemoveErroredUpload.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleSending=this.handleSending.bind(this),this.handleSort=this.handleSort.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.handleSuccessfulUpload=this.handleSuccessfulUpload.bind(this),this.handleQueueComplete=this.handleQueueComplete.bind(this),this.handleFailedUpload=this.handleFailedUpload.bind(this),this.handleClearSearch=this.handleClearSearch.bind(this),this.handleEnableDropzone=this.handleEnableDropzone.bind(this),this.handleMoveFiles=this.handleMoveFiles.bind(this),this.handleBulkEdit=this.handleBulkEdit.bind(this),this.handleBulkPublish=this.handleBulkPublish.bind(this),this.handleBulkUnpublish=this.handleBulkUnpublish.bind(this),this.handleBulkMove=this.handleBulkMove.bind(this),this.handleBulkInsert=this.handleBulkInsert.bind(this),this.handleBeginSelection=this.handleBeginSelection.bind(this),this.handleGroupSelect=this.handleGroupSelect.bind(this),this.handleClearSelection=this.handleClearSelection.bind(this),this.handleSelectAll=this.handleSelectAll.bind(this),this.toggleSelectConcat=this.toggleSelectConcat.bind(this),this.getSelectableFiles=this.getSelectableFiles.bind(this)}componentDidMount(){this.initSortDropdown(),window.addEventListener("keydown",this.toggleSelectConcat),window.addEventListener("keyup",this.toggleSelectConcat)}componentDidUpdate(e){this.initSortDropdown(),this.initFlushUploadFiles(e)}componentWillUnmount(){window.removeEventListener("keydown",this.toggleSelectConcat),window.removeEventListener("keyup",this.toggleSelectConcat)}initFlushUploadFiles(e){if("tile"!==this.props.view){this.getSortElement().off("change")}e.folderId!==this.props.folderId&&this.props.actions.queuedFiles.purgeUploadQueue()}getSortElement(){return(0,r.default)(this.gallery).find(".gallery__sort .dropdown")}getSearchMessage(e){const t=[];e.name&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEKEYWORDS","with keywords '{name}'")),e.lastEditedFrom&&e.lastEditedTo?t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEEDITEDBETWEEN","last edited between '{lastEditedFrom}' and '{lastEditedTo}'")):e.lastEditedFrom?t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEEDITEDFROM","last edited after '{lastEditedFrom}'")):e.lastEditedTo&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEEDITEDTO","last edited before '{lastEditedTo}'")),e.appCategory&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGECATEGORY","categorised as '{appCategory}'")),e.currentFolderOnly&&this.props.folder.title&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGELIMIT","limited to the folder '{folder}'"));const n=[t.slice(0,-1).join(`${o.default._t("AssetAdmin.JOIN",",")} `),t.slice(-1)].filter((e=>e)).join(` ${o.default._t("AssetAdmin.JOINLAST","and")} `);if(""===n)return"";const r={parts:o.default.inject(n,Object.assign({folder:this.props.folder.title},e,{appCategory:e.appCategory?e.appCategory.toLowerCase():void 0}))};return o.default.inject(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGE","Search results {parts}"),r)}getSelection(e,t){const n=this.getSelectableFiles(),r=[e,t].map((e=>n.findIndex((t=>t.id===e)))).filter((e=>-1!==e)).sort(((e,t)=>e-t));if(2!==r.length)return r.map((e=>n[e].id));const[o,i]=r;return n.filter(((e,t)=>t>=o&&t<=i)).map((e=>e.id))}getSelectableFiles(){const e=this.props.files.filter((e=>e.id));return this.props.type===D.SELECT?e.filter((e=>"folder"!==e.type)):e}handleBulkInsert(e,t){this.props.onInsertMany(e,t)}handleBulkPublish(e,t){const n=t.map((e=>e.id));return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onPublish(n).then((e=>{this.props.actions.gallery.setLoading(!1),this.props.actions.toasts.success(o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH_SUCCESS","%s folders/files were successfully published."),e.length)),this.props.actions.gallery.deselectFiles()}))):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}handleBulkUnpublish(e,t){const n=t.filter((e=>e.published)).map((e=>e.id));return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onUnpublish(n).then((e=>{this.props.actions.gallery.setLoading(!1),this.props.actions.toasts.success(o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH_SUCCESS","%s folders/files were successfully unpublished."),e.length)),this.props.actions.gallery.deselectFiles()}))):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}initSortDropdown(){if("tile"===this.props.view){const e=this.getSortElement();e.chosen({allow_single_deselect:!0,disable_search_threshold:20}),e.off("change"),e.on("change",(()=>e.find(":selected")[0].click()))}}handleSort(e){this.props.actions.queuedFiles.purgeUploadQueue(),this.props.onSort(e)}handleSetPage(e){this.props.onSetPage(e)}handleCancelUpload(e){e.xhr.abort(),this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}handleRemoveErroredUpload(e){this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}handleAddedFile(e){this.props.actions.queuedFiles.addQueuedFile(e)}handlePreviewLoaded(e,t){this.props.actions.queuedFiles.updateQueuedFile(e.queuedId,t)}handleSending(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{xhr:t})}handleUploadProgress(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{progress:t})}handleSuccessfulUpload(e){const t=JSON.parse(e.xhr.response);if(void 0!==t[0].error)return void this.handleFailedUpload(e);this.props.actions.queuedFiles.succeedUpload(e._queuedId,t[0]),this.props.onSuccessfulUpload&&this.props.onSuccessfulUpload(t);const n=this.props.queuedFiles.items.reduce(((e,t)=>100!==t.progress?e+1:e),0);if(!this.props.fileId&&!this.props.selectedFiles.length&&0===n){const e=t.pop();this.props.onOpenFile(e.id)}}handleQueueComplete(){this.props.onSuccessfulUploadQueue&&this.props.onSuccessfulUploadQueue()}handleFailedUpload(e,t){const n=e.xhr&&e.xhr.status?(0,S.default)(e.xhr.status,e.xhr):"";this.props.actions.queuedFiles.failUpload(e._queuedId,t,n)}itemIsSelected(e){return this.props.selectedFiles.indexOf(e)>-1}toggleSelectConcat(e){this.props.actions.gallery.setConcatenateSelect(this.isConcat(e))}isConcat(e){return e.metaKey||e.ctrlKey||e.shiftKey}itemIsHighlighted(e){return this.props.fileId===e}hasOpenedItem(){return!!this.props.fileId}handleClearSearch(e){this.props.onClearSearch(e)}handleGroupSelect(e,t){const{setSelectedFiles:n,selectFiles:r}=this.props.actions.gallery,o=this.getSelectableFiles(),i=e.filter(((t,n)=>e.indexOf(t)===n&&o.find((e=>e.id===t)))),s=this.props.concatenateSelect||this.isConcat(t);if(null!==this.props.maxFilesSelect){let e=i.length;if(s){e=this.props.selectedFiles.filter((e=>!this.props.selectedFiles.includes(e))).concat(this.props.selectedFiles).length}if(e>=this.props.maxFilesSelect)return}s?r(i):n(i)}handleClearSelection(){this.props.actions.gallery.deselectFiles()}handleSelectAll(){const e=this.props.files.map((e=>e.id));this.handleGroupSelect(e,new Event("na"))}handleBeginSelection(e){let t=e.target;for(;t;){if(t.classList.contains("griddle-footer"))return!1;if(t.classList.contains("gallery__main--selectable"))break;t=t.parentNode}return!0}handleOpenFolder(e,t){e.preventDefault(),this.props.onOpenFolder(t.id)}handleOpenFile(e,t){e.preventDefault(),null!==t.created&&(this.props.selectedFiles.length&&1!==this.props.maxFilesSelect||this.props.type!==D.SELECT||this.handleSelect(e,t),this.props.onOpenFile(t.id,t))}handleSelect(e,t){const n=this.props.maxFilesSelect;let r=this.getSelectableFiles().filter((e=>e.id===t.id)).map((e=>e.id));if(1!==n)if(-1===this.props.selectedFiles.indexOf(t.id)){e.shiftKey&&(r=this.getSelection(this.props.lastSelected,t.id));if(this.props.selectedFiles.filter((e=>!r.includes(e))).concat(r).length>n&&null!==n)return;this.props.actions.gallery.selectFiles(r),this.props.actions.gallery.setLastSelected(t.id)}else this.props.actions.gallery.deselectFiles([t.id]),e.shiftKey&&this.props.actions.gallery.setLastSelected(null);else this.props.actions.gallery.setSelectedFiles(r)}handleEnableDropzone(e){this.props.actions.gallery.setEnableDropzone(e)}handleMoveFiles(e,t){const n=this.props.sectionConfig.endpoints.move.url;return w.default.post(n,{ids:t,folderID:e},{"X-SecurityID":C.default.get("SecurityID")}).then((()=>{const n=p.default.MOVE_SUCCESS_DURATION,r=`+${t.length}`;this.props.actions.gallery.setFileBadge(e,r,"success",n),"function"==typeof this.props.onMoveFilesSuccess&&this.props.onMoveFilesSuccess(e,t)})).catch((()=>{this.props.actions.toasts.error(o.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))}))}handleBulkEdit(e,t){this.handleOpenFile(e,t[0])}handleBulkMove(){this.props.actions.gallery.activateModal(p.default.MODAL_MOVE)}renderTransitionBulkActions(){return this.renderBulkActions()}renderBulkActions(){const{type:e,dialog:t,maxFilesSelect:n,files:r,selectedFiles:o,BulkActionsComponent:s,sectionConfig:l}=this.props,a=e===D.SELECT||t?e=>e.value===D.INSERT:e=>e.value!==D.INSERT,u=l.filesAreVersioned&&l.archiveFiles?e=>e.value!==D.DELETE:e=>e.value!==D.ARCHIVE,d=p.default.BULK_ACTIONS.filter(a).filter(u).map((e=>{if(e.callback)return e;switch(e.value){case D.DELETE:case D.ARCHIVE:return{...e,callback:(e,t)=>{this.props.actions.confirmDeletion.confirm(t)},confirm:void 0};case D.EDIT:return{...e,callback:this.handleBulkEdit};case D.MOVE:return{...e,callback:this.handleBulkMove};case D.PUBLISH:return{...e,callback:this.handleBulkPublish};case D.UNPUBLISH:return{...e,callback:this.handleBulkUnpublish};case D.INSERT:return{...e,callback:this.handleBulkInsert,color:"primary"};default:return e}})),c=o.map((e=>r.find((t=>t&&e===t.id)))).filter((e=>e));return c.length>0&&[D.ADMIN,D.SELECT].includes(e)?i.default.createElement(s,{actions:d,items:c,total:n,key:c.length>0,container:this.gallery,showCount:1!==n,onClearSelection:this.handleClearSelection,onSelectAll:this.handleSelectAll}):null}renderGalleryView(){const e="table"===this.props.view?c.default:d.default,t=this.props.files.map((e=>{const t=this.itemIsSelected(e.id),n=this.itemIsHighlighted(e.id),r=(e.queuedId?`queueId${e.queuedId}`:`id${e.id}`)+(t?"--selected":"");return{...e,selected:t,highlighted:n,key:r}})),{type:n,loading:r,dialog:o,page:s,totalCount:l,limit:a,sort:u,selectedFiles:p,badges:h,maxFilesSelect:f,sectionConfig:m}=this.props,g={selectableItems:n===D.SELECT||n===D.ADMIN&&(!f||f>1),selectableFolders:n!==D.SELECT&&!o,files:t,loading:r,page:s,totalCount:l,limit:a,sort:u,selectedFiles:p,badges:h,onSort:this.handleSort,onSetPage:this.handleSetPage,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSelect:this.handleSelect,onCancelUpload:this.handleCancelUpload,onDropFiles:this.handleMoveFiles,onRemoveErroredUpload:this.handleRemoveErroredUpload,onEnableDropzone:this.handleEnableDropzone,sectionConfig:m,canDrag:n===D.ADMIN,maxFilesSelect:f};return i.default.createElement(e,g)}renderToolbar(){const{GalleryToolbar:e,sort:t,view:n,folder:r,onCreateFolder:o,onOpenFolder:s,onViewChange:l}=this.props,a={onMoveFiles:this.handleMoveFiles,onSort:this.handleSort,onCreateFolder:o,onOpenFolder:s,onViewChange:l,view:n,sort:t,folder:r};return i.default.createElement(e,a)}render(){const{folder:e,loading:t,errorMessage:n,noticeMessage:r}=this.props,s=this.props.LoadingComponent;if(!e)return n?i.default.createElement("div",{className:"gallery__error flexbox-area-grow"},i.default.createElement("div",{className:"gallery__error-message"},i.default.createElement("h3",null,o.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error.")),n&&i.default.createElement("p",null,n))):t?i.default.createElement("div",{className:"flexbox-area-grow"},i.default.createElement(s,null)):i.default.createElement("div",{className:"flexbox-area-grow"},i.default.createElement("div",{className:"editor__file-preview-message--file-missing m-t-3"},o.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")));const l=i.default.createElement("div",{className:"gallery_messages"},n&&i.default.createElement(h.default,{value:n,type:"danger"}),r&&i.default.createElement(h.default,{value:r,type:"success"})),u={height:p.default.THUMBNAIL_HEIGHT,width:p.default.THUMBNAIL_WIDTH},d={url:this.props.createFileApiUrl,method:this.props.createFileApiMethod,paramName:"Upload",clickable:"#upload-button",...this.props.sectionConfig.dropzoneOptions},c=this.props.securityId,f=this.props.folder.canEdit&&this.props.enableDropzone,m=["panel","panel--padded","panel--scrollable","gallery__main","fill-height"];this.props.type===D.INSERT&&m.push("insert-media-modal__main");const g=m;return this.hasOpenedItem()&&g.push("gallery__main--has-opened-item"),i.default.createElement("div",{className:"flexbox-area-grow gallery__outer",ref:e=>{this.gallery=e}},this.renderTransitionBulkActions(),i.default.createElement(F.default,{className:m.join(" ")},this.renderToolbar(),i.default.createElement(v.SelectableGroup,{enabled:"tile"===this.props.view&&this.props.type===D.ADMIN,className:"flexbox-area-grow fill-height gallery__main--selectable",onSelection:this.handleGroupSelect,onNonItemClick:this.handleClearSelection,onBeginSelection:this.handleBeginSelection,preventDefault:!1,fixedPosition:!0},i.default.createElement(a.default,{name:"gallery-container",className:"flexbox-area-grow",canUpload:f,onAddedFile:this.handleAddedFile,onPreviewLoaded:this.handlePreviewLoaded,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onQueueComplete:this.handleQueueComplete,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:u,folderId:this.props.folderId,options:d,securityID:c,uploadButton:!1},l,this.renderGalleryView()))),this.props.loading&&i.default.createElement(s,null),i.default.createElement(x.default,{sectionConfig:this.props.sectionConfig,folderId:this.props.folderId,onSuccess:this.props.onMoveFilesSuccess,onOpenFolder:this.props.onOpenFolder}))}}t.Component=N;const R={page:1,limit:15},P={sectionConfig:b.default,loading:_.default.bool,sort:_.default.string,files:_.default.arrayOf(_.default.shape({id:_.default.number,parent:_.default.shape({id:_.default.number})})).isRequired,selectedFiles:_.default.arrayOf(_.default.number),totalCount:_.default.number,page:_.default.number,limit:_.default.number,badges:_.default.arrayOf(_.default.shape({id:_.default.number,message:_.default.node,status:_.default.string})),onOpenFile:_.default.func.isRequired,onOpenFolder:_.default.func.isRequired,onSort:_.default.func.isRequired,onSetPage:_.default.func.isRequired,maxFilesSelect:_.default.number};t.galleryViewDefaultProps=Object.assign({},R,{selectableItems:!1}),t.galleryViewPropTypes=Object.assign({},P,{selectableItems:_.default.bool,selectableFolders:_.default.bool,onSelect:_.default.func,onCancelUpload:_.default.func,onRemoveErroredUpload:_.default.func,onEnableDropzone:_.default.func});N.defaultProps=Object.assign({},R,{type:D.ADMIN,view:"tile",enableDropzone:!0,dialog:!1,BulkActionsComponent:u.default}),N.propTypes=Object.assign({},P,{onSuccessfulUpload:_.default.func,onSuccessfulUploadQueue:_.default.func,onCreateFolder:_.default.func,onMoveFilesSuccess:_.default.func,onPublish:_.default.func,onUnpublish:_.default.func,type:_.default.oneOf(["insert-media","insert-link",D.SELECT,D.ADMIN]),view:_.default.oneOf(["tile","table"]),lastSelected:_.default.number,dialog:_.default.bool,fileId:_.default.number,folderId:_.default.number.isRequired,folder:_.default.shape({id:_.default.number,title:_.default.string,parentId:_.default.number,canView:_.default.bool,canEdit:_.default.bool}),files:_.default.array,errorMessage:_.default.string,actions:_.default.object,securityId:_.default.string,onViewChange:_.default.func.isRequired,createFileApiUrl:_.default.string,createFileApiMethod:_.default.string,search:_.default.object,enableDropzone:_.default.bool,concatenateSelect:_.default.bool,GalleryToolbar:_.default.elementType,sorters:_.default.arrayOf(_.default.shape({field:_.default.string.isRequired,direction:_.default.oneOf(["asc","desc"]).isRequired,label:_.default.string.isRequired})).isRequired,BulkActionsComponent:_.default.oneOfType([_.default.object,_.default.func])});t.default=(0,l.compose)((0,E.inject)(["GalleryToolbar","Loading"],((e,t)=>({GalleryToolbar:e,LoadingComponent:t})),(()=>"AssetAdmin.Gallery")),(0,s.connect)((function(e,t){let{sort:n}=t;const{selectedFiles:r,errorMessage:o,noticeMessage:i,enableDropzone:s,badges:l,concatenateSelect:a,loading:u,sorters:d,lastSelected:c}=e.assetAdmin.gallery;return!n&&d&&d[0]&&(n=`${d[0].field},${d[0].direction}`),{lastSelected:c,selectedFiles:r,errorMessage:o,noticeMessage:i,enableDropzone:s,badges:l,concatenateSelect:a,loading:t.loading||u,queuedFiles:e.assetAdmin.queuedFiles,securityId:e.config.SecurityID,sorters:d,sort:n}}),(function(e){return{actions:{gallery:(0,l.bindActionCreators)(f,e),toasts:(0,l.bindActionCreators)(m,e),queuedFiles:(0,l.bindActionCreators)(g,e),confirmDeletion:(0,l.bindActionCreators)(y,e)}}})))(N)},3863:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=a(n(6923)),i=a(n(2914)),s=a(n(6935)),l=a(n(5799));function a(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}class d extends r.Component{constructor(e){super(e),this.state={dragging:!1},this.mounted=!1,this.handleDrop=this.handleDrop.bind(this)}componentDidMount(){this.mounted=!0,window.addEventListener("drop",this.handleDrop,!0)}componentDidUpdate(){setTimeout((()=>{if(!this.mounted||!this.context.dragDropManager)return;const e=this.context.dragDropManager.monitor.isDragging();this.state.dragging!==e&&this.setState({dragging:e})}))}componentWillUnmount(){this.mounted=!1,window.removeEventListener("drop",this.handleDrop,!0)}handleDrop(){const e=this.context.dragDropManager,t=e&&e.backend;t&&t.isDraggingNativeItem()&&t.endDragNativeItem()}render(){const{className:e,children:t}=this.props;return r.default.createElement("div",{className:(0,o.default)(e,{"gallery__main--dragging":this.state.dragging})},t,r.default.createElement(i.default,null))}}d.contextTypes={dragDropManager:s.default.object},d.propTypes={className:s.default.string,children:s.default.oneOfType([s.default.arrayOf(s.default.node),s.default.node])};t.default=(0,l.default)(d)},6931:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=b(n(5815)),o=v(n(1594)),i=n(9367),s=n(9040),l=b(n(7917)),a=b(n(2908)),u=b(n(1957)),d=v(n(4201)),c=v(n(1021)),p=b(n(8737)),h=b(n(6923)),f=b(n(6935)),m=b(n(8268)),g=b(n(7675));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}function v(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function b(e){return e&&e.__esModule?e:{default:e}}class C extends o.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this)}componentDidMount(){const{isOpen:e,onBrowse:t,setOverrides:n,fileAttributes:r,folderId:o}=this.props;e?"function"==typeof n&&r.ID&&(n(this.props),t(o,r.ID)):t(o||0)}componentDidUpdate(e){!this.props.isOpen&&e.isOpen&&(this.props.onBrowse(this.props.folderId),this.props.actions.gallery.deselectFiles()),"function"==typeof e.setOverrides&&this.props.isOpen&&!e.isOpen&&(e.setOverrides(this.props),this.props.onBrowse(this.props.folderId,this.props.fileAttributes?this.props.fileAttributes.ID:null))}getSectionProps(){return{...this.props,dialog:!0,toolbarChildren:this.renderToolbarChildren(),onSubmitEditor:this.handleSubmit,onReplaceUrl:this.props.onBrowse}}getModalProps(){const{onHide:e,onInsert:t,sectionConfig:n,schemaUrl:r,className:o,...i}=this.props;return{...i,className:(0,h.default)("insert-media-modal",o),size:"lg",showCloseButton:!1}}handleSubmit(e,t,n,r){return"action_insert"===t?this.props.onInsert(e,r):n()}renderToolbarChildren(){return o.default.createElement("button",{type:"button",className:"close modal__close-button insert-media-modal__close-button",onClick:this.props.onClosed,"aria-label":r.default._t("FormBuilderModal.CLOSE","Close")},o.default.createElement("span",{"aria-hidden":"true"},"×"))}render(){const e=this.getModalProps(),t=this.getSectionProps(),n=this.props.isOpen?o.default.createElement(l.default,t):null;return o.default.createElement(p.default,e,n)}}t.Component=C,C.propTypes={sectionConfig:f.default.shape({url:f.default.string,form:f.default.object}),type:f.default.oneOf(["insert-media","insert-link","select","admin"]),schemaUrl:f.default.string,isOpen:f.default.bool,setOverrides:f.default.func,onInsert:f.default.func.isRequired,fileAttributes:f.default.shape({ID:f.default.number,AltText:f.default.string,Width:f.default.number,Height:f.default.number,Loading:f.default.string,TitleTooltip:f.default.string,Alignment:f.default.string,Description:f.default.string,TargetBlank:f.default.bool}),requireLinkText:f.default.bool,folderId:f.default.number,fileId:f.default.number,viewAction:f.default.string,query:f.default.object,getUrl:f.default.func,onBrowse:f.default.func.isRequired,onClosed:f.default.func,className:f.default.string,actions:f.default.object,maxFiles:f.default.number,fileSelected:f.default.bool},C.defaultProps={className:"",fileAttributes:{},type:"insert-media",folderId:0,maxFiles:1};t.default=(0,i.compose)(a.default,(0,s.connect)((function(e,t){const n=t.sectionConfig;if(!n)return{};let r=0;null!==t.folderId?r=t.folderId:t.folder&&(r=t.folder.id);const o=t.fileAttributes?t.fileAttributes.ID:t.fileId,i=e.assetAdmin.modal.formSchema,s={config:n,viewAction:t.viewAction,folderId:r,type:i&&i.type,fileId:o},{schemaUrl:l,targetId:a}=(0,m.default)(s);if(!l)return{};const u={};t.requireLinkText&&(u.requireLinkText=!0),t.fileSelected&&(u.fileSelected=!0);let d=g.default.stringify(u);return d=d?`?${d}`:"",{schemaUrl:`${l}/${a}${d}`,type:i&&i.type}}),(function(e){return{actions:{gallery:(0,i.bindActionCreators)(d,e),modal:(0,i.bindActionCreators)(c,e)}}})),u.default)(C)},5769:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=m(n(1594)),o=n(9040),i=n(9367),s=m(n(5815)),l=m(n(6379)),a=m(n(6935)),u=n(4201),d=n(8918),c=m(n(8737)),p=m(n(4350)),h=m(n(6177)),f=m(n(5609));function m(e){return e&&e.__esModule?e:{default:e}}class g extends r.default.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this),this.timeout=null}handleSubmit(e){let{FolderID:t}=e;const{selectedFiles:n,onSuccess:r,onClosed:o,setNotice:i,setError:a,setBadge:u}=this.props;let d=this.props.sectionConfig.endpoints.move.url;return f.default.post(d,{ids:n,folderID:t},{"X-SecurityID":h.default.get("SecurityID")}).then((()=>(d=`${this.props.sectionConfig.endpoints.read.url}/${t}`,f.default.get(d)))).then((e=>e.json())).then((e=>{"function"==typeof r&&r(e.id,n),u(e.id,`${n.length}`,"success",l.default.MOVE_SUCCESS_DURATION),i(s.default.sprintf(s.default._t("AssetAdmin.MOVED_ITEMS_TO","Moved %s item(s) to %s"),n.length,e.name),[{label:s.default._t("AssetAdmin.GO_TO_FOLDER","Go to folder"),onClick:()=>this.props.onOpenFolder(e.id)}]),o()})).catch((()=>{a(s.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))}))}render(){const{isOpen:e,onClosed:t,title:n,folderId:o,sectionConfig:i}=this.props,{schemaUrl:s}=i.form.moveForm;return r.default.createElement(c.default,{title:n,isOpen:e,onClosed:t,onSubmit:this.handleSubmit,identifier:"AssetAdmin.MoveForm",schemaUrl:`${s}/${o}`})}}g.propTypes={sectionConfig:p.default,folderId:a.default.number.isRequired,isOpen:a.default.bool,onClosed:a.default.func,setNotice:a.default.func,setBadge:a.default.func,setError:a.default.func,title:a.default.string,onSuccess:a.default.func,onOpenFolder:a.default.func.isRequired,selectedFiles:a.default.array.isRequired},g.defaultProps={isOpen:!1};t.default=(0,i.compose)((0,o.connect)((function(e){const{modal:t,selectedFiles:n}=e.assetAdmin.gallery;return{isOpen:t===l.default.MODAL_MOVE,selectedFiles:n,title:s.default.sprintf(s.default._t("AssetAdmin.MOVE_ITEMS_TO","Move %s item(s) to..."),n.length)}}),(function(e){return{onClosed(){e((0,u.deactivateModal)())},setNotice(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e((0,d.display)({text:t,type:"success",actions:n}))},setError(t){e((0,d.display)({text:t,type:"error"}))},setBadge(){e((0,u.setFileBadge)(...arguments))}}})))(g)},6609:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=p(n(6935)),i=p(n(9888)),s=p(n(5815)),l=p(n(1990)),a=n(5789),u=n(5716),d=n(5207),c=n(9367);function p(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}class f extends r.Component{constructor(e){super(e),this.getColumns=this.getColumns.bind(this),this.handleSort=this.handleSort.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.handleRowClick=this.handleRowClick.bind(this),this.renderSelect=this.renderSelect.bind(this),this.renderTitle=this.renderTitle.bind(this),this.renderStatus=this.renderStatus.bind(this),this.renderNoItemsNotice=this.renderNoItemsNotice.bind(this)}getColumns(){const e=["thumbnail","title","status","size","lastEdited"];return this.props.selectableItems&&e.unshift("selected"),e}getColumnConfig(){return[{columnName:"selected",sortable:!1,displayName:"",cssClassName:"gallery__table-column--select",customComponent:this.renderSelect},{columnName:"thumbnail",sortable:!1,displayName:"",cssClassName:"gallery__table-column--image",customComponent:this.renderThumbnail},{columnName:"title",customCompareFn:()=>0,displayName:s.default._t("File.TITLE","Title"),cssClassName:"gallery__table-column--title",customComponent:this.renderTitle},{columnName:"status",sortable:!1,cssClassName:"sort--disabled",customComponent:this.renderStatus,displayName:s.default._t("File.STATUS","Status")},{columnName:"lastEdited",displayName:s.default._t("File.MODIFIED","Modified"),customComponent:this.renderDate},{columnName:"size",sortable:!1,displayName:s.default._t("File.SIZE","Size"),cssClassName:"sort--disabled",customComponent:this.renderSize}]}getRowMetadata(e){return"gallery__table-row "+(e.highlighted?"gallery__table-row--highlighted":"")}getTableProps(){const[e,t]=this.props.sort.split(",");return{tableClassName:"gallery__table table table-hover",gridClassName:"gallery__main-view--table",rowMetadata:{bodyCssClassName:this.getRowMetadata,key:"key"},sortAscendingComponent:"",sortDescendingComponent:"",useExternal:!0,externalSetPage:this.handleSetPage,externalChangeSort:this.handleSort,externalSetFilter:()=>null,externalSetPageSize:()=>null,externalCurrentPage:this.props.page-1,externalMaxPage:Math.ceil(this.props.totalCount/this.props.limit),externalSortColumn:e,externalSortAscending:"asc"===t,initialSort:e,columns:this.getColumns(),columnMetadata:this.getColumnConfig(),useGriddleStyles:!1,onRowClick:this.handleRowClick,results:this.props.files,customNoDataComponent:this.renderNoItemsNotice}}handleActivate(e,t){"folder"===t.type?this.props.onOpenFolder(e,t):this.props.onOpenFile(e,t)}handleRowClick(e,t){const n=e.props.data;t.currentTarget.classList.contains("gallery__table-column--select")&&(t.stopPropagation(),t.preventDefault(),"function"==typeof this.props.onSelect)?this.props.onSelect(t,n):this.handleActivate(t,n)}handleSort(e,t){const n=t?"asc":"desc";this.props.onSort(`${e},${n}`)}handleSetPage(e){this.props.onSetPage(e+1)}preventFocus(e){e.preventDefault()}renderNoItemsNotice(){return 0!==this.props.files.length||this.props.loading?null:r.default.createElement("p",{className:"gallery__no-item-notice"},s.default._t("AssetAdmin.NOITEMSFOUND"))}renderSize(e){if("folder"===e.rowData.type)return null;const t=(0,u.fileSize)(e.data);return r.default.createElement("span",null,t)}renderStatus(e){let t=[];const n=e.rowData,{VersionedBadge:o}=this.props;return"folder"!==n.type&&(n.draft?t.push({key:"status-draft",status:"draft"}):n.modified&&t.push({key:"status-modified",status:"modified"})),t=t.map((e=>{let{...t}=e;return r.default.createElement(o,t)})),t?r.default.createElement("span",null,t):null}renderProgressBar(e){if(!e.queuedId||e.message&&"error"===e.message.type)return null;if(e.id>0)return r.default.createElement("div",{className:"gallery__progress-bar--complete"});const t={className:"gallery__progress-bar-progress",style:{width:`${e.progress}%`}};return r.default.createElement("div",{className:"gallery__progress-bar"},r.default.createElement("div",t))}renderRestrictedAccess(e){const{hasRestrictedAccess:t}=e,n={fileID:e.id,placement:"top",hasRestrictedAccess:t};return r.default.createElement(l.default,n)}renderTrackedFormUpload(e){const{isTrackedFormUpload:t,hasRestrictedAccess:n}=e,o={fileID:e.id,placement:"top",isTrackedFormUpload:t,hasRestrictedAccess:n};return r.default.createElement(l.default,o)}renderTitle(e){const t=this.renderProgressBar(e.rowData);return r.default.createElement("div",{className:"fill-width"},r.default.createElement("div",{className:"flexbox-area-grow"},r.default.createElement("span",null,e.data),e.rowData.hasRestrictedAccess&&this.renderRestrictedAccess(e.rowData),e.rowData.isTrackedFormUpload&&this.renderTrackedFormUpload(e.rowData)),t)}renderSelect(e){if(this.props.selectableItems&&(this.props.selectableFolders||"folder"!==e.rowData.type)){const t={type:"checkbox",title:s.default._t("AssetAdmin.SELECT"),defaultChecked:e.data,tabIndex:-1,onMouseDown:this.preventFocus};return![null,1].includes(this.props.maxFilesSelect)&&this.props.selectedFiles.length>=this.props.maxFilesSelect&&!e.data&&(t.disabled=!0),r.default.createElement("input",t)}return null}renderDate(e){return"folder"===e.rowData.type?null:(moment.locale(s.default.detectLocale()),r.default.createElement("span",null,moment(e.data).format("L LT")))}renderThumbnail(e){const t=e.data||e.rowData.url,n=e.rowData.queuedId&&!e.rowData.id,o=e.rowData.category||"false",i="gallery__table-image",s=[i],l={};return s.push(`${i}--${o}`),"image"===o&&t&&(l.backgroundImage=`url("${t}")`),n||t||"folder"===o||s.push(`${i}--error`),r.default.createElement("div",{className:s.join(" "),style:l})}render(){return r.default.createElement(i.default,this.getTableProps())}}t.Component=f,f.defaultProps=a.galleryViewDefaultProps,f.propTypes={...a.galleryViewPropTypes,sort:o.default.string.isRequired,VersionedBadge:o.default.elementType};t.default=(0,c.compose)((0,d.inject)(["VersionedBadge"],(e=>({VersionedBadge:e}))))(f)},2853:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=d(n(5815)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),i=n(5207),s=n(5789),l=d(n(9888)),a=d(n(6935));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function d(e){return e&&e.__esModule?e:{default:e}}class c extends o.Component{constructor(e){super(e),this.renderItem=this.renderItem.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.handlePrevPage=this.handlePrevPage.bind(this),this.handleNextPage=this.handleNextPage.bind(this),this.handleDrag=this.handleDrag.bind(this)}handleDrag(e){this.props.onEnableDropzone(!e)}handleSetPage(e){this.props.onSetPage(e+1)}handleNextPage(){const e=this.props.page-1;this.handleSetPage(e+1)}handlePrevPage(){const e=this.props.page-1;0!==e?this.handleSetPage(e-1):this.handleSetPage(e)}folderFilter(e){return"folder"===e.type}fileFilter(e){return"folder"!==e.type}renderPagination(){if(this.props.totalCount<=this.props.limit)return null;const e={setPage:this.handleSetPage,maxPage:Math.ceil(this.props.totalCount/this.props.limit),next:this.handleNextPage,nextText:r.default._t("AssetAdmin.NEXT","Next"),previous:this.handlePrevPage,previousText:r.default._t("AssetAdmin.PREVIOUS","Previous"),currentPage:this.props.page-1,useGriddleStyles:!1};return o.default.createElement("div",{className:"griddle-footer"},o.default.createElement(l.default.GridPagination,e))}renderItem(e){const{File:t,Folder:n,badges:r,sectionConfig:i,selectedFiles:s,selectableItems:l,selectableFolders:a}=this.props,u=r.find((t=>t.id===e.id));let d={sectionConfig:i,key:e.key,selectableKey:e.id,item:e,selectedFiles:s,onDrag:this.handleDrag,badge:u,canDrag:this.props.canDrag};if(e.queuedId&&!e.id){const{onCancelUpload:e,onRemoveErroredUpload:t}=this.props;d={...d,onCancelUpload:e,onRemoveErroredUpload:t}}else{const{onOpenFolder:t,onOpenFile:n}=this.props;d={...d,onActivate:"folder"===e.type?t:n}}if(l&&(a||"folder"!==e.type)){const e=![null,1].includes(this.props.maxFilesSelect)&&this.props.selectedFiles.length>=this.props.maxFilesSelect,t=1===this.props.maxFilesSelect?d.onActivate:this.props.onSelect;d={...d,selectable:!0,onSelect:t,maxSelected:e}}if("folder"===e.type){const{onDropFiles:e}=this.props;return d={...d,onDropFiles:e},o.default.createElement(n,d)}return o.default.createElement(t,d)}render(){return o.default.createElement("div",{className:"gallery__main-view--tile"},o.default.createElement("div",{className:"gallery__folders"},this.props.files.filter(this.folderFilter).map(this.renderItem)),o.default.createElement("div",{className:"gallery__files"},this.props.files.filter(this.fileFilter).map(this.renderItem)),0===this.props.files.length&&!this.props.loading&&o.default.createElement("p",{className:"gallery__no-item-notice"},r.default._t("AssetAdmin.NOITEMSFOUND")),o.default.createElement("div",{className:"gallery__load"},this.renderPagination()))}}t.Component=c,c.defaultProps=s.galleryViewDefaultProps,c.propTypes={...s.galleryViewPropTypes,File:a.default.elementType.isRequired,Folder:a.default.elementType.isRequired};const p=(0,i.inject)(["GalleryItemFile","GalleryItemFolder"],((e,t)=>({File:e,Folder:t})),(()=>"AssetAdmin.Gallery.ThumbnailView"));t.default=p(c)},4350:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(6935))&&r.__esModule?r:{default:r};const i=o.default.shape({url:o.default.string,limit:o.default.number,imageRetry:o.default.shape({minRetry:o.default.number,maxRetry:o.default.number,expiry:o.default.number}),form:o.default.object,dropzoneOptions:o.default.object});t.default=i},6022:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(6935))&&r.__esModule?r:{default:r};const i=o.default.shape({canEdit:o.default.bool,canDelete:o.default.bool,canView:o.default.bool,exists:o.default.bool,type:o.default.string,smallThumbnail:o.default.string,thumbnail:o.default.string,width:o.default.number,height:o.default.number,category:o.default.oneOfType([o.default.bool,o.default.string]),id:o.default.number,url:o.default.string,title:o.default.string,progress:o.default.number,visibility:o.default.string,hasRestrictedAccess:o.default.bool,isTrackedFormUpload:o.default.bool});t.default=i},8268:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{config:{form:t},viewAction:n,folderId:r,fileId:o,type:l}=e,a=null,u=null;if(n===i)return a=t.folderCreateForm.schemaUrl,u=r,{schemaUrl:a,targetId:u};if(n===s&&o){switch(l){case"insert-media":a=t.fileInsertForm.schemaUrl;break;case"insert-link":a=t.fileEditorLinkForm.schemaUrl;break;case"select":a=t.fileSelectForm.schemaUrl;break;default:a=t.fileEditForm.schemaUrl}return u=o,{schemaUrl:a,targetId:u}}return{}};var r,o=(r=n(6379))&&r.__esModule?r:{default:r};const{CREATE_FOLDER:i,EDIT_FILE:s}=o.default.ACTIONS},9247:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(413===e)return o.default._t("AssetAdmin.ERROR_FILE_SIZE","File size limit exceeded");if(403===e&&t&&"string"==typeof t.response)return t.response;return o.default._t("AssetAdmin.ERROR_DEFAULT","Something went wrong, please try again")};var r,o=(r=n(5815))&&r.__esModule?r:{default:r}},6405:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={CONFIRM_DELETION_ASK:"CONFIRM_DELETION_ASK",CONFIRM_DELETION_CONFIRM:"CONFIRM_DELETION_CONFIRM",CONFIRM_DELETION_CANCEL:"CONFIRM_DELETION_CANCEL",CONFIRM_DELETION_RESET:"CONFIRM_DELETION_RESET",CONFIRM_DELETION_MODAL_CLOSE:"CONFIRM_DELETION_MODAL_CLOSE"}},4461:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cancel=function(){return{type:o.default.CONFIRM_DELETION_CANCEL,payload:{}}},t.confirm=function(e){return{type:o.default.CONFIRM_DELETION_ASK,payload:{files:e}}},t.deleting=function(){return{type:o.default.CONFIRM_DELETION_CONFIRM,payload:{}}},t.modalClose=function(){return{type:o.default.CONFIRM_DELETION_MODAL_CLOSE,payload:{}}},t.reset=function(){return{type:o.default.CONFIRM_DELETION_RESET,payload:{}}};var r,o=(r=n(6405))&&r.__esModule?r:{default:r}},762:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NO_TRANSITION=t.DELETING=t.CANCELING=void 0;t.NO_TRANSITION=!1,t.CANCELING="canceling",t.DELETING="deleting"},6533:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={TOGGLE_SEARCH:"TOGGLE_SEARCH",OPEN_SEARCH:"OPEN_SEARCH",CLOSE_SEARCH:"CLOSE_SEARCH"}},9517:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.closeSearch=function(){return{type:o.default.CLOSE_SEARCH,payload:null}},t.openSearch=function(){return{type:o.default.OPEN_SEARCH,payload:null}},t.toggleSearch=function(){return{type:o.default.TOGGLE_SEARCH,payload:null}};var r,o=(r=n(6533))&&r.__esModule?r:{default:r}},4913:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=["SET_LAST_SELECTED","SET_SELECTED_FILES","DESELECT_FILES","SELECT_FILES","LOAD_FILE_REQUEST","LOAD_FILE_SUCCESS","HIGHLIGHT_FILES","UPDATE_BATCH_ACTIONS","SET_NOTICE_MESSAGE","SET_ERROR_MESSAGE","SET_ENABLE_DROPZONE","SET_FILE_BADGE","CLEAR_FILE_BADGE","ACTIVATE_MODAL","DEACTIVATE_MODAL","CONCATENATE_SELECT","SET_LOADING"].reduce(((e,t)=>Object.assign(e,{[t]:`GALLERY.${t}`})),{})},4201:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activateModal=function(e){return t=>{t({type:o.default.ACTIVATE_MODAL,payload:e})}},t.clearFileBadge=i,t.deactivateModal=function(){return e=>{e({type:o.default.DEACTIVATE_MODAL})}},t.deselectFiles=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>t({type:o.default.DESELECT_FILES,payload:{ids:e}})},t.loadFile=function(e,t){return n=>{n({type:o.default.LOAD_FILE_SUCCESS,payload:{id:e,file:t}})}},t.selectFiles=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>t({type:o.default.SELECT_FILES,payload:{ids:e}})},t.setConcatenateSelect=function(e){return t=>t({type:o.default.CONCATENATE_SELECT,payload:!!e})},t.setEnableDropzone=function(e){return t=>t({type:o.default.SET_ENABLE_DROPZONE,payload:{enableDropzone:e}})},t.setErrorMessage=function(e){return t=>t({type:o.default.SET_ERROR_MESSAGE,payload:{message:e}})},t.setFileBadge=function(e,t,n,r){return(s,l)=>{const{assetAdmin:a}=l(),u=a.gallery.badges.find((t=>t.id===e));u&&u.timer&&clearTimeout(u.timer);const d=r>0?setTimeout((()=>i(e)(s)),r):null;s({type:o.default.SET_FILE_BADGE,payload:{id:e,message:t,status:n,timer:d}})}},t.setLastSelected=function(e){return t=>{t({type:o.default.SET_LAST_SELECTED,payload:{id:e}})}},t.setLoading=function(e){return t=>{t({type:o.default.SET_LOADING,payload:!!e})}},t.setNoticeMessage=function(e){return t=>t({type:o.default.SET_NOTICE_MESSAGE,payload:{message:e}})},t.setSelectedFiles=function(e){return t=>{t({type:o.default.SET_SELECTED_FILES,payload:{files:e}})}};var r,o=(r=n(4913))&&r.__esModule?r:{default:r};function i(e){return t=>{t({type:o.default.CLEAR_FILE_BADGE,payload:{id:e}})}}},423:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultImageFactory=t.default=void 0;var r=i(n(1838)),o=i(n(8632));function i(e){return e&&e.__esModule?e:{default:e}}const s={minRetry:0,maxRetry:0,expiry:0,onStatusChange:()=>null,onRetry:()=>null,onReset:()=>null,onTimeout:()=>null},l=(e,t,n)=>{const r=new Image;r.onload=t,r.onerror=n,r.src=e};t.defaultImageFactory=l;t.default=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;this.options={...s,...e},this.factory=t}loadImage(e){return this.options.minRetry&&o.default.lock(e)?this.loadImageLoop(e,this.options.minRetry):null}loadImageLoop(e,t){return this.options.onStatusChange(e,r.default.LOADING),new Promise(((t,n)=>this.factory(e,t,n))).then((()=>this.handleSuccess(e))).catch((()=>this.handleError(e,t)))}handleReset(e,t){this.options.onReset(e),t()}handleTimeout(e,t){const n=setTimeout(e,t);return this.options.onTimeout(n,t),n}handleSuccess(e){o.default.unlock(e),this.options.onStatusChange(e,r.default.SUCCESS)}handleFailure(e){return o.default.unlock(e),this.options.onStatusChange(e,r.default.FAILED),this.options.expiry?new Promise((t=>{this.handleTimeout((()=>this.handleReset(e,t)),1e3*this.options.expiry)})):null}handleError(e,t){return t>this.options.maxRetry?this.handleFailure(e):(this.options.onStatusChange(e,r.default.WAITING),this.handleRetry(e,t))}handleRetry(e,t){const n=new Promise((n=>{this.handleTimeout((()=>n(this.loadImageLoop(e,2*t))),1e3*t)}));return this.options.onRetry(e,t,n),n}setOnRetry(e){this.options.onRetry=e}setOnReset(e){this.options.onReset=e}setOnStatusChange(e){this.options.onStatusChange=e}setOnTimeout(e){this.options.onTimeout=e}}},2153:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={SET_STATUS:"IMAGE_LOAD_SET_STATUS",RESET:"IMAGE_LOAD_RESET"}},769:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadImage=function(e,t){return(n,i)=>{if(!e)return null;if(i().assetAdmin.imageLoad.files.find((t=>t.url===e)))return null;const s={...t,onStatusChange:(e,t)=>n({type:r.default.SET_STATUS,payload:{status:t,url:e}}),onReset:e=>n({type:r.default.RESET,payload:{url:e}})};return new o.default(s).loadImage(e)}};var r=i(n(2153)),o=i(n(423));function i(e){return e&&e.__esModule?e:{default:e}}},8632:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;class n{constructor(){this.urls=[]}lock(e){return!(this.urls.indexOf(e)>=0)&&(this.urls=[...this.urls,e],!0)}unlock(e){this.urls=this.urls.filter((t=>t!==e))}}t.Component=n,window.ss=window.ss||{},window.ss.imagelocker=window.ss.imagelocker||new n;t.default=window.ss.imagelocker},1838:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={DISABLED:"DISABLED",NONE:"NONE",SUCCESS:"SUCCESS",LOADING:"LOADING",WAITING:"WAITING",FAILED:"FAILED"}},2613:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={DEFINE_IMAGE_SIZE_PRESETS:"DEFINE_IMAGE_SIZE_PRESETS",INIT_FORM_SCHEMA_STACK:"INIT_FORM_SCHEMA_STACK",POP_FORM_SCHEMA:"POP_FORM_SCHEMA",PUSH_FORM_SCHEMA:"PUSH_FORM_SCHEMA",RESET:"RESET",RESET_FORM_STACK:"RESET_FORM_STACK"}},1021:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defineImageSizePresets=function(e){return{type:i.default.DEFINE_IMAGE_SIZE_PRESETS,payload:{imageSizePresets:e}}},t.initFormStack=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:i.default.INIT_FORM_SCHEMA_STACK,payload:{formSchema:{type:e,nextType:t}}}},t.popFormStackEntry=function(){return{type:i.default.POP_FORM_SCHEMA}},t.pushFormStackEntry=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:i.default.PUSH_FORM_SCHEMA,payload:{formSchema:{type:e,nextType:t}}}},t.reset=function(){return{type:i.default.RESET}},t.resetFormStack=function(){return{type:i.default.RESET_FORM_STACK}},t.stashFormValues=function(e,t){return(n,i)=>{const l=i(),a=(0,r.default)(l.form.formState,`${e}.values`),u=(0,r.default)(l.form.formSchemas,`${t}.schema.fields`);if(a){const e=Object.keys(a).filter((e=>null!==a[e]&&(0,s.default)(e,u))).map((e=>({name:e,value:a[e]})));n((0,o.setSchemaStateOverrides)(t,{fields:e}))}}};var r=l(n(6104)),o=n(2811),i=l(n(2613)),s=l(n(8896));function l(e){return e&&e.__esModule?e:{default:e}}},8896:function(e,t){"use strict";function n(e,t){let r;for(r=0;rt({type:o.default.ADD_QUEUED_FILE,payload:{file:e}})},t.failUpload=function(e,t,n){return r=>{let i=t.message;return t.errors&&t.errors.length&&(i=t.errors[0]),"string"==typeof t&&(i={value:n||t,type:"error"}),r({type:o.default.FAIL_UPLOAD,payload:{queuedId:e,message:i}})}},t.purgeUploadQueue=function(){return e=>e({type:o.default.PURGE_UPLOAD_QUEUE,payload:null})},t.removeQueuedFile=function(e){return t=>t({type:o.default.REMOVE_QUEUED_FILE,payload:{queuedId:e}})},t.succeedUpload=function(e,t){return n=>n({type:o.default.SUCCEED_UPLOAD,payload:{queuedId:e,json:t}})},t.updateQueuedFile=function(e,t){return n=>n({type:o.default.UPDATE_QUEUED_FILE,payload:{queuedId:e,updates:t}})};var r,o=(r=n(5793))&&r.__esModule?r:{default:r}},1804:function(e,t,n){"use strict";var r=n(5228),o={};function i(e,t,n,r,o,i,s,l){if(!e){var a;if(void 0===t)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,i,s,l],d=0;(a=new Error(t.replace(/%s/g,(function(){return u[d++]})))).name="Invariant Violation"}throw a.framesToPop=1,a}}var s="mixins";e.exports=function(e,t,n){var l=[],a={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},u={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},d={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n0}},{key:"getMetadataColumnProperty",value:function(e,t,n){var r=this.getColumnMetadataByName(e);return null==r?n:r.hasOwnProperty(t)?r[t]:n}},{key:"orderColumns",value:function(e){var t=this;return l(e,(function(e){var n=s(t.columnMetadata,{columnName:e});return null==n||isNaN(n.order)?100:n.order}))}},{key:"getColumns",value:function(){var e=0===this.filteredColumns.length?this.allColumns:this.filteredColumns;return e=a(e,this.metadataColumns),e=this.orderColumns(e)}}]),e}();e.exports=u},3715:function(e,t,n){"use strict";var r=n(1594),o=n(2306)({getDefaultProps:function(){return{placeholderText:""}},render:function(){return"function"!=typeof this.props.customFilterComponent?(console.log("Couldn't find valid template."),r.createElement("div",null)):r.createElement(this.props.customFilterComponent,{changeFilter:this.props.changeFilter,results:this.props.results,currentResults:this.props.currentResults,placeholderText:this.props.placeholderText})}});e.exports=o},8465:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t0&&(e=r.createElement("button",{type:"button",onClick:this.props.previous,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 0 0 10px"}:null},this.props.previousIconComponent,this.props.previousText)),this.props.currentPage!==this.props.maxPage-1&&(t=r.createElement("button",{type:"button",onClick:this.props.next,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 10px 0 0"}:null},this.props.nextText,this.props.nextIconComponent));var n=null,o=null,s=null;if(!0===this.props.useGriddleStyles){var l={float:"left",minHeight:"1px",marginTop:"5px"};s=i({textAlign:"right",width:"34%"},l),o=i({textAlign:"center",width:"33%"},l),n=i({width:"33%"},l)}for(var a=[],u=1;u<=this.props.maxPage;u++)a.push(r.createElement("option",{value:u,key:u},u));return r.createElement("div",{style:this.props.useGriddleStyles?{minHeight:"35px"}:null},r.createElement("div",{className:this.props.previousClassName,style:n},e),r.createElement("div",{className:"griddle-page",style:o},r.createElement("select",{value:this.props.currentPage+1,onChange:this.pageChange},a)," / ",this.props.maxPage),r.createElement("div",{className:this.props.nextClassName,style:s},t))}});e.exports=s},1507:function(e,t,n){"use strict";var r=n(1594),o=n(2306),i=(n(493),n(9280)),s=n(1882),l=n(7248),a=n(6139),u=n(4684),d=n(8938),c=n(1648),p=o({getDefaultProps:function(){return{isChildRow:!1,showChildren:!1,data:{},columnSettings:null,rowSettings:null,hasChildren:!1,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"▶",parentRowExpandedComponent:"▼",onRowClick:null,multipleSelectionSettings:null,onRowMouseEnter:null,onRowMouseLeave:null,onRowWillMount:null,onRowWillUnmount:null}},componentWillMount:function(){null!==this.props.onRowWillMount&&s(this.props.onRowWillMount)&&this.props.onRowWillMount(this)},componentWillUnmount:function(){null!==this.props.onRowWillUnmount&&s(this.props.onRowWillUnmount)&&this.props.onRowWillUnmount(this)},handleClick:function(e){null!==this.props.onRowClick&&s(this.props.onRowClick)?this.props.onRowClick(this,e):this.props.hasChildren&&this.props.toggleChildren()},handleMouseEnter:function(e){null!==this.props.onRowMouseEnter&&s(this.props.onRowMouseEnter)&&this.props.onRowMouseEnter(this,e)},handleMouseLeave:function(e){null!==this.props.onRowMouseLeave&&s(this.props.onRowMouseLeave)&&this.props.onRowMouseLeave(this,e)},handleSelectionChange:function(e){},handleSelectClick:function(e){this.props.multipleSelectionSettings.isMultipleSelection&&("checkbox"===e.target.type?this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,this.refs.selected.checked):this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,!this.refs.selected.checked))},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRow: The columnSettings prop is null and it shouldn't be")},formatData:function(e){return"boolean"==typeof e?String(e):e},render:function(){var e=this;this.verifyProps();var t=this,n=null;this.props.useGriddleStyles&&(n={margin:"0px",padding:t.props.paddingHeight+"px 5px "+t.props.paddingHeight+"px 5px",height:t.props.rowHeight?this.props.rowHeight-2*t.props.paddingHeight+"px":null,backgroundColor:"#FFF",borderTopColor:"#DDD",color:"#222"});var o=this.props.columnSettings.getColumns(),p=l(o,[]),h=a({},this.props.data);u(h,p);var f,m,g=d(i.pick(h,c(o,"children"))).map((function(t,o){var i=null,s=e.props.columnSettings.getColumnMetadataByName(t[0]),l=0===o&&e.props.hasChildren&&!1===e.props.showChildren&&e.props.useGriddleIcons?r.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px",marginRight:"5px"}:null},e.props.parentRowCollapsedComponent):0===o&&e.props.hasChildren&&e.props.showChildren&&e.props.useGriddleIcons?r.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px"}:null},e.props.parentRowExpandedComponent):"";if(0===o&&e.props.isChildRow&&e.props.useGriddleStyles&&(n=a(n,{paddingLeft:10})),e.props.columnSettings.hasColumnMetadata()&&null!=s)if(void 0!==s.customComponent&&null!==s.customComponent){var u=r.createElement(s.customComponent,{data:t[1],rowData:h,metadata:s});i=r.createElement("td",{onClick:e.handleClick,onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,className:s.cssClassName,key:o,style:n},u)}else i=r.createElement("td",{onClick:e.handleClick,onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,className:s.cssClassName,key:o,style:n},l,e.formatData(t[1]));return i||r.createElement("td",{onClick:e.handleClick,onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,key:o,style:n},l,t[1])}));if(null!==this.props.onRowClick&&s(this.props.onRowClick)?(f=null,m=this.handleSelectClick):this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection?(f=this.handleSelectClick,m=null):(f=null,m=null),g&&this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection){this.props.multipleSelectionSettings.getSelectedRowIds();g.unshift(r.createElement("td",{key:"selection",style:n,className:"griddle-select griddle-select-cell",onClick:m},r.createElement("input",{type:"checkbox",checked:this.props.multipleSelectionSettings.getIsRowChecked(h),onChange:this.handleSelectionChange,ref:"selected"})))}var y=t.props.rowSettings&&t.props.rowSettings.getBodyRowMetadataClass(t.props.data)||"standard-row";return t.props.isChildRow?y="child-row":t.props.hasChildren&&(y=t.props.showChildren?this.props.parentRowExpandedClassName:this.props.parentRowCollapsedClassName),r.createElement("tr",{onClick:f,className:y},g)}});e.exports=p},4734:function(e,t,n){"use strict";var r=n(1594),o=n(2306),i=(n(493),n(4383)),s=o({getDefaultProps:function(){return{useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,columnSettings:null,rowSettings:null,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"▶",parentRowExpandedComponent:"▼",onRowClick:null,onRowMouseEnter:null,onRowMouseLeave:null,onRowWillMount:null,onRowWillUnmount:null,multipleSelectionSettings:null}},getInitialState:function(){return{data:{},showChildren:!1}},componentWillReceiveProps:function(){this.setShowChildren(!1)},toggleChildren:function(){this.setShowChildren(!1===this.state.showChildren)},setShowChildren:function(e){this.setState({showChildren:e})},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be")},render:function(){this.verifyProps();var e=this;if(void 0===this.props.data)return r.createElement("tbody",null);var t=[],n=this.props.columnSettings.getColumns();t.push(r.createElement(this.props.rowSettings.rowComponent,{useGriddleStyles:this.props.useGriddleStyles,isSubGriddle:this.props.isSubGriddle,data:this.props.rowSettings.isCustom?i(this.props.data,n):this.props.data,rowData:this.props.rowSettings.isCustom?this.props.data:null,columnSettings:this.props.columnSettings,rowSettings:this.props.rowSettings,hasChildren:e.props.hasChildren,toggleChildren:e.toggleChildren,showChildren:e.state.showChildren,key:e.props.uniqueId+"_base_row",useGriddleIcons:e.props.useGriddleIcons,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedComponent:this.props.parentRowExpandedComponent,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight,onRowClick:e.props.onRowClick,onRowMouseEnter:e.props.onRowMouseEnter,onRowMouseLeave:e.props.onRowMouseLeave,multipleSelectionSettings:this.props.multipleSelectionSettings,onRowWillMount:e.props.onRowWillMount,onRowWillUnmount:e.props.onRowWillUnmount}));var o=null;return e.state.showChildren&&(o=e.props.hasChildren&&this.props.data.children.map((function(t,n){var o=e.props.rowSettings.getRowKey(t,n);if(void 0!==t.children){var i=e.constructor.Griddle;return r.createElement("tr",{key:o,style:{paddingLeft:5}},r.createElement("td",{colSpan:e.props.columnSettings.getVisibleColumnCount(),className:"griddle-parent",style:e.props.useGriddleStyles?{border:"none",padding:"0 0 0 5px"}:null},r.createElement(i,{rowMetadata:{key:"id"},isSubGriddle:!0,results:[t],columns:e.props.columnSettings.getColumns(),tableClassName:e.props.tableClassName,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,showTableHeading:!1,showPager:!1,columnMetadata:e.props.columnSettings.columnMetadata,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight})))}return r.createElement(e.props.rowSettings.rowComponent,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,data:t,columnSettings:e.props.columnSettings,isChildRow:!0,columnMetadata:e.props.columnSettings.columnMetadata,key:o})}))),!1===e.props.hasChildren?t[0]:r.createElement("tbody",null,e.state.showChildren?t.concat(o):t)}});e.exports=s},4376:function(e,t,n){"use strict";var r=n(1594),o=n(2306),i=n(9859),s=n(1648),l=n(7309),a=o({getDefaultProps:function(){return{columns:[],columnMetadata:[],selectedColumns:[],settingsText:"",maxRowsText:"",resultsPerPage:0,enableToggleCustom:!1,useCustomComponent:!1,useGriddleStyles:!0,toggleCustomComponent:function(){}}},setPageSize:function(e){var t=parseInt(e.target.value,10);this.props.setPageSize(t)},handleChange:function(e){var t=e.target.dataset?e.target.dataset.name:e.target.getAttribute("data-name");!0===e.target.checked&&!1===i(this.props.selectedColumns,t)?(this.props.selectedColumns.push(t),this.props.setColumns(this.props.selectedColumns)):this.props.setColumns(s(this.props.selectedColumns,t))},render:function(){var e=this,t=[];!1===e.props.useCustomComponent&&(t=this.props.columns.map((function(t,n){var o=i(e.props.selectedColumns,t),s=l(e.props.columnMetadata,{columnName:t}),a=t;return void 0!==s&&void 0!==s.displayName&&null!=s.displayName&&(a=s.displayName),void 0!==s&&null!=s&&s.locked?r.createElement("div",{className:"column checkbox"},r.createElement("label",null,r.createElement("input",{type:"checkbox",disabled:!0,name:"check",checked:o,"data-name":t}),a)):void 0!==s&&null!=s&&void 0!==s.visible&&!1===s.visible?null:r.createElement("div",{className:"griddle-column-selection checkbox",key:t,style:e.props.useGriddleStyles?{float:"left",width:"20%"}:null},r.createElement("label",null,r.createElement("input",{type:"checkbox",name:"check",onChange:e.handleChange,checked:o,"data-name":t}),a))})));var n=e.props.enableToggleCustom?r.createElement("div",{className:"form-group"},r.createElement("label",{htmlFor:"maxRows"},r.createElement("input",{type:"checkbox",checked:this.props.useCustomComponent,onChange:this.props.toggleCustomComponent})," ",this.props.enableCustomFormatText)):"",o=this.props.showSetPageSize?r.createElement("div",null,r.createElement("label",{htmlFor:"maxRows"},this.props.maxRowsText,":",r.createElement("select",{onChange:this.setPageSize,value:this.props.resultsPerPage},r.createElement("option",{value:"5"},"5"),r.createElement("option",{value:"10"},"10"),r.createElement("option",{value:"25"},"25"),r.createElement("option",{value:"50"},"50"),r.createElement("option",{value:"100"},"100")))):"";return r.createElement("div",{className:"griddle-settings",style:this.props.useGriddleStyles?{backgroundColor:"#FFF",border:"1px solid #DDD",color:"#222",padding:"10px",marginBottom:"10px"}:null},r.createElement("h6",null,this.props.settingsText),r.createElement("div",{className:"griddle-columns",style:this.props.useGriddleStyles?{clear:"both",display:"table",width:"100%",borderBottom:"1px solid #EDEDED",marginBottom:"10px"}:null},t),o,n)}});e.exports=a},2991:function(e,t,n){"use strict";var r=n(1594),o=n(2306),i=n(9593),s=n(4734),l=(n(493),n(1545),o({getDefaultProps:function(){return{data:[],columnSettings:null,rowSettings:null,sortSettings:null,multipleSelectionSettings:null,className:"",enableInfiniteScroll:!1,nextPage:null,hasMorePages:!1,useFixedHeader:!1,useFixedLayout:!0,paddingHeight:null,rowHeight:null,filterByColumn:null,infiniteScrollLoadTreshold:null,bodyHeight:null,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"▶",parentRowExpandedComponent:"▼",externalLoadingComponent:null,externalIsLoading:!1,onRowClick:null,onRowMouseEnter:null,onRowMouseLeave:null,onRowWillMount:null,onRowWillUnmount:null}},getInitialState:function(){return{scrollTop:0,scrollHeight:this.props.bodyHeight,clientHeight:this.props.bodyHeight}},componentDidMount:function(){this.gridScroll()},componentDidUpdate:function(e,t){this.gridScroll()},gridScroll:function(){if(this.props.enableInfiniteScroll&&!this.props.externalIsLoading){var e=this.refs.scrollable,t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;if(null!==this.props.rowHeight&&this.state.scrollTop!==t&&Math.abs(this.state.scrollTop-t)>=this.getAdjustedRowHeight()){var o={scrollTop:t,scrollHeight:n,clientHeight:r};this.setState(o)}.6*(n-(t+r)-this.props.infiniteScrollLoadTreshold)<=this.props.infiniteScrollLoadTreshold&&this.props.nextPage()}},verifyProps:function(){null===this.props.columnSettings&&console.error("gridTable: The columnSettings prop is null and it shouldn't be"),null===this.props.rowSettings&&console.error("gridTable: The rowSettings prop is null and it shouldn't be")},getAdjustedRowHeight:function(){return this.props.rowHeight+2*this.props.paddingHeight},getNodeContent:function(){this.verifyProps();var e=this,t=!1;if(!this.props.externalIsLoading||this.props.enableInfiniteScroll){var n=e.props.data,o=null,i=null;if(this.props.enableInfiniteScroll&&null!==this.props.rowHeight&&void 0!==this.refs.scrollable){var l=e.getAdjustedRowHeight(),a=Math.ceil(e.state.clientHeight/l),u=Math.max(0,Math.floor(e.state.scrollTop/l)-.25*a),d=Math.min(u+1.25*a,this.props.data.length-1);n=n.slice(u,d+1);var c={height:u*l+"px"};o=r.createElement("tr",{key:"above-"+c.height,style:c});var p={height:(this.props.data.length-d)*l+"px"};i=r.createElement("tr",{key:"below-"+p.height,style:p})}var h=n.map((function(n,o){var i=void 0!==n.children&&n.children.length>0,l=e.props.rowSettings.getRowKey(n,o);return i&&(t=i),r.createElement(s,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,data:n,key:l+"-container",uniqueId:l,columnSettings:e.props.columnSettings,rowSettings:e.props.rowSettings,paddingHeight:e.props.paddingHeight,multipleSelectionSettings:e.props.multipleSelectionSettings,rowHeight:e.props.rowHeight,hasChildren:i,tableClassName:e.props.className,onRowClick:e.props.onRowClick,onRowMouseEnter:e.props.onRowMouseEnter,onRowMouseLeave:e.props.onRowMouseLeave,onRowWillMount:e.props.onRowWillMount,onRowWillUnmount:e.props.onRowWillUnmount})}));if(this.props.showNoData){var f=this.props.columnSettings.getVisibleColumnCount();h.push(r.createElement("tr",{key:"no-data-section"},r.createElement("td",{colSpan:f},this.props.noDataSection)))}return o&&h.unshift(o),i&&h.push(i),{nodes:h,anyHasChildren:t}}return null},render:function(){var e=[],t=!1,n=this.getNodeContent();n&&(e=n.nodes,t=n.anyHasChildren);var o=null,s=null,l={width:"100%"};if(this.props.useFixedLayout&&(l.tableLayout="fixed"),this.props.enableInfiniteScroll&&(o={position:"relative",overflowY:"scroll",height:this.props.bodyHeight+"px",width:"100%"}),this.props.externalIsLoading){var a,u=null;this.props.useGriddleStyles&&(u={textAlign:"center",paddingBottom:"40px"}),a=this.props.columnSettings.getVisibleColumnCount();var d=this.props.externalLoadingComponent?r.createElement(this.props.externalLoadingComponent,null):r.createElement("div",null,"Loading...");s=r.createElement("tbody",null,r.createElement("tr",null,r.createElement("td",{style:u,colSpan:a},d)))}var c=this.props.showTableHeading?r.createElement(i,{useGriddleStyles:this.props.useGriddleStyles,useGriddleIcons:this.props.useGriddleIcons,sortSettings:this.props.sortSettings,multipleSelectionSettings:this.props.multipleSelectionSettings,columnSettings:this.props.columnSettings,filterByColumn:this.props.filterByColumn,rowSettings:this.props.rowSettings}):void 0;t||(e=r.createElement("tbody",null,e));var p=r.createElement("tbody",null);if(this.props.showPager){var h=this.props.useGriddleStyles?{padding:"0px",backgroundColor:"#EDEDED",border:"0px",color:"#222",height:this.props.showNoData?"20px":null}:null;p=r.createElement("tbody",null,r.createElement("tr",null,r.createElement("td",{colSpan:this.props.multipleSelectionSettings.isMultipleSelection?this.props.columnSettings.getVisibleColumnCount()+1:this.props.columnSettings.getVisibleColumnCount(),style:h,className:"footer-container"},this.props.showNoData?null:this.props.pagingContent)))}return this.props.useFixedHeader?(this.props.useGriddleStyles&&(l.tableLayout="fixed"),r.createElement("div",null,r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&l||null},c),r.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:o},r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&l||null},e,s,p)))):r.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:o},r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&l||null},c,e,s,p))}}));e.exports=l},9593:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t=0)return!0}return!1}))},defaultColumnFilter:function(e,t,n){var r=R(A(n)?n:[n],(function(e){return(e||"").toLowerCase()}));return L(b.getObjectValues(t),(function(e){return e=e.toString().toLowerCase(),L(r,(function(t){return e.indexOf(t)>=0}))}))},filterByColumnFilters:function(e){var t=this.props.columnFilterFunc||this.defaultColumnFilter,n=Object.keys(e).reduce((function(n,r){return M(n,(function(n){var o=b.getAt(n,r||""),i=e[r];return t(r||"",o,i)}))}),this.props.results),r={columnFilters:e};e?(r.filteredResults=n,r.maxPage=this.getMaxPage(r.filteredResults)):this.state.filter?r.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,filter):this.defaultFilter(this.props.results,filter):r.filteredResults=null,this.setState(r)},filterByColumn:function(e,t){var n=this.state.columnFilters;if(n.hasOwnProperty(t)&&!e)n=N(n,t);else{var r={};r[t]=e,n=P({},n,r)}this.filterByColumnFilters(n)},setFilter:function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(this.props.useExternal)this.props.externalSetFilter(e);else{var n={page:0,filter:e};n.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(t||this.props.results,e):this.defaultFilter(t||this.props.results,e),n.maxPage=this.getMaxPage(n.filteredResults),(D(e)||I(e)||O(e))&&(n.filter=e,n.filteredResults=null),this.setState(n),this._resetSelectedRows()}},setPageSize:function(e){if(this.props.useExternal)return this.setState({resultsPerPage:e}),void this.props.externalSetPageSize(e);this.state.resultsPerPage=e,this.setMaxPage()},toggleColumnChooser:function(){this.setState({showColumnChooser:!this.state.showColumnChooser})},isNullOrUndefined:function(e){return null==e},shouldUseCustomRowComponent:function(){return this.isNullOrUndefined(this.state.useCustomRowComponent)?this.props.useCustomRowComponent:this.state.useCustomRowComponent},shouldUseCustomGridComponent:function(){return this.isNullOrUndefined(this.state.useCustomGridComponent)?this.props.useCustomGridComponent:this.state.useCustomGridComponent},toggleCustomComponent:function(){"grid"===this.state.customComponentType?this.setState({useCustomGridComponent:!this.shouldUseCustomGridComponent()}):"row"===this.state.customComponentType&&this.setState({useCustomRowComponent:!this.shouldUseCustomRowComponent()})},getMaxPage:function(e,t){return this.props.useExternal?this.props.externalMaxPage:(t||(t=(e||this.getCurrentResults()).length),Math.ceil(t/this.state.resultsPerPage))},setMaxPage:function(e){var t=this.getMaxPage(e);this.state.maxPage!==t&&this.setState({page:0,maxPage:t,filteredColumns:this.columnSettings.filteredColumns})},setPage:function(e){if(this.props.useExternal)this.props.externalSetPage(e);else{if(e*this.state.resultsPerPage<=this.state.resultsPerPage*this.state.maxPage){var t={page:e};this.setState(t)}this.props.enableInfiniteScroll&&this.setState({isSelectAllChecked:!1})}},setColumns:function(e){this.columnSettings.filteredColumns=A(e)?e:[e],this.setState({filteredColumns:this.columnSettings.filteredColumns})},nextPage:function(){var e=this.getCurrentPage();e0&&this.setPage(e-1)},changeSort:function(e){if(!1!==this.props.enableSort){if(this.props.useExternal){var t=this.props.externalSortColumn!==e||!this.props.externalSortAscending;return this.setState({sortColumn:e,sortDirection:t?"asc":"desc"}),void this.props.externalChangeSort(e,t)}var n=E(this.props.columnMetadata,{columnName:e})||{},r=n.sortDirectionCycle?n.sortDirectionCycle:[null,"asc","desc"],o=r.indexOf(this.state.sortDirection&&e===this.state.sortColumn?this.state.sortDirection:null),i={page:0,sortColumn:e,sortDirection:r[o=(o+1)%r.length]?r[o]:null};this.setState(i)}},componentWillReceiveProps:function(e){if(e.results!==this.props.results&&this.setFilter(this.state.filter,e.results),this.setMaxPage(e.results),e.resultsPerPage!==this.props.resultsPerPage&&this.setPageSize(e.resultsPerPage),this.columnSettings.columnMetadata=e.columnMetadata,e.results.length>0){var t=b.keys(e.results[0]);this.columnSettings.allColumns.length==t.length&&this.columnSettings.allColumns.every((function(e,n){return e===t[n]}))||(this.columnSettings.allColumns=t)}else this.columnSettings.allColumns.length>0&&(this.columnSettings.allColumns=[]);if(e.selectedRowIds){var n=this.getDataForRender(this.getCurrentResults(e.results),this.columnSettings.getColumns(),!0);this.setState({isSelectAllChecked:this._getAreAllRowsChecked(e.selectedRowIds,R(n,this.props.uniqueIdentifier)),selectedRowIds:e.selectedRowIds})}},getInitialState:function(){return{maxPage:0,page:0,filteredResults:null,filteredColumns:[],filter:"",columnFilters:{},resultsPerPage:this.props.resultsPerPage||5,showColumnChooser:!1,isSelectAllChecked:!1,selectedRowIds:this.props.selectedRowIds}},componentWillMount:function(){this.verifyExternal(),this.verifyCustom(),this.columnSettings=new y(this.props.results.length>0?b.keys(this.props.results[0]):[],this.props.columns,this.props.childrenColumnName,this.props.columnMetadata,this.props.metadataColumns),this.rowSettings=new v(this.props.rowMetadata,this.props.useCustomTableRowComponent&&this.props.customTableRowComponent?this.props.customTableRowComponent:p,this.props.useCustomTableRowComponent),this.props.initialSort&&(this.props.useExternal?this.setState({sortColumn:this.props.externalSortColumn,sortDirection:this.props.externalSortAscending?"asc":"desc"}):this.changeSort(this.props.initialSort)),this.setMaxPage(),this.shouldUseCustomGridComponent()?this.setState({customComponentType:"grid"}):this.shouldUseCustomRowComponent()?this.setState({customComponentType:"row"}):this.setState({filteredColumns:this.columnSettings.filteredColumns})},componentDidMount:function(){if(this.props.componentDidMount&&"function"==typeof this.props.componentDidMount)return this.props.componentDidMount()},componentDidUpdate:function(){if(this.props.componentDidUpdate&&"function"==typeof this.props.componentDidUpdate)return this.props.componentDidUpdate(this.state)},verifyExternal:function(){!0===this.props.useExternal&&(null===this.props.externalSetPage&&console.error("useExternal is set to true but there is no externalSetPage function specified."),null===this.props.externalChangeSort&&console.error("useExternal is set to true but there is no externalChangeSort function specified."),null===this.props.externalSetFilter&&console.error("useExternal is set to true but there is no externalSetFilter function specified."),null===this.props.externalSetPageSize&&console.error("useExternal is set to true but there is no externalSetPageSize function specified."),null===this.props.externalMaxPage&&console.error("useExternal is set to true but externalMaxPage is not set."),null===this.props.externalCurrentPage&&console.error("useExternal is set to true but externalCurrentPage is not set. Griddle will not page correctly without that property when using external data."))},verifyCustom:function(){!0===this.props.useCustomGridComponent&&null===this.props.customGridComponent&&console.error("useCustomGridComponent is set to true but no custom component was specified."),!0===this.props.useCustomRowComponent&&null===this.props.customRowComponent&&console.error("useCustomRowComponent is set to true but no custom component was specified."),!0===this.props.useCustomGridComponent&&!0===this.props.useCustomRowComponent&&console.error("Cannot currently use both customGridComponent and customRowComponent."),!0===this.props.useCustomFilterer&&null===this.props.customFilterer&&console.error("useCustomFilterer is set to true but no custom filter function was specified."),!0===this.props.useCustomFilterComponent&&null===this.props.customFilterComponent&&console.error("useCustomFilterComponent is set to true but no customFilterComponent was specified.")},getDataForRender:function(e,t,n){var r=this,o=this;if(!this.props.useExternal){if(""!==this.state.sortColumn){var i,s=this.state.sortColumn,l=M(this.props.columnMetadata,{columnName:s}),a={columns:[],orders:[]};if(l.length>0&&(i=l[0].hasOwnProperty("customCompareFn")&&l[0].customCompareFn,l[0].multiSort&&(a=l[0].multiSort)),this.state.sortDirection)if("function"==typeof i)2===i.length?(e=e.sort((function(e,t){return i(k(e,s),k(t,s))})),"desc"===this.state.sortDirection&&e.reverse()):1===i.length&&(e=T(e,(function(e){return i(k(e,s))}),[this.state.sortDirection]));else{var u=[function(e){return(k(e,s)||"").toString().toLowerCase()}],d=[this.state.sortDirection];a.columns.forEach((function(e,t){u.push((function(t){return(k(t,e)||"").toString().toLowerCase()})),"asc"===a.orders[t]||"desc"===a.orders[t]?d.push(a.orders[t]):d.push(r.state.sortDirection)})),e=T(e,u,d)}}var c=this.getCurrentPage();if(!this.props.useExternal&&n&&this.state.resultsPerPage*(c+1)<=this.state.resultsPerPage*this.state.maxPage&&c>=0)if(this.isInfiniteScrollEnabled())e=_(e,(c+1)*this.state.resultsPerPage);else{var p=C(e,c*this.state.resultsPerPage);e=(S||x)(p,p.length-this.state.resultsPerPage)}}for(var h=[],f=0;f0&&(m.children=o.getDataForRender(m[o.props.childrenColumnName],t,!1),"children"!==o.props.childrenColumnName&&delete m[o.props.childrenColumnName]),h.push(m)}return h},getCurrentResults:function(e){return this.state.filteredResults||e||this.props.results},getCurrentPage:function(){return this.props.externalCurrentPage||this.state.page},getCurrentSort:function(){return this.props.useExternal?this.props.externalSortColumn:this.state.sortColumn},getCurrentSortAscending:function(){return this.props.useExternal?this.props.externalSortAscending:"asc"===this.state.sortDirection},getCurrentMaxPage:function(){return this.props.useExternal?this.props.externalMaxPage:this.state.maxPage},getSortObject:function(){return{enableSort:this.props.enableSort,changeSort:this.changeSort,sortColumn:this.getCurrentSort(),sortAscending:this.getCurrentSortAscending(),sortDirection:this.state.sortDirection,sortAscendingClassName:this.props.sortAscendingClassName,sortDescendingClassName:this.props.sortDescendingClassName,sortAscendingComponent:this.props.sortAscendingComponent,sortDescendingComponent:this.props.sortDescendingComponent,sortDefaultComponent:this.props.sortDefaultComponent}},_toggleSelectAll:function(){var e=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),t=!this.state.isSelectAllChecked,n=JSON.parse(JSON.stringify(this.state.selectedRowIds)),r=this;w(e,(function(e){r._updateSelectedRowIds(e[r.props.uniqueIdentifier],n,t)}),this),this.setState({isSelectAllChecked:t,selectedRowIds:n}),this.props.onSelectionChange&&this.props.onSelectionChange(n,t)},_toggleSelectRow:function(e,t){var n=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),r=JSON.parse(JSON.stringify(this.state.selectedRowIds));this._updateSelectedRowIds(e[this.props.uniqueIdentifier],r,t);var o=this._getAreAllRowsChecked(r,R(n,this.props.uniqueIdentifier));this.setState({isSelectAllChecked:o,selectedRowIds:r}),this.props.onSelectionChange&&this.props.onSelectionChange(r,o)},_updateSelectedRowIds:function(e,t,n){n?void 0===E(t,(function(t){return e===t}))&&t.push(e):t.splice(t.indexOf(e),1)},_getIsSelectAllChecked:function(){return this.state.isSelectAllChecked},_getAreAllRowsChecked:function(e,t){return t.length===F(t,e).length},_getIsRowChecked:function(e){return this.state.selectedRowIds.indexOf(e[this.props.uniqueIdentifier])>-1},getSelectedRowIds:function(){return this.state.selectedRowIds},_resetSelectedRows:function(){this.setState({isSelectAllChecked:!1,selectedRowIds:[]})},getMultipleSelectionObject:function(){return{isMultipleSelection:!E(this.props.results,(function(e){return"children"in e}))&&this.props.isMultipleSelection,toggleSelectAll:this._toggleSelectAll,getIsSelectAllChecked:this._getIsSelectAllChecked,toggleSelectRow:this._toggleSelectRow,getSelectedRowIds:this.getSelectedRowIds,getIsRowChecked:this._getIsRowChecked}},isInfiniteScrollEnabled:function(){return!this.props.useCustomPagerComponent&&this.props.enableInfiniteScroll},getClearFixStyles:function(){return{clear:"both",display:"table",width:"100%"}},getSettingsStyles:function(){return{float:"left",width:"50%",textAlign:"right"}},getFilterStyles:function(){return{float:"left",width:"50%",textAlign:"left",color:"#222",minHeight:"1px"}},getFilter:function(){return this.props.showFilter&&!1===this.shouldUseCustomGridComponent()?this.props.useCustomFilterComponent?o.createElement(g,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText,customFilterComponent:this.props.customFilterComponent,results:this.props.results,currentResults:this.getCurrentResults()}):o.createElement(a,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText}):""},getSettings:function(){return this.props.showSettings?o.createElement("button",{type:"button",className:this.props.settingsToggleClassName,onClick:this.toggleColumnChooser,style:this.props.useGriddleStyles?{background:"none",border:"none",padding:0,margin:0,fontSize:14}:null},this.props.settingsText,this.props.settingsIconComponent):""},getTopSection:function(e,t){if(!1===this.props.showFilter&&!1===this.props.showSettings)return"";var n=null,r=null,i=null;return this.props.useGriddleStyles&&(n=this.getFilterStyles(),r=this.getSettingsStyles(),i=this.getClearFixStyles()),o.createElement("div",{className:"top-section",style:i},o.createElement("div",{className:"griddle-filter",style:n},e),o.createElement("div",{className:"griddle-settings-toggle",style:r},t))},getPagingSection:function(e,t){if(!1!==(this.props.showPager&&!this.isInfiniteScrollEnabled()&&!this.shouldUseCustomGridComponent()))return o.createElement("div",{className:"griddle-footer"},this.props.useCustomPagerComponent?o.createElement(m,{customPagerComponentOptions:this.props.customPagerComponentOptions,next:this.nextPage,previous:this.previousPage,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText,customPagerComponent:this.props.customPagerComponent}):o.createElement(u,{useGriddleStyles:this.props.useGriddleStyles,next:this.nextPage,previous:this.previousPage,nextClassName:this.props.nextClassName,nextIconComponent:this.props.nextIconComponent,previousClassName:this.props.previousClassName,previousIconComponent:this.props.previousIconComponent,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText}))},getColumnSelectorSection:function(e,t){return this.state.showColumnChooser?o.createElement(d,{columns:e,selectedColumns:t,setColumns:this.setColumns,settingsText:this.props.settingsText,settingsIconComponent:this.props.settingsIconComponent,maxRowsText:this.props.maxRowsText,setPageSize:this.setPageSize,showSetPageSize:!this.shouldUseCustomGridComponent(),resultsPerPage:this.state.resultsPerPage,enableToggleCustom:this.props.enableToggleCustom,toggleCustomComponent:this.toggleCustomComponent,useCustomComponent:this.shouldUseCustomRowComponent()||this.shouldUseCustomGridComponent(),useGriddleStyles:this.props.useGriddleStyles,enableCustomFormatText:this.props.enableCustomFormatText,columnMetadata:this.props.columnMetadata}):""},getCustomGridSection:function(){return o.createElement(this.props.customGridComponent,r({data:this.props.results,className:this.props.customGridComponentClassName},this.props.gridMetadata))},getCustomRowSection:function(e,t,n,r,i){return o.createElement("div",null,o.createElement(f,{data:e,columns:t,metadataColumns:n,globalData:i,className:this.props.customRowComponentClassName,customComponent:this.props.customRowComponent,style:this.props.useGriddleStyles?this.getClearFixStyles():null}),this.props.showPager&&r)},getStandardGridSection:function(e,t,n,r,i){var s=this.getSortObject(),a=this.getMultipleSelectionObject(),u=this.shouldShowNoDataSection(e),d=this.getNoDataSection();return o.createElement("div",{className:"griddle-body"},o.createElement(l,{useGriddleStyles:this.props.useGriddleStyles,noDataSection:d,showNoData:u,columnSettings:this.columnSettings,rowSettings:this.rowSettings,sortSettings:s,multipleSelectionSettings:a,filterByColumn:this.filterByColumn,isSubGriddle:this.props.isSubGriddle,useGriddleIcons:this.props.useGriddleIcons,useFixedLayout:this.props.useFixedLayout,showPager:this.props.showPager,pagingContent:r,data:e,className:this.props.tableClassName,enableInfiniteScroll:this.isInfiniteScrollEnabled(),nextPage:this.nextPage,showTableHeading:this.props.showTableHeading,useFixedHeader:this.props.useFixedHeader,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,parentRowExpandedComponent:this.props.parentRowExpandedComponent,bodyHeight:this.props.bodyHeight,paddingHeight:this.props.paddingHeight,rowHeight:this.props.rowHeight,infiniteScrollLoadTreshold:this.props.infiniteScrollLoadTreshold,externalLoadingComponent:this.props.externalLoadingComponent,externalIsLoading:this.props.externalIsLoading,hasMorePages:i,onRowClick:this.props.onRowClick,onRowMouseEnter:this.props.onRowMouseEnter,onRowMouseLeave:this.props.onRowMouseLeave,onRowWillMount:this.props.onRowWillMount,onRowWillUnmount:this.props.onRowWillUnmount}))},getContentSection:function(e,t,n,r,o,i){return this.shouldUseCustomGridComponent()&&null!==this.props.customGridComponent?this.getCustomGridSection():this.shouldUseCustomRowComponent()?this.getCustomRowSection(e,t,n,r,i):this.getStandardGridSection(e,t,n,r,o)},getNoDataSection:function(){return null!=this.props.customNoDataComponent?o.createElement("div",{className:this.props.noDataClassName},o.createElement(this.props.customNoDataComponent,this.props.customNoDataComponentProps)):o.createElement(c,{noDataMessage:this.props.noDataMessage})},shouldShowNoDataSection:function(e){return!this.props.allowEmptyGrid&&(!1===this.props.useExternal&&(void 0===e||0===e.length)||!0===this.props.useExternal&&!1===this.props.externalIsLoading&&0===e.length)},render:function(){var e=this.getCurrentResults(),t=(this.props.tableClassName,this.getFilter()),n=this.getSettings(),r=this.getTopSection(t,n),i=[],s=this.columnSettings.getColumns(),l=this.getDataForRender(e,s,!0),a=this.columnSettings.getMetadataColumns();this.props.columnMetadata?w(this.props.columnMetadata,(function(e){"boolean"==typeof e.visible&&!1===e.visible||i.push(e.columnName)})):i=b.keys(N(e[0],a)),i=this.columnSettings.orderColumns(i);var u=this.getCurrentPage(),d=this.getCurrentMaxPage(),c=u+10?"griddle "+this.props.gridClassName:"griddle";return m+=this.shouldUseCustomRowComponent()?" griddle-custom":"",o.createElement("div",{className:m},r,f,o.createElement("div",{className:"griddle-container",style:this.props.useGriddleStyles&&!this.props.isSubGriddle?{border:"1px solid #DDD"}:null},h))}});h.Griddle=e.exports=j},1545:function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n-1}},9905:function(e){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r=200&&(c=a,p=!1,t=new r(t));e:for(;++d0&&i(d)?n>1?e(d,n-1,i,s,l):r(l,d):s||(l[l.length]=d)}return l}},6649:function(e,t,n){var r=n(3221)();e.exports=r},641:function(e,t,n){var r=n(6649),o=n(5950);e.exports=function(e,t){return e&&r(e,t,o)}},7422:function(e,t,n){var r=n(1769),o=n(7797);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n=120&&y.length>=120)?new r(h&&y):void 0}y=e[0];var v=-1,b=f[0];e:for(;++vo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++rt||s&&l&&u&&!a&&!d||o&&l&&u||!n&&u||!i)return 1;if(!o&&!s&&!d&&e=a?u:u*("desc"==n[o]?-1:1)}return e.index-t.index}},3007:function(e){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n1?n[i-1]:void 0,l=i>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(i--,s):void 0,l&&o(n[0],n[1],l)&&(s=i<3?void 0:s,i=1),t=Object(t);++r-1?l[a?t[u]:u]:void 0}}},2963:function(e,t,n){var r=n(1372),o=n(5861),i=n(317),s=n(799);e.exports=function(e){return function(t){var n=o(t);return"[object Map]"==n?i(t):"[object Set]"==n?s(t):r(t,e(t))}}},3138:function(e,t,n){var r=n(1331);e.exports=function(e){return r(e)?void 0:e}},3243:function(e,t,n){var r=n(6110),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},5911:function(e,t,n){var r=n(8859),o=n(4248),i=n(9219);e.exports=function(e,t,n,s,l,a){var u=1&n,d=e.length,c=t.length;if(d!=c&&!(u&&c>d))return!1;var p=a.get(e),h=a.get(t);if(p&&h)return p==t&&h==e;var f=-1,m=!0,g=2&n?new r:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1}},1175:function(e,t,n){var r=n(6025);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},3040:function(e,t,n){var r=n(1549),o=n(79),i=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},7670:function(e,t,n){var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289:function(e,t,n){var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509:function(e,t,n){var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949:function(e,t,n){var r=n(2651);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},317:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},7197:function(e){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},2224:function(e,t,n){var r=n(104);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},1042:function(e,t,n){var r=n(6110)(Object,"create");e.exports=r},3650:function(e,t,n){var r=n(4335)(Object.keys,Object);e.exports=r},181:function(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},6009:function(e,t,n){e=n.nmd(e);var r=n(4840),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o&&r.process,l=function(){try{var e=i&&i.require&&i.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=l},9350:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},6757:function(e,t,n){var r=n(1033),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,s=-1,l=o(i.length-t,0),a=Array(l);++s0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},1420:function(e,t,n){var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605:function(e){e.exports=function(e){return this.__data__.get(e)}},9817:function(e){e.exports=function(e){return this.__data__.has(e)}},945:function(e,t,n){var r=n(79),o=n(8223),i=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!o||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(e,t),this.size=n.size,this}},6959:function(e){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r2?t[2]:void 0;for(u&&i(t[0],t[1],u)&&(r=1);++n-1:!!d&&r(e,t,n)>-1}},3424:function(e,t,n){var r=n(5160);e.exports=function(e){return(null==e?0:e.length)?r(e,0,-1):[]}},5287:function(e,t,n){var r=n(4932),o=n(7185),i=n(9302),s=n(741),l=i((function(e){var t=r(e,s);return t.length&&t[0]===e[0]?o(t):[]}));e.exports=l},2428:function(e,t,n){var r=n(7534),o=n(346),i=Object.prototype,s=i.hasOwnProperty,l=i.propertyIsEnumerable,a=r(function(){return arguments}())?r:function(e){return o(e)&&s.call(e,"callee")&&!l.call(e,"callee")};e.exports=a},6449:function(e){var t=Array.isArray;e.exports=t},4894:function(e,t,n){var r=n(1882),o=n(294);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},3693:function(e,t,n){var r=n(4894),o=n(346);e.exports=function(e){return o(e)&&r(e)}},3656:function(e,t,n){e=n.nmd(e);var r=n(9325),o=n(9935),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,l=s&&s.exports===i?r.Buffer:void 0,a=(l?l.isBuffer:void 0)||o;e.exports=a},2193:function(e,t,n){var r=n(8984),o=n(5861),i=n(2428),s=n(6449),l=n(4894),a=n(3656),u=n(5527),d=n(7167),c=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(l(e)&&(s(e)||"string"==typeof e||"function"==typeof e.splice||a(e)||d(e)||i(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(c.call(e,n))return!1;return!0}},1882:function(e,t,n){var r=n(2552),o=n(3805);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730:function(e,t,n){var r=n(9172),o=n(7301),i=n(6009),s=i&&i.isMap,l=s?o(s):r;e.exports=l},5187:function(e){e.exports=function(e){return null===e}},3805:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},1331:function(e,t,n){var r=n(2552),o=n(8879),i=n(346),s=Function.prototype,l=Object.prototype,a=s.toString,u=l.hasOwnProperty,d=a.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&a.call(n)==d}},8440:function(e,t,n){var r=n(6038),o=n(7301),i=n(6009),s=i&&i.isSet,l=s?o(s):r;e.exports=l},5015:function(e,t,n){var r=n(2552),o=n(6449),i=n(346);e.exports=function(e){return"string"==typeof e||!o(e)&&i(e)&&"[object String]"==r(e)}},4394:function(e,t,n){var r=n(2552),o=n(346);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7167:function(e,t,n){var r=n(4901),o=n(7301),i=n(6009),s=i&&i.isTypedArray,l=s?o(s):r;e.exports=l},2216:function(e){e.exports=function(e){return void 0===e}},5950:function(e,t,n){var r=n(695),o=n(8984),i=n(4894);e.exports=function(e){return i(e)?r(e):o(e)}},7241:function(e,t,n){var r=n(695),o=n(2903),i=n(4894);e.exports=function(e){return i(e)?r(e,!0):o(e)}},8090:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5378:function(e,t,n){var r=n(4932),o=n(5389),i=n(5128),s=n(6449);e.exports=function(e,t){return(s(e)?r:i)(e,o(t,3))}},104:function(e,t,n){var r=n(3661);function o(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 s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},179:function(e,t,n){var r=n(4932),o=n(9999),i=n(9931),s=n(1769),l=n(1791),a=n(3138),u=n(8816),d=n(3349),c=u((function(e,t){var n={};if(null==e)return n;var u=!1;t=r(t,(function(t){return t=s(t,e),u||(u=t.length>1),t})),l(e,d(e),n),u&&(n=o(n,7,a));for(var c=t.length;c--;)i(n,t[c]);return n}));e.exports=c},2877:function(e,t,n){var r=n(6155),o=n(6449);e.exports=function(e,t,n,i){return null==e?[]:(o(t)||(t=null==t?[]:[t]),o(n=i?void 0:n)||(n=null==n?[]:[n]),r(e,t,n))}},4383:function(e,t,n){var r=n(6001),o=n(8816)((function(e,t){return null==e?{}:r(e,t)}));e.exports=o},583:function(e,t,n){var r=n(7237),o=n(7255),i=n(8586),s=n(7797);e.exports=function(e){return i(e)?r(s(e)):o(e)}},2426:function(e,t,n){var r=n(4248),o=n(5389),i=n(916),s=n(6449),l=n(6800);e.exports=function(e,t,n){var a=s(e)?r:i;return n&&l(e,t,n)&&(t=void 0),a(e,o(t,3))}},3031:function(e,t,n){var r=n(3120),o=n(6155),i=n(9302),s=n(6800),l=i((function(e,t){if(null==e)return[];var n=t.length;return n>1&&s(e,t[0],t[1])?t=[]:n>2&&s(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])}));e.exports=l},3345:function(e){e.exports=function(){return[]}},9935:function(e){e.exports=function(){return!1}},4921:function(e,t,n){var r=n(5160),o=n(1489);e.exports=function(e,t,n){return e&&e.length?(t=n||void 0===t?1:o(t),r(e,0,t<0?0:t)):[]}},7400:function(e,t,n){var r=n(9374),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489:function(e,t,n){var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374:function(e,t,n){var r=n(4128),o=n(3805),i=n(4394),s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,a=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||a.test(e)?u(e.slice(2),n?2:8):s.test(e)?NaN:+e}},8938:function(e,t,n){var r=n(2963)(n(5950));e.exports=r},2072:function(e,t,n){var r=n(4932),o=n(3007),i=n(6449),s=n(4394),l=n(1802),a=n(7797),u=n(3222);e.exports=function(e){return i(e)?r(e,a):s(e)?[e]:o(l(u(e)))}},3222:function(e,t,n){var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},7200:function(e,t,n){var r=n(3222),o=0;e.exports=function(e){var t=++o;return r(e)+t}},5880:function(e,t,n){var r=n(514),o=n(5950);e.exports=function(e){return null==e?[]:r(e,o(e))}},1648:function(e,t,n){var r=n(3915),o=n(9302),i=n(3693),s=o((function(e,t){return i(e)?r(e,t):[]}));e.exports=s},7248:function(e,t,n){var r=n(6547),o=n(1234);e.exports=function(e,t){return o(e||[],t||[],r)}},5228:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var i,s,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),a=1;a1)for(var n=1;n1?t-1:0),r=1;r2?n-2:0),i=2;i1&&void 0!==arguments[1]&&arguments[1],n=this.props,r=n.tolerance,o=n.onSelection,i=n.onEndSelection,s=[],l=(0,d.findDOMNode)(this.refs.selectbox);l&&(this._registry.forEach((function(e){e.domNode&&(0,g.default)(l,e.domNode,r)&&!s.includes(e.key)&&s.push(e.key)})),t?"function"==typeof i&&i(s,e):"function"==typeof o&&o(s,e))}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.enabled,r=e.fixedPosition,o=e.className,i=e.selectingClassName,s=this.state,l=s.isBoxSelecting,a=s.boxLeft,d=s.boxTop,c=s.boxWidth,h=s.boxHeight,f=this.props.component;if(!n)return u.default.createElement(f,{className:o},t);var m={left:a,top:d,width:c,height:h,zIndex:9e3,position:r?"fixed":"absolute",cursor:"default"},g={backgroundColor:"transparent",border:"1px dashed #999",width:"100%",height:"100%",float:"left"},y={position:"relative",overflow:"visible"};return u.default.createElement(f,{className:(0,p.default)(o,l?i:null),style:y},l?u.default.createElement("div",{style:m,ref:"selectbox"},u.default.createElement("span",{style:g})):null,t)}}]),t}(a.Component);v.propTypes={children:c.default.node,onBeginSelection:c.default.func,onEndSelection:c.default.func,onSelection:c.default.func,component:c.default.node,tolerance:c.default.number,fixedPosition:c.default.bool,preventDefault:c.default.bool,onNonItemClick:c.default.func,enabled:c.default.bool,className:c.default.string,selectingClassName:c.default.string},v.defaultProps={component:"div",tolerance:0,fixedPosition:!1,preventDefault:!0,enabled:!0},v.childContextTypes={selectable:c.default.object},t.default=v},function(e,t,n){"use strict";(function(t){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=n(1),i=n(2),s=n(8),l=n(15),a=n(3),u=n(16);e.exports=function(e,n){function d(e){var t=e&&(O&&e[O]||e[I]);if("function"==typeof t)return t}function c(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e){this.message=e,this.stack=""}function h(e){function r(r,u,d,c,h,f,m){if(c=c||D,f=f||d,m!==a)if(n)i(!1,"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");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var g=c+":"+d;!o[g]&&l<3&&(s(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",f,c),o[g]=!0,l++)}return null==u[d]?r?new p(null===u[d]?"The "+h+" `"+f+"` is marked as required in `"+c+"`, but its value is `null`.":"The "+h+" `"+f+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(u,d,c,h,f)}if("production"!==t.env.NODE_ENV)var o={},l=0;var u=r.bind(null,!1);return u.isRequired=r.bind(null,!0),u}function f(e){function t(t,n,r,o,i,s){var l=t[n];return w(l)!==e?new p("Invalid "+o+" `"+i+"` of type `"+x(l)+"` supplied to `"+r+"`, expected `"+e+"`."):null}return h(t)}function m(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new p("Invalid "+o+" `"+i+"` of type `"+w(s)+"` supplied to `"+r+"`, expected an array.");for(var l=0;ln+l||t+o-ar+s)};t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=e instanceof HTMLElement?(0,r.default)(e):e,s=t instanceof HTMLElement?(0,r.default)(t):t;return o(i.top,i.left,s.top,s.left,i.offsetWidth,i.offsetHeight,s.offsetWidth,s.offsetHeight,n)}},function(e,t,n){"use strict";(function(t){function n(e,t,n){function r(t){var n=m,r=g;return m=g=void 0,w=t,v=e.apply(r,n)}function i(e){return w=e,b=setTimeout(d,t),x?r(e):v}function s(e){var n=t-(e-C);return F?E(n,y-(e-w)):n}function a(e){var n=e-C;return void 0===C||n>=t||n<0||F&&e-w>=y}function d(){var e=_();if(a(e))return c(e);b=setTimeout(d,s(e))}function c(e){return b=void 0,A&&m?r(e):(m=g=void 0,v)}function p(){void 0!==b&&clearTimeout(b),w=0,m=C=g=b=void 0}function h(){return void 0===b?v:c(_())}function f(){var e=_(),n=a(e);if(m=arguments,g=this,C=e,n){if(void 0===b)return i(C);if(F)return b=setTimeout(d,t),r(C)}return void 0===b&&(b=setTimeout(d,t)),v}var m,g,y,v,b,C,w=0,x=!1,F=!1,A=!0;if("function"!=typeof e)throw new TypeError(u);return t=l(t)||0,o(n)&&(x=!!n.leading,y=(F="maxWait"in n)?S(l(n.maxWait)||0,t):y,A="trailing"in n?!!n.trailing:A),f.cancel=p,f.flush=h,f}function r(e,t,r){var i=!0,s=!0;if("function"!=typeof e)throw new TypeError(u);return o(r)&&(i="leading"in r?!!r.leading:i,s="trailing"in r?!!r.trailing:s),n(e,t,{leading:i,maxWait:t,trailing:s})}function o(e){var t=void 0===e?"undefined":a(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==(void 0===e?"undefined":a(e))}function s(e){return"symbol"==(void 0===e?"undefined":a(e))||i(e)&&C.call(e)==c}function l(e){if("number"==typeof e)return e;if(s(e))return d;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(p,"");var n=f.test(e);return n||m.test(e)?g(e.slice(2),n?2:8):h.test(e)?d:+e}var 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},u="Expected a function",d=NaN,c="[object Symbol]",p=/^\s+|\s+$/g,h=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,m=/^0o[0-7]+$/i,g=parseInt,y="object"==(void 0===t?"undefined":a(t))&&t&&t.Object===Object&&t,v="object"==("undefined"==typeof self?"undefined":a(self))&&self&&self.Object===Object&&self,b=y||v||Function("return this")(),C=Object.prototype.toString,S=Math.max,E=Math.min,_=function(){return b.Date.now()};e.exports=r}).call(t,n(21))},function(e,t,n){"use strict";var r,o="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};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":o(window))&&(r=window)}e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function s(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)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n
'),this.element.appendChild(e));let t=e.getElementsByTagName("span")[0];return t&&(null!=t.textContent?t.textContent=this.options.dictFallbackMessage:null!=t.innerText&&(t.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize(e,t,n,r){let o={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},i=e.width/e.height;null==t&&null==n?(t=o.srcWidth,n=o.srcHeight):null==t?t=n*i:null==n&&(n=t/i);let s=(t=Math.min(t,o.srcWidth))/(n=Math.min(n,o.srcHeight));if(o.srcWidth>t||o.srcHeight>n)if("crop"===r)i>s?(o.srcHeight=e.height,o.srcWidth=o.srcHeight*s):(o.srcWidth=e.width,o.srcHeight=o.srcWidth/s);else{if("contain"!==r)throw new Error(`Unknown resizeMethod '${r}'`);i>s?n=t/i:t=n*i}return o.srcX=(e.width-o.srcWidth)/2,o.srcY=(e.height-o.srcHeight)/2,o.trgWidth=t,o.trgHeight=n,o},transformFile(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:r('
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n'),drop(e){return this.element.classList.remove("dz-drag-hover")},dragstart(e){},dragend(e){return this.element.classList.remove("dz-drag-hover")},dragenter(e){return this.element.classList.add("dz-drag-hover")},dragover(e){return this.element.classList.add("dz-drag-hover")},dragleave(e){return this.element.classList.remove("dz-drag-hover")},paste(e){},reset(){return this.element.classList.remove("dz-started")},addedfile(e){if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){for(var t of(e.previewElement=s.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),e.previewElement.querySelectorAll("[data-dz-name]")))t.textContent=e.name;for(t of e.previewElement.querySelectorAll("[data-dz-size]"))t.innerHTML=this.filesize(e.size);this.options.addRemoveLinks&&(e._removeLink=s.createElement(`${this.options.dictRemoveFile}`),e.previewElement.appendChild(e._removeLink));let n=t=>(t.preventDefault(),t.stopPropagation(),e.status===s.UPLOADING?s.confirm(this.options.dictCancelUploadConfirmation,(()=>this.removeFile(e))):this.options.dictRemoveFileConfirmation?s.confirm(this.options.dictRemoveFileConfirmation,(()=>this.removeFile(e))):this.removeFile(e));for(let t of e.previewElement.querySelectorAll("[data-dz-remove]"))t.addEventListener("click",n)}},removedfile(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");for(let n of e.previewElement.querySelectorAll("[data-dz-thumbnail]"))n.alt=e.name,n.src=t;return setTimeout((()=>e.previewElement.classList.add("dz-image-preview")),1)}},error(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"string"!=typeof t&&t.error&&(t=t.error);for(let n of e.previewElement.querySelectorAll("[data-dz-errormessage]"))n.textContent=t}},errormultiple(){},processing(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple(){},uploadprogress(e,t,n){if(e.previewElement)for(let n of e.previewElement.querySelectorAll("[data-dz-uploadprogress]"))"PROGRESS"===n.nodeName?n.value=t:n.style.width=`${t}%`},totaluploadprogress(){},sending(){},sendingmultiple(){},success(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple(){},canceled(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple(){},complete(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple(){},maxfilesexceeded(){},maxfilesreached(){},queuecomplete(){},addedfiles(){}};class s extends o{static initClass(){this.prototype.Emitter=o,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}constructor(e,t){let n,r;if(super(),this.element=e,this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),null===this.element||!this.element instanceof HTMLElement)throw new Error("Invalid dropzone element: not an instance of HTMLElement.");if(this.element.dropzone)throw new Error("Dropzone already attached.");s.instances.push(this),this.element.dropzone=this;let o=null!=(r=s.optionsForElement(this.element))?r:{};if(this.options=Object.assign({},i,o,null!=t?t:{}),this.options.previewTemplate=this.options.previewTemplate.replace(/\n*/g,""),this.options.forceFallback||!s.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.uploadMultiple&&this.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");if(this.options.binaryBody&&this.options.uploadMultiple)throw new Error("You cannot set both: binaryBody and uploadMultiple.");"string"==typeof this.options.method&&(this.options.method=this.options.method.toUpperCase()),(n=this.getExistingFallback())&&n.parentNode&&n.parentNode.removeChild(n),!1!==this.options.previewsContainer&&(this.options.previewsContainer?this.previewsContainer=s.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(!0===this.options.clickable?this.clickableElements=[this.element]:this.clickableElements=s.getElements(this.options.clickable,"clickable")),this.init()}getAcceptedFiles(){return this.files.filter((e=>e.accepted)).map((e=>e))}getRejectedFiles(){return this.files.filter((e=>!e.accepted)).map((e=>e))}getFilesWithStatus(e){return this.files.filter((t=>t.status===e)).map((e=>e))}getQueuedFiles(){return this.getFilesWithStatus(s.QUEUED)}getUploadingFiles(){return this.getFilesWithStatus(s.UPLOADING)}getAddedFiles(){return this.getFilesWithStatus(s.ADDED)}getActiveFiles(){return this.files.filter((e=>e.status===s.UPLOADING||e.status===s.QUEUED)).map((e=>e))}init(){if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(s.createElement(`
`)),this.clickableElements.length){let e=()=>{this.hiddenFileInput&&this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=document.createElement("input"),this.hiddenFileInput.setAttribute("type","file"),this.hiddenFileInput.setAttribute("form",this.element.id),(null===this.options.maxFiles||this.options.maxFiles>1)&&this.hiddenFileInput.setAttribute("multiple","multiple"),this.hiddenFileInput.className="dz-hidden-input",null!==this.options.acceptedFiles&&this.hiddenFileInput.setAttribute("accept",this.options.acceptedFiles),null!==this.options.capture&&this.hiddenFileInput.setAttribute("capture",this.options.capture),this.hiddenFileInput.setAttribute("tabindex","-1"),this.hiddenFileInput.setAttribute("aria-label","dropzone hidden input"),this.hiddenFileInput.style.visibility="hidden",this.hiddenFileInput.style.position="absolute",this.hiddenFileInput.style.top="0",this.hiddenFileInput.style.left="0",this.hiddenFileInput.style.height="0",this.hiddenFileInput.style.width="0",s.getElement(this.options.hiddenInputContainer,"hiddenInputContainer").appendChild(this.hiddenFileInput),this.hiddenFileInput.addEventListener("change",(()=>{let{files:t}=this.hiddenFileInput;if(t.length)for(let e of t)this.addFile(e);this.emit("addedfiles",t),e()}))};e()}this.URL=null!==window.URL?window.URL:window.webkitURL;for(let e of this.events)this.on(e,this.options[e]);this.on("uploadprogress",(()=>this.updateTotalUploadProgress())),this.on("removedfile",(()=>this.updateTotalUploadProgress())),this.on("canceled",(e=>this.emit("complete",e))),this.on("complete",(e=>{if(0===this.getAddedFiles().length&&0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length)return setTimeout((()=>this.emit("queuecomplete")),0)}));let e=function(e){if(function(e){return e.dataTransfer.types&&e.dataTransfer.types.includes("Files")}(e))return e.stopPropagation(),e.preventDefault()};return this.listeners=[{element:this.element,events:{dragstart:e=>this.emit("dragstart",e),dragenter:t=>(e(t),this.emit("dragenter",t)),dragover:t=>{const n=t.dataTransfer.effectAllowed;return t.dataTransfer.dropEffect="move"===n||"linkMove"===n?"move":"copy",e(t),this.emit("dragover",t)},dragleave:e=>this.emit("dragleave",e),drop:t=>(e(t),this.drop(t)),dragend:e=>this.emit("dragend",e)}}],this.clickableElements.forEach((e=>this.listeners.push({element:e,events:{click:t=>((e!==this.element||t.target===this.element||s.elementInside(t.target,this.element.querySelector(".dz-message")))&&this.hiddenFileInput.click(),!0)}}))),this.enable(),this.options.init.call(this)}destroy(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,s.instances.splice(s.instances.indexOf(this),1)}updateTotalUploadProgress(){let e,t=0,n=0;if(this.getActiveFiles().length){for(let e of this.getActiveFiles())t+=e.upload.bytesSent,n+=e.upload.total;e=100*t/n}else e=100;return this.emit("totaluploadprogress",e,n,t)}_getParamName(e){return"function"==typeof this.options.paramName?this.options.paramName(e):`${this.options.paramName}${this.options.uploadMultiple?`[${e}]`:""}`}_renameFile(e){const t={...e,name:e.name.replace(/\u202F/g," ")};return"function"!=typeof this.options.renameFile?t.name:this.options.renameFile(t)}getFallbackForm(){let e,t;if(e=this.getExistingFallback())return e;let n='
';this.options.dictFallbackText&&(n+=`

${this.options.dictFallbackText}

`),n+=`
`;let r=s.createElement(n);return"FORM"!==this.element.tagName?(t=s.createElement(`
`),t.appendChild(r)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:r}getExistingFallback(){let e=function(e){for(let t of e)if(/(^| )fallback($| )/.test(t.className))return t};for(let n of["div","form"]){var t;if(t=e(this.element.getElementsByTagName(n)))return t}}setupEventListeners(){return this.listeners.map((e=>(()=>{let t=[];for(let n in e.events){let r=e.events[n];t.push(e.element.addEventListener(n,r,!1))}return t})()))}removeEventListeners(){return this.listeners.map((e=>(()=>{let t=[];for(let n in e.events){let r=e.events[n];t.push(e.element.removeEventListener(n,r,!1))}return t})()))}disable(){return this.clickableElements.forEach((e=>e.classList.remove("dz-clickable"))),this.removeEventListeners(),this.disabled=!0,this.files.map((e=>this.cancelUpload(e)))}enable(){return delete this.disabled,this.clickableElements.forEach((e=>e.classList.add("dz-clickable"))),this.setupEventListeners()}filesize(e){let t=0,n="b";if(e>0){let r=["tb","gb","mb","kb","b"];for(let o=0;o=Math.pow(this.options.filesizeBase,4-o)/10){t=e/Math.pow(this.options.filesizeBase,4-o),n=i;break}}t=Math.round(10*t)/10}return`${t} ${this.options.dictFileSizeUnits[n]}`}_updateMaxFilesReachedClass(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}drop(e){if(!e.dataTransfer)return;this.emit("drop",e);let t=[];for(let n=0;ne.items,null!=t?n(t):void 0))return;var t,n;this.emit("paste",e);let{items:r}=e.clipboardData;return r.length?this._addFilesFromItems(r):void 0}handleFiles(e){for(let t of e)this.addFile(t)}_addFilesFromItems(e){return(()=>{let t=[];for(let r of e){var n;null!=r.webkitGetAsEntry&&(n=r.webkitGetAsEntry())?n.isFile?t.push(this.addFile(r.getAsFile())):n.isDirectory?t.push(this._addFilesFromDirectory(n,n.name)):t.push(void 0):null!=r.getAsFile&&(null==r.kind||"file"===r.kind)?t.push(this.addFile(r.getAsFile())):t.push(void 0)}return t})()}_addFilesFromDirectory(e,t){let n=e.createReader(),r=e=>{return t=console,n="log",r=t=>t.log(e),null!=t&&"function"==typeof t[n]?r(t,n):void 0;var t,n,r};var o=()=>n.readEntries((e=>{if(e.length>0){for(let n of e)n.isFile?n.file((e=>{if(!this.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath=`${t}/${e.name}`,this.addFile(e)})):n.isDirectory&&this._addFilesFromDirectory(n,`${t}/${n.name}`);o()}return null}),r);return o()}accept(e,t){this.options.maxFilesize&&e.size>1048576*this.options.maxFilesize?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):s.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)}addFile(e){e.upload={uuid:window.isSecureContext?self.crypto.randomUUID():s.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e)},this.files.push(e),e.status=s.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,(t=>{t?(e.accepted=!1,this._errorProcessing([e],t)):(e.accepted=!0,this.options.autoQueue&&this.enqueueFile(e)),this._updateMaxFilesReachedClass()}))}enqueueFiles(e){for(let t of e)this.enqueueFile(t);return null}enqueueFile(e){if(e.status!==s.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=s.QUEUED,this.options.autoProcessQueue)return setTimeout((()=>this.processQueue()),0)}_enqueueThumbnail(e){if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1048576*this.options.maxThumbnailFilesize)return this._thumbnailQueue.push(e),setTimeout((()=>this._processThumbnailQueue()),0)}_processThumbnailQueue(){if(this._processingThumbnail||0===this._thumbnailQueue.length)return;this._processingThumbnail=!0;let e=this._thumbnailQueue.shift();return this.createThumbnail(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,(t=>(this.emit("thumbnail",e,t),this._processingThumbnail=!1,this._processThumbnailQueue())))}removeFile(e){if(e.status===s.UPLOADING&&this.cancelUpload(e),this.files=l(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}removeAllFiles(e){null==e&&(e=!1);for(let t of this.files.slice())(t.status!==s.UPLOADING||e)&&this.removeFile(t);return null}resizeImage(e,t,n,r,o){return this.createThumbnail(e,t,n,r,!0,((t,n)=>{if(null==n)return o(e);{let{resizeMimeType:t}=this.options;null==t&&(t=e.type);let r=n.toDataURL(t,this.options.resizeQuality);return"image/jpeg"!==t&&"image/jpg"!==t||(r=function(e,t){var n="data:image/jpeg;base64,";if(!e.startsWith(n)||!t.startsWith(n))return t;var r=window.atob(e.slice(n.length));if(!r.startsWith("ÿØÿ"))return t;var o=0,i="";for(;o{e.dataURL=l.result,"image/svg+xml"!==e.type?this.createThumbnailFromUrl(e,t,n,r,o,i,void 0,s):null!=i&&i(l.result)},l.readAsDataURL(e)}displayExistingFile(e,t,n,r,o=!0){if(this.emit("addedfile",e),this.emit("complete",e),o){let o=t=>{this.emit("thumbnail",e,t),n&&n()};e.dataURL=t,this.createThumbnailFromUrl(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,o,r)}else this.emit("thumbnail",e,t),n&&n()}createThumbnailFromUrl(e,t,n,r,o,i,s,l=!1){let a=document.createElement("img");s&&(a.crossOrigin=s),o="from-image"!=getComputedStyle(document.body).imageOrientation&&o,a.onload=()=>{let s=e=>e(1);return"undefined"!=typeof EXIF&&null!==EXIF&&o&&(s=e=>EXIF.getData(a,(function(){return e(EXIF.getTag(this,"Orientation"))}))),s((o=>{e.width=a.width,e.height=a.height;let s=this.options.resize.call(this,e,t,n,r),l=document.createElement("canvas"),d=l.getContext("2d");switch(l.width=s.trgWidth,l.height=s.trgHeight,o>4&&(l.width=s.trgHeight,l.height=s.trgWidth),o){case 2:d.translate(l.width,0),d.scale(-1,1);break;case 3:d.translate(l.width,l.height),d.rotate(Math.PI);break;case 4:d.translate(0,l.height),d.scale(1,-1);break;case 5:d.rotate(.5*Math.PI),d.scale(1,-1);break;case 6:d.rotate(.5*Math.PI),d.translate(0,-l.width);break;case 7:d.rotate(.5*Math.PI),d.translate(l.height,-l.width),d.scale(-1,1);break;case 8:d.rotate(-.5*Math.PI),d.translate(-l.height,0)}u(d,a,null!=s.srcX?s.srcX:0,null!=s.srcY?s.srcY:0,s.srcWidth,s.srcHeight,null!=s.trgX?s.trgX:0,null!=s.trgY?s.trgY:0,s.trgWidth,s.trgHeight);let c=l.toDataURL("image/png");if(null!=i)return i(c,l)}))},null!=i&&(a.onerror=i);var d=e.dataURL;return l&&(d=function(e){var t="data:image/jpeg;base64,";if(!e.startsWith(t))return e;var n=window.atob(e.slice(t.length));if(!n.startsWith("ÿØÿ"))return e;var r=0,o="";for(;r=e)return;let r=this.getQueuedFiles();if(r.length>0){if(this.options.uploadMultiple)return this.processFiles(r.slice(0,e-t));for(;nt.xhr===e)).map((e=>e))}cancelUpload(e){if(e.status===s.UPLOADING){let t=this._getFilesWithXhr(e.xhr);for(let e of t)e.status=s.CANCELED;void 0!==e.xhr&&e.xhr.abort();for(let e of t)this.emit("canceled",e);this.options.uploadMultiple&&this.emit("canceledmultiple",t)}else e.status!==s.ADDED&&e.status!==s.QUEUED||(e.status=s.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}resolveOption(e,...t){return"function"==typeof e?e.apply(this,t):e}uploadFile(e){return this.uploadFiles([e])}uploadFiles(e){this._transformFiles(e,(t=>{if(this.options.chunking){let n=t[0];e[0].upload.chunked=this.options.chunking&&(this.options.forceChunking||n.size>this.options.chunkSize),e[0].upload.totalChunkCount=Math.ceil(n.size/this.options.chunkSize),0===n.size&&(e[0].upload.totalChunkCount=1)}if(e[0].upload.chunked){let n=e[0],r=t[0];n.upload.chunks=[];let o=()=>{let t=0;for(;void 0!==n.upload.chunks[t];)t++;if(t>=n.upload.totalChunkCount)return;let o=t*this.options.chunkSize,i=Math.min(o+this.options.chunkSize,r.size),l={name:this._getParamName(0),data:r.webkitSlice?r.webkitSlice(o,i):r.slice(o,i),filename:n.upload.filename,chunkIndex:t};n.upload.chunks[t]={file:n,index:t,dataBlock:l,status:s.UPLOADING,progress:0,retries:0},this._uploadData(e,[l])};if(n.upload.finishedChunkUpload=(t,r)=>{let i=!0;t.status=s.SUCCESS,t.dataBlock=null,t.response=t.xhr.responseText,t.responseHeaders=t.xhr.getAllResponseHeaders(),t.xhr=null;for(let e=0;e{this._finished(e,r,null)}))},this.options.parallelChunkUploads){const e=Math.min(!0===this.options.parallelChunkUploads?this.options.parallelUploads:this.options.parallelChunkUploads,n.upload.totalChunkCount);for(let t=0;t{this._finishedUploading(e,n,t)},n.ontimeout=()=>{this._handleUploadError(e,n,`Request timedout after ${this.options.timeout/1e3} seconds`)},n.onerror=()=>{this._handleUploadError(e,n)},(null!=n.upload?n.upload:n).onprogress=t=>this._updateFilesUploadProgress(e,n,t);let i=this.options.defaultHeaders?{Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"}:{};this.options.binaryBody&&(i["Content-Type"]=e[0].type),this.options.headers&&Object.assign(i,this.options.headers);for(let e in i){let t=i[e];t&&n.setRequestHeader(e,t)}if(this.options.binaryBody){for(let t of e)this.emit("sending",t,n);this.options.uploadMultiple&&this.emit("sendingmultiple",e,n),this.submitRequest(n,null,e)}else{let r=new FormData;if(this.options.params){let t=this.options.params;"function"==typeof t&&(t=t.call(this,e,n,e[0].upload.chunked?this._getChunk(e[0],n):null));for(let e in t){let n=t[e];if(Array.isArray(n))for(let t=0;t{n[o]=i,++r===e.length&&t(n)}))}_addFormElementData(e){if("FORM"===this.element.tagName)for(let t of this.element.querySelectorAll("input, textarea, select, button")){let n=t.getAttribute("name"),r=t.getAttribute("type");if(r&&(r=r.toLowerCase()),null!=n)if("SELECT"===t.tagName&&t.hasAttribute("multiple"))for(let r of t.options)r.selected&&e.append(n,r.value);else(!r||"checkbox"!==r&&"radio"!==r||t.checked)&&e.append(n,t.value)}}_updateFilesUploadProgress(e,t,n){if(e[0].upload.chunked){let r=e[0],o=this._getChunk(r,t);n?(o.progress=100*n.loaded/n.total,o.total=n.total,o.bytesSent=n.loaded):(o.progress=100,o.bytesSent=o.total),r.upload.progress=0,r.upload.total=0,r.upload.bytesSent=0;for(let e=0;e(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16)))}}s.initClass(),s.options={},s.optionsForElement=function(e){return e.getAttribute("id")&&void 0!==s.options?s.options[a(e.getAttribute("id"))]:void 0},s.instances=[],s.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},s.discover=function(){let e;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else{e=[];let t=t=>(()=>{let n=[];for(let r of t)/(^| )dropzone($| )/.test(r.className)?n.push(e.push(r)):n.push(void 0);return n})();t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))}return(()=>{let t=[];for(let n of e)!1!==s.optionsForElement(n)?t.push(new s(n)):t.push(void 0);return t})()},s.isBrowserSupported=function(){return"undefined"!=typeof Promise},s.dataURItoBlob=function(e){let t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),o=new Uint8Array(r);for(let e=0,n=t.length,r=0<=n;r?e<=n:e>=n;r?e++:e--)o[e]=t.charCodeAt(e);return new Blob([r],{type:n})};const l=(e,t)=>e.filter((e=>e!==t)).map((e=>e)),a=e=>e.replace(/[\-_](\w)/g,(e=>e.charAt(1).toUpperCase()));s.createElement=function(e){let t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},s.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},s.getElement=function(e,t){let n;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector or a plain HTML element.`);return n},s.getElements=function(e,t){let n,r;if(e instanceof Array){r=[];try{for(n of e)r.push(this.getElement(n,t))}catch(e){r=null}}else if("string"==typeof e)for(n of(r=[],document.querySelectorAll(e)))r.push(n);else null!=e.nodeType&&(r=[e]);if(null==r||!r.length)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`);return r},s.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},s.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");let n=e.type,r=n.replace(/\/.*$/,"");for(let o of t)if(o=o.trim(),"."===o.charAt(0)){if(-1!==e.name.toLowerCase().indexOf(o.toLowerCase(),e.name.length-o.length))return!0}else if(/\/\*$/.test(o)){if(r===o.replace(/\/.*$/,""))return!0}else if(n===o)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each((function(){return new s(this,e)}))}),s.ADDED="added",s.QUEUED="queued",s.ACCEPTED=s.QUEUED,s.UPLOADING="uploading",s.PROCESSING=s.UPLOADING,s.CANCELED="canceled",s.ERROR="error",s.SUCCESS="success";var u=function(e,t,n,r,o,i,s,l,a,u){let d=function(e){let t=e.naturalHeight,n=document.createElement("canvas");n.width=1,n.height=t;let r=n.getContext("2d");r.drawImage(e,0,0);let{data:o}=r.getImageData(1,0,1,t),i=0,s=t,l=t;for(;l>i;)0===o[4*(l-1)+3]?s=l:i=l,l=s+i>>1;let a=l/t;return 0===a?1:a}(t);return e.drawImage(t,n,r,o,i,s,l,a,u/d)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};!function(){"use strict";var e=p(n(5815)),t=p(n(1153)),r=p(n(1594)),o=n(5145),i=p(n(1669)),s=p(n(2121)),l=p(n(6931)),a=c(n(5207)),u=c(n(1021));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function p(e){return e&&e.__esModule?e:{default:e}}const h="sslinkfile",f={init(n){t.default.addAction("sslink",{text:e.default._t("AssetAdmin.LINKLABEL_FILE","Link to a file"),onAction:e=>e.execCommand(h),priority:80},n.getParam("editorIdentifier")).addCommandWithUrlTest(h,/^\[file_link/),n.addCommand(h,(()=>{(0,i.default)(`#${n.id}`).entwine("ss").openLinkFileDialog()}))}},m="insert-link__dialog-wrapper--file",g=(0,a.loadComponent)(l.default);i.default.entwine("ss",(e=>{e("textarea.htmleditor").entwine({openLinkFileDialog(){let t=e(`#${m}`);t.length||(t=e(`
`),e("body").append(t)),t.addClass("insert-link__dialog-wrapper"),t.setElement(this),t.open()}}),e(`.js-injector-boot #${m}`).entwine({ReactRoot:null,renderModal(e){var t=this;const{dispatch:n}=a.default.reducer.store;n(u.initFormStack("insert-link","admin"));const i=this.getOriginalAttributes(),s=this.getFolderId(),l=this.getRequireLinkText();let d=this.getReactRoot();d||(d=(0,o.createRoot)(this[0]),this.setReactRoot(d)),d.render(r.default.createElement(g,{isOpen:e,type:"insert-link",folderId:s,onInsert:function(){return t.handleInsert(...arguments)},onClosed:()=>{n(u.reset()),this.close()},title:!1,bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--internal",fileAttributes:i,requireLinkText:l}))},buildAttributes(e){return{href:`${s.default.serialise({name:"file_link",properties:{id:e.ID}},!0)}${e.Anchor&&e.Anchor.length?`#${e.Anchor}`:""}`,target:e.TargetBlank?"_blank":"",title:e.Description}},getFolderId(){const e=this.getElement();if(!e)return null;const t=Number(e.data("config").upload_folder_id);return isNaN(t)?null:t},getOriginalAttributes(){const t=this.getElement().getEditor(),n=e(t.getSelectedNode()),r=(n.attr("href")||"").split("#");if(!r[0])return{};const o=s.default.match("file_link",!1,r[0]);return o?{ID:o.properties.id?parseInt(o.properties.id,10):0,Anchor:r[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}:{}}})})),tinymce.PluginManager.add(h,(e=>f.init(e)))}()}(); \ No newline at end of file +/******/ (function() { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ HiddenText: function() { return /* binding */ HiddenText; }, +/* harmony export */ LiveRegion: function() { return /* binding */ LiveRegion; }, +/* harmony export */ useAnnouncement: function() { return /* binding */ useAnnouncement; } +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); + + +const hiddenStyles = { + display: 'none' +}; +function HiddenText(_ref) { + let { + id, + value + } = _ref; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { + id: id, + style: hiddenStyles + }, value); +} + +function LiveRegion(_ref) { + let { + id, + announcement, + ariaLiveType = "assertive" + } = _ref; + // Hide element visually but keep it readable by screen readers + const visuallyHidden = { + position: 'fixed', + top: 0, + left: 0, + width: 1, + height: 1, + margin: -1, + border: 0, + padding: 0, + overflow: 'hidden', + clip: 'rect(0 0 0 0)', + clipPath: 'inset(100%)', + whiteSpace: 'nowrap' + }; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { + id: id, + style: visuallyHidden, + role: "status", + "aria-live": ariaLiveType, + "aria-atomic": true + }, announcement); +} + +function useAnnouncement() { + const [announcement, setAnnouncement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''); + const announce = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(value => { + if (value != null) { + setAnnouncement(value); + } + }, []); + return { + announce, + announcement + }; +} + + +//# sourceMappingURL=accessibility.esm.js.map + + +/***/ }), + +/***/ "./node_modules/@dnd-kit/core/dist/core.esm.js": +/*!*****************************************************!*\ + !*** ./node_modules/@dnd-kit/core/dist/core.esm.js ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ AutoScrollActivator: function() { return /* binding */ AutoScrollActivator; }, +/* harmony export */ DndContext: function() { return /* binding */ DndContext; }, +/* harmony export */ DragOverlay: function() { return /* binding */ DragOverlay; }, +/* harmony export */ KeyboardCode: function() { return /* binding */ KeyboardCode; }, +/* harmony export */ KeyboardSensor: function() { return /* binding */ KeyboardSensor; }, +/* harmony export */ MeasuringFrequency: function() { return /* binding */ MeasuringFrequency; }, +/* harmony export */ MeasuringStrategy: function() { return /* binding */ MeasuringStrategy; }, +/* harmony export */ MouseSensor: function() { return /* binding */ MouseSensor; }, +/* harmony export */ PointerSensor: function() { return /* binding */ PointerSensor; }, +/* harmony export */ TouchSensor: function() { return /* binding */ TouchSensor; }, +/* harmony export */ TraversalOrder: function() { return /* binding */ TraversalOrder; }, +/* harmony export */ applyModifiers: function() { return /* binding */ applyModifiers; }, +/* harmony export */ closestCenter: function() { return /* binding */ closestCenter; }, +/* harmony export */ closestCorners: function() { return /* binding */ closestCorners; }, +/* harmony export */ defaultAnnouncements: function() { return /* binding */ defaultAnnouncements; }, +/* harmony export */ defaultCoordinates: function() { return /* binding */ defaultCoordinates; }, +/* harmony export */ defaultDropAnimation: function() { return /* binding */ defaultDropAnimationConfiguration; }, +/* harmony export */ defaultDropAnimationSideEffects: function() { return /* binding */ defaultDropAnimationSideEffects; }, +/* harmony export */ defaultKeyboardCoordinateGetter: function() { return /* binding */ defaultKeyboardCoordinateGetter; }, +/* harmony export */ defaultScreenReaderInstructions: function() { return /* binding */ defaultScreenReaderInstructions; }, +/* harmony export */ getClientRect: function() { return /* binding */ getClientRect; }, +/* harmony export */ getFirstCollision: function() { return /* binding */ getFirstCollision; }, +/* harmony export */ getScrollableAncestors: function() { return /* binding */ getScrollableAncestors; }, +/* harmony export */ pointerWithin: function() { return /* binding */ pointerWithin; }, +/* harmony export */ rectIntersection: function() { return /* binding */ rectIntersection; }, +/* harmony export */ useDndContext: function() { return /* binding */ useDndContext; }, +/* harmony export */ useDndMonitor: function() { return /* binding */ useDndMonitor; }, +/* harmony export */ useDraggable: function() { return /* binding */ useDraggable; }, +/* harmony export */ useDroppable: function() { return /* binding */ useDroppable; }, +/* harmony export */ useSensor: function() { return /* binding */ useSensor; }, +/* harmony export */ useSensors: function() { return /* binding */ useSensors; } +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "react-dom"); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dnd-kit/utilities */ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js"); +/* harmony import */ var _dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @dnd-kit/accessibility */ "./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js"); + + + + + +const DndMonitorContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null); + +function useDndMonitor(listener) { + const registerListener = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(DndMonitorContext); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!registerListener) { + throw new Error('useDndMonitor must be used within a children of '); + } + + const unsubscribe = registerListener(listener); + return unsubscribe; + }, [listener, registerListener]); +} + +function useDndMonitorProvider() { + const [listeners] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => new Set()); + const registerListener = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(listener => { + listeners.add(listener); + return () => listeners.delete(listener); + }, [listeners]); + const dispatch = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(_ref => { + let { + type, + event + } = _ref; + listeners.forEach(listener => { + var _listener$type; + + return (_listener$type = listener[type]) == null ? void 0 : _listener$type.call(listener, event); + }); + }, [listeners]); + return [dispatch, registerListener]; +} + +const defaultScreenReaderInstructions = { + draggable: "\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n " +}; +const defaultAnnouncements = { + onDragStart(_ref) { + let { + active + } = _ref; + return "Picked up draggable item " + active.id + "."; + }, + + onDragOver(_ref2) { + let { + active, + over + } = _ref2; + + if (over) { + return "Draggable item " + active.id + " was moved over droppable area " + over.id + "."; + } + + return "Draggable item " + active.id + " is no longer over a droppable area."; + }, + + onDragEnd(_ref3) { + let { + active, + over + } = _ref3; + + if (over) { + return "Draggable item " + active.id + " was dropped over droppable area " + over.id; + } + + return "Draggable item " + active.id + " was dropped."; + }, + + onDragCancel(_ref4) { + let { + active + } = _ref4; + return "Dragging was cancelled. Draggable item " + active.id + " was dropped."; + } + +}; + +function Accessibility(_ref) { + let { + announcements = defaultAnnouncements, + container, + hiddenTextDescribedById, + screenReaderInstructions = defaultScreenReaderInstructions + } = _ref; + const { + announce, + announcement + } = (0,_dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__.useAnnouncement)(); + const liveRegionId = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)("DndLiveRegion"); + const [mounted, setMounted] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + setMounted(true); + }, []); + useDndMonitor((0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + onDragStart(_ref2) { + let { + active + } = _ref2; + announce(announcements.onDragStart({ + active + })); + }, + + onDragMove(_ref3) { + let { + active, + over + } = _ref3; + + if (announcements.onDragMove) { + announce(announcements.onDragMove({ + active, + over + })); + } + }, + + onDragOver(_ref4) { + let { + active, + over + } = _ref4; + announce(announcements.onDragOver({ + active, + over + })); + }, + + onDragEnd(_ref5) { + let { + active, + over + } = _ref5; + announce(announcements.onDragEnd({ + active, + over + })); + }, + + onDragCancel(_ref6) { + let { + active, + over + } = _ref6; + announce(announcements.onDragCancel({ + active, + over + })); + } + + }), [announce, announcements])); + + if (!mounted) { + return null; + } + + const markup = react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__.HiddenText, { + id: hiddenTextDescribedById, + value: screenReaderInstructions.draggable + }), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__.LiveRegion, { + id: liveRegionId, + announcement: announcement + })); + return container ? (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(markup, container) : markup; +} + +var Action; + +(function (Action) { + Action["DragStart"] = "dragStart"; + Action["DragMove"] = "dragMove"; + Action["DragEnd"] = "dragEnd"; + Action["DragCancel"] = "dragCancel"; + Action["DragOver"] = "dragOver"; + Action["RegisterDroppable"] = "registerDroppable"; + Action["SetDroppableDisabled"] = "setDroppableDisabled"; + Action["UnregisterDroppable"] = "unregisterDroppable"; +})(Action || (Action = {})); + +function noop() {} + +function useSensor(sensor, options) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + sensor, + options: options != null ? options : {} + }), // eslint-disable-next-line react-hooks/exhaustive-deps + [sensor, options]); +} + +function useSensors() { + for (var _len = arguments.length, sensors = new Array(_len), _key = 0; _key < _len; _key++) { + sensors[_key] = arguments[_key]; + } + + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => [...sensors].filter(sensor => sensor != null), // eslint-disable-next-line react-hooks/exhaustive-deps + [...sensors]); +} + +const defaultCoordinates = /*#__PURE__*/Object.freeze({ + x: 0, + y: 0 +}); + +/** + * Returns the distance between two points + */ +function distanceBetween(p1, p2) { + return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2)); +} + +function getRelativeTransformOrigin(event, rect) { + const eventCoordinates = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(event); + + if (!eventCoordinates) { + return '0 0'; + } + + const transformOrigin = { + x: (eventCoordinates.x - rect.left) / rect.width * 100, + y: (eventCoordinates.y - rect.top) / rect.height * 100 + }; + return transformOrigin.x + "% " + transformOrigin.y + "%"; +} + +/** + * Sort collisions from smallest to greatest value + */ +function sortCollisionsAsc(_ref, _ref2) { + let { + data: { + value: a + } + } = _ref; + let { + data: { + value: b + } + } = _ref2; + return a - b; +} +/** + * Sort collisions from greatest to smallest value + */ + +function sortCollisionsDesc(_ref3, _ref4) { + let { + data: { + value: a + } + } = _ref3; + let { + data: { + value: b + } + } = _ref4; + return b - a; +} +/** + * Returns the coordinates of the corners of a given rectangle: + * [TopLeft {x, y}, TopRight {x, y}, BottomLeft {x, y}, BottomRight {x, y}] + */ + +function cornersOfRectangle(_ref5) { + let { + left, + top, + height, + width + } = _ref5; + return [{ + x: left, + y: top + }, { + x: left + width, + y: top + }, { + x: left, + y: top + height + }, { + x: left + width, + y: top + height + }]; +} +function getFirstCollision(collisions, property) { + if (!collisions || collisions.length === 0) { + return null; + } + + const [firstCollision] = collisions; + return property ? firstCollision[property] : firstCollision; +} + +/** + * Returns the coordinates of the center of a given ClientRect + */ + +function centerOfRectangle(rect, left, top) { + if (left === void 0) { + left = rect.left; + } + + if (top === void 0) { + top = rect.top; + } + + return { + x: left + rect.width * 0.5, + y: top + rect.height * 0.5 + }; +} +/** + * Returns the closest rectangles from an array of rectangles to the center of a given + * rectangle. + */ + + +const closestCenter = _ref => { + let { + collisionRect, + droppableRects, + droppableContainers + } = _ref; + const centerRect = centerOfRectangle(collisionRect, collisionRect.left, collisionRect.top); + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect) { + const distBetween = distanceBetween(centerOfRectangle(rect), centerRect); + collisions.push({ + id, + data: { + droppableContainer, + value: distBetween + } + }); + } + } + + return collisions.sort(sortCollisionsAsc); +}; + +/** + * Returns the closest rectangles from an array of rectangles to the corners of + * another rectangle. + */ + +const closestCorners = _ref => { + let { + collisionRect, + droppableRects, + droppableContainers + } = _ref; + const corners = cornersOfRectangle(collisionRect); + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect) { + const rectCorners = cornersOfRectangle(rect); + const distances = corners.reduce((accumulator, corner, index) => { + return accumulator + distanceBetween(rectCorners[index], corner); + }, 0); + const effectiveDistance = Number((distances / 4).toFixed(4)); + collisions.push({ + id, + data: { + droppableContainer, + value: effectiveDistance + } + }); + } + } + + return collisions.sort(sortCollisionsAsc); +}; + +/** + * Returns the intersecting rectangle area between two rectangles + */ + +function getIntersectionRatio(entry, target) { + const top = Math.max(target.top, entry.top); + const left = Math.max(target.left, entry.left); + const right = Math.min(target.left + target.width, entry.left + entry.width); + const bottom = Math.min(target.top + target.height, entry.top + entry.height); + const width = right - left; + const height = bottom - top; + + if (left < right && top < bottom) { + const targetArea = target.width * target.height; + const entryArea = entry.width * entry.height; + const intersectionArea = width * height; + const intersectionRatio = intersectionArea / (targetArea + entryArea - intersectionArea); + return Number(intersectionRatio.toFixed(4)); + } // Rectangles do not overlap, or overlap has an area of zero (edge/corner overlap) + + + return 0; +} +/** + * Returns the rectangles that has the greatest intersection area with a given + * rectangle in an array of rectangles. + */ + +const rectIntersection = _ref => { + let { + collisionRect, + droppableRects, + droppableContainers + } = _ref; + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect) { + const intersectionRatio = getIntersectionRatio(rect, collisionRect); + + if (intersectionRatio > 0) { + collisions.push({ + id, + data: { + droppableContainer, + value: intersectionRatio + } + }); + } + } + } + + return collisions.sort(sortCollisionsDesc); +}; + +/** + * Check if a given point is contained within a bounding rectangle + */ + +function isPointWithinRect(point, rect) { + const { + top, + left, + bottom, + right + } = rect; + return top <= point.y && point.y <= bottom && left <= point.x && point.x <= right; +} +/** + * Returns the rectangles that the pointer is hovering over + */ + + +const pointerWithin = _ref => { + let { + droppableContainers, + droppableRects, + pointerCoordinates + } = _ref; + + if (!pointerCoordinates) { + return []; + } + + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect && isPointWithinRect(pointerCoordinates, rect)) { + /* There may be more than a single rectangle intersecting + * with the pointer coordinates. In order to sort the + * colliding rectangles, we measure the distance between + * the pointer and the corners of the intersecting rectangle + */ + const corners = cornersOfRectangle(rect); + const distances = corners.reduce((accumulator, corner) => { + return accumulator + distanceBetween(pointerCoordinates, corner); + }, 0); + const effectiveDistance = Number((distances / 4).toFixed(4)); + collisions.push({ + id, + data: { + droppableContainer, + value: effectiveDistance + } + }); + } + } + + return collisions.sort(sortCollisionsAsc); +}; + +function adjustScale(transform, rect1, rect2) { + return { ...transform, + scaleX: rect1 && rect2 ? rect1.width / rect2.width : 1, + scaleY: rect1 && rect2 ? rect1.height / rect2.height : 1 + }; +} + +function getRectDelta(rect1, rect2) { + return rect1 && rect2 ? { + x: rect1.left - rect2.left, + y: rect1.top - rect2.top + } : defaultCoordinates; +} + +function createRectAdjustmentFn(modifier) { + return function adjustClientRect(rect) { + for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + adjustments[_key - 1] = arguments[_key]; + } + + return adjustments.reduce((acc, adjustment) => ({ ...acc, + top: acc.top + modifier * adjustment.y, + bottom: acc.bottom + modifier * adjustment.y, + left: acc.left + modifier * adjustment.x, + right: acc.right + modifier * adjustment.x + }), { ...rect + }); + }; +} +const getAdjustedRect = /*#__PURE__*/createRectAdjustmentFn(1); + +function parseTransform(transform) { + if (transform.startsWith('matrix3d(')) { + const transformArray = transform.slice(9, -1).split(/, /); + return { + x: +transformArray[12], + y: +transformArray[13], + scaleX: +transformArray[0], + scaleY: +transformArray[5] + }; + } else if (transform.startsWith('matrix(')) { + const transformArray = transform.slice(7, -1).split(/, /); + return { + x: +transformArray[4], + y: +transformArray[5], + scaleX: +transformArray[0], + scaleY: +transformArray[3] + }; + } + + return null; +} + +function inverseTransform(rect, transform, transformOrigin) { + const parsedTransform = parseTransform(transform); + + if (!parsedTransform) { + return rect; + } + + const { + scaleX, + scaleY, + x: translateX, + y: translateY + } = parsedTransform; + const x = rect.left - translateX - (1 - scaleX) * parseFloat(transformOrigin); + const y = rect.top - translateY - (1 - scaleY) * parseFloat(transformOrigin.slice(transformOrigin.indexOf(' ') + 1)); + const w = scaleX ? rect.width / scaleX : rect.width; + const h = scaleY ? rect.height / scaleY : rect.height; + return { + width: w, + height: h, + top: y, + right: x + w, + bottom: y + h, + left: x + }; +} + +const defaultOptions = { + ignoreTransform: false +}; +/** + * Returns the bounding client rect of an element relative to the viewport. + */ + +function getClientRect(element, options) { + if (options === void 0) { + options = defaultOptions; + } + + let rect = element.getBoundingClientRect(); + + if (options.ignoreTransform) { + const { + transform, + transformOrigin + } = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element).getComputedStyle(element); + + if (transform) { + rect = inverseTransform(rect, transform, transformOrigin); + } + } + + const { + top, + left, + width, + height, + bottom, + right + } = rect; + return { + top, + left, + width, + height, + bottom, + right + }; +} +/** + * Returns the bounding client rect of an element relative to the viewport. + * + * @remarks + * The ClientRect returned by this method does not take into account transforms + * applied to the element it measures. + * + */ + +function getTransformAgnosticClientRect(element) { + return getClientRect(element, { + ignoreTransform: true + }); +} + +function getWindowClientRect(element) { + const width = element.innerWidth; + const height = element.innerHeight; + return { + top: 0, + left: 0, + right: width, + bottom: height, + width, + height + }; +} + +function isFixed(node, computedStyle) { + if (computedStyle === void 0) { + computedStyle = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(node).getComputedStyle(node); + } + + return computedStyle.position === 'fixed'; +} + +function isScrollable(element, computedStyle) { + if (computedStyle === void 0) { + computedStyle = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element).getComputedStyle(element); + } + + const overflowRegex = /(auto|scroll|overlay)/; + const properties = ['overflow', 'overflowX', 'overflowY']; + return properties.some(property => { + const value = computedStyle[property]; + return typeof value === 'string' ? overflowRegex.test(value) : false; + }); +} + +function getScrollableAncestors(element, limit) { + const scrollParents = []; + + function findScrollableAncestors(node) { + if (limit != null && scrollParents.length >= limit) { + return scrollParents; + } + + if (!node) { + return scrollParents; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isDocument)(node) && node.scrollingElement != null && !scrollParents.includes(node.scrollingElement)) { + scrollParents.push(node.scrollingElement); + return scrollParents; + } + + if (!(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(node) || (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isSVGElement)(node)) { + return scrollParents; + } + + if (scrollParents.includes(node)) { + return scrollParents; + } + + const computedStyle = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element).getComputedStyle(node); + + if (node !== element) { + if (isScrollable(node, computedStyle)) { + scrollParents.push(node); + } + } + + if (isFixed(node, computedStyle)) { + return scrollParents; + } + + return findScrollableAncestors(node.parentNode); + } + + if (!element) { + return scrollParents; + } + + return findScrollableAncestors(element); +} +function getFirstScrollableAncestor(node) { + const [firstScrollableAncestor] = getScrollableAncestors(node, 1); + return firstScrollableAncestor != null ? firstScrollableAncestor : null; +} + +function getScrollableElement(element) { + if (!_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.canUseDOM || !element) { + return null; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isWindow)(element)) { + return element; + } + + if (!(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isNode)(element)) { + return null; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isDocument)(element) || element === (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(element).scrollingElement) { + return window; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(element)) { + return element; + } + + return null; +} + +function getScrollXCoordinate(element) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isWindow)(element)) { + return element.scrollX; + } + + return element.scrollLeft; +} +function getScrollYCoordinate(element) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isWindow)(element)) { + return element.scrollY; + } + + return element.scrollTop; +} +function getScrollCoordinates(element) { + return { + x: getScrollXCoordinate(element), + y: getScrollYCoordinate(element) + }; +} + +var Direction; + +(function (Direction) { + Direction[Direction["Forward"] = 1] = "Forward"; + Direction[Direction["Backward"] = -1] = "Backward"; +})(Direction || (Direction = {})); + +function isDocumentScrollingElement(element) { + if (!_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.canUseDOM || !element) { + return false; + } + + return element === document.scrollingElement; +} + +function getScrollPosition(scrollingContainer) { + const minScroll = { + x: 0, + y: 0 + }; + const dimensions = isDocumentScrollingElement(scrollingContainer) ? { + height: window.innerHeight, + width: window.innerWidth + } : { + height: scrollingContainer.clientHeight, + width: scrollingContainer.clientWidth + }; + const maxScroll = { + x: scrollingContainer.scrollWidth - dimensions.width, + y: scrollingContainer.scrollHeight - dimensions.height + }; + const isTop = scrollingContainer.scrollTop <= minScroll.y; + const isLeft = scrollingContainer.scrollLeft <= minScroll.x; + const isBottom = scrollingContainer.scrollTop >= maxScroll.y; + const isRight = scrollingContainer.scrollLeft >= maxScroll.x; + return { + isTop, + isLeft, + isBottom, + isRight, + maxScroll, + minScroll + }; +} + +const defaultThreshold = { + x: 0.2, + y: 0.2 +}; +function getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, _ref, acceleration, thresholdPercentage) { + let { + top, + left, + right, + bottom + } = _ref; + + if (acceleration === void 0) { + acceleration = 10; + } + + if (thresholdPercentage === void 0) { + thresholdPercentage = defaultThreshold; + } + + const { + isTop, + isBottom, + isLeft, + isRight + } = getScrollPosition(scrollContainer); + const direction = { + x: 0, + y: 0 + }; + const speed = { + x: 0, + y: 0 + }; + const threshold = { + height: scrollContainerRect.height * thresholdPercentage.y, + width: scrollContainerRect.width * thresholdPercentage.x + }; + + if (!isTop && top <= scrollContainerRect.top + threshold.height) { + // Scroll Up + direction.y = Direction.Backward; + speed.y = acceleration * Math.abs((scrollContainerRect.top + threshold.height - top) / threshold.height); + } else if (!isBottom && bottom >= scrollContainerRect.bottom - threshold.height) { + // Scroll Down + direction.y = Direction.Forward; + speed.y = acceleration * Math.abs((scrollContainerRect.bottom - threshold.height - bottom) / threshold.height); + } + + if (!isRight && right >= scrollContainerRect.right - threshold.width) { + // Scroll Right + direction.x = Direction.Forward; + speed.x = acceleration * Math.abs((scrollContainerRect.right - threshold.width - right) / threshold.width); + } else if (!isLeft && left <= scrollContainerRect.left + threshold.width) { + // Scroll Left + direction.x = Direction.Backward; + speed.x = acceleration * Math.abs((scrollContainerRect.left + threshold.width - left) / threshold.width); + } + + return { + direction, + speed + }; +} + +function getScrollElementRect(element) { + if (element === document.scrollingElement) { + const { + innerWidth, + innerHeight + } = window; + return { + top: 0, + left: 0, + right: innerWidth, + bottom: innerHeight, + width: innerWidth, + height: innerHeight + }; + } + + const { + top, + left, + right, + bottom + } = element.getBoundingClientRect(); + return { + top, + left, + right, + bottom, + width: element.clientWidth, + height: element.clientHeight + }; +} + +function getScrollOffsets(scrollableAncestors) { + return scrollableAncestors.reduce((acc, node) => { + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(acc, getScrollCoordinates(node)); + }, defaultCoordinates); +} +function getScrollXOffset(scrollableAncestors) { + return scrollableAncestors.reduce((acc, node) => { + return acc + getScrollXCoordinate(node); + }, 0); +} +function getScrollYOffset(scrollableAncestors) { + return scrollableAncestors.reduce((acc, node) => { + return acc + getScrollYCoordinate(node); + }, 0); +} + +function scrollIntoViewIfNeeded(element, measure) { + if (measure === void 0) { + measure = getClientRect; + } + + if (!element) { + return; + } + + const { + top, + left, + bottom, + right + } = measure(element); + const firstScrollableAncestor = getFirstScrollableAncestor(element); + + if (!firstScrollableAncestor) { + return; + } + + if (bottom <= 0 || right <= 0 || top >= window.innerHeight || left >= window.innerWidth) { + element.scrollIntoView({ + block: 'center', + inline: 'center' + }); + } +} + +const properties = [['x', ['left', 'right'], getScrollXOffset], ['y', ['top', 'bottom'], getScrollYOffset]]; +class Rect { + constructor(rect, element) { + this.rect = void 0; + this.width = void 0; + this.height = void 0; + this.top = void 0; + this.bottom = void 0; + this.right = void 0; + this.left = void 0; + const scrollableAncestors = getScrollableAncestors(element); + const scrollOffsets = getScrollOffsets(scrollableAncestors); + this.rect = { ...rect + }; + this.width = rect.width; + this.height = rect.height; + + for (const [axis, keys, getScrollOffset] of properties) { + for (const key of keys) { + Object.defineProperty(this, key, { + get: () => { + const currentOffsets = getScrollOffset(scrollableAncestors); + const scrollOffsetsDeltla = scrollOffsets[axis] - currentOffsets; + return this.rect[key] + scrollOffsetsDeltla; + }, + enumerable: true + }); + } + } + + Object.defineProperty(this, 'rect', { + enumerable: false + }); + } + +} + +class Listeners { + constructor(target) { + this.target = void 0; + this.listeners = []; + + this.removeAll = () => { + this.listeners.forEach(listener => { + var _this$target; + + return (_this$target = this.target) == null ? void 0 : _this$target.removeEventListener(...listener); + }); + }; + + this.target = target; + } + + add(eventName, handler, options) { + var _this$target2; + + (_this$target2 = this.target) == null ? void 0 : _this$target2.addEventListener(eventName, handler, options); + this.listeners.push([eventName, handler, options]); + } + +} + +function getEventListenerTarget(target) { + // If the `event.target` element is removed from the document events will still be targeted + // at it, and hence won't always bubble up to the window or document anymore. + // If there is any risk of an element being removed while it is being dragged, + // the best practice is to attach the event listeners directly to the target. + // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget + const { + EventTarget + } = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(target); + return target instanceof EventTarget ? target : (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(target); +} + +function hasExceededDistance(delta, measurement) { + const dx = Math.abs(delta.x); + const dy = Math.abs(delta.y); + + if (typeof measurement === 'number') { + return Math.sqrt(dx ** 2 + dy ** 2) > measurement; + } + + if ('x' in measurement && 'y' in measurement) { + return dx > measurement.x && dy > measurement.y; + } + + if ('x' in measurement) { + return dx > measurement.x; + } + + if ('y' in measurement) { + return dy > measurement.y; + } + + return false; +} + +var EventName; + +(function (EventName) { + EventName["Click"] = "click"; + EventName["DragStart"] = "dragstart"; + EventName["Keydown"] = "keydown"; + EventName["ContextMenu"] = "contextmenu"; + EventName["Resize"] = "resize"; + EventName["SelectionChange"] = "selectionchange"; + EventName["VisibilityChange"] = "visibilitychange"; +})(EventName || (EventName = {})); + +function preventDefault(event) { + event.preventDefault(); +} +function stopPropagation(event) { + event.stopPropagation(); +} + +var KeyboardCode; + +(function (KeyboardCode) { + KeyboardCode["Space"] = "Space"; + KeyboardCode["Down"] = "ArrowDown"; + KeyboardCode["Right"] = "ArrowRight"; + KeyboardCode["Left"] = "ArrowLeft"; + KeyboardCode["Up"] = "ArrowUp"; + KeyboardCode["Esc"] = "Escape"; + KeyboardCode["Enter"] = "Enter"; + KeyboardCode["Tab"] = "Tab"; +})(KeyboardCode || (KeyboardCode = {})); + +const defaultKeyboardCodes = { + start: [KeyboardCode.Space, KeyboardCode.Enter], + cancel: [KeyboardCode.Esc], + end: [KeyboardCode.Space, KeyboardCode.Enter, KeyboardCode.Tab] +}; +const defaultKeyboardCoordinateGetter = (event, _ref) => { + let { + currentCoordinates + } = _ref; + + switch (event.code) { + case KeyboardCode.Right: + return { ...currentCoordinates, + x: currentCoordinates.x + 25 + }; + + case KeyboardCode.Left: + return { ...currentCoordinates, + x: currentCoordinates.x - 25 + }; + + case KeyboardCode.Down: + return { ...currentCoordinates, + y: currentCoordinates.y + 25 + }; + + case KeyboardCode.Up: + return { ...currentCoordinates, + y: currentCoordinates.y - 25 + }; + } + + return undefined; +}; + +class KeyboardSensor { + constructor(props) { + this.props = void 0; + this.autoScrollEnabled = false; + this.referenceCoordinates = void 0; + this.listeners = void 0; + this.windowListeners = void 0; + this.props = props; + const { + event: { + target + } + } = props; + this.props = props; + this.listeners = new Listeners((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(target)); + this.windowListeners = new Listeners((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(target)); + this.handleKeyDown = this.handleKeyDown.bind(this); + this.handleCancel = this.handleCancel.bind(this); + this.attach(); + } + + attach() { + this.handleStart(); + this.windowListeners.add(EventName.Resize, this.handleCancel); + this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); + setTimeout(() => this.listeners.add(EventName.Keydown, this.handleKeyDown)); + } + + handleStart() { + const { + activeNode, + onStart + } = this.props; + const node = activeNode.node.current; + + if (node) { + scrollIntoViewIfNeeded(node); + } + + onStart(defaultCoordinates); + } + + handleKeyDown(event) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(event)) { + const { + active, + context, + options + } = this.props; + const { + keyboardCodes = defaultKeyboardCodes, + coordinateGetter = defaultKeyboardCoordinateGetter, + scrollBehavior = 'smooth' + } = options; + const { + code + } = event; + + if (keyboardCodes.end.includes(code)) { + this.handleEnd(event); + return; + } + + if (keyboardCodes.cancel.includes(code)) { + this.handleCancel(event); + return; + } + + const { + collisionRect + } = context.current; + const currentCoordinates = collisionRect ? { + x: collisionRect.left, + y: collisionRect.top + } : defaultCoordinates; + + if (!this.referenceCoordinates) { + this.referenceCoordinates = currentCoordinates; + } + + const newCoordinates = coordinateGetter(event, { + active, + context: context.current, + currentCoordinates + }); + + if (newCoordinates) { + const coordinatesDelta = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(newCoordinates, currentCoordinates); + const scrollDelta = { + x: 0, + y: 0 + }; + const { + scrollableAncestors + } = context.current; + + for (const scrollContainer of scrollableAncestors) { + const direction = event.code; + const { + isTop, + isRight, + isLeft, + isBottom, + maxScroll, + minScroll + } = getScrollPosition(scrollContainer); + const scrollElementRect = getScrollElementRect(scrollContainer); + const clampedCoordinates = { + x: Math.min(direction === KeyboardCode.Right ? scrollElementRect.right - scrollElementRect.width / 2 : scrollElementRect.right, Math.max(direction === KeyboardCode.Right ? scrollElementRect.left : scrollElementRect.left + scrollElementRect.width / 2, newCoordinates.x)), + y: Math.min(direction === KeyboardCode.Down ? scrollElementRect.bottom - scrollElementRect.height / 2 : scrollElementRect.bottom, Math.max(direction === KeyboardCode.Down ? scrollElementRect.top : scrollElementRect.top + scrollElementRect.height / 2, newCoordinates.y)) + }; + const canScrollX = direction === KeyboardCode.Right && !isRight || direction === KeyboardCode.Left && !isLeft; + const canScrollY = direction === KeyboardCode.Down && !isBottom || direction === KeyboardCode.Up && !isTop; + + if (canScrollX && clampedCoordinates.x !== newCoordinates.x) { + const newScrollCoordinates = scrollContainer.scrollLeft + coordinatesDelta.x; + const canScrollToNewCoordinates = direction === KeyboardCode.Right && newScrollCoordinates <= maxScroll.x || direction === KeyboardCode.Left && newScrollCoordinates >= minScroll.x; + + if (canScrollToNewCoordinates && !coordinatesDelta.y) { + // We don't need to update coordinates, the scroll adjustment alone will trigger + // logic to auto-detect the new container we are over + scrollContainer.scrollTo({ + left: newScrollCoordinates, + behavior: scrollBehavior + }); + return; + } + + if (canScrollToNewCoordinates) { + scrollDelta.x = scrollContainer.scrollLeft - newScrollCoordinates; + } else { + scrollDelta.x = direction === KeyboardCode.Right ? scrollContainer.scrollLeft - maxScroll.x : scrollContainer.scrollLeft - minScroll.x; + } + + if (scrollDelta.x) { + scrollContainer.scrollBy({ + left: -scrollDelta.x, + behavior: scrollBehavior + }); + } + + break; + } else if (canScrollY && clampedCoordinates.y !== newCoordinates.y) { + const newScrollCoordinates = scrollContainer.scrollTop + coordinatesDelta.y; + const canScrollToNewCoordinates = direction === KeyboardCode.Down && newScrollCoordinates <= maxScroll.y || direction === KeyboardCode.Up && newScrollCoordinates >= minScroll.y; + + if (canScrollToNewCoordinates && !coordinatesDelta.x) { + // We don't need to update coordinates, the scroll adjustment alone will trigger + // logic to auto-detect the new container we are over + scrollContainer.scrollTo({ + top: newScrollCoordinates, + behavior: scrollBehavior + }); + return; + } + + if (canScrollToNewCoordinates) { + scrollDelta.y = scrollContainer.scrollTop - newScrollCoordinates; + } else { + scrollDelta.y = direction === KeyboardCode.Down ? scrollContainer.scrollTop - maxScroll.y : scrollContainer.scrollTop - minScroll.y; + } + + if (scrollDelta.y) { + scrollContainer.scrollBy({ + top: -scrollDelta.y, + behavior: scrollBehavior + }); + } + + break; + } + } + + this.handleMove(event, (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(newCoordinates, this.referenceCoordinates), scrollDelta)); + } + } + } + + handleMove(event, coordinates) { + const { + onMove + } = this.props; + event.preventDefault(); + onMove(coordinates); + } + + handleEnd(event) { + const { + onEnd + } = this.props; + event.preventDefault(); + this.detach(); + onEnd(); + } + + handleCancel(event) { + const { + onCancel + } = this.props; + event.preventDefault(); + this.detach(); + onCancel(); + } + + detach() { + this.listeners.removeAll(); + this.windowListeners.removeAll(); + } + +} +KeyboardSensor.activators = [{ + eventName: 'onKeyDown', + handler: (event, _ref, _ref2) => { + let { + keyboardCodes = defaultKeyboardCodes, + onActivation + } = _ref; + let { + active + } = _ref2; + const { + code + } = event.nativeEvent; + + if (keyboardCodes.start.includes(code)) { + const activator = active.activatorNode.current; + + if (activator && event.target !== activator) { + return false; + } + + event.preventDefault(); + onActivation == null ? void 0 : onActivation({ + event: event.nativeEvent + }); + return true; + } + + return false; + } +}]; + +function isDistanceConstraint(constraint) { + return Boolean(constraint && 'distance' in constraint); +} + +function isDelayConstraint(constraint) { + return Boolean(constraint && 'delay' in constraint); +} + +class AbstractPointerSensor { + constructor(props, events, listenerTarget) { + var _getEventCoordinates; + + if (listenerTarget === void 0) { + listenerTarget = getEventListenerTarget(props.event.target); + } + + this.props = void 0; + this.events = void 0; + this.autoScrollEnabled = true; + this.document = void 0; + this.activated = false; + this.initialCoordinates = void 0; + this.timeoutId = null; + this.listeners = void 0; + this.documentListeners = void 0; + this.windowListeners = void 0; + this.props = props; + this.events = events; + const { + event + } = props; + const { + target + } = event; + this.props = props; + this.events = events; + this.document = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(target); + this.documentListeners = new Listeners(this.document); + this.listeners = new Listeners(listenerTarget); + this.windowListeners = new Listeners((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(target)); + this.initialCoordinates = (_getEventCoordinates = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(event)) != null ? _getEventCoordinates : defaultCoordinates; + this.handleStart = this.handleStart.bind(this); + this.handleMove = this.handleMove.bind(this); + this.handleEnd = this.handleEnd.bind(this); + this.handleCancel = this.handleCancel.bind(this); + this.handleKeydown = this.handleKeydown.bind(this); + this.removeTextSelection = this.removeTextSelection.bind(this); + this.attach(); + } + + attach() { + const { + events, + props: { + options: { + activationConstraint, + bypassActivationConstraint + } + } + } = this; + this.listeners.add(events.move.name, this.handleMove, { + passive: false + }); + this.listeners.add(events.end.name, this.handleEnd); + + if (events.cancel) { + this.listeners.add(events.cancel.name, this.handleCancel); + } + + this.windowListeners.add(EventName.Resize, this.handleCancel); + this.windowListeners.add(EventName.DragStart, preventDefault); + this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); + this.windowListeners.add(EventName.ContextMenu, preventDefault); + this.documentListeners.add(EventName.Keydown, this.handleKeydown); + + if (activationConstraint) { + if (bypassActivationConstraint != null && bypassActivationConstraint({ + event: this.props.event, + activeNode: this.props.activeNode, + options: this.props.options + })) { + return this.handleStart(); + } + + if (isDelayConstraint(activationConstraint)) { + this.timeoutId = setTimeout(this.handleStart, activationConstraint.delay); + this.handlePending(activationConstraint); + return; + } + + if (isDistanceConstraint(activationConstraint)) { + this.handlePending(activationConstraint); + return; + } + } + + this.handleStart(); + } + + detach() { + this.listeners.removeAll(); + this.windowListeners.removeAll(); // Wait until the next event loop before removing document listeners + // This is necessary because we listen for `click` and `selection` events on the document + + setTimeout(this.documentListeners.removeAll, 50); + + if (this.timeoutId !== null) { + clearTimeout(this.timeoutId); + this.timeoutId = null; + } + } + + handlePending(constraint, offset) { + const { + active, + onPending + } = this.props; + onPending(active, constraint, this.initialCoordinates, offset); + } + + handleStart() { + const { + initialCoordinates + } = this; + const { + onStart + } = this.props; + + if (initialCoordinates) { + this.activated = true; // Stop propagation of click events once activation constraints are met + + this.documentListeners.add(EventName.Click, stopPropagation, { + capture: true + }); // Remove any text selection from the document + + this.removeTextSelection(); // Prevent further text selection while dragging + + this.documentListeners.add(EventName.SelectionChange, this.removeTextSelection); + onStart(initialCoordinates); + } + } + + handleMove(event) { + var _getEventCoordinates2; + + const { + activated, + initialCoordinates, + props + } = this; + const { + onMove, + options: { + activationConstraint + } + } = props; + + if (!initialCoordinates) { + return; + } + + const coordinates = (_getEventCoordinates2 = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(event)) != null ? _getEventCoordinates2 : defaultCoordinates; + const delta = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(initialCoordinates, coordinates); // Constraint validation + + if (!activated && activationConstraint) { + if (isDistanceConstraint(activationConstraint)) { + if (activationConstraint.tolerance != null && hasExceededDistance(delta, activationConstraint.tolerance)) { + return this.handleCancel(); + } + + if (hasExceededDistance(delta, activationConstraint.distance)) { + return this.handleStart(); + } + } + + if (isDelayConstraint(activationConstraint)) { + if (hasExceededDistance(delta, activationConstraint.tolerance)) { + return this.handleCancel(); + } + } + + this.handlePending(activationConstraint, delta); + return; + } + + if (event.cancelable) { + event.preventDefault(); + } + + onMove(coordinates); + } + + handleEnd() { + const { + onAbort, + onEnd + } = this.props; + this.detach(); + + if (!this.activated) { + onAbort(this.props.active); + } + + onEnd(); + } + + handleCancel() { + const { + onAbort, + onCancel + } = this.props; + this.detach(); + + if (!this.activated) { + onAbort(this.props.active); + } + + onCancel(); + } + + handleKeydown(event) { + if (event.code === KeyboardCode.Esc) { + this.handleCancel(); + } + } + + removeTextSelection() { + var _this$document$getSel; + + (_this$document$getSel = this.document.getSelection()) == null ? void 0 : _this$document$getSel.removeAllRanges(); + } + +} + +const events = { + cancel: { + name: 'pointercancel' + }, + move: { + name: 'pointermove' + }, + end: { + name: 'pointerup' + } +}; +class PointerSensor extends AbstractPointerSensor { + constructor(props) { + const { + event + } = props; // Pointer events stop firing if the target is unmounted while dragging + // Therefore we attach listeners to the owner document instead + + const listenerTarget = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(event.target); + super(props, events, listenerTarget); + } + +} +PointerSensor.activators = [{ + eventName: 'onPointerDown', + handler: (_ref, _ref2) => { + let { + nativeEvent: event + } = _ref; + let { + onActivation + } = _ref2; + + if (!event.isPrimary || event.button !== 0) { + return false; + } + + onActivation == null ? void 0 : onActivation({ + event + }); + return true; + } +}]; + +const events$1 = { + move: { + name: 'mousemove' + }, + end: { + name: 'mouseup' + } +}; +var MouseButton; + +(function (MouseButton) { + MouseButton[MouseButton["RightClick"] = 2] = "RightClick"; +})(MouseButton || (MouseButton = {})); + +class MouseSensor extends AbstractPointerSensor { + constructor(props) { + super(props, events$1, (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(props.event.target)); + } + +} +MouseSensor.activators = [{ + eventName: 'onMouseDown', + handler: (_ref, _ref2) => { + let { + nativeEvent: event + } = _ref; + let { + onActivation + } = _ref2; + + if (event.button === MouseButton.RightClick) { + return false; + } + + onActivation == null ? void 0 : onActivation({ + event + }); + return true; + } +}]; + +const events$2 = { + cancel: { + name: 'touchcancel' + }, + move: { + name: 'touchmove' + }, + end: { + name: 'touchend' + } +}; +class TouchSensor extends AbstractPointerSensor { + constructor(props) { + super(props, events$2); + } + + static setup() { + // Adding a non-capture and non-passive `touchmove` listener in order + // to force `event.preventDefault()` calls to work in dynamically added + // touchmove event handlers. This is required for iOS Safari. + window.addEventListener(events$2.move.name, noop, { + capture: false, + passive: false + }); + return function teardown() { + window.removeEventListener(events$2.move.name, noop); + }; // We create a new handler because the teardown function of another sensor + // could remove our event listener if we use a referentially equal listener. + + function noop() {} + } + +} +TouchSensor.activators = [{ + eventName: 'onTouchStart', + handler: (_ref, _ref2) => { + let { + nativeEvent: event + } = _ref; + let { + onActivation + } = _ref2; + const { + touches + } = event; + + if (touches.length > 1) { + return false; + } + + onActivation == null ? void 0 : onActivation({ + event + }); + return true; + } +}]; + +var AutoScrollActivator; + +(function (AutoScrollActivator) { + AutoScrollActivator[AutoScrollActivator["Pointer"] = 0] = "Pointer"; + AutoScrollActivator[AutoScrollActivator["DraggableRect"] = 1] = "DraggableRect"; +})(AutoScrollActivator || (AutoScrollActivator = {})); + +var TraversalOrder; + +(function (TraversalOrder) { + TraversalOrder[TraversalOrder["TreeOrder"] = 0] = "TreeOrder"; + TraversalOrder[TraversalOrder["ReversedTreeOrder"] = 1] = "ReversedTreeOrder"; +})(TraversalOrder || (TraversalOrder = {})); + +function useAutoScroller(_ref) { + let { + acceleration, + activator = AutoScrollActivator.Pointer, + canScroll, + draggingRect, + enabled, + interval = 5, + order = TraversalOrder.TreeOrder, + pointerCoordinates, + scrollableAncestors, + scrollableAncestorRects, + delta, + threshold + } = _ref; + const scrollIntent = useScrollIntent({ + delta, + disabled: !enabled + }); + const [setAutoScrollInterval, clearAutoScrollInterval] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useInterval)(); + const scrollSpeed = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + x: 0, + y: 0 + }); + const scrollDirection = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + x: 0, + y: 0 + }); + const rect = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + switch (activator) { + case AutoScrollActivator.Pointer: + return pointerCoordinates ? { + top: pointerCoordinates.y, + bottom: pointerCoordinates.y, + left: pointerCoordinates.x, + right: pointerCoordinates.x + } : null; + + case AutoScrollActivator.DraggableRect: + return draggingRect; + } + }, [activator, draggingRect, pointerCoordinates]); + const scrollContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const autoScroll = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => { + const scrollContainer = scrollContainerRef.current; + + if (!scrollContainer) { + return; + } + + const scrollLeft = scrollSpeed.current.x * scrollDirection.current.x; + const scrollTop = scrollSpeed.current.y * scrollDirection.current.y; + scrollContainer.scrollBy(scrollLeft, scrollTop); + }, []); + const sortedScrollableAncestors = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => order === TraversalOrder.TreeOrder ? [...scrollableAncestors].reverse() : scrollableAncestors, [order, scrollableAncestors]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!enabled || !scrollableAncestors.length || !rect) { + clearAutoScrollInterval(); + return; + } + + for (const scrollContainer of sortedScrollableAncestors) { + if ((canScroll == null ? void 0 : canScroll(scrollContainer)) === false) { + continue; + } + + const index = scrollableAncestors.indexOf(scrollContainer); + const scrollContainerRect = scrollableAncestorRects[index]; + + if (!scrollContainerRect) { + continue; + } + + const { + direction, + speed + } = getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, rect, acceleration, threshold); + + for (const axis of ['x', 'y']) { + if (!scrollIntent[axis][direction[axis]]) { + speed[axis] = 0; + direction[axis] = 0; + } + } + + if (speed.x > 0 || speed.y > 0) { + clearAutoScrollInterval(); + scrollContainerRef.current = scrollContainer; + setAutoScrollInterval(autoScroll, interval); + scrollSpeed.current = speed; + scrollDirection.current = direction; + return; + } + } + + scrollSpeed.current = { + x: 0, + y: 0 + }; + scrollDirection.current = { + x: 0, + y: 0 + }; + clearAutoScrollInterval(); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [acceleration, autoScroll, canScroll, clearAutoScrollInterval, enabled, interval, // eslint-disable-next-line react-hooks/exhaustive-deps + JSON.stringify(rect), // eslint-disable-next-line react-hooks/exhaustive-deps + JSON.stringify(scrollIntent), setAutoScrollInterval, scrollableAncestors, sortedScrollableAncestors, scrollableAncestorRects, // eslint-disable-next-line react-hooks/exhaustive-deps + JSON.stringify(threshold)]); +} +const defaultScrollIntent = { + x: { + [Direction.Backward]: false, + [Direction.Forward]: false + }, + y: { + [Direction.Backward]: false, + [Direction.Forward]: false + } +}; + +function useScrollIntent(_ref2) { + let { + delta, + disabled + } = _ref2; + const previousDelta = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(delta); + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousIntent => { + if (disabled || !previousDelta || !previousIntent) { + // Reset scroll intent tracking when auto-scrolling is disabled + return defaultScrollIntent; + } + + const direction = { + x: Math.sign(delta.x - previousDelta.x), + y: Math.sign(delta.y - previousDelta.y) + }; // Keep track of the user intent to scroll in each direction for both axis + + return { + x: { + [Direction.Backward]: previousIntent.x[Direction.Backward] || direction.x === -1, + [Direction.Forward]: previousIntent.x[Direction.Forward] || direction.x === 1 + }, + y: { + [Direction.Backward]: previousIntent.y[Direction.Backward] || direction.y === -1, + [Direction.Forward]: previousIntent.y[Direction.Forward] || direction.y === 1 + } + }; + }, [disabled, delta, previousDelta]); +} + +function useCachedNode(draggableNodes, id) { + const draggableNode = id != null ? draggableNodes.get(id) : undefined; + const node = draggableNode ? draggableNode.node.current : null; + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(cachedNode => { + var _ref; + + if (id == null) { + return null; + } // In some cases, the draggable node can unmount while dragging + // This is the case for virtualized lists. In those situations, + // we fall back to the last known value for that node. + + + return (_ref = node != null ? node : cachedNode) != null ? _ref : null; + }, [node, id]); +} + +function useCombineActivators(sensors, getSyntheticHandler) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => sensors.reduce((accumulator, sensor) => { + const { + sensor: Sensor + } = sensor; + const sensorActivators = Sensor.activators.map(activator => ({ + eventName: activator.eventName, + handler: getSyntheticHandler(activator.handler, sensor) + })); + return [...accumulator, ...sensorActivators]; + }, []), [sensors, getSyntheticHandler]); +} + +var MeasuringStrategy; + +(function (MeasuringStrategy) { + MeasuringStrategy[MeasuringStrategy["Always"] = 0] = "Always"; + MeasuringStrategy[MeasuringStrategy["BeforeDragging"] = 1] = "BeforeDragging"; + MeasuringStrategy[MeasuringStrategy["WhileDragging"] = 2] = "WhileDragging"; +})(MeasuringStrategy || (MeasuringStrategy = {})); + +var MeasuringFrequency; + +(function (MeasuringFrequency) { + MeasuringFrequency["Optimized"] = "optimized"; +})(MeasuringFrequency || (MeasuringFrequency = {})); + +const defaultValue = /*#__PURE__*/new Map(); +function useDroppableMeasuring(containers, _ref) { + let { + dragging, + dependencies, + config + } = _ref; + const [queue, setQueue] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const { + frequency, + measure, + strategy + } = config; + const containersRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(containers); + const disabled = isDisabled(); + const disabledRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(disabled); + const measureDroppableContainers = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (ids) { + if (ids === void 0) { + ids = []; + } + + if (disabledRef.current) { + return; + } + + setQueue(value => { + if (value === null) { + return ids; + } + + return value.concat(ids.filter(id => !value.includes(id))); + }); + }, [disabledRef]); + const timeoutId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const droppableRects = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousValue => { + if (disabled && !dragging) { + return defaultValue; + } + + if (!previousValue || previousValue === defaultValue || containersRef.current !== containers || queue != null) { + const map = new Map(); + + for (let container of containers) { + if (!container) { + continue; + } + + if (queue && queue.length > 0 && !queue.includes(container.id) && container.rect.current) { + // This container does not need to be re-measured + map.set(container.id, container.rect.current); + continue; + } + + const node = container.node.current; + const rect = node ? new Rect(measure(node), node) : null; + container.rect.current = rect; + + if (rect) { + map.set(container.id, rect); + } + } + + return map; + } + + return previousValue; + }, [containers, queue, dragging, disabled, measure]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + containersRef.current = containers; + }, [containers]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled) { + return; + } + + measureDroppableContainers(); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [dragging, disabled]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (queue && queue.length > 0) { + setQueue(null); + } + }, //eslint-disable-next-line react-hooks/exhaustive-deps + [JSON.stringify(queue)]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled || typeof frequency !== 'number' || timeoutId.current !== null) { + return; + } + + timeoutId.current = setTimeout(() => { + measureDroppableContainers(); + timeoutId.current = null; + }, frequency); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [frequency, disabled, measureDroppableContainers, ...dependencies]); + return { + droppableRects, + measureDroppableContainers, + measuringScheduled: queue != null + }; + + function isDisabled() { + switch (strategy) { + case MeasuringStrategy.Always: + return false; + + case MeasuringStrategy.BeforeDragging: + return dragging; + + default: + return !dragging; + } + } +} + +function useInitialValue(value, computeFn) { + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousValue => { + if (!value) { + return null; + } + + if (previousValue) { + return previousValue; + } + + return typeof computeFn === 'function' ? computeFn(value) : value; + }, [computeFn, value]); +} + +function useInitialRect(node, measure) { + return useInitialValue(node, measure); +} + +/** + * Returns a new MutationObserver instance. + * If `MutationObserver` is undefined in the execution environment, returns `undefined`. + */ + +function useMutationObserver(_ref) { + let { + callback, + disabled + } = _ref; + const handleMutations = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useEvent)(callback); + const mutationObserver = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (disabled || typeof window === 'undefined' || typeof window.MutationObserver === 'undefined') { + return undefined; + } + + const { + MutationObserver + } = window; + return new MutationObserver(handleMutations); + }, [handleMutations, disabled]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + return () => mutationObserver == null ? void 0 : mutationObserver.disconnect(); + }, [mutationObserver]); + return mutationObserver; +} + +/** + * Returns a new ResizeObserver instance bound to the `onResize` callback. + * If `ResizeObserver` is undefined in the execution environment, returns `undefined`. + */ + +function useResizeObserver(_ref) { + let { + callback, + disabled + } = _ref; + const handleResize = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useEvent)(callback); + const resizeObserver = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (disabled || typeof window === 'undefined' || typeof window.ResizeObserver === 'undefined') { + return undefined; + } + + const { + ResizeObserver + } = window; + return new ResizeObserver(handleResize); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [disabled]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + return () => resizeObserver == null ? void 0 : resizeObserver.disconnect(); + }, [resizeObserver]); + return resizeObserver; +} + +function defaultMeasure(element) { + return new Rect(getClientRect(element), element); +} + +function useRect(element, measure, fallbackRect) { + if (measure === void 0) { + measure = defaultMeasure; + } + + const [rect, setRect] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + + function measureRect() { + setRect(currentRect => { + if (!element) { + return null; + } + + if (element.isConnected === false) { + var _ref; + + // Fall back to last rect we measured if the element is + // no longer connected to the DOM. + return (_ref = currentRect != null ? currentRect : fallbackRect) != null ? _ref : null; + } + + const newRect = measure(element); + + if (JSON.stringify(currentRect) === JSON.stringify(newRect)) { + return currentRect; + } + + return newRect; + }); + } + + const mutationObserver = useMutationObserver({ + callback(records) { + if (!element) { + return; + } + + for (const record of records) { + const { + type, + target + } = record; + + if (type === 'childList' && target instanceof HTMLElement && target.contains(element)) { + measureRect(); + break; + } + } + } + + }); + const resizeObserver = useResizeObserver({ + callback: measureRect + }); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + measureRect(); + + if (element) { + resizeObserver == null ? void 0 : resizeObserver.observe(element); + mutationObserver == null ? void 0 : mutationObserver.observe(document.body, { + childList: true, + subtree: true + }); + } else { + resizeObserver == null ? void 0 : resizeObserver.disconnect(); + mutationObserver == null ? void 0 : mutationObserver.disconnect(); + } + }, [element]); + return rect; +} + +function useRectDelta(rect) { + const initialRect = useInitialValue(rect); + return getRectDelta(rect, initialRect); +} + +const defaultValue$1 = []; +function useScrollableAncestors(node) { + const previousNode = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(node); + const ancestors = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousValue => { + if (!node) { + return defaultValue$1; + } + + if (previousValue && previousValue !== defaultValue$1 && node && previousNode.current && node.parentNode === previousNode.current.parentNode) { + return previousValue; + } + + return getScrollableAncestors(node); + }, [node]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + previousNode.current = node; + }, [node]); + return ancestors; +} + +function useScrollOffsets(elements) { + const [scrollCoordinates, setScrollCoordinates] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const prevElements = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(elements); // To-do: Throttle the handleScroll callback + + const handleScroll = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(event => { + const scrollingElement = getScrollableElement(event.target); + + if (!scrollingElement) { + return; + } + + setScrollCoordinates(scrollCoordinates => { + if (!scrollCoordinates) { + return null; + } + + scrollCoordinates.set(scrollingElement, getScrollCoordinates(scrollingElement)); + return new Map(scrollCoordinates); + }); + }, []); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const previousElements = prevElements.current; + + if (elements !== previousElements) { + cleanup(previousElements); + const entries = elements.map(element => { + const scrollableElement = getScrollableElement(element); + + if (scrollableElement) { + scrollableElement.addEventListener('scroll', handleScroll, { + passive: true + }); + return [scrollableElement, getScrollCoordinates(scrollableElement)]; + } + + return null; + }).filter(entry => entry != null); + setScrollCoordinates(entries.length ? new Map(entries) : null); + prevElements.current = elements; + } + + return () => { + cleanup(elements); + cleanup(previousElements); + }; + + function cleanup(elements) { + elements.forEach(element => { + const scrollableElement = getScrollableElement(element); + scrollableElement == null ? void 0 : scrollableElement.removeEventListener('scroll', handleScroll); + }); + } + }, [handleScroll, elements]); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (elements.length) { + return scrollCoordinates ? Array.from(scrollCoordinates.values()).reduce((acc, coordinates) => (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(acc, coordinates), defaultCoordinates) : getScrollOffsets(elements); + } + + return defaultCoordinates; + }, [elements, scrollCoordinates]); +} + +function useScrollOffsetsDelta(scrollOffsets, dependencies) { + if (dependencies === void 0) { + dependencies = []; + } + + const initialScrollOffsets = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + initialScrollOffsets.current = null; + }, // eslint-disable-next-line react-hooks/exhaustive-deps + dependencies); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const hasScrollOffsets = scrollOffsets !== defaultCoordinates; + + if (hasScrollOffsets && !initialScrollOffsets.current) { + initialScrollOffsets.current = scrollOffsets; + } + + if (!hasScrollOffsets && initialScrollOffsets.current) { + initialScrollOffsets.current = null; + } + }, [scrollOffsets]); + return initialScrollOffsets.current ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(scrollOffsets, initialScrollOffsets.current) : defaultCoordinates; +} + +function useSensorSetup(sensors) { + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.canUseDOM) { + return; + } + + const teardownFns = sensors.map(_ref => { + let { + sensor + } = _ref; + return sensor.setup == null ? void 0 : sensor.setup(); + }); + return () => { + for (const teardown of teardownFns) { + teardown == null ? void 0 : teardown(); + } + }; + }, // TO-DO: Sensors length could theoretically change which would not be a valid dependency + // eslint-disable-next-line react-hooks/exhaustive-deps + sensors.map(_ref2 => { + let { + sensor + } = _ref2; + return sensor; + })); +} + +function useSyntheticListeners(listeners, id) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + return listeners.reduce((acc, _ref) => { + let { + eventName, + handler + } = _ref; + + acc[eventName] = event => { + handler(event, id); + }; + + return acc; + }, {}); + }, [listeners, id]); +} + +function useWindowRect(element) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => element ? getWindowClientRect(element) : null, [element]); +} + +const defaultValue$2 = []; +function useRects(elements, measure) { + if (measure === void 0) { + measure = getClientRect; + } + + const [firstElement] = elements; + const windowRect = useWindowRect(firstElement ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(firstElement) : null); + const [rects, setRects] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(defaultValue$2); + + function measureRects() { + setRects(() => { + if (!elements.length) { + return defaultValue$2; + } + + return elements.map(element => isDocumentScrollingElement(element) ? windowRect : new Rect(measure(element), element)); + }); + } + + const resizeObserver = useResizeObserver({ + callback: measureRects + }); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + resizeObserver == null ? void 0 : resizeObserver.disconnect(); + measureRects(); + elements.forEach(element => resizeObserver == null ? void 0 : resizeObserver.observe(element)); + }, [elements]); + return rects; +} + +function getMeasurableNode(node) { + if (!node) { + return null; + } + + if (node.children.length > 1) { + return node; + } + + const firstChild = node.children[0]; + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(firstChild) ? firstChild : node; +} + +function useDragOverlayMeasuring(_ref) { + let { + measure + } = _ref; + const [rect, setRect] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const handleResize = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(entries => { + for (const { + target + } of entries) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(target)) { + setRect(rect => { + const newRect = measure(target); + return rect ? { ...rect, + width: newRect.width, + height: newRect.height + } : newRect; + }); + break; + } + } + }, [measure]); + const resizeObserver = useResizeObserver({ + callback: handleResize + }); + const handleNodeChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(element => { + const node = getMeasurableNode(element); + resizeObserver == null ? void 0 : resizeObserver.disconnect(); + + if (node) { + resizeObserver == null ? void 0 : resizeObserver.observe(node); + } + + setRect(node ? measure(node) : null); + }, [measure, resizeObserver]); + const [nodeRef, setRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(handleNodeChange); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + nodeRef, + rect, + setRef + }), [rect, nodeRef, setRef]); +} + +const defaultSensors = [{ + sensor: PointerSensor, + options: {} +}, { + sensor: KeyboardSensor, + options: {} +}]; +const defaultData = { + current: {} +}; +const defaultMeasuringConfiguration = { + draggable: { + measure: getTransformAgnosticClientRect + }, + droppable: { + measure: getTransformAgnosticClientRect, + strategy: MeasuringStrategy.WhileDragging, + frequency: MeasuringFrequency.Optimized + }, + dragOverlay: { + measure: getClientRect + } +}; + +class DroppableContainersMap extends Map { + get(id) { + var _super$get; + + return id != null ? (_super$get = super.get(id)) != null ? _super$get : undefined : undefined; + } + + toArray() { + return Array.from(this.values()); + } + + getEnabled() { + return this.toArray().filter(_ref => { + let { + disabled + } = _ref; + return !disabled; + }); + } + + getNodeFor(id) { + var _this$get$node$curren, _this$get; + + return (_this$get$node$curren = (_this$get = this.get(id)) == null ? void 0 : _this$get.node.current) != null ? _this$get$node$curren : undefined; + } + +} + +const defaultPublicContext = { + activatorEvent: null, + active: null, + activeNode: null, + activeNodeRect: null, + collisions: null, + containerNodeRect: null, + draggableNodes: /*#__PURE__*/new Map(), + droppableRects: /*#__PURE__*/new Map(), + droppableContainers: /*#__PURE__*/new DroppableContainersMap(), + over: null, + dragOverlay: { + nodeRef: { + current: null + }, + rect: null, + setRef: noop + }, + scrollableAncestors: [], + scrollableAncestorRects: [], + measuringConfiguration: defaultMeasuringConfiguration, + measureDroppableContainers: noop, + windowRect: null, + measuringScheduled: false +}; +const defaultInternalContext = { + activatorEvent: null, + activators: [], + active: null, + activeNodeRect: null, + ariaDescribedById: { + draggable: '' + }, + dispatch: noop, + draggableNodes: /*#__PURE__*/new Map(), + over: null, + measureDroppableContainers: noop +}; +const InternalContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(defaultInternalContext); +const PublicContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(defaultPublicContext); + +function getInitialState() { + return { + draggable: { + active: null, + initialCoordinates: { + x: 0, + y: 0 + }, + nodes: new Map(), + translate: { + x: 0, + y: 0 + } + }, + droppable: { + containers: new DroppableContainersMap() + } + }; +} +function reducer(state, action) { + switch (action.type) { + case Action.DragStart: + return { ...state, + draggable: { ...state.draggable, + initialCoordinates: action.initialCoordinates, + active: action.active + } + }; + + case Action.DragMove: + if (state.draggable.active == null) { + return state; + } + + return { ...state, + draggable: { ...state.draggable, + translate: { + x: action.coordinates.x - state.draggable.initialCoordinates.x, + y: action.coordinates.y - state.draggable.initialCoordinates.y + } + } + }; + + case Action.DragEnd: + case Action.DragCancel: + return { ...state, + draggable: { ...state.draggable, + active: null, + initialCoordinates: { + x: 0, + y: 0 + }, + translate: { + x: 0, + y: 0 + } + } + }; + + case Action.RegisterDroppable: + { + const { + element + } = action; + const { + id + } = element; + const containers = new DroppableContainersMap(state.droppable.containers); + containers.set(id, element); + return { ...state, + droppable: { ...state.droppable, + containers + } + }; + } + + case Action.SetDroppableDisabled: + { + const { + id, + key, + disabled + } = action; + const element = state.droppable.containers.get(id); + + if (!element || key !== element.key) { + return state; + } + + const containers = new DroppableContainersMap(state.droppable.containers); + containers.set(id, { ...element, + disabled + }); + return { ...state, + droppable: { ...state.droppable, + containers + } + }; + } + + case Action.UnregisterDroppable: + { + const { + id, + key + } = action; + const element = state.droppable.containers.get(id); + + if (!element || key !== element.key) { + return state; + } + + const containers = new DroppableContainersMap(state.droppable.containers); + containers.delete(id); + return { ...state, + droppable: { ...state.droppable, + containers + } + }; + } + + default: + { + return state; + } + } +} + +function RestoreFocus(_ref) { + let { + disabled + } = _ref; + const { + active, + activatorEvent, + draggableNodes + } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(InternalContext); + const previousActivatorEvent = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(activatorEvent); + const previousActiveId = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(active == null ? void 0 : active.id); // Restore keyboard focus on the activator node + + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled) { + return; + } + + if (!activatorEvent && previousActivatorEvent && previousActiveId != null) { + if (!(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(previousActivatorEvent)) { + return; + } + + if (document.activeElement === previousActivatorEvent.target) { + // No need to restore focus + return; + } + + const draggableNode = draggableNodes.get(previousActiveId); + + if (!draggableNode) { + return; + } + + const { + activatorNode, + node + } = draggableNode; + + if (!activatorNode.current && !node.current) { + return; + } + + requestAnimationFrame(() => { + for (const element of [activatorNode.current, node.current]) { + if (!element) { + continue; + } + + const focusableNode = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.findFirstFocusableNode)(element); + + if (focusableNode) { + focusableNode.focus(); + break; + } + } + }); + } + }, [activatorEvent, disabled, draggableNodes, previousActiveId, previousActivatorEvent]); + return null; +} + +function applyModifiers(modifiers, _ref) { + let { + transform, + ...args + } = _ref; + return modifiers != null && modifiers.length ? modifiers.reduce((accumulator, modifier) => { + return modifier({ + transform: accumulator, + ...args + }); + }, transform) : transform; +} + +function useMeasuringConfiguration(config) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + draggable: { ...defaultMeasuringConfiguration.draggable, + ...(config == null ? void 0 : config.draggable) + }, + droppable: { ...defaultMeasuringConfiguration.droppable, + ...(config == null ? void 0 : config.droppable) + }, + dragOverlay: { ...defaultMeasuringConfiguration.dragOverlay, + ...(config == null ? void 0 : config.dragOverlay) + } + }), // eslint-disable-next-line react-hooks/exhaustive-deps + [config == null ? void 0 : config.draggable, config == null ? void 0 : config.droppable, config == null ? void 0 : config.dragOverlay]); +} + +function useLayoutShiftScrollCompensation(_ref) { + let { + activeNode, + measure, + initialRect, + config = true + } = _ref; + const initialized = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false); + const { + x, + y + } = typeof config === 'boolean' ? { + x: config, + y: config + } : config; + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + const disabled = !x && !y; + + if (disabled || !activeNode) { + initialized.current = false; + return; + } + + if (initialized.current || !initialRect) { + // Return early if layout shift scroll compensation was already attempted + // or if there is no initialRect to compare to. + return; + } // Get the most up to date node ref for the active draggable + + + const node = activeNode == null ? void 0 : activeNode.node.current; + + if (!node || node.isConnected === false) { + // Return early if there is no attached node ref or if the node is + // disconnected from the document. + return; + } + + const rect = measure(node); + const rectDelta = getRectDelta(rect, initialRect); + + if (!x) { + rectDelta.x = 0; + } + + if (!y) { + rectDelta.y = 0; + } // Only perform layout shift scroll compensation once + + + initialized.current = true; + + if (Math.abs(rectDelta.x) > 0 || Math.abs(rectDelta.y) > 0) { + const firstScrollableAncestor = getFirstScrollableAncestor(node); + + if (firstScrollableAncestor) { + firstScrollableAncestor.scrollBy({ + top: rectDelta.y, + left: rectDelta.x + }); + } + } + }, [activeNode, x, y, initialRect, measure]); +} + +const ActiveDraggableContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({ ...defaultCoordinates, + scaleX: 1, + scaleY: 1 +}); +var Status; + +(function (Status) { + Status[Status["Uninitialized"] = 0] = "Uninitialized"; + Status[Status["Initializing"] = 1] = "Initializing"; + Status[Status["Initialized"] = 2] = "Initialized"; +})(Status || (Status = {})); + +const DndContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(function DndContext(_ref) { + var _sensorContext$curren, _dragOverlay$nodeRef$, _dragOverlay$rect, _over$rect; + + let { + id, + accessibility, + autoScroll = true, + children, + sensors = defaultSensors, + collisionDetection = rectIntersection, + measuring, + modifiers, + ...props + } = _ref; + const store = (0,react__WEBPACK_IMPORTED_MODULE_0__.useReducer)(reducer, undefined, getInitialState); + const [state, dispatch] = store; + const [dispatchMonitorEvent, registerMonitorListener] = useDndMonitorProvider(); + const [status, setStatus] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(Status.Uninitialized); + const isInitialized = status === Status.Initialized; + const { + draggable: { + active: activeId, + nodes: draggableNodes, + translate + }, + droppable: { + containers: droppableContainers + } + } = state; + const node = activeId != null ? draggableNodes.get(activeId) : null; + const activeRects = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + initial: null, + translated: null + }); + const active = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + var _node$data; + + return activeId != null ? { + id: activeId, + // It's possible for the active node to unmount while dragging + data: (_node$data = node == null ? void 0 : node.data) != null ? _node$data : defaultData, + rect: activeRects + } : null; + }, [activeId, node]); + const activeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const [activeSensor, setActiveSensor] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const [activatorEvent, setActivatorEvent] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const latestProps = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(props, Object.values(props)); + const draggableDescribedById = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)("DndDescribedBy", id); + const enabledDroppableContainers = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => droppableContainers.getEnabled(), [droppableContainers]); + const measuringConfiguration = useMeasuringConfiguration(measuring); + const { + droppableRects, + measureDroppableContainers, + measuringScheduled + } = useDroppableMeasuring(enabledDroppableContainers, { + dragging: isInitialized, + dependencies: [translate.x, translate.y], + config: measuringConfiguration.droppable + }); + const activeNode = useCachedNode(draggableNodes, activeId); + const activationCoordinates = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => activatorEvent ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(activatorEvent) : null, [activatorEvent]); + const autoScrollOptions = getAutoScrollerOptions(); + const initialActiveNodeRect = useInitialRect(activeNode, measuringConfiguration.draggable.measure); + useLayoutShiftScrollCompensation({ + activeNode: activeId != null ? draggableNodes.get(activeId) : null, + config: autoScrollOptions.layoutShiftCompensation, + initialRect: initialActiveNodeRect, + measure: measuringConfiguration.draggable.measure + }); + const activeNodeRect = useRect(activeNode, measuringConfiguration.draggable.measure, initialActiveNodeRect); + const containerNodeRect = useRect(activeNode ? activeNode.parentElement : null); + const sensorContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + activatorEvent: null, + active: null, + activeNode, + collisionRect: null, + collisions: null, + droppableRects, + draggableNodes, + draggingNode: null, + draggingNodeRect: null, + droppableContainers, + over: null, + scrollableAncestors: [], + scrollAdjustedTranslate: null + }); + const overNode = droppableContainers.getNodeFor((_sensorContext$curren = sensorContext.current.over) == null ? void 0 : _sensorContext$curren.id); + const dragOverlay = useDragOverlayMeasuring({ + measure: measuringConfiguration.dragOverlay.measure + }); // Use the rect of the drag overlay if it is mounted + + const draggingNode = (_dragOverlay$nodeRef$ = dragOverlay.nodeRef.current) != null ? _dragOverlay$nodeRef$ : activeNode; + const draggingNodeRect = isInitialized ? (_dragOverlay$rect = dragOverlay.rect) != null ? _dragOverlay$rect : activeNodeRect : null; + const usesDragOverlay = Boolean(dragOverlay.nodeRef.current && dragOverlay.rect); // The delta between the previous and new position of the draggable node + // is only relevant when there is no drag overlay + + const nodeRectDelta = useRectDelta(usesDragOverlay ? null : activeNodeRect); // Get the window rect of the dragging node + + const windowRect = useWindowRect(draggingNode ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(draggingNode) : null); // Get scrollable ancestors of the dragging node + + const scrollableAncestors = useScrollableAncestors(isInitialized ? overNode != null ? overNode : activeNode : null); + const scrollableAncestorRects = useRects(scrollableAncestors); // Apply modifiers + + const modifiedTranslate = applyModifiers(modifiers, { + transform: { + x: translate.x - nodeRectDelta.x, + y: translate.y - nodeRectDelta.y, + scaleX: 1, + scaleY: 1 + }, + activatorEvent, + active, + activeNodeRect, + containerNodeRect, + draggingNodeRect, + over: sensorContext.current.over, + overlayNodeRect: dragOverlay.rect, + scrollableAncestors, + scrollableAncestorRects, + windowRect + }); + const pointerCoordinates = activationCoordinates ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(activationCoordinates, translate) : null; + const scrollOffsets = useScrollOffsets(scrollableAncestors); // Represents the scroll delta since dragging was initiated + + const scrollAdjustment = useScrollOffsetsDelta(scrollOffsets); // Represents the scroll delta since the last time the active node rect was measured + + const activeNodeScrollDelta = useScrollOffsetsDelta(scrollOffsets, [activeNodeRect]); + const scrollAdjustedTranslate = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(modifiedTranslate, scrollAdjustment); + const collisionRect = draggingNodeRect ? getAdjustedRect(draggingNodeRect, modifiedTranslate) : null; + const collisions = active && collisionRect ? collisionDetection({ + active, + collisionRect, + droppableRects, + droppableContainers: enabledDroppableContainers, + pointerCoordinates + }) : null; + const overId = getFirstCollision(collisions, 'id'); + const [over, setOver] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); // When there is no drag overlay used, we need to account for the + // window scroll delta + + const appliedTranslate = usesDragOverlay ? modifiedTranslate : (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(modifiedTranslate, activeNodeScrollDelta); + const transform = adjustScale(appliedTranslate, (_over$rect = over == null ? void 0 : over.rect) != null ? _over$rect : null, activeNodeRect); + const activeSensorRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const instantiateSensor = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((event, _ref2) => { + let { + sensor: Sensor, + options + } = _ref2; + + if (activeRef.current == null) { + return; + } + + const activeNode = draggableNodes.get(activeRef.current); + + if (!activeNode) { + return; + } + + const activatorEvent = event.nativeEvent; + const sensorInstance = new Sensor({ + active: activeRef.current, + activeNode, + event: activatorEvent, + options, + // Sensors need to be instantiated with refs for arguments that change over time + // otherwise they are frozen in time with the stale arguments + context: sensorContext, + + onAbort(id) { + const draggableNode = draggableNodes.get(id); + + if (!draggableNode) { + return; + } + + const { + onDragAbort + } = latestProps.current; + const event = { + id + }; + onDragAbort == null ? void 0 : onDragAbort(event); + dispatchMonitorEvent({ + type: 'onDragAbort', + event + }); + }, + + onPending(id, constraint, initialCoordinates, offset) { + const draggableNode = draggableNodes.get(id); + + if (!draggableNode) { + return; + } + + const { + onDragPending + } = latestProps.current; + const event = { + id, + constraint, + initialCoordinates, + offset + }; + onDragPending == null ? void 0 : onDragPending(event); + dispatchMonitorEvent({ + type: 'onDragPending', + event + }); + }, + + onStart(initialCoordinates) { + const id = activeRef.current; + + if (id == null) { + return; + } + + const draggableNode = draggableNodes.get(id); + + if (!draggableNode) { + return; + } + + const { + onDragStart + } = latestProps.current; + const event = { + activatorEvent, + active: { + id, + data: draggableNode.data, + rect: activeRects + } + }; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + onDragStart == null ? void 0 : onDragStart(event); + setStatus(Status.Initializing); + dispatch({ + type: Action.DragStart, + initialCoordinates, + active: id + }); + dispatchMonitorEvent({ + type: 'onDragStart', + event + }); + setActiveSensor(activeSensorRef.current); + setActivatorEvent(activatorEvent); + }); + }, + + onMove(coordinates) { + dispatch({ + type: Action.DragMove, + coordinates + }); + }, + + onEnd: createHandler(Action.DragEnd), + onCancel: createHandler(Action.DragCancel) + }); + activeSensorRef.current = sensorInstance; + + function createHandler(type) { + return async function handler() { + const { + active, + collisions, + over, + scrollAdjustedTranslate + } = sensorContext.current; + let event = null; + + if (active && scrollAdjustedTranslate) { + const { + cancelDrop + } = latestProps.current; + event = { + activatorEvent, + active: active, + collisions, + delta: scrollAdjustedTranslate, + over + }; + + if (type === Action.DragEnd && typeof cancelDrop === 'function') { + const shouldCancel = await Promise.resolve(cancelDrop(event)); + + if (shouldCancel) { + type = Action.DragCancel; + } + } + } + + activeRef.current = null; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + dispatch({ + type + }); + setStatus(Status.Uninitialized); + setOver(null); + setActiveSensor(null); + setActivatorEvent(null); + activeSensorRef.current = null; + const eventName = type === Action.DragEnd ? 'onDragEnd' : 'onDragCancel'; + + if (event) { + const handler = latestProps.current[eventName]; + handler == null ? void 0 : handler(event); + dispatchMonitorEvent({ + type: eventName, + event + }); + } + }); + }; + } + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [draggableNodes]); + const bindActivatorToSensorInstantiator = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((handler, sensor) => { + return (event, active) => { + const nativeEvent = event.nativeEvent; + const activeDraggableNode = draggableNodes.get(active); + + if ( // Another sensor is already instantiating + activeRef.current !== null || // No active draggable + !activeDraggableNode || // Event has already been captured + nativeEvent.dndKit || nativeEvent.defaultPrevented) { + return; + } + + const activationContext = { + active: activeDraggableNode + }; + const shouldActivate = handler(event, sensor.options, activationContext); + + if (shouldActivate === true) { + nativeEvent.dndKit = { + capturedBy: sensor.sensor + }; + activeRef.current = active; + instantiateSensor(event, sensor); + } + }; + }, [draggableNodes, instantiateSensor]); + const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator); + useSensorSetup(sensors); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + if (activeNodeRect && status === Status.Initializing) { + setStatus(Status.Initialized); + } + }, [activeNodeRect, status]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const { + onDragMove + } = latestProps.current; + const { + active, + activatorEvent, + collisions, + over + } = sensorContext.current; + + if (!active || !activatorEvent) { + return; + } + + const event = { + active, + activatorEvent, + collisions, + delta: { + x: scrollAdjustedTranslate.x, + y: scrollAdjustedTranslate.y + }, + over + }; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + onDragMove == null ? void 0 : onDragMove(event); + dispatchMonitorEvent({ + type: 'onDragMove', + event + }); + }); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [scrollAdjustedTranslate.x, scrollAdjustedTranslate.y]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const { + active, + activatorEvent, + collisions, + droppableContainers, + scrollAdjustedTranslate + } = sensorContext.current; + + if (!active || activeRef.current == null || !activatorEvent || !scrollAdjustedTranslate) { + return; + } + + const { + onDragOver + } = latestProps.current; + const overContainer = droppableContainers.get(overId); + const over = overContainer && overContainer.rect.current ? { + id: overContainer.id, + rect: overContainer.rect.current, + data: overContainer.data, + disabled: overContainer.disabled + } : null; + const event = { + active, + activatorEvent, + collisions, + delta: { + x: scrollAdjustedTranslate.x, + y: scrollAdjustedTranslate.y + }, + over + }; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + setOver(over); + onDragOver == null ? void 0 : onDragOver(event); + dispatchMonitorEvent({ + type: 'onDragOver', + event + }); + }); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [overId]); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + sensorContext.current = { + activatorEvent, + active, + activeNode, + collisionRect, + collisions, + droppableRects, + draggableNodes, + draggingNode, + draggingNodeRect, + droppableContainers, + over, + scrollableAncestors, + scrollAdjustedTranslate + }; + activeRects.current = { + initial: draggingNodeRect, + translated: collisionRect + }; + }, [active, activeNode, collisions, collisionRect, draggableNodes, draggingNode, draggingNodeRect, droppableRects, droppableContainers, over, scrollableAncestors, scrollAdjustedTranslate]); + useAutoScroller({ ...autoScrollOptions, + delta: translate, + draggingRect: collisionRect, + pointerCoordinates, + scrollableAncestors, + scrollableAncestorRects + }); + const publicContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + const context = { + active, + activeNode, + activeNodeRect, + activatorEvent, + collisions, + containerNodeRect, + dragOverlay, + draggableNodes, + droppableContainers, + droppableRects, + over, + measureDroppableContainers, + scrollableAncestors, + scrollableAncestorRects, + measuringConfiguration, + measuringScheduled, + windowRect + }; + return context; + }, [active, activeNode, activeNodeRect, activatorEvent, collisions, containerNodeRect, dragOverlay, draggableNodes, droppableContainers, droppableRects, over, measureDroppableContainers, scrollableAncestors, scrollableAncestorRects, measuringConfiguration, measuringScheduled, windowRect]); + const internalContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + const context = { + activatorEvent, + activators, + active, + activeNodeRect, + ariaDescribedById: { + draggable: draggableDescribedById + }, + dispatch, + draggableNodes, + over, + measureDroppableContainers + }; + return context; + }, [activatorEvent, activators, active, activeNodeRect, dispatch, draggableDescribedById, draggableNodes, over, measureDroppableContainers]); + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(DndMonitorContext.Provider, { + value: registerMonitorListener + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(InternalContext.Provider, { + value: internalContext + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PublicContext.Provider, { + value: publicContext + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ActiveDraggableContext.Provider, { + value: transform + }, children)), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RestoreFocus, { + disabled: (accessibility == null ? void 0 : accessibility.restoreFocus) === false + })), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Accessibility, { ...accessibility, + hiddenTextDescribedById: draggableDescribedById + })); + + function getAutoScrollerOptions() { + const activeSensorDisablesAutoscroll = (activeSensor == null ? void 0 : activeSensor.autoScrollEnabled) === false; + const autoScrollGloballyDisabled = typeof autoScroll === 'object' ? autoScroll.enabled === false : autoScroll === false; + const enabled = isInitialized && !activeSensorDisablesAutoscroll && !autoScrollGloballyDisabled; + + if (typeof autoScroll === 'object') { + return { ...autoScroll, + enabled + }; + } + + return { + enabled + }; + } +}); + +const NullContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null); +const defaultRole = 'button'; +const ID_PREFIX = 'Draggable'; +function useDraggable(_ref) { + let { + id, + data, + disabled = false, + attributes + } = _ref; + const key = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)(ID_PREFIX); + const { + activators, + activatorEvent, + active, + activeNodeRect, + ariaDescribedById, + draggableNodes, + over + } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(InternalContext); + const { + role = defaultRole, + roleDescription = 'draggable', + tabIndex = 0 + } = attributes != null ? attributes : {}; + const isDragging = (active == null ? void 0 : active.id) === id; + const transform = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(isDragging ? ActiveDraggableContext : NullContext); + const [node, setNodeRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(); + const [activatorNode, setActivatorNodeRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(); + const listeners = useSyntheticListeners(activators, id); + const dataRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(data); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + draggableNodes.set(id, { + id, + key, + node, + activatorNode, + data: dataRef + }); + return () => { + const node = draggableNodes.get(id); + + if (node && node.key === key) { + draggableNodes.delete(id); + } + }; + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [draggableNodes, id]); + const memoizedAttributes = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + role, + tabIndex, + 'aria-disabled': disabled, + 'aria-pressed': isDragging && role === defaultRole ? true : undefined, + 'aria-roledescription': roleDescription, + 'aria-describedby': ariaDescribedById.draggable + }), [disabled, role, tabIndex, isDragging, roleDescription, ariaDescribedById.draggable]); + return { + active, + activatorEvent, + activeNodeRect, + attributes: memoizedAttributes, + isDragging, + listeners: disabled ? undefined : listeners, + node, + over, + setNodeRef, + setActivatorNodeRef, + transform + }; +} + +function useDndContext() { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(PublicContext); +} + +const ID_PREFIX$1 = 'Droppable'; +const defaultResizeObserverConfig = { + timeout: 25 +}; +function useDroppable(_ref) { + let { + data, + disabled = false, + id, + resizeObserverConfig + } = _ref; + const key = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)(ID_PREFIX$1); + const { + active, + dispatch, + over, + measureDroppableContainers + } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(InternalContext); + const previous = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + disabled + }); + const resizeObserverConnected = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false); + const rect = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const callbackId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const { + disabled: resizeObserverDisabled, + updateMeasurementsFor, + timeout: resizeObserverTimeout + } = { ...defaultResizeObserverConfig, + ...resizeObserverConfig + }; + const ids = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(updateMeasurementsFor != null ? updateMeasurementsFor : id); + const handleResize = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => { + if (!resizeObserverConnected.current) { + // ResizeObserver invokes the `handleResize` callback as soon as `observe` is called, + // assuming the element is rendered and displayed. + resizeObserverConnected.current = true; + return; + } + + if (callbackId.current != null) { + clearTimeout(callbackId.current); + } + + callbackId.current = setTimeout(() => { + measureDroppableContainers(Array.isArray(ids.current) ? ids.current : [ids.current]); + callbackId.current = null; + }, resizeObserverTimeout); + }, //eslint-disable-next-line react-hooks/exhaustive-deps + [resizeObserverTimeout]); + const resizeObserver = useResizeObserver({ + callback: handleResize, + disabled: resizeObserverDisabled || !active + }); + const handleNodeChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((newElement, previousElement) => { + if (!resizeObserver) { + return; + } + + if (previousElement) { + resizeObserver.unobserve(previousElement); + resizeObserverConnected.current = false; + } + + if (newElement) { + resizeObserver.observe(newElement); + } + }, [resizeObserver]); + const [nodeRef, setNodeRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(handleNodeChange); + const dataRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(data); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!resizeObserver || !nodeRef.current) { + return; + } + + resizeObserver.disconnect(); + resizeObserverConnected.current = false; + resizeObserver.observe(nodeRef.current); + }, [nodeRef, resizeObserver]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + dispatch({ + type: Action.RegisterDroppable, + element: { + id, + key, + disabled, + node: nodeRef, + rect, + data: dataRef + } + }); + return () => dispatch({ + type: Action.UnregisterDroppable, + key, + id + }); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [id]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled !== previous.current.disabled) { + dispatch({ + type: Action.SetDroppableDisabled, + id, + key, + disabled + }); + previous.current.disabled = disabled; + } + }, [id, key, disabled, dispatch]); + return { + active, + rect, + isOver: (over == null ? void 0 : over.id) === id, + node: nodeRef, + over, + setNodeRef + }; +} + +function AnimationManager(_ref) { + let { + animation, + children + } = _ref; + const [clonedChildren, setClonedChildren] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const [element, setElement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const previousChildren = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(children); + + if (!children && !clonedChildren && previousChildren) { + setClonedChildren(previousChildren); + } + + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + if (!element) { + return; + } + + const key = clonedChildren == null ? void 0 : clonedChildren.key; + const id = clonedChildren == null ? void 0 : clonedChildren.props.id; + + if (key == null || id == null) { + setClonedChildren(null); + return; + } + + Promise.resolve(animation(id, element)).then(() => { + setClonedChildren(null); + }); + }, [animation, clonedChildren, element]); + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, children, clonedChildren ? (0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(clonedChildren, { + ref: setElement + }) : null); +} + +const defaultTransform = { + x: 0, + y: 0, + scaleX: 1, + scaleY: 1 +}; +function NullifiedContextProvider(_ref) { + let { + children + } = _ref; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(InternalContext.Provider, { + value: defaultInternalContext + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ActiveDraggableContext.Provider, { + value: defaultTransform + }, children)); +} + +const baseStyles = { + position: 'fixed', + touchAction: 'none' +}; + +const defaultTransition = activatorEvent => { + const isKeyboardActivator = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(activatorEvent); + return isKeyboardActivator ? 'transform 250ms ease' : undefined; +}; + +const PositionedOverlay = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((_ref, ref) => { + let { + as, + activatorEvent, + adjustScale, + children, + className, + rect, + style, + transform, + transition = defaultTransition + } = _ref; + + if (!rect) { + return null; + } + + const scaleAdjustedTransform = adjustScale ? transform : { ...transform, + scaleX: 1, + scaleY: 1 + }; + const styles = { ...baseStyles, + width: rect.width, + height: rect.height, + top: rect.top, + left: rect.left, + transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(scaleAdjustedTransform), + transformOrigin: adjustScale && activatorEvent ? getRelativeTransformOrigin(activatorEvent, rect) : undefined, + transition: typeof transition === 'function' ? transition(activatorEvent) : transition, + ...style + }; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(as, { + className, + style: styles, + ref + }, children); +}); + +const defaultDropAnimationSideEffects = options => _ref => { + let { + active, + dragOverlay + } = _ref; + const originalStyles = {}; + const { + styles, + className + } = options; + + if (styles != null && styles.active) { + for (const [key, value] of Object.entries(styles.active)) { + if (value === undefined) { + continue; + } + + originalStyles[key] = active.node.style.getPropertyValue(key); + active.node.style.setProperty(key, value); + } + } + + if (styles != null && styles.dragOverlay) { + for (const [key, value] of Object.entries(styles.dragOverlay)) { + if (value === undefined) { + continue; + } + + dragOverlay.node.style.setProperty(key, value); + } + } + + if (className != null && className.active) { + active.node.classList.add(className.active); + } + + if (className != null && className.dragOverlay) { + dragOverlay.node.classList.add(className.dragOverlay); + } + + return function cleanup() { + for (const [key, value] of Object.entries(originalStyles)) { + active.node.style.setProperty(key, value); + } + + if (className != null && className.active) { + active.node.classList.remove(className.active); + } + }; +}; + +const defaultKeyframeResolver = _ref2 => { + let { + transform: { + initial, + final + } + } = _ref2; + return [{ + transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(initial) + }, { + transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(final) + }]; +}; + +const defaultDropAnimationConfiguration = { + duration: 250, + easing: 'ease', + keyframes: defaultKeyframeResolver, + sideEffects: /*#__PURE__*/defaultDropAnimationSideEffects({ + styles: { + active: { + opacity: '0' + } + } + }) +}; +function useDropAnimation(_ref3) { + let { + config, + draggableNodes, + droppableContainers, + measuringConfiguration + } = _ref3; + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useEvent)((id, node) => { + if (config === null) { + return; + } + + const activeDraggable = draggableNodes.get(id); + + if (!activeDraggable) { + return; + } + + const activeNode = activeDraggable.node.current; + + if (!activeNode) { + return; + } + + const measurableNode = getMeasurableNode(node); + + if (!measurableNode) { + return; + } + + const { + transform + } = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(node).getComputedStyle(node); + const parsedTransform = parseTransform(transform); + + if (!parsedTransform) { + return; + } + + const animation = typeof config === 'function' ? config : createDefaultDropAnimation(config); + scrollIntoViewIfNeeded(activeNode, measuringConfiguration.draggable.measure); + return animation({ + active: { + id, + data: activeDraggable.data, + node: activeNode, + rect: measuringConfiguration.draggable.measure(activeNode) + }, + draggableNodes, + dragOverlay: { + node, + rect: measuringConfiguration.dragOverlay.measure(measurableNode) + }, + droppableContainers, + measuringConfiguration, + transform: parsedTransform + }); + }); +} + +function createDefaultDropAnimation(options) { + const { + duration, + easing, + sideEffects, + keyframes + } = { ...defaultDropAnimationConfiguration, + ...options + }; + return _ref4 => { + let { + active, + dragOverlay, + transform, + ...rest + } = _ref4; + + if (!duration) { + // Do not animate if animation duration is zero. + return; + } + + const delta = { + x: dragOverlay.rect.left - active.rect.left, + y: dragOverlay.rect.top - active.rect.top + }; + const scale = { + scaleX: transform.scaleX !== 1 ? active.rect.width * transform.scaleX / dragOverlay.rect.width : 1, + scaleY: transform.scaleY !== 1 ? active.rect.height * transform.scaleY / dragOverlay.rect.height : 1 + }; + const finalTransform = { + x: transform.x - delta.x, + y: transform.y - delta.y, + ...scale + }; + const animationKeyframes = keyframes({ ...rest, + active, + dragOverlay, + transform: { + initial: transform, + final: finalTransform + } + }); + const [firstKeyframe] = animationKeyframes; + const lastKeyframe = animationKeyframes[animationKeyframes.length - 1]; + + if (JSON.stringify(firstKeyframe) === JSON.stringify(lastKeyframe)) { + // The start and end keyframes are the same, infer that there is no animation needed. + return; + } + + const cleanup = sideEffects == null ? void 0 : sideEffects({ + active, + dragOverlay, + ...rest + }); + const animation = dragOverlay.node.animate(animationKeyframes, { + duration, + easing, + fill: 'forwards' + }); + return new Promise(resolve => { + animation.onfinish = () => { + cleanup == null ? void 0 : cleanup(); + resolve(); + }; + }); + }; +} + +let key = 0; +function useKey(id) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (id == null) { + return; + } + + key++; + return key; + }, [id]); +} + +const DragOverlay = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(_ref => { + let { + adjustScale = false, + children, + dropAnimation: dropAnimationConfig, + style, + transition, + modifiers, + wrapperElement = 'div', + className, + zIndex = 999 + } = _ref; + const { + activatorEvent, + active, + activeNodeRect, + containerNodeRect, + draggableNodes, + droppableContainers, + dragOverlay, + over, + measuringConfiguration, + scrollableAncestors, + scrollableAncestorRects, + windowRect + } = useDndContext(); + const transform = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(ActiveDraggableContext); + const key = useKey(active == null ? void 0 : active.id); + const modifiedTransform = applyModifiers(modifiers, { + activatorEvent, + active, + activeNodeRect, + containerNodeRect, + draggingNodeRect: dragOverlay.rect, + over, + overlayNodeRect: dragOverlay.rect, + scrollableAncestors, + scrollableAncestorRects, + transform, + windowRect + }); + const initialRect = useInitialValue(activeNodeRect); + const dropAnimation = useDropAnimation({ + config: dropAnimationConfig, + draggableNodes, + droppableContainers, + measuringConfiguration + }); // We need to wait for the active node to be measured before connecting the drag overlay ref + // otherwise collisions can be computed against a mispositioned drag overlay + + const ref = initialRect ? dragOverlay.setRef : undefined; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(NullifiedContextProvider, null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AnimationManager, { + animation: dropAnimation + }, active && key ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PositionedOverlay, { + key: key, + id: active.id, + ref: ref, + as: wrapperElement, + activatorEvent: activatorEvent, + adjustScale: adjustScale, + className: className, + transition: transition, + rect: initialRect, + style: { + zIndex, + ...style + }, + transform: modifiedTransform + }, children) : null)); +}); + + +//# sourceMappingURL=core.esm.js.map + + +/***/ }), + +/***/ "./node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js": +/*!***************************************************************!*\ + !*** ./node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createSnapModifier: function() { return /* binding */ createSnapModifier; }, +/* harmony export */ restrictToFirstScrollableAncestor: function() { return /* binding */ restrictToFirstScrollableAncestor; }, +/* harmony export */ restrictToHorizontalAxis: function() { return /* binding */ restrictToHorizontalAxis; }, +/* harmony export */ restrictToParentElement: function() { return /* binding */ restrictToParentElement; }, +/* harmony export */ restrictToVerticalAxis: function() { return /* binding */ restrictToVerticalAxis; }, +/* harmony export */ restrictToWindowEdges: function() { return /* binding */ restrictToWindowEdges; }, +/* harmony export */ snapCenterToCursor: function() { return /* binding */ snapCenterToCursor; } +/* harmony export */ }); +/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dnd-kit/utilities */ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js"); + + +function createSnapModifier(gridSize) { + return _ref => { + let { + transform + } = _ref; + return { ...transform, + x: Math.ceil(transform.x / gridSize) * gridSize, + y: Math.ceil(transform.y / gridSize) * gridSize + }; + }; +} + +const restrictToHorizontalAxis = _ref => { + let { + transform + } = _ref; + return { ...transform, + y: 0 + }; +}; + +function restrictToBoundingRect(transform, rect, boundingRect) { + const value = { ...transform + }; + + if (rect.top + transform.y <= boundingRect.top) { + value.y = boundingRect.top - rect.top; + } else if (rect.bottom + transform.y >= boundingRect.top + boundingRect.height) { + value.y = boundingRect.top + boundingRect.height - rect.bottom; + } + + if (rect.left + transform.x <= boundingRect.left) { + value.x = boundingRect.left - rect.left; + } else if (rect.right + transform.x >= boundingRect.left + boundingRect.width) { + value.x = boundingRect.left + boundingRect.width - rect.right; + } + + return value; +} + +const restrictToParentElement = _ref => { + let { + containerNodeRect, + draggingNodeRect, + transform + } = _ref; + + if (!draggingNodeRect || !containerNodeRect) { + return transform; + } + + return restrictToBoundingRect(transform, draggingNodeRect, containerNodeRect); +}; + +const restrictToFirstScrollableAncestor = _ref => { + let { + draggingNodeRect, + transform, + scrollableAncestorRects + } = _ref; + const firstScrollableAncestorRect = scrollableAncestorRects[0]; + + if (!draggingNodeRect || !firstScrollableAncestorRect) { + return transform; + } + + return restrictToBoundingRect(transform, draggingNodeRect, firstScrollableAncestorRect); +}; + +const restrictToVerticalAxis = _ref => { + let { + transform + } = _ref; + return { ...transform, + x: 0 + }; +}; + +const restrictToWindowEdges = _ref => { + let { + transform, + draggingNodeRect, + windowRect + } = _ref; + + if (!draggingNodeRect || !windowRect) { + return transform; + } + + return restrictToBoundingRect(transform, draggingNodeRect, windowRect); +}; + +const snapCenterToCursor = _ref => { + let { + activatorEvent, + draggingNodeRect, + transform + } = _ref; + + if (draggingNodeRect && activatorEvent) { + const activatorCoordinates = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_0__.getEventCoordinates)(activatorEvent); + + if (!activatorCoordinates) { + return transform; + } + + const offsetX = activatorCoordinates.x - draggingNodeRect.left; + const offsetY = activatorCoordinates.y - draggingNodeRect.top; + return { ...transform, + x: transform.x + offsetX - draggingNodeRect.width / 2, + y: transform.y + offsetY - draggingNodeRect.height / 2 + }; + } + + return transform; +}; + + +//# sourceMappingURL=modifiers.esm.js.map + + +/***/ }), + +/***/ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js": +/*!***************************************************************!*\ + !*** ./node_modules/@dnd-kit/utilities/dist/utilities.esm.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ CSS: function() { return /* binding */ CSS; }, +/* harmony export */ add: function() { return /* binding */ add; }, +/* harmony export */ canUseDOM: function() { return /* binding */ canUseDOM; }, +/* harmony export */ findFirstFocusableNode: function() { return /* binding */ findFirstFocusableNode; }, +/* harmony export */ getEventCoordinates: function() { return /* binding */ getEventCoordinates; }, +/* harmony export */ getOwnerDocument: function() { return /* binding */ getOwnerDocument; }, +/* harmony export */ getWindow: function() { return /* binding */ getWindow; }, +/* harmony export */ hasViewportRelativeCoordinates: function() { return /* binding */ hasViewportRelativeCoordinates; }, +/* harmony export */ isDocument: function() { return /* binding */ isDocument; }, +/* harmony export */ isHTMLElement: function() { return /* binding */ isHTMLElement; }, +/* harmony export */ isKeyboardEvent: function() { return /* binding */ isKeyboardEvent; }, +/* harmony export */ isNode: function() { return /* binding */ isNode; }, +/* harmony export */ isSVGElement: function() { return /* binding */ isSVGElement; }, +/* harmony export */ isTouchEvent: function() { return /* binding */ isTouchEvent; }, +/* harmony export */ isWindow: function() { return /* binding */ isWindow; }, +/* harmony export */ subtract: function() { return /* binding */ subtract; }, +/* harmony export */ useCombinedRefs: function() { return /* binding */ useCombinedRefs; }, +/* harmony export */ useEvent: function() { return /* binding */ useEvent; }, +/* harmony export */ useInterval: function() { return /* binding */ useInterval; }, +/* harmony export */ useIsomorphicLayoutEffect: function() { return /* binding */ useIsomorphicLayoutEffect; }, +/* harmony export */ useLatestValue: function() { return /* binding */ useLatestValue; }, +/* harmony export */ useLazyMemo: function() { return /* binding */ useLazyMemo; }, +/* harmony export */ useNodeRef: function() { return /* binding */ useNodeRef; }, +/* harmony export */ usePrevious: function() { return /* binding */ usePrevious; }, +/* harmony export */ useUniqueId: function() { return /* binding */ useUniqueId; } +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); + + +function useCombinedRefs() { + for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { + refs[_key] = arguments[_key]; + } + + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => node => { + refs.forEach(ref => ref(node)); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + refs); +} + +// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js +const canUseDOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'; + +function isWindow(element) { + const elementString = Object.prototype.toString.call(element); + return elementString === '[object Window]' || // In Electron context the Window object serializes to [object global] + elementString === '[object global]'; +} + +function isNode(node) { + return 'nodeType' in node; +} + +function getWindow(target) { + var _target$ownerDocument, _target$ownerDocument2; + + if (!target) { + return window; + } + + if (isWindow(target)) { + return target; + } + + if (!isNode(target)) { + return window; + } + + return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window; +} + +function isDocument(node) { + const { + Document + } = getWindow(node); + return node instanceof Document; +} + +function isHTMLElement(node) { + if (isWindow(node)) { + return false; + } + + return node instanceof getWindow(node).HTMLElement; +} + +function isSVGElement(node) { + return node instanceof getWindow(node).SVGElement; +} + +function getOwnerDocument(target) { + if (!target) { + return document; + } + + if (isWindow(target)) { + return target.document; + } + + if (!isNode(target)) { + return document; + } + + if (isDocument(target)) { + return target; + } + + if (isHTMLElement(target) || isSVGElement(target)) { + return target.ownerDocument; + } + + return document; +} + +/** + * A hook that resolves to useEffect on the server and useLayoutEffect on the client + * @param callback {function} Callback function that is invoked when the dependencies of the hook change + */ + +const useIsomorphicLayoutEffect = canUseDOM ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect; + +function useEvent(handler) { + const handlerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(handler); + useIsomorphicLayoutEffect(() => { + handlerRef.current = handler; + }); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return handlerRef.current == null ? void 0 : handlerRef.current(...args); + }, []); +} + +function useInterval() { + const intervalRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const set = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((listener, duration) => { + intervalRef.current = setInterval(listener, duration); + }, []); + const clear = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => { + if (intervalRef.current !== null) { + clearInterval(intervalRef.current); + intervalRef.current = null; + } + }, []); + return [set, clear]; +} + +function useLatestValue(value, dependencies) { + if (dependencies === void 0) { + dependencies = [value]; + } + + const valueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(value); + useIsomorphicLayoutEffect(() => { + if (valueRef.current !== value) { + valueRef.current = value; + } + }, dependencies); + return valueRef; +} + +function useLazyMemo(callback, dependencies) { + const valueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + const newValue = callback(valueRef.current); + valueRef.current = newValue; + return newValue; + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [...dependencies]); +} + +function useNodeRef(onChange) { + const onChangeHandler = useEvent(onChange); + const node = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const setNodeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(element => { + if (element !== node.current) { + onChangeHandler == null ? void 0 : onChangeHandler(element, node.current); + } + + node.current = element; + }, //eslint-disable-next-line + []); + return [node, setNodeRef]; +} + +function usePrevious(value) { + const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + ref.current = value; + }, [value]); + return ref.current; +} + +let ids = {}; +function useUniqueId(prefix, value) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (value) { + return value; + } + + const id = ids[prefix] == null ? 0 : ids[prefix] + 1; + ids[prefix] = id; + return prefix + "-" + id; + }, [prefix, value]); +} + +function createAdjustmentFn(modifier) { + return function (object) { + for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + adjustments[_key - 1] = arguments[_key]; + } + + return adjustments.reduce((accumulator, adjustment) => { + const entries = Object.entries(adjustment); + + for (const [key, valueAdjustment] of entries) { + const value = accumulator[key]; + + if (value != null) { + accumulator[key] = value + modifier * valueAdjustment; + } + } + + return accumulator; + }, { ...object + }); + }; +} + +const add = /*#__PURE__*/createAdjustmentFn(1); +const subtract = /*#__PURE__*/createAdjustmentFn(-1); + +function hasViewportRelativeCoordinates(event) { + return 'clientX' in event && 'clientY' in event; +} + +function isKeyboardEvent(event) { + if (!event) { + return false; + } + + const { + KeyboardEvent + } = getWindow(event.target); + return KeyboardEvent && event instanceof KeyboardEvent; +} + +function isTouchEvent(event) { + if (!event) { + return false; + } + + const { + TouchEvent + } = getWindow(event.target); + return TouchEvent && event instanceof TouchEvent; +} + +/** + * Returns the normalized x and y coordinates for mouse and touch events. + */ + +function getEventCoordinates(event) { + if (isTouchEvent(event)) { + if (event.touches && event.touches.length) { + const { + clientX: x, + clientY: y + } = event.touches[0]; + return { + x, + y + }; + } else if (event.changedTouches && event.changedTouches.length) { + const { + clientX: x, + clientY: y + } = event.changedTouches[0]; + return { + x, + y + }; + } + } + + if (hasViewportRelativeCoordinates(event)) { + return { + x: event.clientX, + y: event.clientY + }; + } + + return null; +} + +const CSS = /*#__PURE__*/Object.freeze({ + Translate: { + toString(transform) { + if (!transform) { + return; + } + + const { + x, + y + } = transform; + return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)"; + } + + }, + Scale: { + toString(transform) { + if (!transform) { + return; + } + + const { + scaleX, + scaleY + } = transform; + return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")"; + } + + }, + Transform: { + toString(transform) { + if (!transform) { + return; + } + + return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(' '); + } + + }, + Transition: { + toString(_ref) { + let { + property, + duration, + easing + } = _ref; + return property + " " + duration + "ms " + easing; + } + + } +}); + +const SELECTOR = 'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]'; +function findFirstFocusableNode(element) { + if (element.matches(SELECTOR)) { + return element; + } + + return element.querySelector(SELECTOR); +} + + +//# sourceMappingURL=utilities.esm.js.map + + +/***/ }), + +/***/ "./client/src/components/AssetDropzone/AssetDropzone.js": +/*!**************************************************************!*\ + !*** ./client/src/components/AssetDropzone/AssetDropzone.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _dropzone = _interopRequireDefault(__webpack_require__(/*! @deltablot/dropzone */ "./node_modules/@deltablot/dropzone/dist/dropzone.mjs")); +var _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ "jquery")); +var _DataFormat = __webpack_require__(/*! lib/DataFormat */ "lib/DataFormat"); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +let idCounter = 0; +class AssetDropzone extends _react.Component { + constructor(props) { + super(props); + this.dropzone = null; + this.dragging = false; + this.handleAccept = this.handleAccept.bind(this); + this.handleAddedFile = this.handleAddedFile.bind(this); + this.handleDragEnter = this.handleDragEnter.bind(this); + this.handleDragLeave = this.handleDragLeave.bind(this); + this.handleDrop = this.handleDrop.bind(this); + this.handleUploadProgress = this.handleUploadProgress.bind(this); + this.handleUploadComplete = this.handleUploadComplete.bind(this); + this.handleError = this.handleError.bind(this); + this.handleSending = this.handleSending.bind(this); + this.handleSuccess = this.handleSuccess.bind(this); + this.handleQueueComplete = this.handleQueueComplete.bind(this); + this.loadImage = this.loadImage.bind(this); + this.handleMaxFilesExceeded = this.handleMaxFilesExceeded.bind(this); + } + componentDidMount() { + this.dropzone = new _dropzone.default(this.dropzoneRef, Object.assign({}, this.getDefaultOptions(), this.props.options)); + const { + name + } = this.props; + if (name && this.dropzone.hiddenFileInput) { + this.dropzone.hiddenFileInput.classList.add(`dz-input-${name}`); + } + if (typeof this.props.promptOnRemove !== 'undefined') { + this.setPromptOnRemove(this.props.promptOnRemove); + } + } + componentDidUpdate(prevProps) { + const { + name + } = this.props; + if (name && this.dropzone.hiddenFileInput) { + this.dropzone.hiddenFileInput.classList.add(`dz-input-${name}`); + } + if (this.props.canUpload && prevProps.options !== this.props.options) { + if (this.dropzone) { + this.dropzone.enable(); + this.dropzone.options = Object.assign({}, this.getDefaultOptions(), this.dropzone.options, this.props.options); + } + } + } + componentWillUnmount() { + this.dropzone.files = []; + this.dropzone.destroy(); + } + getDefaultOptions() { + let clickable = null; + let uploadSelector = this.props.uploadSelector; + if (!uploadSelector && this.props.uploadButton) { + uploadSelector = '.asset-dropzone__upload-button'; + } + if (uploadSelector) { + const found = (0, _jquery.default)(this.dropzoneRef).find(uploadSelector); + if (found && found.length) { + clickable = found.toArray(); + } + } + return { + accept: this.handleAccept, + addedfile: this.handleAddedFile, + dragenter: this.handleDragEnter, + dragleave: this.handleDragLeave, + drop: this.handleDrop, + maxfilesexceeded: this.handleMaxFilesExceeded, + uploadprogress: this.handleUploadProgress, + complete: this.handleUploadComplete, + dictDefaultMessage: _i18n.default._t('AssetAdmin.DROPZONE_DEFAULT_MESSAGE', 'Drop files here to upload'), + dictFallbackMessage: _i18n.default._t('AssetAdmin.DROPZONE_FALLBACK_MESSAGE', 'Your browser does not support drag\'n\'drop file uploads.'), + dictFallbackText: _i18n.default._t('AssetAdmin.DROPZONE_FALLBACK_TEXT', 'Please use the fallback form below to upload your files like in the olden days.'), + dictInvalidFileType: _i18n.default._t('AssetAdmin.DROPZONE_INVALID_FILE_TYPE', 'You can\'t upload files of this type.'), + dictResponseError: _i18n.default._t('AssetAdmin.DROPZONE_RESPONSE_ERROR', 'Server responded with an error.'), + dictCancelUpload: _i18n.default._t('AssetAdmin.DROPZONE_CANCEL_UPLOAD', 'Cancel upload'), + dictCancelUploadConfirmation: _i18n.default._t('AssetAdmin.DROPZONE_CANCEL_UPLOAD_CONFIRMATION', 'Are you sure you want to cancel this upload?'), + dictRemoveFile: _i18n.default._t('AssetAdmin.DROPZONE_REMOVE_FILE', 'Remove file'), + dictMaxFilesExceeded: _i18n.default._t('AssetAdmin.DROPZONE_MAX_FILES_EXCEEDED', 'You can not upload any more files.'), + error: this.handleError, + sending: this.handleSending, + success: this.handleSuccess, + queuecomplete: this.handleQueueComplete, + thumbnailHeight: 150, + thumbnailWidth: 200, + timeout: 0, + clickable + }; + } + getFileCategory(fileType) { + return fileType.split('/')[0]; + } + getLoadPreview(file) { + return new Promise(resolve => { + const reader = new FileReader(); + reader.onload = event => { + if (this.getFileCategory(file.type) === 'image') { + const img = new Image(); + resolve(this.loadImage(img, event.target.result)); + } else { + resolve({}); + } + }; + reader.readAsDataURL(file); + }); + } + getFileTitle(filename) { + return filename.replace(/[.][^.]+$/, '').replace(/-_/, ' '); + } + setPromptOnRemove(userPrompt) { + this.dropzone.options.dictRemoveFileConfirmation = userPrompt; + } + handleDragEnter(event) { + if (!this.props.canUpload) { + return; + } + this.dragging = true; + this.forceUpdate(); + if (typeof this.props.onDragEnter === 'function') { + this.props.onDragEnter(event); + } + } + handleDragLeave(event) { + const componentNode = this.dropzoneRef; + if (!this.props.canUpload) { + return; + } + if (event.target !== componentNode) { + return; + } + this.dragging = false; + this.forceUpdate(); + if (typeof this.props.onDragLeave === 'function') { + this.props.onDragLeave(event, componentNode); + } + } + handleUploadProgress(file, progress, bytesSent) { + if (typeof this.props.onUploadProgress === 'function') { + this.props.onUploadProgress(file, progress, bytesSent); + } + } + handleUploadComplete(file) { + if (typeof this.props.onUploadComplete === 'function') { + this.props.onUploadComplete(file.status); + } + } + handleDrop(event) { + this.dragging = false; + this.forceUpdate(); + if (typeof this.props.onDrop === 'function') { + this.props.onDrop(event); + } + } + handleSending(file, xhr, formData) { + if (typeof this.props.updateFormData === 'function') { + this.props.updateFormData(formData); + } + formData.append('SecurityID', this.props.securityID); + formData.append('ParentID', this.props.folderId); + const newXhr = Object.assign({}, xhr, { + abort: () => { + this.dropzone.cancelUpload(file); + xhr.abort(); + } + }); + if (typeof this.props.onSending === 'function') { + this.props.onSending(file, newXhr, formData); + } + } + handleMaxFilesExceeded(file) { + if (typeof this.props.onMaxFilesExceeded === 'function') { + return this.props.onMaxFilesExceeded(file); + } + return true; + } + generateQueuedId() { + idCounter += 1; + return idCounter; + } + handleAccept(file, done) { + if (typeof this.props.canFileUpload === 'function' && !this.props.canFileUpload(file)) { + return done(_i18n.default._t('AssetAdmin.DROPZONE_CANNOT_UPLOAD', 'Uploading not permitted.')); + } + if (!this.props.canUpload) { + return done(_i18n.default._t('AssetAdmin.DROPZONE_CANNOT_UPLOAD', 'Uploading not permitted.')); + } + return done(); + } + handleAddedFile(file) { + file._queuedId = this.generateQueuedId(); + const details = { + category: this.getFileCategory(file.type), + filename: file.name, + queuedId: file._queuedId, + size: file.size, + title: this.getFileTitle(file.name), + extension: (0, _DataFormat.getFileExtension)(file.name), + type: file.type, + uploadedToFolderId: this.props.folderId + }; + this.props.onAddedFile(details); + const loadPreview = this.getLoadPreview(file); + return loadPreview.then(preview => { + const previewDetails = { + height: preview.height, + width: preview.width, + url: preview.thumbnailURL, + thumbnail: preview.thumbnailURL, + smallThumbnail: preview.thumbnailURL + }; + if (typeof this.props.onPreviewLoaded === 'function') { + this.props.onPreviewLoaded(details, previewDetails); + } + return { + ...details, + ...previewDetails + }; + }); + } + loadImage(img, newSource) { + return new Promise(resolve => { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + img.onload = () => { + const previewWidth = this.props.preview.width * 2; + const previewHeight = this.props.preview.height * 2; + const ratio = img.naturalWidth / img.naturalHeight; + if (img.naturalWidth < previewWidth || img.naturalHeight < previewHeight) { + canvas.width = img.naturalWidth; + canvas.height = img.naturalHeight; + } else if (ratio < 1) { + canvas.width = previewWidth; + canvas.height = previewWidth / ratio; + } else { + canvas.width = previewHeight * ratio; + canvas.height = previewHeight; + } + ctx.drawImage(img, 0, 0, canvas.width, canvas.height); + const thumbnailURL = canvas.toDataURL('image/png'); + resolve({ + width: img.naturalWidth, + height: img.naturalHeight, + thumbnailURL + }); + }; + img.src = newSource; + }); + } + handleError(file, message) { + this.dropzone.removeFile(file); + this.props.onError(file, message); + } + handleSuccess(file) { + this.dropzone.removeFile(file); + this.props.onSuccess(file); + } + handleQueueComplete() { + if (this.props.onQueueComplete) { + this.props.onQueueComplete(); + } + } + render() { + const className = ['asset-dropzone']; + if (this.props.className) { + className.push(this.props.className); + } + const buttonProps = { + className: 'asset-dropzone__upload-button ss-ui-button font-icon-upload', + type: 'button' + }; + if (!this.props.canUpload) { + buttonProps.disabled = true; + } + if (this.dragging === true) { + className.push('dragging'); + } + return _react.default.createElement("div", { + className: className.join(' '), + ref: node => { + this.dropzoneRef = node; + } + }, this.props.uploadButton && _react.default.createElement("button", buttonProps, _i18n.default._t('AssetAdmin.DROPZONE_UPLOAD')), this.props.children); + } +} +AssetDropzone.propTypes = { + folderId: _propTypes.default.number.isRequired, + onAccept: _propTypes.default.func, + onAddedFile: _propTypes.default.func.isRequired, + onDragEnter: _propTypes.default.func, + onDragLeave: _propTypes.default.func, + onDrop: _propTypes.default.func, + onError: _propTypes.default.func.isRequired, + onPreviewLoaded: _propTypes.default.func, + onSending: _propTypes.default.func, + onSuccess: _propTypes.default.func.isRequired, + onMaxFilesExceeded: _propTypes.default.func, + updateFormData: _propTypes.default.func, + canFileUpload: _propTypes.default.func, + onQueueComplete: _propTypes.default.func, + options: _propTypes.default.shape({ + url: _propTypes.default.string.isRequired + }), + promptOnRemove: _propTypes.default.string, + securityID: _propTypes.default.string.isRequired, + uploadButton: _propTypes.default.bool, + uploadSelector: _propTypes.default.string, + canUpload: _propTypes.default.bool.isRequired, + preview: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }), + className: _propTypes.default.string +}; +AssetDropzone.defaultProps = { + uploadButton: true +}; +var _default = exports["default"] = AssetDropzone; + +/***/ }), + +/***/ "./client/src/components/BulkActions/BulkActions.js": +/*!**********************************************************!*\ + !*** ./client/src/components/BulkActions/BulkActions.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _reactstrap = __webpack_require__(/*! reactstrap */ "reactstrap"); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +class BulkActions extends _react.Component { + constructor(props) { + super(props); + this.handleChangeValue = this.handleChangeValue.bind(this); + this.renderChild = this.renderChild.bind(this); + } + getOptionByValue(value) { + return this.props.actions.find(action => action.value === value); + } + handleChangeValue(event) { + let promise = null; + const option = this.getOptionByValue(event.target.value); + if (option === null) { + return null; + } + if (typeof option.confirm === 'function') { + promise = option.confirm(this.props.items).then(() => option.callback(event, this.props.items)).catch(reason => { + if (reason !== 'cancelled') { + throw reason; + } + }); + } else { + promise = option.callback(event, this.props.items) || Promise.resolve(); + } + return promise; + } + renderChild(action, i) { + const className = (0, _classnames.default)('bulk-actions__action', action.className || 'font-icon-info-circled', { + btn: i < 2, + 'bulk-actions__action--more': i > 2 + }); + if (i < 2) { + return _react.default.createElement(_reactstrap.Button, { + className: className, + key: action.value, + onClick: this.handleChangeValue, + value: action.value, + color: action.color + }, action.label); + } + return _react.default.createElement(_reactstrap.DropdownItem, { + type: "button", + className: className, + key: action.value, + onClick: this.handleChangeValue, + value: action.value + }, action.label); + } + render() { + if (!this.props.items.length) { + return null; + } + let children = this.props.actions.filter(action => !action.canApply || action.canApply(this.props.items)); + children = children.map(this.renderChild); + if (!children.length) { + return null; + } + const { + ActionMenu, + showCount + } = this.props; + const selectAll = _i18n.default._t('AssetAdmin.BULK_ACTIONS_SELECT_ALL', 'Select all'); + const selected = _i18n.default.sprintf(_i18n.default._t('AssetAdmin.BULK_ACTIONS_SELECTED', '%s selected'), this.props.items.length); + const title = _i18n.default._t('AssetAdmin.BULK_ACTIONS_CLEAR_SELECTION', 'Clear selection'); + return _react.default.createElement("div", { + className: "bulk-actions fieldholder-small" + }, showCount && _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_reactstrap.Button, { + className: "bulk-actions-counter font-icon-cross-mark", + onClick: this.props.onClearSelection, + title: title + }, selected), _react.default.createElement("div", { + className: "bulk-actions-select-all" + }, _react.default.createElement(_reactstrap.Button, { + onClick: this.props.onSelectAll + }, selectAll))), children.slice(0, 2), children.length > 2 && ActionMenu ? _react.default.createElement(ActionMenu, { + id: "BulkActions", + className: "bulk-actions__more-actions-menu" + }, children.slice(2)) : children.slice(2)); + } +} +exports.Component = BulkActions; +BulkActions.propTypes = { + items: _propTypes.default.array, + actions: _propTypes.default.arrayOf(_propTypes.default.shape({ + value: _propTypes.default.string.isRequired, + label: _propTypes.default.string.isRequired, + className: _propTypes.default.string, + destructive: _propTypes.default.bool, + callback: _propTypes.default.func, + canApply: _propTypes.default.func, + confirm: _propTypes.default.func + })), + ActionMenu: _propTypes.default.elementType, + showCount: _propTypes.default.bool, + onClearSelection: _propTypes.default.func.isRequired, + onSelectAll: _propTypes.default.func.isRequired +}; +BulkActions.defaultProps = { + items: [], + actions: [], + ActionMenu: null, + total: null, + showCount: true, + totalReachedMessage: _i18n.default._t('') +}; +function mapStateToProps(state) { + return { + gallery: state.assetAdmin.gallery + }; +} +const BulkActionsWithState = (0, _reactRedux.connect)(mapStateToProps)(BulkActions); +var _default = exports["default"] = (0, _Injector.inject)(['ActionMenu'], ActionMenu => ({ + ActionMenu +}), () => 'BulkActions')(BulkActionsWithState); + +/***/ }), + +/***/ "./client/src/components/GalleryItem/GalleryItem.js": +/*!**********************************************************!*\ + !*** ./client/src/components/GalleryItem/GalleryItem.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Folder = exports.File = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _fileShape = _interopRequireDefault(__webpack_require__(/*! lib/fileShape */ "./client/src/lib/fileShape.js")); +var _draggable = _interopRequireDefault(__webpack_require__(/*! components/GalleryItem/draggable */ "./client/src/components/GalleryItem/draggable.js")); +var _droppable = _interopRequireDefault(__webpack_require__(/*! components/GalleryItem/droppable */ "./client/src/components/GalleryItem/droppable.js")); +var _Badge = _interopRequireDefault(__webpack_require__(/*! components/Badge/Badge */ "components/Badge/Badge")); +var _FileStatusIcon = _interopRequireDefault(__webpack_require__(/*! components/FileStatusIcon/FileStatusIcon */ "components/FileStatusIcon/FileStatusIcon")); +var _configShape = _interopRequireDefault(__webpack_require__(/*! lib/configShape */ "./client/src/lib/configShape.js")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _reactSelectable = __webpack_require__(/*! react-selectable */ "./node_modules/react-selectable/dist/react-selectable.js"); +var imageLoadActions = _interopRequireWildcard(__webpack_require__(/*! state/imageLoad/ImageLoadActions */ "./client/src/state/imageLoad/ImageLoadActions.js")); +var _ImageLoadStatus = _interopRequireDefault(__webpack_require__(/*! state/imageLoad/ImageLoadStatus */ "./client/src/state/imageLoad/ImageLoadStatus.js")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +function shouldLoadImage(props) { + return props.item.thumbnail && props.item.category === 'image' && props.item.exists && !props.item.queuedId && props.sectionConfig.imageRetry.minRetry && props.sectionConfig.imageRetry.maxRetry; +} +const preventFocus = event => { + event.preventDefault(); +}; +class GalleryItem extends _react.Component { + constructor(props) { + super(props); + this.handleSelect = this.handleSelect.bind(this); + this.handleActivate = this.handleActivate.bind(this); + this.handleKeyDown = this.handleKeyDown.bind(this); + this.handleCancelUpload = this.handleCancelUpload.bind(this); + } + componentDidUpdate() { + if (shouldLoadImage(this.props)) { + this.props.actions.imageLoad.loadImage(this.props.item.thumbnail, this.props.sectionConfig.imageRetry); + } + } + getThumbnailStyles() { + const { + item: { + thumbnail, + version + }, + bustCache + } = this.props; + if (!this.isImage() || !thumbnail || this.missing()) { + return {}; + } + const url = bustCache === false || !version || thumbnail.startsWith('data:image/') ? thumbnail : `${thumbnail}?vid=${version}`; + switch (this.props.loadState) { + case _ImageLoadStatus.default.SUCCESS: + case _ImageLoadStatus.default.DISABLED: + return { + backgroundImage: `url(${url})` + }; + default: + return {}; + } + } + getErrorMessage() { + let message = null; + const { + item, + loadState + } = this.props; + if (this.hasError()) { + message = item.message.value; + } else if (this.missing()) { + message = _i18n.default._t('AssetAdmin.FILE_MISSING', 'File cannot be found'); + } else if (loadState === _ImageLoadStatus.default.FAILED) { + message = _i18n.default._t('AssetAdmin.FILE_LOAD_ERROR', 'Thumbnail not available'); + } + if (message !== null) { + const updateErrorMessage = this.getItemFunction('updateErrorMessage'); + message = updateErrorMessage(message, this.props); + return _react.default.createElement("span", { + className: "gallery-item__error-message" + }, message); + } + return null; + } + getThumbnailClassNames() { + const thumbnailClassNames = ['gallery-item__thumbnail']; + if (this.isImageSmallerThanThumbnail()) { + thumbnailClassNames.push('gallery-item__thumbnail--small'); + } + if (!this.props.item.thumbnail && this.isImage()) { + thumbnailClassNames.push('gallery-item__thumbnail--no-preview'); + } + switch (this.props.loadState) { + case _ImageLoadStatus.default.LOADING: + case _ImageLoadStatus.default.WAITING: + thumbnailClassNames.push('gallery-item__thumbnail--loading'); + break; + case _ImageLoadStatus.default.FAILED: + thumbnailClassNames.push('gallery-item__thumbnail--error'); + break; + default: + break; + } + return thumbnailClassNames.join(' '); + } + getItemClassNames() { + const category = this.props.item.category || 'false'; + const selected = this.props.selectable && (this.props.item.selected || this.props.isDragging); + return (0, _classnames.default)({ + 'gallery-item': true, + [`gallery-item--${category}`]: true, + 'gallery-item--max-selected': this.props.maxSelected && !selected, + 'gallery-item--missing': this.missing(), + 'gallery-item--selectable': this.props.selectable, + 'gallery-item--selected': selected, + 'gallery-item--dropping': this.props.isDropping, + 'gallery-item--highlighted': this.props.item.highlighted, + 'gallery-item--error': this.hasError(), + 'gallery-item--dragging': this.props.isDragging + }); + } + getItemFunction(functionName) { + const { + item + } = this.props; + return typeof item[functionName] === 'function' ? item[functionName] : this.props[functionName]; + } + getStatusFlags() { + let flags = []; + const { + item + } = this.props; + if (item.type !== 'folder') { + if (item.draft) { + flags.push({ + key: 'status-draft', + title: _i18n.default._t('File.DRAFT', 'Draft'), + className: 'gallery-item--draft' + }); + } else if (item.modified) { + flags.push({ + key: 'status-modified', + title: _i18n.default._t('File.MODIFIED', 'Modified'), + className: 'gallery-item--modified' + }); + } + } + const updateStatusFlags = this.getItemFunction('updateStatusFlags'); + flags = updateStatusFlags(flags, this.props); + return _react.default.createElement("div", { + className: "gallery-item__status-flags" + }, flags.map(attrs => _react.default.createElement("span", attrs))); + } + getStatusIcons() { + const { + item + } = this.props; + const icons = []; + if (item.hasRestrictedAccess) { + icons.push({ + key: 'status-restricted', + fileID: item.id, + hasRestrictedAccess: true, + placement: 'top', + disableTooltip: item.type === 'folder', + includeBackground: item.type !== 'folder' + }); + } + if (item.isTrackedFormUpload && item.type !== 'folder') { + icons.push({ + key: 'status-tracked-form-upload', + fileID: item.id, + isTrackedFormUpload: true, + hasRestrictedAccess: item.hasRestrictedAccess, + placement: 'top', + includeBackground: true + }); + } + return _react.default.createElement("div", { + className: "gallery-item__status-icons" + }, icons.map(attrs => _react.default.createElement(_FileStatusIcon.default, attrs))); + } + getProgressBar() { + let progressBar = null; + const { + item + } = this.props; + const progressBarProps = { + className: 'gallery-item__progress-bar', + style: { + width: `${item.progress}%` + } + }; + if (!this.hasError() && this.uploading() && !this.complete()) { + progressBar = _react.default.createElement("div", { + className: "gallery-item__upload-progress" + }, _react.default.createElement("div", progressBarProps)); + } + const updateProgressBar = this.getItemFunction('updateProgressBar'); + progressBar = updateProgressBar(progressBar, this.props); + return progressBar; + } + isImageSmallerThanThumbnail() { + if (!this.isImage() || this.missing()) { + return false; + } + const width = this.props.item.width; + const height = this.props.item.height; + return height && width && height < _index.default.THUMBNAIL_HEIGHT && width < _index.default.THUMBNAIL_WIDTH; + } + complete() { + return this.props.item.queuedId && this.saved(); + } + saved() { + return this.props.item.id > 0; + } + missing() { + return !this.exists() && this.saved(); + } + uploading() { + return this.props.item.queuedId && !this.saved(); + } + exists() { + return this.props.item.exists; + } + isImage() { + return this.props.item.category === 'image'; + } + canBatchSelect() { + return this.props.selectable && this.props.item.canEdit; + } + hasError() { + let hasError = false; + if (this.props.item.message) { + hasError = this.props.item.message.type === 'error'; + } + return hasError; + } + handleActivate(event) { + event.stopPropagation(); + if (typeof this.props.onActivate === 'function' && this.saved()) { + this.props.onActivate(event, this.props.item); + } + } + handleSelect(event) { + event.stopPropagation(); + event.preventDefault(); + if (typeof this.props.onSelect === 'function') { + this.props.onSelect(event, this.props.item); + } + } + handleKeyDown(event) { + if (_index.default.SPACE_KEY_CODE === event.keyCode) { + event.preventDefault(); + if (this.canBatchSelect()) { + this.handleSelect(event); + } + } + if (_index.default.RETURN_KEY_CODE === event.keyCode) { + this.handleActivate(event); + } + } + handleCancelUpload(event) { + event.stopPropagation(); + event.preventDefault(); + if (this.hasError()) { + this.props.onRemoveErroredUpload(this.props.item); + } else if (this.props.onCancelUpload) { + this.props.onCancelUpload(this.props.item); + } + } + render() { + let action = null; + let actionIcon = null; + let overlay = null; + const { + id, + queuedId + } = this.props.item; + const htmlID = id ? `item-${id}` : `queued-${queuedId}`; + if (this.props.selectable) { + if (this.canBatchSelect()) { + action = this.handleSelect; + } + actionIcon = 'font-icon-tick'; + } + if (this.uploading()) { + action = this.handleCancelUpload; + actionIcon = 'font-icon-cancel'; + } else if (this.exists()) { + const label = _i18n.default._t('AssetAdmin.VIEW', 'View'); + overlay = _react.default.createElement("div", { + className: "gallery-item--overlay font-icon-eye" + }, label); + } + const badge = this.props.badge; + const inputProps = { + className: 'gallery-item__checkbox', + type: 'checkbox', + title: _i18n.default._t('AssetAdmin.SELECT', 'Select'), + tabIndex: -1, + onMouseDown: preventFocus, + id: htmlID + }; + const inputLabelClasses = ['gallery-item__checkbox-label', actionIcon]; + if (!this.canBatchSelect()) { + inputProps.disabled = true; + inputLabelClasses.push('gallery-item__checkbox-label--disabled'); + } + const inputLabelProps = { + className: inputLabelClasses.join(' '), + onClick: action + }; + return _react.default.createElement("div", { + className: this.getItemClassNames(), + "data-id": this.props.item.id, + tabIndex: 0, + role: "button", + onKeyDown: this.handleKeyDown, + onClick: this.handleActivate + }, !!badge && _react.default.createElement(_Badge.default, { + className: "gallery-item__badge", + status: badge.status, + message: badge.message + }), _react.default.createElement("div", { + ref: thumbnail => { + this.thumbnail = thumbnail; + }, + className: this.getThumbnailClassNames(), + style: this.getThumbnailStyles() + }, overlay, this.getStatusFlags(), this.getStatusIcons()), this.getProgressBar(), this.getErrorMessage(), this.props.children, _react.default.createElement("div", { + className: "gallery-item__title", + ref: title => { + this.title = title; + } + }, _react.default.createElement("label", _extends({}, inputLabelProps, { + htmlFor: htmlID + }), _react.default.createElement("input", inputProps)), this.props.item.title)); + } +} +exports.Component = GalleryItem; +GalleryItem.propTypes = { + sectionConfig: _configShape.default, + item: _fileShape.default, + loadState: _propTypes.default.oneOf(Object.values(_ImageLoadStatus.default)), + bustCache: _propTypes.default.bool, + highlighted: _propTypes.default.bool, + selected: _propTypes.default.bool, + isDropping: _propTypes.default.bool, + isDragging: _propTypes.default.bool, + message: _propTypes.default.shape({ + value: _propTypes.default.string, + type: _propTypes.default.string + }), + selectable: _propTypes.default.bool, + onActivate: _propTypes.default.func, + onSelect: _propTypes.default.func, + onCancelUpload: _propTypes.default.func, + onRemoveErroredUpload: _propTypes.default.func, + badge: _propTypes.default.shape({ + status: _propTypes.default.string, + message: _propTypes.default.string + }), + updateStatusFlags: _propTypes.default.func, + updateProgressBar: _propTypes.default.func, + updateErrorMessage: _propTypes.default.func +}; +GalleryItem.defaultProps = { + item: {}, + sectionConfig: { + imageRetry: {} + }, + updateStatusFlags: flags => flags, + updateProgressBar: progressBar => progressBar, + updateErrorMessage: message => message, + bustCache: true +}; +function mapStateToProps(state, ownprops) { + const sectionConfigKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; + const { + bustCache + } = state.config.sections.find(section => section.name === sectionConfigKey); + let loadState = _ImageLoadStatus.default.DISABLED; + if (shouldLoadImage(ownprops)) { + const imageLoad = state.assetAdmin.imageLoad; + const file = imageLoad.files.find(next => ownprops.item.thumbnail === next.url); + loadState = file && file.status || _ImageLoadStatus.default.NONE; + } + return { + bustCache, + loadState + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + imageLoad: (0, _redux.bindActionCreators)(imageLoadActions, dispatch) + } + }; +} +const ConnectedGalleryItem = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(GalleryItem); +const File = exports.File = (0, _reactSelectable.createSelectable)((0, _draggable.default)(ConnectedGalleryItem)); +const Folder = exports.Folder = (0, _reactSelectable.createSelectable)((0, _droppable.default)(File)); +var _default = exports["default"] = ConnectedGalleryItem; + +/***/ }), + +/***/ "./client/src/components/GalleryItem/GalleryItemDragLayer.js": +/*!*******************************************************************!*\ + !*** ./client/src/components/GalleryItem/GalleryItemDragLayer.js ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _Badge = _interopRequireDefault(__webpack_require__(/*! components/Badge/Badge */ "components/Badge/Badge")); +var _GalleryItem = _interopRequireDefault(__webpack_require__(/*! ./GalleryItem */ "./client/src/components/GalleryItem/GalleryItem.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +function GalleryItemDragLayer(props) { + const { + draggingItems, + draggingItemProps + } = props; + const selectionCount = draggingItems.length; + const shadows = [selectionCount > 1 ? _react.default.createElement("div", { + key: "1", + className: "gallery-item__drag-shadow" + }) : null, selectionCount > 2 ? _react.default.createElement("div", { + key: "2", + className: "gallery-item__drag-shadow gallery-item__drag-shadow--second" + }) : null]; + const isFolder = draggingItemProps.item.type === 'folder'; + let badge = null; + if (selectionCount > 1) { + badge = _react.default.createElement(_Badge.default, { + className: "gallery-item__drag-layer-count", + status: "info", + message: `${selectionCount}` + }); + } + return _react.default.createElement("div", { + className: "gallery-item__drag-layer" + }, _react.default.createElement("div", { + className: "gallery-item__drag-layer-item" + }, _react.default.createElement("div", { + className: "gallery-item__drag-layer-preview" + }, shadows, _react.default.createElement(_GalleryItem.default, _extends({}, draggingItemProps, { + isDragging: true + })), isFolder && badge), !isFolder && badge)); +} +GalleryItemDragLayer.propTypes = { + draggingItems: _propTypes.default.arrayOf(_propTypes.default.number), + draggingItemProps: _propTypes.default.object +}; +var _default = exports["default"] = GalleryItemDragLayer; + +/***/ }), + +/***/ "./client/src/components/GalleryItem/draggable.js": +/*!********************************************************!*\ + !*** ./client/src/components/GalleryItem/draggable.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = draggable; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _core = __webpack_require__(/*! @dnd-kit/core */ "./node_modules/@dnd-kit/core/dist/core.esm.js"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +function draggable(Item) { + let uniqueID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + function DraggableItem(props) { + let id = uniqueID; + if (id === null) { + id = props.item.id; + } + const canDrag = typeof props.canDrag === 'boolean' ? props.canDrag : true; + const { + attributes, + listeners, + setNodeRef + } = (0, _core.useDraggable)({ + disabled: !canDrag, + id, + data: { + props + } + }); + const item = _react.default.createElement(Item, props); + return _react.default.createElement("div", _extends({ + className: "gallery-item__draggable", + draggable: true, + ref: setNodeRef + }, listeners, attributes), item); + } + DraggableItem.propTypes = { + item: _propTypes.default.shape({ + id: _propTypes.default.number.isRequired + }).isRequired, + onDrag: _propTypes.default.func, + canDrag: _propTypes.default.bool, + selectedFiles: _propTypes.default.arrayOf(_propTypes.default.number) + }; + return DraggableItem; +} + +/***/ }), + +/***/ "./client/src/components/GalleryItem/droppable.js": +/*!********************************************************!*\ + !*** ./client/src/components/GalleryItem/droppable.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = droppable; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _core = __webpack_require__(/*! @dnd-kit/core */ "./node_modules/@dnd-kit/core/dist/core.esm.js"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +function droppable(Item) { + let uniqueID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + function DroppableItem(props) { + let id = uniqueID; + if (id === null) { + id = props.item.id; + } + const { + setNodeRef, + isOver + } = (0, _core.useDroppable)({ + id + }); + const item = _react.default.createElement(Item, _extends({ + isDropping: isOver + }, props)); + return _react.default.createElement("div", { + ref: setNodeRef, + className: "gallery-item__droppable" + }, item); + } + DroppableItem.propTypes = { + connectDropTarget: _propTypes.default.func.isRequired, + item: _propTypes.default.shape({ + id: _propTypes.default.number.isRequired + }).isRequired + }; + return DroppableItem; +} + +/***/ }), + +/***/ "./client/src/constants/index.js": +/*!***************************************!*\ + !*** ./client/src/constants/index.js ***! + \***************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +var _default = exports["default"] = { + ACTIONS: { + CREATE_FOLDER: 'create-folder', + EDIT_FILE: 'edit' + }, + MOVE_SUCCESS_DURATION: 3000, + CSS_TRANSITION_TIME: 300, + SMALL_THUMBNAIL_HEIGHT: 60, + SMALL_THUMBNAIL_WIDTH: 60, + THUMBNAIL_HEIGHT: 150, + THUMBNAIL_WIDTH: 200, + BULK_ACTIONS: [{ + value: 'delete', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_DELETE', 'Delete'), + className: 'font-icon-trash', + destructive: true, + callback: null, + canApply: items => items.every(item => item && item.canDelete) + }, { + value: 'archive', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_ARCHIVE', 'Archive'), + className: 'font-icon-box', + destructive: true, + callback: null, + canApply: items => items.every(item => item && item.canDelete) + }, { + value: 'edit', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_EDIT', 'Edit'), + className: 'font-icon-edit', + destructive: false, + canApply: items => items.length === 1, + callback: null + }, { + value: 'move', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_MOVE', 'Move'), + className: 'font-icon-folder-move', + canApply: items => items.every(item => item && item.canEdit), + destructive: false, + callback: null + }, { + value: 'publish', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_PUBLISH', 'Publish'), + className: 'font-icon-rocket', + destructive: false, + callback: null, + canApply: items => items.some(item => item && item.modified) && items.every(item => item.canEdit && item.type !== 'folder'), + confirm: null + }, { + value: 'unpublish', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_UNPUBLISH', 'Unpublish'), + className: 'font-icon-cancel-circled', + destructive: false, + callback: null, + canApply: items => items.some(item => item.published) && items.every(item => item.canEdit && item.type !== 'folder'), + confirm: null + }, { + value: 'insert', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_INSERT', 'Insert'), + className: 'font-icon-plus-circled btn-primary', + destructive: false, + callback: null, + canApply: items => items.length, + confirm: null + }], + BULK_ACTIONS_PLACEHOLDER: _i18n.default._t('AssetAdmin.BULK_ACTIONS_PLACEHOLDER'), + SPACE_KEY_CODE: 32, + RETURN_KEY_CODE: 13, + DEFAULT_PREVIEW: 'framework/client/dist/images/app_icons/generic_92.png', + MODAL_MOVE: 'MODAL_MOVE' +}; + +/***/ }), + +/***/ "./client/src/containers/AssetAdmin/AssetAdmin.js": +/*!********************************************************!*\ + !*** ./client/src/containers/AssetAdmin/AssetAdmin.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var galleryActions = _interopRequireWildcard(__webpack_require__(/*! state/gallery/GalleryActions */ "./client/src/state/gallery/GalleryActions.js")); +var toastsActions = _interopRequireWildcard(__webpack_require__(/*! state/toasts/ToastsActions */ "state/toasts/ToastsActions")); +var queuedFilesActions = _interopRequireWildcard(__webpack_require__(/*! state/queuedFiles/QueuedFilesActions */ "./client/src/state/queuedFiles/QueuedFilesActions.js")); +var displaySearchActions = _interopRequireWildcard(__webpack_require__(/*! state/displaySearch/DisplaySearchActions */ "./client/src/state/displaySearch/DisplaySearchActions.js")); +var _Editor = _interopRequireDefault(__webpack_require__(/*! containers/Editor/Editor */ "./client/src/containers/Editor/Editor.js")); +var _Gallery = _interopRequireDefault(__webpack_require__(/*! containers/Gallery/Gallery */ "./client/src/containers/Gallery/Gallery.js")); +var _Toolbar = _interopRequireDefault(__webpack_require__(/*! components/Toolbar/Toolbar */ "components/Toolbar/Toolbar")); +var _Search = _interopRequireWildcard(__webpack_require__(/*! components/Search/Search */ "components/Search/Search")); +var _SearchToggle = _interopRequireDefault(__webpack_require__(/*! components/Search/SearchToggle */ "components/Search/SearchToggle")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _configShape = _interopRequireDefault(__webpack_require__(/*! lib/configShape */ "./client/src/lib/configShape.js")); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var confirmDeletionActions = _interopRequireWildcard(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionActions */ "./client/src/state/confirmDeletion/ConfirmDeletionActions.js")); +var _getFormSchema = _interopRequireDefault(__webpack_require__(/*! lib/getFormSchema */ "./client/src/lib/getFormSchema.js")); +var _getJsonErrorMessage = _interopRequireDefault(__webpack_require__(/*! lib/getJsonErrorMessage */ "lib/getJsonErrorMessage")); +var _BulkDeleteConfirmation = _interopRequireDefault(__webpack_require__(/*! ../BulkDeleteConfirmation/BulkDeleteConfirmation */ "./client/src/containers/BulkDeleteConfirmation/BulkDeleteConfirmation.js")); +var _AssetAdminBreadcrumb = _interopRequireDefault(__webpack_require__(/*! ./AssetAdminBreadcrumb */ "./client/src/containers/AssetAdmin/AssetAdminBreadcrumb.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +class AssetAdmin extends _react.Component { + constructor(props) { + super(props); + this.handleOpenFile = this.handleOpenFile.bind(this); + this.handleCloseFile = this.handleCloseFile.bind(this); + this.handleDelete = this.handleDelete.bind(this); + this.doPublish = this.doPublish.bind(this); + this.doUnpublish = this.doUnpublish.bind(this); + this.handleUnpublish = this.handleUnpublish.bind(this); + this.handleDoSearch = this.handleDoSearch.bind(this); + this.handleClearSearch = this.handleClearSearch.bind(this); + this.handleSubmitEditor = this.handleSubmitEditor.bind(this); + this.handleOpenFolder = this.handleOpenFolder.bind(this); + this.handleSort = this.handleSort.bind(this); + this.handleSetPage = this.handleSetPage.bind(this); + this.createEndpoint = this.createEndpoint.bind(this); + this.handleBackButtonClick = this.handleBackButtonClick.bind(this); + this.handleFolderIcon = this.handleFolderIcon.bind(this); + this.handleBrowse = this.handleBrowse.bind(this); + this.handleViewChange = this.handleViewChange.bind(this); + this.handleUpload = this.handleUpload.bind(this); + this.handleUploadQueue = this.handleUploadQueue.bind(this); + this.handleCreateFolder = this.handleCreateFolder.bind(this); + this.handleMoveFilesSuccess = this.handleMoveFilesSuccess.bind(this); + this.refetchFolder = this.refetchFolder.bind(this); + this.state = { + loading: false, + folder: null, + files: [], + totalCount: 0, + forceRefetch: false + }; + } + componentDidMount() { + this.refetchFolder(); + } + componentDidUpdate(prevProps) { + if (this.props.folderId !== prevProps.folderId || this.props.fileId !== prevProps.fileId && this.props.fileId !== 0 || this.state.forceRefetch) { + this.refetchFolder(); + } + if (this.state.forceRefetch) { + this.setState({ + forceRefetch: false + }); + } + } + getFolderId() { + if (this.props.folderId !== null) { + return this.props.folderId; + } + if (this.state.folder) { + return this.state.folder.id; + } + return 0; + } + refetchFolder() { + const folderId = this.getFolderId(); + const urlParams = new URLSearchParams(window.location.search); + const qsParams = []; + urlParams.forEach((value, key) => { + if (key === 'page' || key.substring(0, 6) === 'filter' || key.substring(0, 4) === 'sort') { + qsParams.push(`${key}=${value}`); + } + }); + let qs = ''; + if (qsParams.length) { + qs = `?${qsParams.join('&')}`; + } + const sectionConfig = _Config.default.getSection('SilverStripe\\AssetAdmin\\Controller\\AssetAdminOpen'); + const url = `${sectionConfig.endpoints.read.url}/${folderId}${qs}`; + _Backend.default.get(url).then(async response => { + const responseJson = await response.json(); + this.setState({ + loading: false, + folder: responseJson, + files: responseJson.children.nodes, + totalCount: responseJson.children.pageInfo.totalCount + }); + }).catch(async err => { + this.setState({ + loading: false, + folder: null, + files: [], + totalCount: 0 + }); + const message = await (0, _getJsonErrorMessage.default)(err); + this.props.actions.toasts.error(message); + }); + } + getFiles() { + const { + queuedFiles, + folderId + } = this.props; + const files = this.state.files; + const combinedFilesList = [...queuedFiles.items.filter(item => (!item.id || !files.find(file => file.id === item.id)) && (!item.hasOwnProperty('uploadedToFolderId') || item.uploadedToFolderId === folderId)), ...files]; + const foldersList = combinedFilesList.filter(file => file.type === 'folder'); + const filesList = combinedFilesList.filter(file => file.type !== 'folder'); + return foldersList.concat(filesList); + } + handleBrowse(folderId, fileId, query) { + if (typeof this.props.onBrowse === 'function') { + this.props.onBrowse(folderId, fileId, query); + this.setState({ + forceRefetch: true + }); + } + if (folderId !== this.getFolderId()) { + this.props.actions.gallery.deselectFiles(); + } + } + handleSetPage(page) { + this.handleBrowse(this.getFolderId(), this.props.fileId, Object.assign({}, this.props.query, { + page + })); + this.setState({ + forceRefetch: true + }); + } + handleDoSearch(data) { + this.props.actions.gallery.deselectFiles(); + this.props.actions.queuedFiles.purgeUploadQueue(); + this.handleBrowse(data.currentFolderOnly ? this.getFolderId() : 0, null, { + filter: data, + view: this.props.query.view + }); + } + handleClearSearch(event) { + this.props.actions.displaySearch.closeSearch(); + this.props.actions.gallery.deselectFiles(); + this.props.actions.queuedFiles.purgeUploadQueue(); + this.refetchFolder(); + const folder = this.state.folder; + this.handleOpenFolder(event, folder); + } + handleSort(sort) { + this.handleBrowse(this.getFolderId(), this.props.fileId, { + ...this.props.query, + sort, + limit: undefined, + page: undefined + }); + this.setState({ + forceRefetch: true + }); + } + handleViewChange(view) { + this.handleBrowse(this.getFolderId(), this.props.fileId, Object.assign({}, this.props.query, { + view + })); + } + createEndpoint(endpointConfig) { + let includeToken = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + return _Backend.default.createEndpointFetcher(Object.assign({}, endpointConfig, includeToken ? { + defaultData: { + SecurityID: this.props.securityId + } + } : {})); + } + handleBackButtonClick(event) { + event.preventDefault(); + this.props.actions.gallery.deselectFiles(); + const folder = this.state.folder; + if (folder) { + this.handleOpenFolder(folder.parentId || 0); + } else { + this.handleOpenFolder(0); + } + } + resetFile(file) { + if (file.queuedId) { + this.props.actions.queuedFiles.removeQueuedFile(file.queuedId); + } + if (this.props.fileId === file.id) { + this.props.resetFileDetails(this.getFolderId(), file.id, this.props.query); + } + } + handleFolderIcon() { + this.handleOpenFile(this.getFolderId()); + } + handleOpenFile(fileId) { + this.handleBrowse(this.getFolderId(), fileId, this.props.query); + } + handleSubmitEditor(data, action, submitFn) { + let promise = null; + if (action === 'action_insert' && this.props.type === 'select') { + const files = this.getFiles(); + const file = files.find(item => item.id === parseInt(data.ID, 10)); + this.props.onInsertMany(null, [file]); + this.setState({ + forceRefetch: true + }); + return Promise.resolve(); + } + if (typeof this.props.onSubmitEditor === 'function') { + const file = this.findFile(this.props.fileId); + promise = this.props.onSubmitEditor(data, action, submitFn, file); + } else { + promise = submitFn(); + } + if (!promise) { + throw new Error('Promise was not returned for submitting'); + } + this.setState({ + forceRefetch: true + }); + return promise.then(response => { + if (action === 'action_createfolder') { + if (this.props.type === 'admin') { + this.handleOpenFile(response.record.id); + } else { + this.handleOpenFolder(this.getFolderId()); + } + } else if ((action === 'action_save' || action === 'action_publish') && this.getFolderId() !== response.record.parent.id) { + this.handleBrowse(response.record.parent.id, response.record.id, null); + } + return response; + }); + } + handleCloseFile() { + this.handleBrowse(this.getFolderId(), null, this.props.query); + } + handleOpenFolder(folderId) { + const { + page, + filter, + ...query + } = this.props.query; + this.handleBrowse(folderId, null, query); + } + handleDelete(ids) { + this.props.actions.confirmDeletion.deleting(); + const files = ids.map(id => { + const result = this.findFile(id); + if (!result) { + throw new Error(`File selected for deletion cannot be found: ${id}`); + } + if (result.queuedId) { + this.props.actions.queuedFiles.removeQueuedFile(result.queuedId); + } + return result; + }); + const fileIDs = files.map(file => file.id); + const folder = this.state.folder; + const parentId = folder ? folder.id : 0; + const url = this.props.sectionConfig.endpoints.delete.url; + return _Backend.default.post(url, { + ids: fileIDs + }, { + 'X-SecurityID': _Config.default.get('SecurityID') + }).then(() => { + this.handleBrowse(parentId, null, this.props.query); + const queuedFiles = this.props.queuedFiles.items.filter(file => fileIDs.includes(file.id)); + queuedFiles.forEach(file => { + if (file.queuedId) { + this.props.actions.queuedFiles.removeQueuedFile(file.queuedId); + } + }); + let transKey = 'AssetAdmin.BULK_ACTIONS_DELETE_SUCCESS_02'; + let transDefault = '%s folders/files were successfully deleted.'; + if (this.props.sectionConfig.filesAreVersioned && this.props.sectionConfig.archiveFiles) { + transKey = 'AssetAdmin.BULK_ACTIONS_ARCHIVE_SUCCESS_02'; + transDefault = '%s folders/files were successfully archived.'; + } + this.props.actions.toasts.success(_i18n.default.sprintf(_i18n.default._t(transKey, transDefault), fileIDs.length)); + this.props.actions.gallery.deselectFiles(); + this.refetchFolder(); + }).catch(async err => { + const message = await (0, _getJsonErrorMessage.default)(err); + this.props.actions.toasts.error(message); + }).finally(() => this.props.actions.confirmDeletion.reset()); + } + doUnpublish(ids) { + const files = ids.map(id => { + const result = this.findFile(id); + if (!result) { + throw new Error(`File selected for unpublishing cannot be found: ${id}`); + } else if (result.type === 'folder') { + throw new Error('Cannot unpublish folders'); + } + return result; + }); + const fileIDs = files.map(file => file.id); + const qs = fileIDs.map(id => `ids[]=${id}`).join('&'); + let url = `${this.props.sectionConfig.endpoints.readLiveOwnerCounts.url}?${qs}`; + return _Backend.default.get(url).then(async response => { + const responseJson = await response.json(); + const filesWithLiveUsage = responseJson.filter(fileObj => fileObj.count > 0); + const displayedMessages = filesWithLiveUsage.slice(0, 4).map(fileObj => fileObj.message); + const theRestLength = filesWithLiveUsage.slice(5).length; + let theRestMessage = ''; + if (theRestLength > 0) { + theRestMessage = _i18n.default.inject(_i18n.default._t('AssetAdmin.BULK_OWNED_WARNING_REMAINING', 'And {count} other file(s)'), { + count: theRestLength + }); + } + if (displayedMessages.length) { + const confirmationMessage = [_i18n.default.inject(_i18n.default._t('AssetAdmin.BULK_OWNED_WARNING_HEADING', '{count} file(s) are being used by other published content.'), { + count: displayedMessages.length + }), ...displayedMessages, theRestMessage, _i18n.default._t('AssetAdmin.BULK_OWNED_WARNING_FOOTER', 'Unpublishing will only remove files from the published version of the content. They will remain on the draft version. Unpublish anyway?')].filter(s => s).join('\n\n'); + if (!confirm(confirmationMessage)) { + return Promise.reject(); + } + } + return Promise.resolve(); + }).then(() => { + url = this.props.sectionConfig.endpoints.unpublish.url; + return _Backend.default.post(url, { + ids: fileIDs + }, { + 'X-SecurityID': _Config.default.get('SecurityID') + }).catch(async err => { + const message = await (0, _getJsonErrorMessage.default)(err); + this.props.actions.toasts.error(message); + }); + }).then(() => { + this.refetchFolder(); + return files; + }).catch(async err => { + const message = await (0, _getJsonErrorMessage.default)(err); + this.props.actions.toasts.error(message); + return []; + }); + } + handleUnpublish(fileIds) { + return this.doUnpublish(fileIds).then(files => { + const { + fileId + } = this.props; + this.refetchFolder().then(() => { + if (fileId && files.find(file => file.id === fileId)) { + this.props.resetFileDetails(this.getFolderId(), fileId, this.props.query); + } + }); + }); + } + doPublish(ids) { + const files = ids.map(id => { + const result = this.findFile(id); + if (!result) { + throw new Error(`File selected for publishing cannot be found: ${id}`); + } else if (result.type === 'folder') { + throw new Error('Cannot publish folders'); + } + return result; + }); + const fileIDs = files.map(file => file.id); + const url = this.props.sectionConfig.endpoints.publish.url; + return _Backend.default.post(url, { + ids: fileIDs + }, { + 'X-SecurityID': _Config.default.get('SecurityID') + }).then(() => { + files.forEach(file => this.resetFile(file)); + this.refetchFolder(); + return files; + }).catch(async err => { + const message = await (0, _getJsonErrorMessage.default)(err); + this.props.actions.toasts.error(message); + }); + } + findFile(fileId) { + const allFiles = this.getFiles(); + return allFiles.find(item => item.id === parseInt(fileId, 10)); + } + handleUpload() {} + handleUploadQueue() { + if (this.props.fileId) { + this.refetchFolder(); + } + } + handleCreateFolder() { + this.props.onBrowse(this.getFolderId(), null, this.props.query, _index.default.ACTIONS.CREATE_FOLDER); + } + handleMoveFilesSuccess(folderId, fileIds) { + const files = this.props.queuedFiles.items.filter(file => fileIds.includes(file.id)); + files.forEach(file => { + if (file.queuedId) { + this.props.actions.queuedFiles.removeQueuedFile(file.queuedId); + } + }); + this.props.actions.gallery.deselectFiles(); + this.refetchFolder(); + } + renderGallery() { + const { + GalleryComponent + } = this.props; + const config = this.props.sectionConfig; + const createFileApiUrl = config.endpoints.createFile.url; + const createFileApiMethod = config.endpoints.createFile.method; + const limit = this.props.query && parseInt(this.props.query.limit || config.limit, 10); + const page = this.props.query && parseInt(this.props.query.page || 1, 10); + const sort = this.props.query && this.props.query.sort; + const view = this.props.query && this.props.query.view; + const filters = this.props.query.filter || {}; + const folder = this.state.folder; + const loading = this.state.loading; + return _react.default.createElement(GalleryComponent, { + files: this.getFiles(), + fileId: this.props.fileId, + folderId: this.getFolderId(), + folder: folder, + type: this.props.type, + limit: limit, + page: page, + totalCount: this.state.totalCount, + view: view, + filters: filters, + createFileApiUrl: createFileApiUrl, + createFileApiMethod: createFileApiMethod, + onInsertMany: this.props.onInsertMany, + onPublish: this.doPublish, + onUnpublish: this.doUnpublish, + onOpenFile: this.handleOpenFile, + onOpenFolder: this.handleOpenFolder, + onSuccessfulUpload: this.handleUpload, + onSuccessfulUploadQueue: this.handleUploadQueue, + onCreateFolder: this.handleCreateFolder, + onMoveFilesSuccess: this.handleMoveFilesSuccess, + onClearSearch: this.handleClearSearch, + onSort: this.handleSort, + onSetPage: this.handleSetPage, + onViewChange: this.handleViewChange, + sort: sort, + sectionConfig: config, + loading: loading, + maxFilesSelect: this.props.maxFiles, + dialog: this.props.dialog + }); + } + renderEditor() { + const { + sectionConfig: config, + viewAction, + type, + fileId, + dialog, + requireLinkText, + fileSelected, + EditorComponent + } = this.props; + const { + schemaUrl, + targetId + } = (0, _getFormSchema.default)({ + config, + viewAction, + folderId: this.getFolderId(), + type, + fileId + }); + if (!schemaUrl) { + return null; + } + const schemaUrlQueries = []; + if (requireLinkText) { + schemaUrlQueries.push({ + name: 'requireLinkText', + value: true + }); + } + if (fileSelected) { + schemaUrlQueries.push({ + name: 'fileSelected', + value: true + }); + } + const editorProps = { + dialog, + fileId: targetId, + schemaUrl, + schemaUrlQueries, + onClose: this.handleCloseFile, + onSubmit: this.handleSubmitEditor, + onUnpublish: this.handleUnpublish + }; + return _react.default.createElement(EditorComponent, editorProps); + } + render() { + const { + folderId, + query, + getUrl, + type, + maxFiles, + toolbarChildren, + SearchComponent, + BulkDeleteConfirmationComponent + } = this.props; + if (this.state.folder === null) { + return null; + } + const showBackButton = Boolean(folderId || (0, _Search.hasFilters)(query.filter)); + const searchFormSchemaUrl = this.props.sectionConfig.form.fileSearchForm.schemaUrl; + const filters = query.filter || {}; + const classNames = (0, _classnames.default)('fill-height asset-admin', type === 'select' && { + 'asset-admin--single-select': maxFiles === 1, + 'asset-admin--multi-select': maxFiles !== 1 + }); + const showSearch = (0, _Search.hasFilters)(query.filter) || this.props.showSearch; + const onSearchToggle = this.props.actions.displaySearch ? this.props.actions.displaySearch.toggleSearch : undefined; + const folder = this.state.folder; + const breadcrumbProps = { + folder, + query, + getUrl, + onBrowse: this.handleBrowse, + onFolderIcon: this.handleFolderIcon + }; + return _react.default.createElement("div", { + className: classNames + }, _react.default.createElement(_Toolbar.default, { + showBackButton: showBackButton, + onBackButtonClick: this.handleBackButtonClick + }, folder && _react.default.createElement(_AssetAdminBreadcrumb.default, breadcrumbProps), _react.default.createElement("div", { + className: "asset-admin__toolbar-extra pull-xs-right fill-width vertical-align-items" + }, _react.default.createElement(_SearchToggle.default, { + toggled: showSearch, + onToggle: onSearchToggle + }), toolbarChildren)), showSearch && _react.default.createElement(SearchComponent, { + onSearch: this.handleDoSearch, + id: "AssetSearchForm", + formSchemaUrl: searchFormSchemaUrl, + onHide: this.handleClearSearch, + displayBehavior: "HIDEABLE", + filters: filters, + name: "name" + }), _react.default.createElement("div", { + className: "flexbox-area-grow fill-width fill-height gallery" + }, this.renderGallery(), this.renderEditor()), _react.default.createElement(BulkDeleteConfirmationComponent, { + onConfirm: this.handleDelete, + filesAreVersioned: this.props.sectionConfig.filesAreVersioned, + archiveFiles: this.props.sectionConfig.archiveFiles + })); + } +} +exports.Component = AssetAdmin; +AssetAdmin.propTypes = { + dialog: _propTypes.default.bool, + sectionConfig: _configShape.default, + fileId: _propTypes.default.number, + folderId: _propTypes.default.number, + resetFileDetails: _propTypes.default.func, + onBrowse: _propTypes.default.func, + onReplaceUrl: _propTypes.default.func, + onInsertMany: _propTypes.default.func, + getUrl: _propTypes.default.func, + query: _propTypes.default.shape({ + sort: _propTypes.default.string, + limit: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), + page: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), + filter: _propTypes.default.object + }), + onSubmitEditor: _propTypes.default.func, + type: _propTypes.default.oneOf(['insert-media', 'insert-link', 'select', 'admin']), + queuedFiles: _propTypes.default.shape({ + items: _propTypes.default.array.isRequired + }), + filesTotalCount: _propTypes.default.number, + loading: _propTypes.default.bool, + actions: _propTypes.default.object, + maxFiles: _propTypes.default.number, + fileSelected: _propTypes.default.bool, + EditorComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]), + GalleryComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]), + SearchComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]), + BulkDeleteConfirmationComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +AssetAdmin.defaultProps = { + type: 'admin', + query: { + sort: '', + limit: null, + page: 0, + filter: {} + }, + maxFiles: null, + EditorComponent: _Editor.default, + GalleryComponent: _Gallery.default, + SearchComponent: _Search.default, + BulkDeleteConfirmationComponent: _BulkDeleteConfirmation.default +}; +function mapStateToProps(state, ownProps) { + const { + formSchema + } = state.assetAdmin.modal; + return { + securityId: state.config.SecurityID, + queuedFiles: state.assetAdmin.queuedFiles, + showSearch: state.assetAdmin.displaySearch.isOpen, + type: formSchema && formSchema.type || ownProps.type + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + gallery: (0, _redux.bindActionCreators)(galleryActions, dispatch), + toasts: (0, _redux.bindActionCreators)(toastsActions, dispatch), + displaySearch: (0, _redux.bindActionCreators)(displaySearchActions, dispatch), + queuedFiles: (0, _redux.bindActionCreators)(queuedFilesActions, dispatch), + confirmDeletion: (0, _redux.bindActionCreators)(confirmDeletionActions, dispatch) + } + }; +} +var _default = exports["default"] = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(AssetAdmin); + +/***/ }), + +/***/ "./client/src/containers/AssetAdmin/AssetAdminBreadcrumb.js": +/*!******************************************************************!*\ + !*** ./client/src/containers/AssetAdmin/AssetAdminBreadcrumb.js ***! + \******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _Breadcrumb = __webpack_require__(/*! components/Breadcrumb/Breadcrumb */ "components/Breadcrumb/Breadcrumb"); +var _Search = __webpack_require__(/*! components/Search/Search */ "components/Search/Search"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const AssetAdminBreadcrumb = _ref => { + let { + folder, + query, + getUrl, + onBrowse, + onFolderIcon, + PlainBreadcrumbComponent + } = _ref; + const handleClick = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return event => { + event.preventDefault(); + onBrowse(...args); + }; + }; + const hrefBuilder = function () { + return getUrl && getUrl(...arguments); + }; + const breadcrumbs = [{ + text: _i18n.default._t('AssetAdmin.FILES', 'Files'), + href: hrefBuilder(0, null, query), + onClick: handleClick(0, null, query) + }]; + if (folder && folder.id) { + if (folder.ancestors) { + folder.ancestors.forEach(parent => { + breadcrumbs.push({ + text: parent.title, + href: hrefBuilder(parent.id, null, query), + onClick: handleClick(parent.id, null, query) + }); + }); + } + const icons = [{ + className: 'icon font-icon-edit-list', + onClick: e => { + e.preventDefault(); + onFolderIcon(); + } + }]; + if (folder.hasRestrictedAccess) { + icons.push({ + nodeName: 'FileStatusIcon', + hasRestrictedAccess: true + }); + } + breadcrumbs.push({ + text: folder.title, + href: hrefBuilder(folder.id, null, query), + onClick: handleClick(folder.id, null, query), + icons + }); + } + if ((0, _Search.hasFilters)(query.filter)) { + breadcrumbs.push({ + text: _i18n.default._t('LeftAndMain.SEARCHRESULTS', 'Search results') + }); + } + return _react.default.createElement(PlainBreadcrumbComponent, { + multiline: true, + crumbs: breadcrumbs + }); +}; +AssetAdminBreadcrumb.propTypes = { + onBrowse: _propTypes.default.func, + onFolderIcon: _propTypes.default.func, + getUrl: _propTypes.default.func, + query: _propTypes.default.shape({ + sort: _propTypes.default.string, + limit: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), + page: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), + filter: _propTypes.default.object, + view: _propTypes.default.string + }), + folder: _propTypes.default.shape({ + id: _propTypes.default.number, + title: _propTypes.default.string, + ancestors: _propTypes.default.array, + parentId: _propTypes.default.number, + canView: _propTypes.default.bool, + canEdit: _propTypes.default.bool + }), + PlainBreadcrumbComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +AssetAdminBreadcrumb.defaultProps = { + PlainBreadcrumbComponent: _Breadcrumb.Component +}; +var _default = exports["default"] = AssetAdminBreadcrumb; + +/***/ }), + +/***/ "./client/src/containers/AssetAdmin/AssetAdminRouter.js": +/*!**************************************************************!*\ + !*** ./client/src/containers/AssetAdmin/AssetAdminRouter.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Component = void 0; +exports.buildUrl = buildUrl; +exports["default"] = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _reactRouterDom = __webpack_require__(/*! react-router-dom */ "react-router-dom"); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _withRouter = _interopRequireWildcard(__webpack_require__(/*! lib/withRouter */ "lib/withRouter")); +var _AssetAdmin = _interopRequireDefault(__webpack_require__(/*! containers/AssetAdmin/AssetAdmin */ "./client/src/containers/AssetAdmin/AssetAdmin.js")); +var _DataFormat = __webpack_require__(/*! lib/DataFormat */ "lib/DataFormat"); +var _qs = _interopRequireDefault(__webpack_require__(/*! qs */ "qs")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _configShape = _interopRequireDefault(__webpack_require__(/*! lib/configShape */ "./client/src/lib/configShape.js")); +var _urls = __webpack_require__(/*! lib/urls */ "lib/urls"); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const sectionConfigKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; +const actions = Object.keys(_index.default.ACTIONS).map(key => _index.default.ACTIONS[key]); +function buildUrl(_ref) { + let { + base, + folderId, + fileId, + query, + action + } = _ref; + if (action && actions.indexOf(action) === -1) { + throw new Error(`Invalid action provided: ${action}`); + } + let url = null; + if (fileId) { + url = (0, _urls.joinUrlPaths)(base, `show/${folderId}/${_index.default.ACTIONS.EDIT_FILE}/${fileId}`); + } else if (folderId) { + url = (0, _urls.joinUrlPaths)(base, `show/${folderId}`); + } else { + url = base; + } + if (action === _index.default.ACTIONS.CREATE_FOLDER) { + url = (0, _urls.joinUrlPaths)(base, `show/${folderId || 0}/${action}`); + } + const hasQuery = query && Object.keys(query).length > 0; + if (hasQuery) { + url = `${url}?${_qs.default.stringify(query)}`; + } + return url; +} +class AssetAdminRouter extends _react.Component { + constructor(props) { + super(props); + this.handleBrowse = this.handleBrowse.bind(this); + this.handleReplaceUrl = this.handleReplaceUrl.bind(this); + this.handleResetDetails = this.handleResetDetails.bind(this); + this.getUrl = this.getUrl.bind(this); + } + getUrl() { + let folderId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + let fileId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + let action = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _index.default.ACTIONS.EDIT_FILE; + const newFolderId = parseInt(folderId || 0, 10); + const newFileId = parseInt(fileId || 0, 10); + const hasFolderChanged = newFolderId !== this.getFolderId(); + const newQuery = Object.assign({}, query); + if (hasFolderChanged || newQuery.page <= 1) { + delete newQuery.page; + } + return buildUrl({ + base: `/${this.props.sectionConfig.reactRoutePath}`, + folderId: newFolderId, + fileId: newFileId, + query: newQuery, + action + }); + } + getFolderId() { + if (this.props.router.params && this.props.router.params.folderId) { + return parseInt(this.props.router.params.folderId, 10); + } + return 0; + } + getFileId() { + if (this.props.router.params && this.props.router.params.fileId) { + return parseInt(this.props.router.params.fileId, 10); + } + return 0; + } + getViewAction() { + if (this.props.router.params && this.props.router.params.viewAction) { + return this.props.router.params.viewAction; + } + return _index.default.ACTIONS.EDIT_FILE; + } + getSectionProps() { + return { + sectionConfig: this.props.sectionConfig, + type: 'admin', + folderId: this.getFolderId(), + viewAction: this.getViewAction(), + fileId: this.getFileId(), + query: this.getQuery(), + getUrl: this.getUrl, + onBrowse: this.handleBrowse, + onReplaceUrl: this.handleReplaceUrl, + resetFileDetails: this.handleResetDetails + }; + } + getQuery() { + return (0, _DataFormat.decodeQuery)(this.props.router.location.search); + } + handleBrowse(folderId, fileId, query, action) { + const pathname = this.getUrl(folderId, fileId, query, action); + this.props.router.navigate(pathname); + } + handleReplaceUrl(folderId, fileId, query, action) { + const pathname = this.getUrl(folderId, fileId, query, action); + this.props.router.navigate(pathname, { + replace: true + }); + } + handleResetDetails(folderId, fileId, query) { + const currentPathname = this.getUrl(folderId, fileId, query); + const clearPathname = this.getUrl(folderId, null, query); + this.props.router.navigate(clearPathname, { + replace: true, + state: { + reset: true, + resetPath: currentPathname + } + }); + } + render() { + const { + AssetAdminComponent + } = this.props; + const locationState = this.props.router.location.state; + if (locationState && locationState && locationState.reset) { + return _react.default.createElement(_reactRouterDom.Navigate, { + to: locationState.resetPath, + replace: true + }); + } + if (!this.props.sectionConfig) { + return null; + } + return _react.default.createElement(AssetAdminComponent, this.getSectionProps()); + } +} +exports.Component = AssetAdminRouter; +AssetAdminRouter.propTypes = { + sectionConfig: _configShape.default, + router: _withRouter.routerPropTypes, + AssetAdminComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +AssetAdminRouter.defaultProps = { + AssetAdminComponent: _AssetAdmin.default +}; +function mapStateToProps(state) { + const sectionConfig = state.config.sections.find(section => section.name === sectionConfigKey); + return { + sectionConfig + }; +} +var _default = exports["default"] = (0, _withRouter.default)((0, _reactRedux.connect)(mapStateToProps)(AssetAdminRouter)); + +/***/ }), + +/***/ "./client/src/containers/AssetAdmin/stateRouter.js": +/*!*********************************************************!*\ + !*** ./client/src/containers/AssetAdmin/stateRouter.js ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.AssetAdminStateRouter = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _AssetAdminRouter = __webpack_require__(/*! containers/AssetAdmin/AssetAdminRouter */ "./client/src/containers/AssetAdmin/AssetAdminRouter.js"); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _ModalActions = __webpack_require__(/*! state/modal/ModalActions */ "./client/src/state/modal/ModalActions.js"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const sectionConfigKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; +const initialState = { + folderId: null, + fileId: null, + query: {}, + action: _index.default.ACTIONS.EDIT_FILE +}; +class AssetAdminStateRouter extends _react.Component { + constructor(props) { + super(props); + this.handleBrowse = this.handleBrowse.bind(this); + this.getUrl = this.getUrl.bind(this); + this.state = Object.assign({}, initialState, { + folderId: props.folderId + }); + } + getUrl() { + let folderId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + let fileId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + let action = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _index.default.ACTIONS.EDIT_FILE; + const newFolderId = parseInt(folderId || 0, 10); + const newFileId = parseInt(fileId || 0, 10); + const oldFolderId = this.getFolderId(); + const hasFolderChanged = newFolderId !== oldFolderId && oldFolderId !== null; + const newQuery = Object.assign({}, query); + if (hasFolderChanged || newQuery.page <= 1) { + delete newQuery.page; + } + return (0, _AssetAdminRouter.buildUrl)({ + base: this.props.sectionConfig.reactRoutePath, + folderId: newFolderId, + fileId: newFileId, + query: newQuery, + action + }); + } + getFolderId() { + if (this.state.folderId === null) { + return null; + } + return parseInt(this.state.folderId || 0, 10); + } + getFileId() { + return parseInt(this.state.fileId || this.props.fileId || 0, 10); + } + getViewAction() { + return this.state.action || _index.default.ACTIONS.EDIT_FILE; + } + getSectionProps() { + const props = Object.assign({}, this.props, { + folderId: this.getFolderId(), + fileId: this.getFileId(), + viewAction: this.getViewAction(), + query: this.state.query, + getUrl: this.getUrl, + onBrowse: this.handleBrowse + }); + delete props.Component; + return props; + } + handleBrowse(folderId, fileId) { + let query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + let action = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _index.default.ACTIONS.EDIT_FILE; + if (action && Object.values(_index.default.ACTIONS).indexOf(action) === -1) { + throw new Error(`Invalid action provided: ${action}`); + } + if (this.state.fileId !== fileId) { + this.props.actions.resetFormStack(); + } + this.setState({ + folderId, + fileId, + query, + action + }); + } + render() { + const sectionProps = this.getSectionProps(); + const AssetAdmin = this.props.Component; + return _react.default.createElement(AssetAdmin, sectionProps); + } +} +exports.AssetAdminStateRouter = AssetAdminStateRouter; +AssetAdminStateRouter.propTypes = { + Component: _propTypes.default.elementType, + sectionConfig: _propTypes.default.shape({ + url: _propTypes.default.string.isRequired + }).isRequired, + fileId: _propTypes.default.number +}; +function mapDispatchToProps(dispatch) { + return { + actions: { + resetFormStack: () => dispatch((0, _ModalActions.resetFormStack)()) + } + }; +} +function stateRouter(AssetAdmin) { + function mapStateToProps(state) { + const sectionConfig = state.config.sections.find(section => section.name === sectionConfigKey); + return { + Component: AssetAdmin, + sectionConfig + }; + } + return (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(AssetAdminStateRouter); +} +var _default = exports["default"] = stateRouter; + +/***/ }), + +/***/ "./client/src/containers/BulkDeleteConfirmation/BulkDeleteConfirmation.js": +/*!********************************************************************************!*\ + !*** ./client/src/containers/BulkDeleteConfirmation/BulkDeleteConfirmation.js ***! + \********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var confirmDeletionActions = _interopRequireWildcard(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionActions */ "./client/src/state/confirmDeletion/ConfirmDeletionActions.js")); +var TRANSITIONS = _interopRequireWildcard(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionTransitions */ "./client/src/state/confirmDeletion/ConfirmDeletionTransitions.js")); +var toastsActions = _interopRequireWildcard(__webpack_require__(/*! state/toasts/ToastsActions */ "state/toasts/ToastsActions")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _fileShape = _interopRequireDefault(__webpack_require__(/*! lib/fileShape */ "./client/src/lib/fileShape.js")); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var _getJsonErrorMessage = _interopRequireDefault(__webpack_require__(/*! lib/getJsonErrorMessage */ "lib/getJsonErrorMessage")); +var _DeletionModal = _interopRequireDefault(__webpack_require__(/*! ./DeletionModal */ "./client/src/containers/BulkDeleteConfirmation/DeletionModal.js")); +var _BulkDeleteMessage = _interopRequireDefault(__webpack_require__(/*! ./BulkDeleteMessage */ "./client/src/containers/BulkDeleteConfirmation/BulkDeleteMessage.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +const BulkDeleteConfirmation = _ref => { + let { + LoadingComponent, + transition, + files, + onModalClose, + onCancel, + onConfirm, + filesAreVersioned, + archiveFiles, + actions + } = _ref; + const [isLoading, setIsLoading] = (0, _react.useState)(true); + const [fileCounts, setFileCounts] = (0, _react.useState)({}); + (0, _react.useEffect)(() => { + const sectionKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; + const config = _Config.default.getSection(sectionKey); + const fileIDs = files.map(fild => fild.id); + const qs = fileIDs.map(id => `ids[]=${id}`).join('&'); + const url = `${config.endpoints.readDescendantCounts.url}?${qs}`; + setIsLoading(true); + _Backend.default.get(url).then(async response => { + const responseJson = await response.json(); + setIsLoading(false); + setFileCounts(responseJson); + }).catch(async err => { + const message = await (0, _getJsonErrorMessage.default)(err); + actions.toasts.error(message); + }); + }, [files]); + let body = null; + const transKey = filesAreVersioned && archiveFiles ? 'AssetAdmin.ARCHIVE' : 'AssetAdmin.DELETE'; + const transDefault = filesAreVersioned && archiveFiles ? 'Archive' : 'Delete'; + let deleteModalActions = [{ + label: _i18n.default._t(transKey, transDefault), + handler: () => onConfirm(files.map(_ref2 => { + let { + id + } = _ref2; + return id; + })), + color: 'danger' + }, { + label: _i18n.default._t('AssetAdmin.CANCEL', 'Cancel'), + handler: onCancel + }]; + if (isLoading) { + body = _react.default.createElement(LoadingComponent, null); + } else { + const topLevelFolderCount = fileCounts.filter(r => r.type === 'folder').length; + const topLevelFileCount = fileCounts.filter(r => r.type === 'file').length; + const descendantFileCount = fileCounts.reduce((t, r) => t + r.count, 0); + const bodyProps = { + topLevelFolderCount, + topLevelFileCount, + descendantFileCount, + filesAreVersioned, + archiveFiles + }; + body = _react.default.createElement(_BulkDeleteMessage.default, bodyProps); + if (topLevelFileCount + descendantFileCount > 0) { + deleteModalActions = [{ + label: _i18n.default._t('AssetAdmin.CANCEL', 'Cancel'), + handler: onCancel, + color: 'primary' + }, { + label: _i18n.default._t(transKey, transDefault), + handler: () => onConfirm(files.map(_ref3 => { + let { + id + } = _ref3; + return id; + })), + color: 'danger' + }]; + } + } + const isOpen = ![TRANSITIONS.CANCELING, TRANSITIONS.DELETING].includes(transition); + return _react.default.createElement(_DeletionModal.default, { + body: body, + isOpen: isOpen, + actions: deleteModalActions, + onCancel: onCancel, + onClosed: onModalClose, + filesAreVersioned: filesAreVersioned, + archiveFiles: archiveFiles + }); +}; +exports.Component = BulkDeleteConfirmation; +BulkDeleteConfirmation.propTypes = { + LoadingComponent: _propTypes.default.elementType, + transition: _propTypes.default.oneOf(['canceling', 'deleting', false]), + files: _propTypes.default.arrayOf(_fileShape.default), + descendantFileCounts: _propTypes.default.object, + onCancel: _propTypes.default.func.isRequired, + onModalClose: _propTypes.default.func.isRequired, + onConfirm: _propTypes.default.func.isRequired, + filesAreVersioned: _propTypes.default.bool.isRequired, + archiveFiles: _propTypes.default.bool.isRequired, + actions: _propTypes.default.object.isRequired +}; +const ConnectedModal = (0, _redux.compose)((0, _Injector.inject)(['Loading'], Loading => ({ + LoadingComponent: Loading +})))(BulkDeleteConfirmation); +const ConditionalModal = _ref4 => { + let { + showConfirmation, + files, + ...props + } = _ref4; + return showConfirmation && files.length > 0 ? _react.default.createElement(ConnectedModal, _extends({}, props, { + files: files + })) : null; +}; +const mapStateToProps = _ref5 => { + let { + assetAdmin: { + confirmDeletion + } + } = _ref5; + return confirmDeletion; +}; +const mapDispatchToProps = dispatch => ({ + onCancel: () => dispatch(confirmDeletionActions.cancel()), + onModalClose: () => dispatch(confirmDeletionActions.modalClose()), + actions: { + toasts: (0, _redux.bindActionCreators)(toastsActions, dispatch), + confirmation: (0, _redux.bindActionCreators)(confirmDeletionActions, dispatch) + } +}); +var _default = exports["default"] = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(ConditionalModal); + +/***/ }), + +/***/ "./client/src/containers/BulkDeleteConfirmation/BulkDeleteMessage.js": +/*!***************************************************************************!*\ + !*** ./client/src/containers/BulkDeleteConfirmation/BulkDeleteMessage.js ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const confirmationMessage = (topLevelFolderCount, topLevelFileCount, descendantFileCount, filesAreVersioned, archiveFiles) => { + const fileCount = topLevelFileCount + descendantFileCount; + if (fileCount > 0) { + let transKey = 'AssetAdmin.BULK_ACTIONS_DELETE_ITEMS_CONFIRM'; + let transDefault = ["You're about to delete %s file(s) which may be used in your site's content.", 'Carefully check the file usage on the files before deleting the file(s).'].join(' '); + if (filesAreVersioned && archiveFiles) { + transKey = 'AssetAdmin.BULK_ACTIONS_ARCHIVE_ITEMS_CONFIRM'; + transDefault = ["You're about to archive %s file(s) which may be used in your site's content.", 'Carefully check the file usage on the files before archiving the file(s).'].join(' '); + } + return _i18n.default.sprintf(_i18n.default._t(transKey, transDefault), fileCount); + } else if (topLevelFolderCount === 1) { + let transKey = 'AssetAdmin.BULK_ACTIONS_DELETE_FOLDER_CONFIRM'; + let transDefault = 'Are you sure you want to delete this folder?'; + if (filesAreVersioned && archiveFiles) { + transKey = 'AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDER_CONFIRM'; + transDefault = 'Are you sure you want to archive this folder?'; + } + return _i18n.default._t(transKey, transDefault); + } + let transKey = 'AssetAdmin.BULK_ACTIONS_DELETE_FOLDERS_CONFIRM'; + let transDefault = 'Are you sure you want to delete these folders?'; + if (filesAreVersioned && archiveFiles) { + transKey = 'AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDERS_CONFIRM'; + transDefault = 'Are you sure you want to archive these folders?'; + } + return _i18n.default._t(transKey, transDefault); +}; +const BulkDeleteMessage = _ref => { + let { + topLevelFolderCount, + topLevelFileCount, + descendantFileCount, + filesAreVersioned, + archiveFiles + } = _ref; + let transKey = 'AssetAdmin.BULK_ACTIONS_DELETE_WARNING'; + let transDefault = 'Ensure files are removed from content areas prior to deleting them, otherwise they will ' + 'appear as broken links.'; + if (filesAreVersioned && archiveFiles) { + transKey = 'AssetAdmin.BULK_ACTIONS_ARCHIVE_WARNING'; + transDefault = 'Ensure files are removed from content areas prior to archiving them, otherwise they will ' + 'appear as broken links.'; + } + const message = confirmationMessage(topLevelFolderCount, topLevelFileCount, descendantFileCount, filesAreVersioned, archiveFiles); + return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("p", null, message), topLevelFileCount + descendantFileCount > 0 && _react.default.createElement("p", null, _i18n.default._t(transKey, transDefault))); +}; +BulkDeleteMessage.propTypes = { + topLevelFolderCount: _propTypes.default.number, + topLevelFileCount: _propTypes.default.number, + descendantFileCount: _propTypes.default.number +}; +BulkDeleteMessage.defaultProps = { + topLevelFolderCount: 0, + topLevelFileCount: 0, + descendantFileCount: 0 +}; +var _default = exports["default"] = BulkDeleteMessage; + +/***/ }), + +/***/ "./client/src/containers/BulkDeleteConfirmation/DeletionModal.js": +/*!***********************************************************************!*\ + !*** ./client/src/containers/BulkDeleteConfirmation/DeletionModal.js ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _reactstrap = __webpack_require__(/*! reactstrap */ "reactstrap"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const DeletionModal = _ref => { + let { + isOpen, + body, + onCancel, + actions, + filesAreVersioned, + archiveFiles + } = _ref; + let transKey = 'AssetAdmin.CONFIRM_FILE_DELETION'; + let transDefault = 'Confirm deletion'; + if (filesAreVersioned && archiveFiles) { + transKey = 'AssetAdmin.CONFIRM_FILE_ARCHIVE'; + transDefault = 'Confirm archive'; + } + return _react.default.createElement(_reactstrap.Modal, { + isOpen: isOpen, + toggle: onCancel + }, _react.default.createElement(_reactstrap.ModalHeader, { + toggle: onCancel + }, _i18n.default._t(transKey, transDefault)), _react.default.createElement(_reactstrap.ModalBody, null, body), _react.default.createElement(_reactstrap.ModalFooter, null, actions.map(_ref2 => { + let { + label, + handler, + color + } = _ref2; + return _react.default.createElement(_reactstrap.Button, { + key: label, + color: color, + onClick: handler + }, label); + }))); +}; +DeletionModal.propTypes = { + isOpen: _propTypes.default.bool.isRequired, + body: _propTypes.default.node.isRequired, + onCancel: _propTypes.default.func.isRequired, + actions: _propTypes.default.arrayOf(_propTypes.default.shape({ + label: _propTypes.default.string.isRequired, + handler: _propTypes.default.func, + color: _propTypes.default.string + })), + filesAreVersioned: _propTypes.default.bool.isRequired, + archiveFiles: _propTypes.default.bool.isRequired +}; +var _default = exports["default"] = DeletionModal; + +/***/ }), + +/***/ "./client/src/containers/Editor/Editor.js": +/*!************************************************!*\ + !*** ./client/src/containers/Editor/Editor.js ***! + \************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _FormBuilderLoader = _interopRequireDefault(__webpack_require__(/*! containers/FormBuilderLoader/FormBuilderLoader */ "containers/FormBuilderLoader/FormBuilderLoader")); +var UnsavedFormsActions = _interopRequireWildcard(__webpack_require__(/*! state/unsavedForms/UnsavedFormsActions */ "state/unsavedForms/UnsavedFormsActions")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +var confirmDeletionActions = _interopRequireWildcard(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionActions */ "./client/src/state/confirmDeletion/ConfirmDeletionActions.js")); +var modalActions = _interopRequireWildcard(__webpack_require__(/*! state/modal/ModalActions */ "./client/src/state/modal/ModalActions.js")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _url = _interopRequireDefault(__webpack_require__(/*! url */ "url")); +var _qs = _interopRequireDefault(__webpack_require__(/*! qs */ "qs")); +var _EditorHeader = _interopRequireWildcard(__webpack_require__(/*! ./EditorHeader */ "./client/src/containers/Editor/EditorHeader.js")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +const formIdentifier = 'AssetAdmin.EditForm'; +class Editor extends _react.Component { + constructor(props) { + super(props); + this.getFormSchemaUrl = this.getFormSchemaUrl.bind(this); + this.handleCancelKeyDown = this.handleCancelKeyDown.bind(this); + this.handleClose = this.handleClose.bind(this); + this.handleSubmit = this.handleSubmit.bind(this); + this.handleAction = this.handleAction.bind(this); + this.handleLoadingSuccess = this.handleLoadingSuccess.bind(this); + this.handleLoadingError = this.handleLoadingError.bind(this); + this.handleFetchingSchema = this.handleFetchingSchema.bind(this); + this.createFn = this.createFn.bind(this); + this.editorHeader = this.editorHeader.bind(this); + this.state = { + loadingForm: false, + loadingError: null, + file: null + }; + } + componentDidMount() { + this.refetchFile(); + } + componentDidUpdate(prevProps) { + if (prevProps.fileId !== this.props.fileId && prevProps.fileId !== null) { + this.refetchFile(); + } + } + refetchFile() { + const sectionConfig = _Config.default.getSection('SilverStripe\\AssetAdmin\\Controller\\AssetAdminOpen'); + const endpointUrl = `${sectionConfig.endpoints.read.url}/${this.props.fileId}`; + _Backend.default.get(endpointUrl).then(response => response.json()).then(responseJson => { + this.setState({ + file: responseJson + }); + }); + } + getFormSchemaUrl() { + const { + schemaUrlQueries, + schemaUrl, + fileId + } = this.props; + const parsedURL = _url.default.parse(schemaUrl); + const parsedQs = schemaUrlQueries.reduce((accumulator, _ref) => { + let { + name, + value + } = _ref; + return { + ...accumulator, + [name]: value + }; + }, {}); + return _url.default.format({ + ...parsedURL, + pathname: `${parsedURL.path}/${fileId}`, + search: _qs.default.stringify(parsedQs) + }); + } + handleAction(event) { + const file = this.state.file; + switch (event.currentTarget.name) { + case 'action_replacefile': + this.replaceFile(); + event.preventDefault(); + break; + case 'action_downloadfile': + this.downloadFile(); + event.preventDefault(); + break; + case 'action_delete': + this.props.actions.confirmDeletion.confirm([file]); + event.preventDefault(); + break; + default: + break; + } + } + handleCancelKeyDown(event) { + if (event.keyCode === _index.default.SPACE_KEY_CODE || event.keyCode === _index.default.RETURN_KEY_CODE) { + this.handleClose(event); + } + } + handleSubmit(data, action, submitFn) { + const { + showingSubForm, + actions + } = this.props; + if (typeof this.props.onSubmit === 'function') { + return this.props.onSubmit(data, action, submitFn).finally(() => { + if (showingSubForm && ['action_save', 'action_publish'].indexOf(action) !== -1) { + actions.modal.popFormStackEntry(); + } + }); + } + return submitFn(); + } + handleClose(event) { + const { + showingSubForm, + onClose, + actions + } = this.props; + if (showingSubForm) { + actions.modal.popFormStackEntry(); + } else { + onClose(); + } + if (event) { + event.preventDefault(); + } + } + replaceFile() { + const hiddenFileInput = document.querySelector('.dz-input-PreviewImage'); + if (hiddenFileInput) { + hiddenFileInput.click(); + } + } + downloadFile() { + function downloadURI(uri, name) { + const link = document.createElement('a'); + link.download = name; + link.href = uri; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } + const file = this.state.file; + downloadURI(file.url, file.name); + document.getElementById('Form_fileEditForm_PopoverActions').focus(); + } + handleLoadingError(exception) { + this.setState({ + loadingForm: false, + loadingError: exception.errors[0] + }); + } + handleLoadingSuccess() { + this.setState({ + loadingForm: false, + loadingError: null + }); + } + handleFetchingSchema() { + this.setState({ + loadingForm: true + }); + } + editorHeader(_ref2) { + let { + SchemaComponent, + ...fieldProps + } = _ref2; + const { + dialog, + nextType, + showingSubForm, + actions, + EditorHeaderComponent + } = this.props; + const schemaUrl = this.getFormSchemaUrl(); + const file = this.state.file; + let showButton = _EditorHeader.buttonStates.SWITCH; + if (dialog && file && file.type !== 'folder') { + showButton = showingSubForm ? _EditorHeader.buttonStates.ALWAYS_BACK : _EditorHeader.buttonStates.ONLY_BACK; + } + const { + formid + } = fieldProps; + const onDetails = nextType && file && file.type !== 'folder' ? () => { + actions.modal.stashFormValues(formid, schemaUrl); + actions.modal.pushFormStackEntry(nextType); + } : undefined; + const props = { + onCancel: this.handleClose, + showButton, + onDetails + }; + return _react.default.createElement(EditorHeaderComponent, props, _react.default.createElement(SchemaComponent, fieldProps)); + } + createFn(SchemaComponent, componentProps) { + if (componentProps.name === 'AssetEditorHeaderFieldGroup') { + const CreatedEditorHeader = this.editorHeader; + const editorHeaderProps = { + key: componentProps.id, + SchemaComponent, + ...componentProps + }; + return _react.default.createElement(CreatedEditorHeader, editorHeaderProps); + } + return _react.default.createElement(SchemaComponent, _extends({ + key: componentProps.id + }, componentProps)); + } + render() { + if (!this.state.file) { + return null; + } + const { + FormBuilderLoaderComponent + } = this.props; + const formSchemaUrl = this.getFormSchemaUrl(); + const editorClasses = (0, _classnames.default)('panel', 'form--no-dividers', 'editor', { + 'editor--asset-dropzone--disable': !this.props.enableDropzone + }, this.props.className); + let error = null; + if (this.state.loadingError) { + let message = this.state.loadingError.value; + if (this.state.loadingError.code === 404) { + message = _i18n.default._t('AssetAdmin.FILE_MISSING', 'File cannot be found'); + } + if (!message) { + message = _i18n.default._t('Admin.UNKNOWN_ERROR', 'An unknown error has occurred'); + } + error = _react.default.createElement("div", { + className: "editor__file-preview-message--file-missing" + }, message); + } + const Loading = this.props.loadingComponent; + return _react.default.createElement("div", { + className: editorClasses + }, _react.default.createElement("div", { + className: "editor__details fill-height" + }, _react.default.createElement(FormBuilderLoaderComponent, { + identifier: formIdentifier, + schemaUrl: formSchemaUrl, + onSubmit: this.handleSubmit, + onAction: this.handleAction, + onLoadingSuccess: this.handleLoadingSuccess, + onLoadingError: this.handleLoadingError, + onFetchingSchema: this.handleFetchingSchema, + createFn: this.createFn, + file: this.state.file + }), error, this.state.loadingForm && _react.default.createElement(Loading, null))); + } +} +exports.Component = Editor; +Editor.propTypes = { + className: _propTypes.default.string, + fileId: _propTypes.default.number.isRequired, + enableDropzone: _propTypes.default.bool, + dialog: _propTypes.default.bool, + onClose: _propTypes.default.func.isRequired, + onSubmit: _propTypes.default.func.isRequired, + schemaUrl: _propTypes.default.string.isRequired, + schemaUrlQueries: _propTypes.default.arrayOf(_propTypes.default.shape({ + name: _propTypes.default.string, + value: _propTypes.default.any + })), + actions: _propTypes.default.object, + showingSubForm: _propTypes.default.bool, + nextType: _propTypes.default.string, + EditorHeaderComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]), + FormBuilderLoaderComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +Editor.defaultProps = { + EditorHeaderComponent: _EditorHeader.default, + FormBuilderLoaderComponent: _FormBuilderLoader.default +}; +function mapDispatchToProps(dispatch) { + return { + actions: { + unsavedForms: (0, _redux.bindActionCreators)(UnsavedFormsActions, dispatch), + confirmDeletion: (0, _redux.bindActionCreators)(confirmDeletionActions, dispatch), + modal: (0, _redux.bindActionCreators)(modalActions, dispatch) + } + }; +} +function mapStateToProps(_ref3) { + let { + assetAdmin: { + gallery, + modal + } + } = _ref3; + return { + enableDropzone: gallery.enableDropzone, + nextType: modal.formSchema && modal.formSchema.nextType, + showingSubForm: modal.formSchemaStack && modal.formSchemaStack.length > 1 + }; +} +var _default = exports["default"] = (0, _redux.compose)((0, _Injector.inject)(['Loading'], Loading => ({ + loadingComponent: Loading +}), () => 'AssetAdmin.Editor'), (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(Editor); + +/***/ }), + +/***/ "./client/src/containers/Editor/EditorHeader.js": +/*!******************************************************!*\ + !*** ./client/src/containers/Editor/EditorHeader.js ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.buttonStates = void 0; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _Button = _interopRequireDefault(__webpack_require__(/*! components/Button/Button */ "components/Button/Button")); +var _BackButton = _interopRequireDefault(__webpack_require__(/*! components/Button/BackButton */ "components/Button/BackButton")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const handle = handler => e => { + e.preventDefault(); + if (handler) { + handler(); + } +}; +const ALWAYS_BACK = 'ALWAYS_BACK'; +const ALWAYS_CANCEL = 'ALWAYS_CANCEL'; +const SWITCH = 'SWITCH'; +const ONLY_BACK = 'ONLY_BACK'; +const ONLY_CANCEL = 'ONLY_CANCEL'; +const NONE = 'NONE'; +const buttonStates = exports.buttonStates = { + ALWAYS_BACK, + ALWAYS_CANCEL, + SWITCH, + ONLY_BACK, + ONLY_CANCEL, + NONE +}; +const EditorHeader = _ref => { + let { + onCancel, + onDetails, + showButton, + children + } = _ref; + const cancelHandler = handle(onCancel); + const showBack = [ALWAYS_BACK, SWITCH, ONLY_BACK].indexOf(showButton) >= 0; + const showCancel = [ALWAYS_CANCEL, SWITCH, ONLY_CANCEL].indexOf(showButton) >= 0; + const backClassName = (0, _classnames.default)('editor-header__back-button', 'btn--icon-xl', { + 'editor-header__back-button--md-below': [SWITCH, ONLY_BACK].indexOf(showButton) >= 0 + }); + const cancelClassName = (0, _classnames.default)('editor-header__cancel-button', 'btn--icon-xl', { + 'editor-header__cancel-button--lg-above': [SWITCH, ONLY_CANCEL].indexOf(showButton) >= 0 + }); + return _react.default.createElement("div", { + className: "editor-header" + }, showBack && _react.default.createElement(_BackButton.default, { + className: backClassName, + onClick: cancelHandler + }), _react.default.createElement("div", { + className: "editor-header__field" + }, children), onDetails && _react.default.createElement(_Button.default, { + onClick: handle(onDetails), + icon: "edit-list", + className: "editor-header__edit", + outline: true + }, _i18n.default._t('AssetAdmin.DETAILS', 'Details')), showCancel && _react.default.createElement("div", null, _react.default.createElement(_Button.default, { + icon: "cancel", + className: cancelClassName, + noText: true, + onClick: cancelHandler + }, _i18n.default._t('AssetAdmin.CANCEL')))); +}; +EditorHeader.propTypes = { + onCancel: _propTypes.default.func, + onDetails: _propTypes.default.func, + showButton: _propTypes.default.oneOf(Object.keys(buttonStates).map(state => buttonStates[state])), + children: _propTypes.default.node +}; +var _default = exports["default"] = EditorHeader; + +/***/ }), + +/***/ "./client/src/containers/Gallery/Gallery.js": +/*!**************************************************!*\ + !*** ./client/src/containers/Gallery/Gallery.js ***! + \**************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.galleryViewPropTypes = exports.galleryViewDefaultProps = exports["default"] = exports.Component = void 0; +var _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ "jquery")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _AssetDropzone = _interopRequireDefault(__webpack_require__(/*! components/AssetDropzone/AssetDropzone */ "./client/src/components/AssetDropzone/AssetDropzone.js")); +var _BulkActions = _interopRequireDefault(__webpack_require__(/*! components/BulkActions/BulkActions */ "./client/src/components/BulkActions/BulkActions.js")); +var _ThumbnailView = _interopRequireDefault(__webpack_require__(/*! containers/ThumbnailView/ThumbnailView */ "./client/src/containers/ThumbnailView/ThumbnailView.js")); +var _TableView = _interopRequireDefault(__webpack_require__(/*! containers/TableView/TableView */ "./client/src/containers/TableView/TableView.js")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _FormAlert = _interopRequireDefault(__webpack_require__(/*! components/FormAlert/FormAlert */ "components/FormAlert/FormAlert")); +var galleryActions = _interopRequireWildcard(__webpack_require__(/*! state/gallery/GalleryActions */ "./client/src/state/gallery/GalleryActions.js")); +var toastsActions = _interopRequireWildcard(__webpack_require__(/*! state/toasts/ToastsActions */ "state/toasts/ToastsActions")); +var queuedFilesActions = _interopRequireWildcard(__webpack_require__(/*! state/queuedFiles/QueuedFilesActions */ "./client/src/state/queuedFiles/QueuedFilesActions.js")); +var confirmDeletionActions = _interopRequireWildcard(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionActions */ "./client/src/state/confirmDeletion/ConfirmDeletionActions.js")); +var _reactSelectable = __webpack_require__(/*! react-selectable */ "./node_modules/react-selectable/dist/react-selectable.js"); +var _configShape = _interopRequireDefault(__webpack_require__(/*! lib/configShape */ "./client/src/lib/configShape.js")); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var _getStatusCodeMessage = _interopRequireDefault(__webpack_require__(/*! lib/getStatusCodeMessage */ "./client/src/lib/getStatusCodeMessage.js")); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +var _MoveModal = _interopRequireDefault(__webpack_require__(/*! ../MoveModal/MoveModal */ "./client/src/containers/MoveModal/MoveModal.js")); +var _GalleryDND = _interopRequireDefault(__webpack_require__(/*! ./GalleryDND */ "./client/src/containers/Gallery/GalleryDND.js")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const ACTION_TYPES = { + DELETE: 'delete', + ARCHIVE: 'archive', + EDIT: 'edit', + MOVE: 'move', + PUBLISH: 'publish', + UNPUBLISH: 'unpublish', + INSERT: 'insert', + ADMIN: 'admin', + SELECT: 'select' +}; +class Gallery extends _react.Component { + constructor(props) { + super(props); + this.handleOpenFolder = this.handleOpenFolder.bind(this); + this.handleOpenFile = this.handleOpenFile.bind(this); + this.handleSelect = this.handleSelect.bind(this); + this.handleAddedFile = this.handleAddedFile.bind(this); + this.handlePreviewLoaded = this.handlePreviewLoaded.bind(this); + this.handleCancelUpload = this.handleCancelUpload.bind(this); + this.handleRemoveErroredUpload = this.handleRemoveErroredUpload.bind(this); + this.handleUploadProgress = this.handleUploadProgress.bind(this); + this.handleSending = this.handleSending.bind(this); + this.handleSort = this.handleSort.bind(this); + this.handleSetPage = this.handleSetPage.bind(this); + this.handleSuccessfulUpload = this.handleSuccessfulUpload.bind(this); + this.handleQueueComplete = this.handleQueueComplete.bind(this); + this.handleFailedUpload = this.handleFailedUpload.bind(this); + this.handleClearSearch = this.handleClearSearch.bind(this); + this.handleEnableDropzone = this.handleEnableDropzone.bind(this); + this.handleMoveFiles = this.handleMoveFiles.bind(this); + this.handleBulkEdit = this.handleBulkEdit.bind(this); + this.handleBulkPublish = this.handleBulkPublish.bind(this); + this.handleBulkUnpublish = this.handleBulkUnpublish.bind(this); + this.handleBulkMove = this.handleBulkMove.bind(this); + this.handleBulkInsert = this.handleBulkInsert.bind(this); + this.handleBeginSelection = this.handleBeginSelection.bind(this); + this.handleGroupSelect = this.handleGroupSelect.bind(this); + this.handleClearSelection = this.handleClearSelection.bind(this); + this.handleSelectAll = this.handleSelectAll.bind(this); + this.toggleSelectConcat = this.toggleSelectConcat.bind(this); + this.getSelectableFiles = this.getSelectableFiles.bind(this); + } + componentDidMount() { + this.initSortDropdown(); + window.addEventListener('keydown', this.toggleSelectConcat); + window.addEventListener('keyup', this.toggleSelectConcat); + } + componentDidUpdate(prevProps) { + this.initSortDropdown(); + this.initFlushUploadFiles(prevProps); + } + componentWillUnmount() { + window.removeEventListener('keydown', this.toggleSelectConcat); + window.removeEventListener('keyup', this.toggleSelectConcat); + } + initFlushUploadFiles(prevProps) { + if (this.props.view !== 'tile') { + const $select = this.getSortElement(); + $select.off('change'); + } + if (prevProps.folderId !== this.props.folderId) { + this.props.actions.queuedFiles.purgeUploadQueue(); + } + } + getSortElement() { + return (0, _jquery.default)(this.gallery).find('.gallery__sort .dropdown'); + } + getSearchMessage(filters) { + const messages = []; + if (filters.name) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGEKEYWORDS', 'with keywords \'{name}\'')); + } + if (filters.lastEditedFrom && filters.lastEditedTo) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGEEDITEDBETWEEN', 'last edited between \'{lastEditedFrom}\' and \'{lastEditedTo}\'')); + } else if (filters.lastEditedFrom) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGEEDITEDFROM', 'last edited after \'{lastEditedFrom}\'')); + } else if (filters.lastEditedTo) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGEEDITEDTO', 'last edited before \'{lastEditedTo}\'')); + } + if (filters.appCategory) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGECATEGORY', 'categorised as \'{appCategory}\'')); + } + if (filters.currentFolderOnly && this.props.folder.title) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGELIMIT', 'limited to the folder \'{folder}\'')); + } + const parts = [messages.slice(0, -1).join(`${_i18n.default._t('AssetAdmin.JOIN', ',')} `), messages.slice(-1)].filter(part => part).join(` ${_i18n.default._t('AssetAdmin.JOINLAST', 'and')} `); + if (parts === '') { + return ''; + } + const searchResults = { + parts: _i18n.default.inject(parts, Object.assign({ + folder: this.props.folder.title + }, filters, { + appCategory: filters.appCategory ? filters.appCategory.toLowerCase() : undefined + })) + }; + return _i18n.default.inject(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGE', 'Search results {parts}'), searchResults); + } + getSelection(firstId, lastId) { + const selectable = this.getSelectableFiles(); + const indexes = [firstId, lastId].map(id => selectable.findIndex(file => file.id === id)).filter(index => index !== -1).sort((a, b) => a - b); + if (indexes.length !== 2) { + return indexes.map(index => selectable[index].id); + } + const [firstIndex, lastIndex] = indexes; + return selectable.filter((file, index) => index >= firstIndex && index <= lastIndex).map(file => file.id); + } + getSelectableFiles() { + const selectable = this.props.files.filter(file => file.id); + if (this.props.type === ACTION_TYPES.SELECT) { + return selectable.filter(item => item.type !== 'folder'); + } + return selectable; + } + handleBulkInsert(event, items) { + this.props.onInsertMany(event, items); + } + handleBulkPublish(event, items) { + const publishItems = items.map(item => item.id); + if (!publishItems.length) { + this.props.actions.gallery.deselectFiles(); + return Promise.resolve(true); + } + this.props.actions.gallery.setLoading(true); + return this.props.onPublish(publishItems).then(resultItems => { + this.props.actions.gallery.setLoading(false); + this.props.actions.toasts.success(_i18n.default.sprintf(_i18n.default._t('AssetAdmin.BULK_ACTIONS_PUBLISH_SUCCESS', '%s folders/files were successfully published.'), resultItems.length)); + this.props.actions.gallery.deselectFiles(); + }); + } + handleBulkUnpublish(event, items) { + const unpublishItems = items.filter(item => item.published).map(item => item.id); + if (!unpublishItems.length) { + this.props.actions.gallery.deselectFiles(); + return Promise.resolve(true); + } + this.props.actions.gallery.setLoading(true); + return this.props.onUnpublish(unpublishItems).then(resultItems => { + this.props.actions.gallery.setLoading(false); + this.props.actions.toasts.success(_i18n.default.sprintf(_i18n.default._t('AssetAdmin.BULK_ACTIONS_UNPUBLISH_SUCCESS', '%s folders/files were successfully unpublished.'), resultItems.length)); + this.props.actions.gallery.deselectFiles(); + }); + } + initSortDropdown() { + if (this.props.view === 'tile') { + const $select = this.getSortElement(); + $select.chosen({ + allow_single_deselect: true, + disable_search_threshold: 20 + }); + $select.off('change'); + $select.on('change', () => $select.find(':selected')[0].click()); + } + } + handleSort(value) { + this.props.actions.queuedFiles.purgeUploadQueue(); + this.props.onSort(value); + } + handleSetPage(page) { + this.props.onSetPage(page); + } + handleCancelUpload(fileData) { + fileData.xhr.abort(); + this.props.actions.queuedFiles.removeQueuedFile(fileData.queuedId); + } + handleRemoveErroredUpload(fileData) { + this.props.actions.queuedFiles.removeQueuedFile(fileData.queuedId); + } + handleAddedFile(fileData) { + this.props.actions.queuedFiles.addQueuedFile(fileData); + } + handlePreviewLoaded(fileData, previewData) { + this.props.actions.queuedFiles.updateQueuedFile(fileData.queuedId, previewData); + } + handleSending(file, xhr) { + this.props.actions.queuedFiles.updateQueuedFile(file._queuedId, { + xhr + }); + } + handleUploadProgress(file, progress) { + this.props.actions.queuedFiles.updateQueuedFile(file._queuedId, { + progress + }); + } + handleSuccessfulUpload(fileXhr) { + const json = JSON.parse(fileXhr.xhr.response); + if (typeof json[0].error !== 'undefined') { + this.handleFailedUpload(fileXhr); + return; + } + this.props.actions.queuedFiles.succeedUpload(fileXhr._queuedId, json[0]); + if (this.props.onSuccessfulUpload) { + this.props.onSuccessfulUpload(json); + } + const filesInProgress = this.props.queuedFiles.items.reduce((inProgress, file) => { + if (file.progress !== 100) { + return inProgress + 1; + } + return inProgress; + }, 0); + if (!this.props.fileId && !this.props.selectedFiles.length && filesInProgress === 0) { + const lastFile = json.pop(); + this.props.onOpenFile(lastFile.id); + } + } + handleQueueComplete() { + if (this.props.onSuccessfulUploadQueue) { + this.props.onSuccessfulUploadQueue(); + } + } + handleFailedUpload(fileXhr, response) { + const statusCodeMessage = fileXhr.xhr && fileXhr.xhr.status ? (0, _getStatusCodeMessage.default)(fileXhr.xhr.status, fileXhr.xhr) : ''; + this.props.actions.queuedFiles.failUpload(fileXhr._queuedId, response, statusCodeMessage); + } + itemIsSelected(id) { + return this.props.selectedFiles.indexOf(id) > -1; + } + toggleSelectConcat(event) { + this.props.actions.gallery.setConcatenateSelect(this.isConcat(event)); + } + isConcat(event) { + return event.metaKey || event.ctrlKey || event.shiftKey; + } + itemIsHighlighted(id) { + return this.props.fileId === id; + } + hasOpenedItem() { + return !!this.props.fileId; + } + handleClearSearch(event) { + this.props.onClearSearch(event); + } + handleGroupSelect(items, event) { + const { + setSelectedFiles, + selectFiles + } = this.props.actions.gallery; + const selectableFiles = this.getSelectableFiles(); + const selectItems = items.filter((id, index) => { + if (items.indexOf(id) !== index) { + return false; + } + return selectableFiles.find(file => file.id === id); + }); + const concat = this.props.concatenateSelect || this.isConcat(event); + if (this.props.maxFilesSelect !== null) { + let totalFiles = selectItems.length; + if (concat) { + const totalSelected = this.props.selectedFiles.filter(id => !this.props.selectedFiles.includes(id)).concat(this.props.selectedFiles); + totalFiles = totalSelected.length; + } + if (totalFiles >= this.props.maxFilesSelect) { + return; + } + } + if (!concat) { + setSelectedFiles(selectItems); + } else { + selectFiles(selectItems); + } + } + handleClearSelection() { + this.props.actions.gallery.deselectFiles(); + } + handleSelectAll() { + const ids = this.props.files.map(file => file.id); + this.handleGroupSelect(ids, new Event('na')); + } + handleBeginSelection(e) { + let node = e.target; + while (node) { + if (node.classList.contains('griddle-footer')) { + return false; + } + if (node.classList.contains('gallery__main--selectable')) { + break; + } + node = node.parentNode; + } + return true; + } + handleOpenFolder(event, folder) { + event.preventDefault(); + this.props.onOpenFolder(folder.id); + } + handleOpenFile(event, file) { + event.preventDefault(); + if (file.created === null) { + return; + } + if ((!this.props.selectedFiles.length || this.props.maxFilesSelect === 1) && this.props.type === ACTION_TYPES.SELECT) { + this.handleSelect(event, file); + } + this.props.onOpenFile(file.id, file); + } + handleSelect(event, item) { + const maxFiles = this.props.maxFilesSelect; + const selectable = this.getSelectableFiles(); + let selectedItemIDs = selectable.filter(file => file.id === item.id).map(file => file.id); + if (maxFiles === 1) { + this.props.actions.gallery.setSelectedFiles(selectedItemIDs); + return; + } + if (this.props.selectedFiles.indexOf(item.id) === -1) { + if (event.shiftKey) { + selectedItemIDs = this.getSelection(this.props.lastSelected, item.id); + } + const totalSelected = this.props.selectedFiles.filter(id => !selectedItemIDs.includes(id)).concat(selectedItemIDs); + if (totalSelected.length > maxFiles && maxFiles !== null) { + return; + } + this.props.actions.gallery.selectFiles(selectedItemIDs); + this.props.actions.gallery.setLastSelected(item.id); + } else { + this.props.actions.gallery.deselectFiles([item.id]); + if (event.shiftKey) { + this.props.actions.gallery.setLastSelected(null); + } + } + } + handleEnableDropzone(enabled) { + this.props.actions.gallery.setEnableDropzone(enabled); + } + handleMoveFiles(folderId, fileIds) { + const url = this.props.sectionConfig.endpoints.move.url; + return _Backend.default.post(url, { + ids: fileIds, + folderID: folderId + }, { + 'X-SecurityID': _Config.default.get('SecurityID') + }).then(() => { + const duration = _index.default.MOVE_SUCCESS_DURATION; + const message = `+${fileIds.length}`; + this.props.actions.gallery.setFileBadge(folderId, message, 'success', duration); + if (typeof this.props.onMoveFilesSuccess === 'function') { + this.props.onMoveFilesSuccess(folderId, fileIds); + } + }).catch(() => { + this.props.actions.toasts.error(_i18n.default._t('AssetAdmin.FAILED_MOVE', 'There was an error moving the selected items.')); + }); + } + handleBulkEdit(event, items) { + this.handleOpenFile(event, items[0]); + } + handleBulkMove() { + this.props.actions.gallery.activateModal(_index.default.MODAL_MOVE); + } + renderTransitionBulkActions() { + return this.renderBulkActions(); + } + renderBulkActions() { + const { + type, + dialog, + maxFilesSelect, + files, + selectedFiles, + BulkActionsComponent, + sectionConfig + } = this.props; + const actionFilter = type === ACTION_TYPES.SELECT || dialog ? action => action.value === ACTION_TYPES.INSERT : action => action.value !== ACTION_TYPES.INSERT; + const deleteButtonFilter = sectionConfig.filesAreVersioned && sectionConfig.archiveFiles ? action => action.value !== ACTION_TYPES.DELETE : action => action.value !== ACTION_TYPES.ARCHIVE; + const actions = _index.default.BULK_ACTIONS.filter(actionFilter).filter(deleteButtonFilter).map(action => { + if (action.callback) { + return action; + } + switch (action.value) { + case ACTION_TYPES.DELETE: + case ACTION_TYPES.ARCHIVE: + { + return { + ...action, + callback: (event, items) => { + this.props.actions.confirmDeletion.confirm(items); + }, + confirm: undefined + }; + } + case ACTION_TYPES.EDIT: + { + return { + ...action, + callback: this.handleBulkEdit + }; + } + case ACTION_TYPES.MOVE: + { + return { + ...action, + callback: this.handleBulkMove + }; + } + case ACTION_TYPES.PUBLISH: + { + return { + ...action, + callback: this.handleBulkPublish + }; + } + case ACTION_TYPES.UNPUBLISH: + { + return { + ...action, + callback: this.handleBulkUnpublish + }; + } + case ACTION_TYPES.INSERT: + { + return { + ...action, + callback: this.handleBulkInsert, + color: 'primary' + }; + } + default: + { + return action; + } + } + }); + const selected = selectedFiles.map(id => files.find(file => file && id === file.id)).filter(item => item); + if (selected.length > 0 && [ACTION_TYPES.ADMIN, ACTION_TYPES.SELECT].includes(type)) { + return _react.default.createElement(BulkActionsComponent, { + actions: actions, + items: selected, + total: maxFilesSelect, + key: selected.length > 0, + container: this.gallery, + showCount: maxFilesSelect !== 1, + onClearSelection: this.handleClearSelection, + onSelectAll: this.handleSelectAll + }); + } + return null; + } + renderGalleryView() { + const GalleryView = this.props.view === 'table' ? _TableView.default : _ThumbnailView.default; + const files = this.props.files.map(file => { + const selected = this.itemIsSelected(file.id); + const highlighted = this.itemIsHighlighted(file.id); + const key = (file.queuedId ? `queueId${file.queuedId}` : `id${file.id}`) + (selected ? '--selected' : ''); + return { + ...file, + selected, + highlighted, + key + }; + }); + const { + type, + loading, + dialog, + page, + totalCount, + limit, + sort, + selectedFiles, + badges, + maxFilesSelect, + sectionConfig + } = this.props; + const selectableItems = type === ACTION_TYPES.SELECT || type === ACTION_TYPES.ADMIN && (!maxFilesSelect || maxFilesSelect > 1); + const props = { + selectableItems, + selectableFolders: type !== ACTION_TYPES.SELECT && !dialog, + files, + loading, + page, + totalCount, + limit, + sort, + selectedFiles, + badges, + onSort: this.handleSort, + onSetPage: this.handleSetPage, + onOpenFile: this.handleOpenFile, + onOpenFolder: this.handleOpenFolder, + onSelect: this.handleSelect, + onCancelUpload: this.handleCancelUpload, + onDropFiles: this.handleMoveFiles, + onRemoveErroredUpload: this.handleRemoveErroredUpload, + onEnableDropzone: this.handleEnableDropzone, + sectionConfig, + canDrag: type === ACTION_TYPES.ADMIN, + maxFilesSelect + }; + return _react.default.createElement(GalleryView, props); + } + renderToolbar() { + const { + GalleryToolbar, + sort, + view, + folder, + onCreateFolder, + onOpenFolder, + onViewChange + } = this.props; + const props = { + onMoveFiles: this.handleMoveFiles, + onSort: this.handleSort, + onCreateFolder, + onOpenFolder, + onViewChange, + view, + sort, + folder + }; + return _react.default.createElement(GalleryToolbar, props); + } + render() { + const { + folder, + loading, + errorMessage, + noticeMessage + } = this.props; + const Loading = this.props.LoadingComponent; + if (!folder) { + if (errorMessage) { + return _react.default.createElement("div", { + className: "gallery__error flexbox-area-grow" + }, _react.default.createElement("div", { + className: "gallery__error-message" + }, _react.default.createElement("h3", null, _i18n.default._t('AssetAdmin.DROPZONE_RESPONSE_ERROR', 'Server responded with an error.')), errorMessage && _react.default.createElement("p", null, errorMessage))); + } + if (loading) { + return _react.default.createElement("div", { + className: "flexbox-area-grow" + }, _react.default.createElement(Loading, null)); + } + return _react.default.createElement("div", { + className: "flexbox-area-grow" + }, _react.default.createElement("div", { + className: "editor__file-preview-message--file-missing m-t-3" + }, _i18n.default._t('Admin.UNKNOWN_ERROR', 'An unknown error has occurred'))); + } + const messages = _react.default.createElement("div", { + className: "gallery_messages" + }, errorMessage && _react.default.createElement(_FormAlert.default, { + value: errorMessage, + type: "danger" + }), noticeMessage && _react.default.createElement(_FormAlert.default, { + value: noticeMessage, + type: "success" + })); + const dimensions = { + height: _index.default.THUMBNAIL_HEIGHT, + width: _index.default.THUMBNAIL_WIDTH + }; + const dropzoneOptions = { + url: this.props.createFileApiUrl, + method: this.props.createFileApiMethod, + paramName: 'Upload', + clickable: '#upload-button', + ...this.props.sectionConfig.dropzoneOptions + }; + const securityID = this.props.securityId; + const canEdit = this.props.folder.canEdit && this.props.enableDropzone; + const galleryClasses = ['panel', 'panel--padded', 'panel--scrollable', 'gallery__main', 'fill-height']; + if (this.props.type === ACTION_TYPES.INSERT) { + galleryClasses.push('insert-media-modal__main'); + } + const cssClasses = galleryClasses; + if (this.hasOpenedItem()) { + cssClasses.push('gallery__main--has-opened-item'); + } + return _react.default.createElement("div", { + className: "flexbox-area-grow gallery__outer", + ref: gallery => { + this.gallery = gallery; + } + }, this.renderTransitionBulkActions(), _react.default.createElement(_GalleryDND.default, { + selectedFiles: this.props.selectedFiles, + className: galleryClasses.join(' ') + }, this.renderToolbar(), _react.default.createElement(_reactSelectable.SelectableGroup, { + enabled: this.props.view === 'tile' && this.props.type === ACTION_TYPES.ADMIN, + className: "flexbox-area-grow fill-height gallery__main--selectable", + onSelection: this.handleGroupSelect, + onNonItemClick: this.handleClearSelection, + onBeginSelection: this.handleBeginSelection, + preventDefault: false, + fixedPosition: true + }, _react.default.createElement(_AssetDropzone.default, { + name: "gallery-container", + className: "flexbox-area-grow", + canUpload: canEdit, + onAddedFile: this.handleAddedFile, + onPreviewLoaded: this.handlePreviewLoaded, + onError: this.handleFailedUpload, + onSuccess: this.handleSuccessfulUpload, + onQueueComplete: this.handleQueueComplete, + onSending: this.handleSending, + onUploadProgress: this.handleUploadProgress, + preview: dimensions, + folderId: this.props.folderId, + options: dropzoneOptions, + securityID: securityID, + uploadButton: false + }, messages, this.renderGalleryView()))), this.props.loading && _react.default.createElement(Loading, null), _react.default.createElement(_MoveModal.default, { + sectionConfig: this.props.sectionConfig, + folderId: this.props.folderId, + onSuccess: this.props.onMoveFilesSuccess, + onOpenFolder: this.props.onOpenFolder + })); + } +} +exports.Component = Gallery; +const sharedDefaultProps = { + page: 1, + limit: 15 +}; +const sharedPropTypes = { + sectionConfig: _configShape.default, + loading: _propTypes.default.bool, + sort: _propTypes.default.string, + files: _propTypes.default.arrayOf(_propTypes.default.shape({ + id: _propTypes.default.number, + parent: _propTypes.default.shape({ + id: _propTypes.default.number + }) + })).isRequired, + selectedFiles: _propTypes.default.arrayOf(_propTypes.default.number), + totalCount: _propTypes.default.number, + page: _propTypes.default.number, + limit: _propTypes.default.number, + badges: _propTypes.default.arrayOf(_propTypes.default.shape({ + id: _propTypes.default.number, + message: _propTypes.default.node, + status: _propTypes.default.string + })), + onOpenFile: _propTypes.default.func.isRequired, + onOpenFolder: _propTypes.default.func.isRequired, + onSort: _propTypes.default.func.isRequired, + onSetPage: _propTypes.default.func.isRequired, + maxFilesSelect: _propTypes.default.number +}; +const galleryViewDefaultProps = exports.galleryViewDefaultProps = Object.assign({}, sharedDefaultProps, { + selectableItems: false +}); +const galleryViewPropTypes = exports.galleryViewPropTypes = Object.assign({}, sharedPropTypes, { + selectableItems: _propTypes.default.bool, + selectableFolders: _propTypes.default.bool, + onSelect: _propTypes.default.func, + onCancelUpload: _propTypes.default.func, + onRemoveErroredUpload: _propTypes.default.func, + onEnableDropzone: _propTypes.default.func +}); +Gallery.defaultProps = Object.assign({}, sharedDefaultProps, { + type: ACTION_TYPES.ADMIN, + view: 'tile', + enableDropzone: true, + dialog: false, + BulkActionsComponent: _BulkActions.default +}); +Gallery.propTypes = Object.assign({}, sharedPropTypes, { + onSuccessfulUpload: _propTypes.default.func, + onSuccessfulUploadQueue: _propTypes.default.func, + onCreateFolder: _propTypes.default.func, + onMoveFilesSuccess: _propTypes.default.func, + onPublish: _propTypes.default.func, + onUnpublish: _propTypes.default.func, + type: _propTypes.default.oneOf(['insert-media', 'insert-link', ACTION_TYPES.SELECT, ACTION_TYPES.ADMIN]), + view: _propTypes.default.oneOf(['tile', 'table']), + lastSelected: _propTypes.default.number, + dialog: _propTypes.default.bool, + fileId: _propTypes.default.number, + folderId: _propTypes.default.number.isRequired, + folder: _propTypes.default.shape({ + id: _propTypes.default.number, + title: _propTypes.default.string, + parentId: _propTypes.default.number, + canView: _propTypes.default.bool, + canEdit: _propTypes.default.bool + }), + files: _propTypes.default.array, + errorMessage: _propTypes.default.string, + actions: _propTypes.default.object, + securityId: _propTypes.default.string, + onViewChange: _propTypes.default.func.isRequired, + createFileApiUrl: _propTypes.default.string, + createFileApiMethod: _propTypes.default.string, + search: _propTypes.default.object, + enableDropzone: _propTypes.default.bool, + concatenateSelect: _propTypes.default.bool, + GalleryToolbar: _propTypes.default.elementType, + sorters: _propTypes.default.arrayOf(_propTypes.default.shape({ + field: _propTypes.default.string.isRequired, + direction: _propTypes.default.oneOf(['asc', 'desc']).isRequired, + label: _propTypes.default.string.isRequired + })).isRequired, + BulkActionsComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}); +function mapStateToProps(state, ownProps) { + let { + sort + } = ownProps; + const { + selectedFiles, + errorMessage, + noticeMessage, + enableDropzone, + badges, + concatenateSelect, + loading, + sorters, + lastSelected + } = state.assetAdmin.gallery; + if (!sort && sorters && sorters[0]) { + sort = `${sorters[0].field},${sorters[0].direction}`; + } + return { + lastSelected, + selectedFiles, + errorMessage, + noticeMessage, + enableDropzone, + badges, + concatenateSelect, + loading: ownProps.loading || loading, + queuedFiles: state.assetAdmin.queuedFiles, + securityId: state.config.SecurityID, + sorters, + sort + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + gallery: (0, _redux.bindActionCreators)(galleryActions, dispatch), + toasts: (0, _redux.bindActionCreators)(toastsActions, dispatch), + queuedFiles: (0, _redux.bindActionCreators)(queuedFilesActions, dispatch), + confirmDeletion: (0, _redux.bindActionCreators)(confirmDeletionActions, dispatch) + } + }; +} +var _default = exports["default"] = (0, _redux.compose)((0, _Injector.inject)(['GalleryToolbar', 'Loading'], (GalleryToolbar, Loading) => ({ + GalleryToolbar, + LoadingComponent: Loading +}), () => 'AssetAdmin.Gallery'), (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(Gallery); + +/***/ }), + +/***/ "./client/src/containers/Gallery/GalleryDND.js": +/*!*****************************************************!*\ + !*** ./client/src/containers/Gallery/GalleryDND.js ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _GalleryItemDragLayer = _interopRequireDefault(__webpack_require__(/*! components/GalleryItem/GalleryItemDragLayer */ "./client/src/components/GalleryItem/GalleryItemDragLayer.js")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _core = __webpack_require__(/*! @dnd-kit/core */ "./node_modules/@dnd-kit/core/dist/core.esm.js"); +var _modifiers = __webpack_require__(/*! @dnd-kit/modifiers */ "./node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function GalleryDND(_ref) { + let { + className, + selectedFiles, + children, + ...props + } = _ref; + const [dragging, setDragging] = (0, _react.useState)(false); + const [draggingItemID, setDraggingItemID] = (0, _react.useState)(null); + const [draggingItemProps, setDraggingItemProps] = (0, _react.useState)(null); + const handleDragStart = (0, _react.useCallback)(event => { + setDragging(true); + setDraggingItemID(event.active.id); + setDraggingItemProps(event.active.data.current.props); + }); + const handleDragEnd = (0, _react.useCallback)(event => { + setDragging(false); + setDraggingItemID(null); + setDraggingItemProps(null); + }); + const sensors = (0, _core.useSensors)((0, _core.useSensor)(_core.PointerSensor, { + activationConstraint: { + distance: 10 + } + })); + const draggingItems = [...selectedFiles]; + if (!draggingItems.includes(draggingItemID)) { + draggingItems.push(draggingItemID); + } + return _react.default.createElement("div", { + className: (0, _classnames.default)(className, { + 'gallery__main--dragging': dragging + }) + }, _react.default.createElement(_core.DndContext, { + sensors: sensors, + onDragStart: handleDragStart, + onDragEnd: handleDragEnd, + modifiers: [_modifiers.restrictToWindowEdges] + }, children, _react.default.createElement(_core.DragOverlay, null, dragging && _react.default.createElement(_GalleryItemDragLayer.default, { + draggingItemProps: draggingItemProps, + draggingItems: draggingItems + })))); +} +GalleryDND.contextTypes = { + dragDropManager: _propTypes.default.object +}; +GalleryDND.propTypes = { + selectedFiles: _propTypes.default.arrayOf(_propTypes.default.number), + className: _propTypes.default.string, + children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]) +}; +var _default = exports["default"] = GalleryDND; + +/***/ }), + +/***/ "./client/src/containers/InsertMediaModal/InsertMediaModal.js": +/*!********************************************************************!*\ + !*** ./client/src/containers/InsertMediaModal/InsertMediaModal.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _AssetAdmin = _interopRequireDefault(__webpack_require__(/*! containers/AssetAdmin/AssetAdmin */ "./client/src/containers/AssetAdmin/AssetAdmin.js")); +var _stateRouter = _interopRequireDefault(__webpack_require__(/*! containers/AssetAdmin/stateRouter */ "./client/src/containers/AssetAdmin/stateRouter.js")); +var _fileSchemaModalHandler = _interopRequireDefault(__webpack_require__(/*! containers/InsertLinkModal/fileSchemaModalHandler */ "containers/InsertLinkModal/fileSchemaModalHandler")); +var galleryActions = _interopRequireWildcard(__webpack_require__(/*! state/gallery/GalleryActions */ "./client/src/state/gallery/GalleryActions.js")); +var modalActions = _interopRequireWildcard(__webpack_require__(/*! state/modal/ModalActions */ "./client/src/state/modal/ModalActions.js")); +var _FormBuilderModal = _interopRequireDefault(__webpack_require__(/*! components/FormBuilderModal/FormBuilderModal */ "components/FormBuilderModal/FormBuilderModal")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _getFormSchema = _interopRequireDefault(__webpack_require__(/*! lib/getFormSchema */ "./client/src/lib/getFormSchema.js")); +var _qs = _interopRequireDefault(__webpack_require__(/*! qs */ "qs")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +class InsertMediaModal extends _react.Component { + constructor(props) { + super(props); + this.handleSubmit = this.handleSubmit.bind(this); + } + componentDidMount() { + const { + isOpen, + onBrowse, + setOverrides, + fileAttributes, + folderId + } = this.props; + if (!isOpen) { + onBrowse(folderId || 0); + } else if (typeof setOverrides === 'function' && fileAttributes.ID) { + setOverrides(this.props); + onBrowse(folderId, fileAttributes.ID); + } + } + componentDidUpdate(prevProps) { + if (!this.props.isOpen && prevProps.isOpen) { + this.props.onBrowse(this.props.folderId); + this.props.actions.gallery.deselectFiles(); + } + if (typeof prevProps.setOverrides === 'function' && this.props.isOpen && !prevProps.isOpen) { + prevProps.setOverrides(this.props); + this.props.onBrowse(this.props.folderId, this.props.fileAttributes ? this.props.fileAttributes.ID : null); + } + } + getSectionProps() { + return { + ...this.props, + dialog: true, + toolbarChildren: this.renderToolbarChildren(), + onSubmitEditor: this.handleSubmit, + onReplaceUrl: this.props.onBrowse + }; + } + getModalProps() { + const { + onHide, + onInsert, + sectionConfig, + schemaUrl, + className, + ...props + } = this.props; + return { + ...props, + className: (0, _classnames.default)('insert-media-modal', className), + size: 'lg', + showCloseButton: false + }; + } + handleSubmit(data, action, submitFn, file) { + if (action === 'action_insert') { + return this.props.onInsert(data, file); + } + return submitFn(); + } + renderToolbarChildren() { + return _react.default.createElement("button", { + type: "button", + className: "close modal__close-button insert-media-modal__close-button", + onClick: this.props.onClosed, + "aria-label": _i18n.default._t('FormBuilderModal.CLOSE', 'Close') + }, _react.default.createElement("span", { + "aria-hidden": "true" + }, "\xD7")); + } + render() { + const modalProps = this.getModalProps(); + const sectionProps = this.getSectionProps(); + const assetAdmin = this.props.isOpen ? _react.default.createElement(_AssetAdmin.default, sectionProps) : null; + return _react.default.createElement(_FormBuilderModal.default, modalProps, assetAdmin); + } +} +exports.Component = InsertMediaModal; +InsertMediaModal.propTypes = { + sectionConfig: _propTypes.default.shape({ + url: _propTypes.default.string, + form: _propTypes.default.object + }), + type: _propTypes.default.oneOf(['insert-media', 'insert-link', 'select', 'admin']), + schemaUrl: _propTypes.default.string, + isOpen: _propTypes.default.bool, + setOverrides: _propTypes.default.func, + onInsert: _propTypes.default.func.isRequired, + fileAttributes: _propTypes.default.shape({ + ID: _propTypes.default.number, + AltText: _propTypes.default.string, + Width: _propTypes.default.number, + Height: _propTypes.default.number, + Loading: _propTypes.default.string, + TitleTooltip: _propTypes.default.string, + Alignment: _propTypes.default.string, + Description: _propTypes.default.string, + TargetBlank: _propTypes.default.bool + }), + requireLinkText: _propTypes.default.bool, + folderId: _propTypes.default.number, + fileId: _propTypes.default.number, + viewAction: _propTypes.default.string, + query: _propTypes.default.object, + getUrl: _propTypes.default.func, + onBrowse: _propTypes.default.func.isRequired, + onClosed: _propTypes.default.func, + className: _propTypes.default.string, + actions: _propTypes.default.object, + maxFiles: _propTypes.default.number, + fileSelected: _propTypes.default.bool +}; +InsertMediaModal.defaultProps = { + className: '', + fileAttributes: {}, + type: 'insert-media', + folderId: 0, + maxFiles: 1 +}; +function mapStateToProps(state, ownProps) { + const config = ownProps.sectionConfig; + if (!config) { + return {}; + } + let folderId = 0; + if (ownProps.folderId !== null) { + folderId = ownProps.folderId; + } else if (ownProps.folder) { + folderId = ownProps.folder.id; + } + const fileId = ownProps.fileAttributes ? ownProps.fileAttributes.ID : ownProps.fileId; + const formSchema = state.assetAdmin.modal.formSchema; + const props = { + config, + viewAction: ownProps.viewAction, + folderId, + type: formSchema && formSchema.type, + fileId + }; + const { + schemaUrl, + targetId + } = (0, _getFormSchema.default)(props); + if (!schemaUrl) { + return {}; + } + const queryMap = {}; + if (ownProps.requireLinkText) { + queryMap.requireLinkText = true; + } + if (ownProps.fileSelected) { + queryMap.fileSelected = true; + } + let query = _qs.default.stringify(queryMap); + query = query ? `?${query}` : ''; + return { + schemaUrl: `${schemaUrl}/${targetId}${query}`, + type: formSchema && formSchema.type + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + gallery: (0, _redux.bindActionCreators)(galleryActions, dispatch), + modal: (0, _redux.bindActionCreators)(modalActions, dispatch) + } + }; +} +var _default = exports["default"] = (0, _redux.compose)(_stateRouter.default, (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), _fileSchemaModalHandler.default)(InsertMediaModal); + +/***/ }), + +/***/ "./client/src/containers/MoveModal/MoveModal.js": +/*!******************************************************!*\ + !*** ./client/src/containers/MoveModal/MoveModal.js ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _GalleryActions = __webpack_require__(/*! state/gallery/GalleryActions */ "./client/src/state/gallery/GalleryActions.js"); +var _ToastsActions = __webpack_require__(/*! state/toasts/ToastsActions */ "state/toasts/ToastsActions"); +var _FormBuilderModal = _interopRequireDefault(__webpack_require__(/*! components/FormBuilderModal/FormBuilderModal */ "components/FormBuilderModal/FormBuilderModal")); +var _configShape = _interopRequireDefault(__webpack_require__(/*! lib/configShape */ "./client/src/lib/configShape.js")); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +class MoveModal extends _react.default.Component { + constructor(props) { + super(props); + this.handleSubmit = this.handleSubmit.bind(this); + this.timeout = null; + } + handleSubmit(_ref) { + let { + FolderID + } = _ref; + const { + selectedFiles, + onSuccess, + onClosed, + setNotice, + setError, + setBadge + } = this.props; + let url = this.props.sectionConfig.endpoints.move.url; + return _Backend.default.post(url, { + ids: selectedFiles, + folderID: FolderID + }, { + 'X-SecurityID': _Config.default.get('SecurityID') + }).then(() => { + url = `${this.props.sectionConfig.endpoints.read.url}/${FolderID}`; + return _Backend.default.get(url); + }).then(response => response.json()).then(responseJson => { + if (typeof onSuccess === 'function') { + onSuccess(responseJson.id, selectedFiles); + } + setBadge(responseJson.id, `${selectedFiles.length}`, 'success', _index.default.MOVE_SUCCESS_DURATION); + setNotice(_i18n.default.sprintf(_i18n.default._t('AssetAdmin.MOVED_ITEMS_TO', 'Moved %s item(s) to %s'), selectedFiles.length, responseJson.name), [{ + label: _i18n.default._t('AssetAdmin.GO_TO_FOLDER', 'Go to folder'), + onClick: () => this.props.onOpenFolder(responseJson.id) + }]); + onClosed(); + }).catch(() => { + setError(_i18n.default._t('AssetAdmin.FAILED_MOVE', 'There was an error moving the selected items.')); + }); + } + render() { + const { + isOpen, + onClosed, + title, + folderId, + sectionConfig + } = this.props; + const { + schemaUrl + } = sectionConfig.form.moveForm; + return _react.default.createElement(_FormBuilderModal.default, { + title: title, + isOpen: isOpen, + onClosed: onClosed, + onSubmit: this.handleSubmit, + identifier: "AssetAdmin.MoveForm", + schemaUrl: `${schemaUrl}/${folderId}` + }); + } +} +MoveModal.propTypes = { + sectionConfig: _configShape.default, + folderId: _propTypes.default.number.isRequired, + isOpen: _propTypes.default.bool, + onClosed: _propTypes.default.func, + setNotice: _propTypes.default.func, + setBadge: _propTypes.default.func, + setError: _propTypes.default.func, + title: _propTypes.default.string, + onSuccess: _propTypes.default.func, + onOpenFolder: _propTypes.default.func.isRequired, + selectedFiles: _propTypes.default.array.isRequired +}; +MoveModal.defaultProps = { + isOpen: false +}; +function mapStateToProps(state) { + const { + modal, + selectedFiles + } = state.assetAdmin.gallery; + return { + isOpen: modal === _index.default.MODAL_MOVE, + selectedFiles, + title: _i18n.default.sprintf(_i18n.default._t('AssetAdmin.MOVE_ITEMS_TO', 'Move %s item(s) to...'), selectedFiles.length) + }; +} +function mapDispatchToProps(dispatch) { + return { + onClosed() { + dispatch((0, _GalleryActions.deactivateModal)()); + }, + setNotice(msg) { + let actions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + dispatch((0, _ToastsActions.display)({ + text: msg, + type: 'success', + actions + })); + }, + setError(msg) { + dispatch((0, _ToastsActions.display)({ + text: msg, + type: 'error' + })); + }, + setBadge() { + dispatch((0, _GalleryActions.setFileBadge)(...arguments)); + } + }; +} +var _default = exports["default"] = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(MoveModal); + +/***/ }), + +/***/ "./client/src/containers/TableView/TableView.js": +/*!******************************************************!*\ + !*** ./client/src/containers/TableView/TableView.js ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _griddleReact = _interopRequireDefault(__webpack_require__(/*! griddle-react */ "./node_modules/griddle-react/modules/griddle.jsx.js")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _FileStatusIcon = _interopRequireDefault(__webpack_require__(/*! components/FileStatusIcon/FileStatusIcon */ "components/FileStatusIcon/FileStatusIcon")); +var _Gallery = __webpack_require__(/*! containers/Gallery/Gallery */ "./client/src/containers/Gallery/Gallery.js"); +var _DataFormat = __webpack_require__(/*! lib/DataFormat */ "lib/DataFormat"); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _redux = __webpack_require__(/*! redux */ "redux"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +class TableView extends _react.Component { + constructor(props) { + super(props); + this.getColumns = this.getColumns.bind(this); + this.handleSort = this.handleSort.bind(this); + this.handleSetPage = this.handleSetPage.bind(this); + this.handleRowClick = this.handleRowClick.bind(this); + this.renderSelect = this.renderSelect.bind(this); + this.renderTitle = this.renderTitle.bind(this); + this.renderStatus = this.renderStatus.bind(this); + this.renderNoItemsNotice = this.renderNoItemsNotice.bind(this); + } + getColumns() { + const columns = ['thumbnail', 'title', 'status', 'size', 'lastEdited']; + if (this.props.selectableItems) { + columns.unshift('selected'); + } + return columns; + } + getColumnConfig() { + return [{ + columnName: 'selected', + sortable: false, + displayName: '', + cssClassName: 'gallery__table-column--select', + customComponent: this.renderSelect + }, { + columnName: 'thumbnail', + sortable: false, + displayName: '', + cssClassName: 'gallery__table-column--image', + customComponent: this.renderThumbnail + }, { + columnName: 'title', + customCompareFn: () => 0, + displayName: _i18n.default._t('File.TITLE', 'Title'), + cssClassName: 'gallery__table-column--title', + customComponent: this.renderTitle + }, { + columnName: 'status', + sortable: false, + cssClassName: 'sort--disabled', + customComponent: this.renderStatus, + displayName: _i18n.default._t('File.STATUS', 'Status') + }, { + columnName: 'lastEdited', + displayName: _i18n.default._t('File.MODIFIED', 'Modified'), + customComponent: this.renderDate + }, { + columnName: 'size', + sortable: false, + displayName: _i18n.default._t('File.SIZE', 'Size'), + cssClassName: 'sort--disabled', + customComponent: this.renderSize + }]; + } + getRowMetadata(rowData) { + return `gallery__table-row ${rowData.highlighted ? 'gallery__table-row--highlighted' : ''}`; + } + getTableProps() { + const [sortColumn, sortDirection] = this.props.sort.split(','); + return { + tableClassName: 'gallery__table table table-hover', + gridClassName: 'gallery__main-view--table', + rowMetadata: { + bodyCssClassName: this.getRowMetadata, + key: 'key' + }, + sortAscendingComponent: '', + sortDescendingComponent: '', + useExternal: true, + externalSetPage: this.handleSetPage, + externalChangeSort: this.handleSort, + externalSetFilter: () => null, + externalSetPageSize: () => null, + externalCurrentPage: this.props.page - 1, + externalMaxPage: Math.ceil(this.props.totalCount / this.props.limit), + externalSortColumn: sortColumn, + externalSortAscending: sortDirection === 'asc', + initialSort: sortColumn, + columns: this.getColumns(), + columnMetadata: this.getColumnConfig(), + useGriddleStyles: false, + onRowClick: this.handleRowClick, + results: this.props.files, + customNoDataComponent: this.renderNoItemsNotice + }; + } + handleActivate(event, item) { + if (item.type === 'folder') { + this.props.onOpenFolder(event, item); + } else { + this.props.onOpenFile(event, item); + } + } + handleRowClick(row, event) { + const item = row.props.data; + if (event.currentTarget.classList.contains('gallery__table-column--select')) { + event.stopPropagation(); + event.preventDefault(); + if (typeof this.props.onSelect === 'function') { + this.props.onSelect(event, item); + return; + } + } + this.handleActivate(event, item); + } + handleSort(column, ascending) { + const direction = ascending ? 'asc' : 'desc'; + this.props.onSort(`${column},${direction}`); + } + handleSetPage(page) { + this.props.onSetPage(page + 1); + } + preventFocus(event) { + event.preventDefault(); + } + renderNoItemsNotice() { + if (this.props.files.length === 0 && !this.props.loading) { + return _react.default.createElement("p", { + className: "gallery__no-item-notice" + }, _i18n.default._t('AssetAdmin.NOITEMSFOUND')); + } + return null; + } + renderSize(props) { + if (props.rowData.type === 'folder') { + return null; + } + const description = (0, _DataFormat.fileSize)(props.data); + return _react.default.createElement("span", null, description); + } + renderStatus(props) { + let flags = []; + const item = props.rowData; + const { + VersionedBadge + } = this.props; + if (item.type !== 'folder') { + if (item.draft) { + flags.push({ + key: 'status-draft', + status: 'draft' + }); + } else if (item.modified) { + flags.push({ + key: 'status-modified', + status: 'modified' + }); + } + } + flags = flags.map(_ref => { + let { + ...attributes + } = _ref; + return _react.default.createElement(VersionedBadge, attributes); + }); + return flags ? _react.default.createElement("span", null, flags) : null; + } + renderProgressBar(rowData) { + if (!rowData.queuedId || rowData.message && rowData.message.type === 'error') { + return null; + } + if (rowData.id > 0) { + return _react.default.createElement("div", { + className: "gallery__progress-bar--complete" + }); + } + const progressBarProps = { + className: 'gallery__progress-bar-progress', + style: { + width: `${rowData.progress}%` + } + }; + return _react.default.createElement("div", { + className: "gallery__progress-bar" + }, _react.default.createElement("div", progressBarProps)); + } + renderRestrictedAccess(rowData) { + const { + hasRestrictedAccess + } = rowData; + const attrs = { + fileID: rowData.id, + placement: 'top', + hasRestrictedAccess + }; + return _react.default.createElement(_FileStatusIcon.default, attrs); + } + renderTrackedFormUpload(rowData) { + const { + isTrackedFormUpload, + hasRestrictedAccess + } = rowData; + const attrs = { + fileID: rowData.id, + placement: 'top', + isTrackedFormUpload, + hasRestrictedAccess + }; + return _react.default.createElement(_FileStatusIcon.default, attrs); + } + renderTitle(props) { + const progress = this.renderProgressBar(props.rowData); + return _react.default.createElement("div", { + className: "fill-width" + }, _react.default.createElement("div", { + className: "flexbox-area-grow" + }, _react.default.createElement("span", null, props.data), props.rowData.hasRestrictedAccess && this.renderRestrictedAccess(props.rowData), props.rowData.isTrackedFormUpload && this.renderTrackedFormUpload(props.rowData)), progress); + } + renderSelect(props) { + if (this.props.selectableItems && (this.props.selectableFolders || props.rowData.type !== 'folder')) { + const checkboxProps = { + type: 'checkbox', + title: _i18n.default._t('AssetAdmin.SELECT'), + defaultChecked: props.data, + tabIndex: -1, + onMouseDown: this.preventFocus + }; + const maxSelected = ![null, 1].includes(this.props.maxFilesSelect) && this.props.selectedFiles.length >= this.props.maxFilesSelect; + if (maxSelected && !props.data) { + checkboxProps.disabled = true; + } + return _react.default.createElement("input", checkboxProps); + } + return null; + } + renderDate(props) { + if (props.rowData.type === 'folder') { + return null; + } + moment.locale(_i18n.default.detectLocale()); + return _react.default.createElement("span", null, moment(props.data).format('L LT')); + } + renderThumbnail(props) { + const url = props.data || props.rowData.url; + const uploading = props.rowData.queuedId && !props.rowData.id; + const category = props.rowData.category || 'false'; + const baseClass = 'gallery__table-image'; + const classNames = [baseClass]; + const styles = {}; + classNames.push(`${baseClass}--${category}`); + if (category === 'image' && url) { + styles.backgroundImage = `url("${url}")`; + } + if (!uploading && !url && category !== 'folder') { + classNames.push(`${baseClass}--error`); + } + return _react.default.createElement("div", { + className: classNames.join(' '), + style: styles + }); + } + render() { + return _react.default.createElement(_griddleReact.default, this.getTableProps()); + } +} +exports.Component = TableView; +TableView.defaultProps = _Gallery.galleryViewDefaultProps; +TableView.propTypes = { + ..._Gallery.galleryViewPropTypes, + sort: _propTypes.default.string.isRequired, + VersionedBadge: _propTypes.default.elementType +}; +var _default = exports["default"] = (0, _redux.compose)((0, _Injector.inject)(['VersionedBadge'], VersionedBadge => ({ + VersionedBadge +})))(TableView); + +/***/ }), + +/***/ "./client/src/containers/ThumbnailView/ThumbnailView.js": +/*!**************************************************************!*\ + !*** ./client/src/containers/ThumbnailView/ThumbnailView.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _Gallery = __webpack_require__(/*! containers/Gallery/Gallery */ "./client/src/containers/Gallery/Gallery.js"); +var _griddleReact = _interopRequireDefault(__webpack_require__(/*! griddle-react */ "./node_modules/griddle-react/modules/griddle.jsx.js")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +class ThumbnailView extends _react.Component { + constructor(props) { + super(props); + this.renderItem = this.renderItem.bind(this); + this.handleSetPage = this.handleSetPage.bind(this); + this.handlePrevPage = this.handlePrevPage.bind(this); + this.handleNextPage = this.handleNextPage.bind(this); + this.handleDrag = this.handleDrag.bind(this); + } + handleDrag(dragging) { + this.props.onEnableDropzone(!dragging); + } + handleSetPage(page) { + this.props.onSetPage(page + 1); + } + handleNextPage() { + const currentPage = this.props.page - 1; + this.handleSetPage(currentPage + 1); + } + handlePrevPage() { + const currentPage = this.props.page - 1; + if (currentPage === 0) { + this.handleSetPage(currentPage); + return; + } + this.handleSetPage(currentPage - 1); + } + folderFilter(file) { + return file.type === 'folder'; + } + fileFilter(file) { + return file.type !== 'folder'; + } + renderPagination() { + if (this.props.totalCount <= this.props.limit) { + return null; + } + const props = { + setPage: this.handleSetPage, + maxPage: Math.ceil(this.props.totalCount / this.props.limit), + next: this.handleNextPage, + nextText: _i18n.default._t('AssetAdmin.NEXT', 'Next'), + previous: this.handlePrevPage, + previousText: _i18n.default._t('AssetAdmin.PREVIOUS', 'Previous'), + currentPage: this.props.page - 1, + useGriddleStyles: false + }; + return _react.default.createElement("div", { + className: "griddle-footer" + }, _react.default.createElement(_griddleReact.default.GridPagination, props)); + } + renderItem(item) { + const { + File, + Folder, + badges, + sectionConfig, + selectedFiles, + selectableItems, + selectableFolders + } = this.props; + const badge = badges.find(badgeItem => badgeItem.id === item.id); + let props = { + sectionConfig, + key: item.key, + selectableKey: item.id, + item, + selectedFiles, + onDrag: this.handleDrag, + badge, + canDrag: this.props.canDrag + }; + if (item.queuedId && !item.id) { + const { + onCancelUpload, + onRemoveErroredUpload + } = this.props; + props = { + ...props, + onCancelUpload, + onRemoveErroredUpload + }; + } else { + const { + onOpenFolder, + onOpenFile + } = this.props; + props = { + ...props, + onActivate: item.type === 'folder' ? onOpenFolder : onOpenFile + }; + } + if (selectableItems && (selectableFolders || item.type !== 'folder')) { + const maxSelected = ![null, 1].includes(this.props.maxFilesSelect) && this.props.selectedFiles.length >= this.props.maxFilesSelect; + const onSelect = this.props.maxFilesSelect === 1 ? props.onActivate : this.props.onSelect; + props = { + ...props, + selectable: true, + onSelect, + maxSelected + }; + } + if (item.type === 'folder') { + const { + onDropFiles + } = this.props; + props = { + ...props, + onDropFiles + }; + return _react.default.createElement(Folder, props); + } + return _react.default.createElement(File, props); + } + render() { + const className = 'gallery__main-view--tile'; + return _react.default.createElement("div", { + className: className + }, _react.default.createElement("div", { + className: "gallery__folders" + }, this.props.files.filter(this.folderFilter).map(this.renderItem)), _react.default.createElement("div", { + className: "gallery__files" + }, this.props.files.filter(this.fileFilter).map(this.renderItem)), this.props.files.length === 0 && !this.props.loading && _react.default.createElement("p", { + className: "gallery__no-item-notice" + }, _i18n.default._t('AssetAdmin.NOITEMSFOUND')), _react.default.createElement("div", { + className: "gallery__load" + }, this.renderPagination())); + } +} +exports.Component = ThumbnailView; +ThumbnailView.defaultProps = _Gallery.galleryViewDefaultProps; +ThumbnailView.propTypes = { + ..._Gallery.galleryViewPropTypes, + File: _propTypes.default.elementType.isRequired, + Folder: _propTypes.default.elementType.isRequired +}; +const injector = (0, _Injector.inject)(['GalleryItemFile', 'GalleryItemFolder'], (GalleryItemFile, GalleryItemFolder) => ({ + File: GalleryItemFile, + Folder: GalleryItemFolder +}), () => 'AssetAdmin.Gallery.ThumbnailView'); +var _default = exports["default"] = injector(ThumbnailView); + +/***/ }), + +/***/ "./client/src/lib/configShape.js": +/*!***************************************!*\ + !*** ./client/src/lib/configShape.js ***! + \***************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const configShape = _propTypes.default.shape({ + url: _propTypes.default.string, + limit: _propTypes.default.number, + imageRetry: _propTypes.default.shape({ + minRetry: _propTypes.default.number, + maxRetry: _propTypes.default.number, + expiry: _propTypes.default.number + }), + form: _propTypes.default.object, + dropzoneOptions: _propTypes.default.object +}); +var _default = exports["default"] = configShape; + +/***/ }), + +/***/ "./client/src/lib/fileShape.js": +/*!*************************************!*\ + !*** ./client/src/lib/fileShape.js ***! + \*************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const fileShape = _propTypes.default.shape({ + canEdit: _propTypes.default.bool, + canDelete: _propTypes.default.bool, + canView: _propTypes.default.bool, + exists: _propTypes.default.bool, + type: _propTypes.default.string, + smallThumbnail: _propTypes.default.string, + thumbnail: _propTypes.default.string, + width: _propTypes.default.number, + height: _propTypes.default.number, + category: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string]), + id: _propTypes.default.number, + url: _propTypes.default.string, + title: _propTypes.default.string, + progress: _propTypes.default.number, + visibility: _propTypes.default.string, + hasRestrictedAccess: _propTypes.default.bool, + isTrackedFormUpload: _propTypes.default.bool +}); +var _default = exports["default"] = fileShape; + +/***/ }), + +/***/ "./client/src/lib/getFormSchema.js": +/*!*****************************************!*\ + !*** ./client/src/lib/getFormSchema.js ***! + \*****************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getFormSchema; +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const { + CREATE_FOLDER, + EDIT_FILE +} = _index.default.ACTIONS; +function getFormSchema(_ref) { + let { + config: { + form + }, + viewAction, + folderId, + fileId, + type + } = _ref; + let schemaUrl = null; + let targetId = null; + if (viewAction === CREATE_FOLDER) { + schemaUrl = form.folderCreateForm.schemaUrl; + targetId = folderId; + return { + schemaUrl, + targetId + }; + } + if (viewAction === EDIT_FILE && fileId) { + switch (type) { + case 'insert-media': + schemaUrl = form.fileInsertForm.schemaUrl; + break; + case 'insert-link': + schemaUrl = form.fileEditorLinkForm.schemaUrl; + break; + case 'select': + schemaUrl = form.fileSelectForm.schemaUrl; + break; + case 'admin': + default: + schemaUrl = form.fileEditForm.schemaUrl; + break; + } + targetId = fileId; + return { + schemaUrl, + targetId + }; + } + return {}; +} + +/***/ }), + +/***/ "./client/src/lib/getStatusCodeMessage.js": +/*!************************************************!*\ + !*** ./client/src/lib/getStatusCodeMessage.js ***! + \************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getStatusCodeMessage; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function getStatusCodeMessage(statusCode, xhr) { + if (statusCode === 413) { + return _i18n.default._t('AssetAdmin.ERROR_FILE_SIZE', 'File size limit exceeded'); + } + if (statusCode === 403) { + if (xhr && typeof xhr.response === 'string') { + return xhr.response; + } + } + return _i18n.default._t('AssetAdmin.ERROR_DEFAULT', 'Something went wrong, please try again'); +} + +/***/ }), + +/***/ "./client/src/state/confirmDeletion/ConfirmDeletionActionTypes.js": +/*!************************************************************************!*\ + !*** ./client/src/state/confirmDeletion/ConfirmDeletionActionTypes.js ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + CONFIRM_DELETION_ASK: 'CONFIRM_DELETION_ASK', + CONFIRM_DELETION_CONFIRM: 'CONFIRM_DELETION_CONFIRM', + CONFIRM_DELETION_CANCEL: 'CONFIRM_DELETION_CANCEL', + CONFIRM_DELETION_RESET: 'CONFIRM_DELETION_RESET', + CONFIRM_DELETION_MODAL_CLOSE: 'CONFIRM_DELETION_MODAL_CLOSE' +}; + +/***/ }), + +/***/ "./client/src/state/confirmDeletion/ConfirmDeletionActions.js": +/*!********************************************************************!*\ + !*** ./client/src/state/confirmDeletion/ConfirmDeletionActions.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.cancel = cancel; +exports.confirm = confirm; +exports.deleting = deleting; +exports.modalClose = modalClose; +exports.reset = reset; +var _ConfirmDeletionActionTypes = _interopRequireDefault(__webpack_require__(/*! ./ConfirmDeletionActionTypes */ "./client/src/state/confirmDeletion/ConfirmDeletionActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function confirm(files) { + return { + type: _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_ASK, + payload: { + files + } + }; +} +function deleting() { + return { + type: _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_CONFIRM, + payload: {} + }; +} +function cancel() { + return { + type: _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_CANCEL, + payload: {} + }; +} +function reset() { + return { + type: _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_RESET, + payload: {} + }; +} +function modalClose() { + return { + type: _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_MODAL_CLOSE, + payload: {} + }; +} + +/***/ }), + +/***/ "./client/src/state/confirmDeletion/ConfirmDeletionTransitions.js": +/*!************************************************************************!*\ + !*** ./client/src/state/confirmDeletion/ConfirmDeletionTransitions.js ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.NO_TRANSITION = exports.DELETING = exports.CANCELING = void 0; +const NO_TRANSITION = exports.NO_TRANSITION = false; +const CANCELING = exports.CANCELING = 'canceling'; +const DELETING = exports.DELETING = 'deleting'; + +/***/ }), + +/***/ "./client/src/state/displaySearch/DisplaySearchActionTypes.js": +/*!********************************************************************!*\ + !*** ./client/src/state/displaySearch/DisplaySearchActionTypes.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + TOGGLE_SEARCH: 'TOGGLE_SEARCH', + OPEN_SEARCH: 'OPEN_SEARCH', + CLOSE_SEARCH: 'CLOSE_SEARCH' +}; + +/***/ }), + +/***/ "./client/src/state/displaySearch/DisplaySearchActions.js": +/*!****************************************************************!*\ + !*** ./client/src/state/displaySearch/DisplaySearchActions.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.closeSearch = closeSearch; +exports.openSearch = openSearch; +exports.toggleSearch = toggleSearch; +var _DisplaySearchActionTypes = _interopRequireDefault(__webpack_require__(/*! ./DisplaySearchActionTypes */ "./client/src/state/displaySearch/DisplaySearchActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function toggleSearch() { + return { + type: _DisplaySearchActionTypes.default.TOGGLE_SEARCH, + payload: null + }; +} +function openSearch() { + return { + type: _DisplaySearchActionTypes.default.OPEN_SEARCH, + payload: null + }; +} +function closeSearch() { + return { + type: _DisplaySearchActionTypes.default.CLOSE_SEARCH, + payload: null + }; +} + +/***/ }), + +/***/ "./client/src/state/gallery/GalleryActionTypes.js": +/*!********************************************************!*\ + !*** ./client/src/state/gallery/GalleryActionTypes.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = ['SET_LAST_SELECTED', 'SET_SELECTED_FILES', 'DESELECT_FILES', 'SELECT_FILES', 'LOAD_FILE_REQUEST', 'LOAD_FILE_SUCCESS', 'HIGHLIGHT_FILES', 'UPDATE_BATCH_ACTIONS', 'SET_NOTICE_MESSAGE', 'SET_ERROR_MESSAGE', 'SET_ENABLE_DROPZONE', 'SET_FILE_BADGE', 'CLEAR_FILE_BADGE', 'ACTIVATE_MODAL', 'DEACTIVATE_MODAL', 'CONCATENATE_SELECT', 'SET_LOADING'].reduce((obj, item) => Object.assign(obj, { + [item]: `GALLERY.${item}` +}), {}); + +/***/ }), + +/***/ "./client/src/state/gallery/GalleryActions.js": +/*!****************************************************!*\ + !*** ./client/src/state/gallery/GalleryActions.js ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.activateModal = activateModal; +exports.clearFileBadge = clearFileBadge; +exports.deactivateModal = deactivateModal; +exports.deselectFiles = deselectFiles; +exports.loadFile = loadFile; +exports.selectFiles = selectFiles; +exports.setConcatenateSelect = setConcatenateSelect; +exports.setEnableDropzone = setEnableDropzone; +exports.setErrorMessage = setErrorMessage; +exports.setFileBadge = setFileBadge; +exports.setLastSelected = setLastSelected; +exports.setLoading = setLoading; +exports.setNoticeMessage = setNoticeMessage; +exports.setSelectedFiles = setSelectedFiles; +var _GalleryActionTypes = _interopRequireDefault(__webpack_require__(/*! ./GalleryActionTypes */ "./client/src/state/gallery/GalleryActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function setLastSelected(id) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.SET_LAST_SELECTED, + payload: { + id + } + }); + }; +} +function setSelectedFiles(files) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.SET_SELECTED_FILES, + payload: { + files + } + }); + }; +} +function loadFile(id, file) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.LOAD_FILE_SUCCESS, + payload: { + id, + file + } + }); + }; +} +function selectFiles() { + let ids = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + return dispatch => dispatch({ + type: _GalleryActionTypes.default.SELECT_FILES, + payload: { + ids + } + }); +} +function setConcatenateSelect(concat) { + return dispatch => dispatch({ + type: _GalleryActionTypes.default.CONCATENATE_SELECT, + payload: !!concat + }); +} +function deselectFiles() { + let ids = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + return dispatch => dispatch({ + type: _GalleryActionTypes.default.DESELECT_FILES, + payload: { + ids + } + }); +} +function setNoticeMessage(message) { + return dispatch => dispatch({ + type: _GalleryActionTypes.default.SET_NOTICE_MESSAGE, + payload: { + message + } + }); +} +function setErrorMessage(message) { + return dispatch => dispatch({ + type: _GalleryActionTypes.default.SET_ERROR_MESSAGE, + payload: { + message + } + }); +} +function setEnableDropzone(enableDropzone) { + return dispatch => dispatch({ + type: _GalleryActionTypes.default.SET_ENABLE_DROPZONE, + payload: { + enableDropzone + } + }); +} +function clearFileBadge(id) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.CLEAR_FILE_BADGE, + payload: { + id + } + }); + }; +} +function setFileBadge(id, message, status, duration) { + return (dispatch, getState) => { + const { + assetAdmin + } = getState(); + const badge = assetAdmin.gallery.badges.find(item => item.id === id); + if (badge && badge.timer) { + clearTimeout(badge.timer); + } + const timer = duration > 0 ? setTimeout(() => clearFileBadge(id)(dispatch), duration) : null; + dispatch({ + type: _GalleryActionTypes.default.SET_FILE_BADGE, + payload: { + id, + message, + status, + timer + } + }); + }; +} +function activateModal(name) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.ACTIVATE_MODAL, + payload: name + }); + }; +} +function deactivateModal() { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.DEACTIVATE_MODAL + }); + }; +} +function setLoading(active) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.SET_LOADING, + payload: !!active + }); + }; +} + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadActionHandler.js": +/*!**************************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadActionHandler.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.defaultImageFactory = exports["default"] = void 0; +var _ImageLoadStatus = _interopRequireDefault(__webpack_require__(/*! ./ImageLoadStatus */ "./client/src/state/imageLoad/ImageLoadStatus.js")); +var _ImageLoadLocker = _interopRequireDefault(__webpack_require__(/*! ./ImageLoadLocker */ "./client/src/state/imageLoad/ImageLoadLocker.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const defaultOptions = { + minRetry: 0, + maxRetry: 0, + expiry: 0, + onStatusChange: () => null, + onRetry: () => null, + onReset: () => null, + onTimeout: () => null +}; +const defaultImageFactory = (url, resolve, reject) => { + const img = new Image(); + img.onload = resolve; + img.onerror = reject; + img.src = url; +}; +exports.defaultImageFactory = defaultImageFactory; +class ImageLoadActionHandler { + constructor(options) { + let factory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultImageFactory; + this.options = { + ...defaultOptions, + ...options + }; + this.factory = factory; + } + loadImage(url) { + if (!this.options.minRetry) { + return null; + } + if (!_ImageLoadLocker.default.lock(url)) { + return null; + } + return this.loadImageLoop(url, this.options.minRetry); + } + loadImageLoop(url, retryAfter) { + this.options.onStatusChange(url, _ImageLoadStatus.default.LOADING); + return new Promise((resolve, reject) => this.factory(url, resolve, reject)).then(() => this.handleSuccess(url)).catch(() => this.handleError(url, retryAfter)); + } + handleReset(url, resolve) { + this.options.onReset(url); + resolve(); + } + handleTimeout(callback, delay) { + const id = setTimeout(callback, delay); + this.options.onTimeout(id, delay); + return id; + } + handleSuccess(url) { + _ImageLoadLocker.default.unlock(url); + this.options.onStatusChange(url, _ImageLoadStatus.default.SUCCESS); + } + handleFailure(url) { + _ImageLoadLocker.default.unlock(url); + this.options.onStatusChange(url, _ImageLoadStatus.default.FAILED); + if (this.options.expiry) { + return new Promise(resolve => { + this.handleTimeout(() => this.handleReset(url, resolve), this.options.expiry * 1000); + }); + } + return null; + } + handleError(url, retryAfter) { + if (retryAfter > this.options.maxRetry) { + return this.handleFailure(url); + } + this.options.onStatusChange(url, _ImageLoadStatus.default.WAITING); + return this.handleRetry(url, retryAfter); + } + handleRetry(url, retryAfter) { + const promise = new Promise(resolve => { + this.handleTimeout(() => resolve(this.loadImageLoop(url, retryAfter * 2)), retryAfter * 1000); + }); + this.options.onRetry(url, retryAfter, promise); + return promise; + } + setOnRetry(callback) { + this.options.onRetry = callback; + } + setOnReset(callback) { + this.options.onReset = callback; + } + setOnStatusChange(callback) { + this.options.onStatusChange = callback; + } + setOnTimeout(callback) { + this.options.onTimeout = callback; + } +} +var _default = exports["default"] = ImageLoadActionHandler; + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadActionTypes.js": +/*!************************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadActionTypes.js ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + SET_STATUS: 'IMAGE_LOAD_SET_STATUS', + RESET: 'IMAGE_LOAD_RESET' +}; + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadActions.js": +/*!********************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadActions.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.loadImage = loadImage; +var _ImageLoadActionTypes = _interopRequireDefault(__webpack_require__(/*! ./ImageLoadActionTypes */ "./client/src/state/imageLoad/ImageLoadActionTypes.js")); +var _ImageLoadActionHandler = _interopRequireDefault(__webpack_require__(/*! ./ImageLoadActionHandler */ "./client/src/state/imageLoad/ImageLoadActionHandler.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function loadImage(url, options) { + return (dispatch, getState) => { + if (!url) { + return null; + } + const state = getState(); + const currentFile = state.assetAdmin.imageLoad.files.find(file => file.url === url); + if (currentFile) { + return null; + } + const loadOptions = { + ...options, + onStatusChange: (statusURL, status) => dispatch({ + type: _ImageLoadActionTypes.default.SET_STATUS, + payload: { + status, + url: statusURL + } + }), + onReset: statusURL => dispatch({ + type: _ImageLoadActionTypes.default.RESET, + payload: { + url: statusURL + } + }) + }; + const handler = new _ImageLoadActionHandler.default(loadOptions); + return handler.loadImage(url); + }; +} + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadLocker.js": +/*!*******************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadLocker.js ***! + \*******************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +class ImageLoadLocker { + constructor() { + this.urls = []; + } + lock(url) { + const index = this.urls.indexOf(url); + if (index >= 0) { + return false; + } + this.urls = [...this.urls, url]; + return true; + } + unlock(url) { + this.urls = this.urls.filter(next => next !== url); + } +} +exports.Component = ImageLoadLocker; +window.ss = window.ss || {}; +window.ss.imagelocker = window.ss.imagelocker || new ImageLoadLocker(); +var _default = exports["default"] = window.ss.imagelocker; + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadStatus.js": +/*!*******************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadStatus.js ***! + \*******************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + DISABLED: 'DISABLED', + NONE: 'NONE', + SUCCESS: 'SUCCESS', + LOADING: 'LOADING', + WAITING: 'WAITING', + FAILED: 'FAILED' +}; + +/***/ }), + +/***/ "./client/src/state/modal/ModalActionTypes.js": +/*!****************************************************!*\ + !*** ./client/src/state/modal/ModalActionTypes.js ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + DEFINE_IMAGE_SIZE_PRESETS: 'DEFINE_IMAGE_SIZE_PRESETS', + INIT_FORM_SCHEMA_STACK: 'INIT_FORM_SCHEMA_STACK', + POP_FORM_SCHEMA: 'POP_FORM_SCHEMA', + PUSH_FORM_SCHEMA: 'PUSH_FORM_SCHEMA', + RESET: 'RESET', + RESET_FORM_STACK: 'RESET_FORM_STACK' +}; + +/***/ }), + +/***/ "./client/src/state/modal/ModalActions.js": +/*!************************************************!*\ + !*** ./client/src/state/modal/ModalActions.js ***! + \************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.defineImageSizePresets = defineImageSizePresets; +exports.initFormStack = initFormStack; +exports.popFormStackEntry = popFormStackEntry; +exports.pushFormStackEntry = pushFormStackEntry; +exports.reset = reset; +exports.resetFormStack = resetFormStack; +exports.stashFormValues = stashFormValues; +var _getIn = _interopRequireDefault(__webpack_require__(/*! redux-form/lib/structure/plain/getIn */ "./node_modules/redux-form/lib/structure/plain/getIn.js")); +var _SchemaActions = __webpack_require__(/*! state/schema/SchemaActions */ "state/schema/SchemaActions"); +var _ModalActionTypes = _interopRequireDefault(__webpack_require__(/*! ./ModalActionTypes */ "./client/src/state/modal/ModalActionTypes.js")); +var _helpers = _interopRequireDefault(__webpack_require__(/*! ./helpers */ "./client/src/state/modal/helpers.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function defineImageSizePresets(imageSizePresets) { + return { + type: _ModalActionTypes.default.DEFINE_IMAGE_SIZE_PRESETS, + payload: { + imageSizePresets + } + }; +} +function stashFormValues(formIdentifier, schemaUrl) { + return (dispatch, getState) => { + const state = getState(); + const values = (0, _getIn.default)(state.form.formState, `${formIdentifier}.values`); + const fieldSchema = (0, _getIn.default)(state.form.formSchemas, `${schemaUrl}.schema.fields`); + if (values) { + const fields = Object.keys(values).filter(name => values[name] !== null && (0, _helpers.default)(name, fieldSchema)).map(name => ({ + name, + value: values[name] + })); + dispatch((0, _SchemaActions.setSchemaStateOverrides)(schemaUrl, { + fields + })); + } + }; +} +function pushFormStackEntry(type) { + let nextType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + return { + type: _ModalActionTypes.default.PUSH_FORM_SCHEMA, + payload: { + formSchema: { + type, + nextType + } + } + }; +} +function initFormStack(type) { + let nextType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + return { + type: _ModalActionTypes.default.INIT_FORM_SCHEMA_STACK, + payload: { + formSchema: { + type, + nextType + } + } + }; +} +function popFormStackEntry() { + return { + type: _ModalActionTypes.default.POP_FORM_SCHEMA + }; +} +function reset() { + return { + type: _ModalActionTypes.default.RESET + }; +} +function resetFormStack() { + return { + type: _ModalActionTypes.default.RESET_FORM_STACK + }; +} + +/***/ }), + +/***/ "./client/src/state/modal/helpers.js": +/*!*******************************************!*\ + !*** ./client/src/state/modal/helpers.js ***! + \*******************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isStashableField; +exports.findField = findField; +function findField(fieldName, fieldTree) { + let i; + for (i = 0; i < fieldTree.length; i++) { + const field = fieldTree[i]; + if (field.name === fieldName) { + return field; + } + if (field.children) { + const child = findField(fieldName, field.children); + if (child) { + return child; + } + } + } + return false; +} +function isStashableField(fieldName, fieldTree) { + const field = findField(fieldName, fieldTree); + return field && field.type !== 'hidden' && field.schemaType !== 'Structural' && !field.readOnly && !field.disabled; +} + +/***/ }), + +/***/ "./client/src/state/queuedFiles/QueuedFilesActionTypes.js": +/*!****************************************************************!*\ + !*** ./client/src/state/queuedFiles/QueuedFilesActionTypes.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + ADD_QUEUED_FILE: 'ADD_QUEUED_FILE', + FAIL_UPLOAD: 'FAIL_UPLOAD', + PURGE_UPLOAD_QUEUE: 'PURGE_UPLOAD_QUEUE', + REMOVE_QUEUED_FILE: 'REMOVE_QUEUED_FILE', + SUCCEED_UPLOAD: 'SUCCEED_UPLOAD', + UPDATE_QUEUED_FILE: 'UPDATE_QUEUED_FILE' +}; + +/***/ }), + +/***/ "./client/src/state/queuedFiles/QueuedFilesActions.js": +/*!************************************************************!*\ + !*** ./client/src/state/queuedFiles/QueuedFilesActions.js ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.addQueuedFile = addQueuedFile; +exports.failUpload = failUpload; +exports.purgeUploadQueue = purgeUploadQueue; +exports.removeQueuedFile = removeQueuedFile; +exports.succeedUpload = succeedUpload; +exports.updateQueuedFile = updateQueuedFile; +var _QueuedFilesActionTypes = _interopRequireDefault(__webpack_require__(/*! ./QueuedFilesActionTypes */ "./client/src/state/queuedFiles/QueuedFilesActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function addQueuedFile(file) { + return dispatch => dispatch({ + type: _QueuedFilesActionTypes.default.ADD_QUEUED_FILE, + payload: { + file + } + }); +} +function failUpload(queuedId, response, statusCodeMessage) { + return dispatch => { + let message = response.message; + if (response.errors && response.errors.length) { + message = response.errors[0]; + } + if (typeof response === 'string') { + message = { + value: statusCodeMessage || response, + type: 'error' + }; + } + return dispatch({ + type: _QueuedFilesActionTypes.default.FAIL_UPLOAD, + payload: { + queuedId, + message + } + }); + }; +} +function purgeUploadQueue() { + return dispatch => dispatch({ + type: _QueuedFilesActionTypes.default.PURGE_UPLOAD_QUEUE, + payload: null + }); +} +function removeQueuedFile(queuedId) { + return dispatch => dispatch({ + type: _QueuedFilesActionTypes.default.REMOVE_QUEUED_FILE, + payload: { + queuedId + } + }); +} +function succeedUpload(queuedId, json) { + return dispatch => dispatch({ + type: _QueuedFilesActionTypes.default.SUCCEED_UPLOAD, + payload: { + queuedId, + json + } + }); +} +function updateQueuedFile(queuedId, updates) { + return dispatch => dispatch({ + type: _QueuedFilesActionTypes.default.UPDATE_QUEUED_FILE, + payload: { + queuedId, + updates + } + }); +} + +/***/ }), + +/***/ "./node_modules/create-react-class/factory.js": +/*!****************************************************!*\ + !*** ./node_modules/create-react-class/factory.js ***! + \****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + + +var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); + +// -- Inlined from fbjs -- + +var emptyObject = {}; + +if (true) { + Object.freeze(emptyObject); +} + +var validateFormat = function validateFormat(format) {}; + +if (true) { + validateFormat = function validateFormat(format) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + }; +} + +function _invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); + + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +} + +var warning = function(){}; + +if (true) { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } + + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +// /-- Inlined from fbjs -- + +var MIXINS_KEY = 'mixins'; + +// Helper function to allow the creation of anonymous functions which do not +// have .name set to the name of the variable being assigned to. +function identity(fn) { + return fn; +} + +var ReactPropTypeLocationNames; +if (true) { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; +} else {} + +function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { + /** + * Policies that describe methods in `ReactClassInterface`. + */ + + var injectedMixins = []; + + /** + * Composite components are higher-level components that compose other composite + * or host components. + * + * To create a new type of `ReactClass`, pass a specification of + * your new class to `React.createClass`. The only requirement of your class + * specification is that you implement a `render` method. + * + * var MyComponent = React.createClass({ + * render: function() { + * return
Hello World
; + * } + * }); + * + * The class specification supports a specific protocol of methods that have + * special meaning (e.g. `render`). See `ReactClassInterface` for + * more the comprehensive protocol. Any other properties and methods in the + * class specification will be available on the prototype. + * + * @interface ReactClassInterface + * @internal + */ + var ReactClassInterface = { + /** + * An array of Mixin objects to include when defining your component. + * + * @type {array} + * @optional + */ + mixins: 'DEFINE_MANY', + + /** + * An object containing properties and methods that should be defined on + * the component's constructor instead of its prototype (static methods). + * + * @type {object} + * @optional + */ + statics: 'DEFINE_MANY', + + /** + * Definition of prop types for this component. + * + * @type {object} + * @optional + */ + propTypes: 'DEFINE_MANY', + + /** + * Definition of context types for this component. + * + * @type {object} + * @optional + */ + contextTypes: 'DEFINE_MANY', + + /** + * Definition of context types this component sets for its children. + * + * @type {object} + * @optional + */ + childContextTypes: 'DEFINE_MANY', + + // ==== Definition methods ==== + + /** + * Invoked when the component is mounted. Values in the mapping will be set on + * `this.props` if that prop is not specified (i.e. using an `in` check). + * + * This method is invoked before `getInitialState` and therefore cannot rely + * on `this.state` or use `this.setState`. + * + * @return {object} + * @optional + */ + getDefaultProps: 'DEFINE_MANY_MERGED', + + /** + * Invoked once before the component is mounted. The return value will be used + * as the initial value of `this.state`. + * + * getInitialState: function() { + * return { + * isOn: false, + * fooBaz: new BazFoo() + * } + * } + * + * @return {object} + * @optional + */ + getInitialState: 'DEFINE_MANY_MERGED', + + /** + * @return {object} + * @optional + */ + getChildContext: 'DEFINE_MANY_MERGED', + + /** + * Uses props from `this.props` and state from `this.state` to render the + * structure of the component. + * + * No guarantees are made about when or how often this method is invoked, so + * it must not have side effects. + * + * render: function() { + * var name = this.props.name; + * return
Hello, {name}!
; + * } + * + * @return {ReactComponent} + * @required + */ + render: 'DEFINE_ONCE', + + // ==== Delegate methods ==== + + /** + * Invoked when the component is initially created and about to be mounted. + * This may have side effects, but any external subscriptions or data created + * by this method must be cleaned up in `componentWillUnmount`. + * + * @optional + */ + componentWillMount: 'DEFINE_MANY', + + /** + * Invoked when the component has been mounted and has a DOM representation. + * However, there is no guarantee that the DOM node is in the document. + * + * Use this as an opportunity to operate on the DOM when the component has + * been mounted (initialized and rendered) for the first time. + * + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidMount: 'DEFINE_MANY', + + /** + * Invoked before the component receives new props. + * + * Use this as an opportunity to react to a prop transition by updating the + * state using `this.setState`. Current props are accessed via `this.props`. + * + * componentWillReceiveProps: function(nextProps, nextContext) { + * this.setState({ + * likesIncreasing: nextProps.likeCount > this.props.likeCount + * }); + * } + * + * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop + * transition may cause a state change, but the opposite is not true. If you + * need it, you are probably looking for `componentWillUpdate`. + * + * @param {object} nextProps + * @optional + */ + componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Invoked while deciding if the component should be updated as a result of + * receiving new props, state and/or context. + * + * Use this as an opportunity to `return false` when you're certain that the + * transition to the new props/state/context will not require a component + * update. + * + * shouldComponentUpdate: function(nextProps, nextState, nextContext) { + * return !equal(nextProps, this.props) || + * !equal(nextState, this.state) || + * !equal(nextContext, this.context); + * } + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @return {boolean} True if the component should update. + * @optional + */ + shouldComponentUpdate: 'DEFINE_ONCE', + + /** + * Invoked when the component is about to update due to a transition from + * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` + * and `nextContext`. + * + * Use this as an opportunity to perform preparation before an update occurs. + * + * NOTE: You **cannot** use `this.setState()` in this method. + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @param {ReactReconcileTransaction} transaction + * @optional + */ + componentWillUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component's DOM representation has been updated. + * + * Use this as an opportunity to operate on the DOM when the component has + * been updated. + * + * @param {object} prevProps + * @param {?object} prevState + * @param {?object} prevContext + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component is about to be removed from its parent and have + * its DOM representation destroyed. + * + * Use this as an opportunity to deallocate any external resources. + * + * NOTE: There is no `componentDidUnmount` since your component will have been + * destroyed by that point. + * + * @optional + */ + componentWillUnmount: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillMount`. + * + * @optional + */ + UNSAFE_componentWillMount: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillReceiveProps`. + * + * @optional + */ + UNSAFE_componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillUpdate`. + * + * @optional + */ + UNSAFE_componentWillUpdate: 'DEFINE_MANY', + + // ==== Advanced methods ==== + + /** + * Updates the component's currently mounted DOM representation. + * + * By default, this implements React's rendering and reconciliation algorithm. + * Sophisticated clients may wish to override this. + * + * @param {ReactReconcileTransaction} transaction + * @internal + * @overridable + */ + updateComponent: 'OVERRIDE_BASE' + }; + + /** + * Similar to ReactClassInterface but for static methods. + */ + var ReactClassStaticInterface = { + /** + * This method is invoked after a component is instantiated and when it + * receives new props. Return an object to update state in response to + * prop changes. Return null to indicate no change to state. + * + * If an object is returned, its keys will be merged into the existing state. + * + * @return {object || null} + * @optional + */ + getDerivedStateFromProps: 'DEFINE_MANY_MERGED' + }; + + /** + * Mapping from class specification keys to special processing functions. + * + * Although these are declared like instance properties in the specification + * when defining classes using `React.createClass`, they are actually static + * and are accessible on the constructor instead of the prototype. Despite + * being static, they must be defined outside of the "statics" key under + * which all other static methods are defined. + */ + var RESERVED_SPEC_KEYS = { + displayName: function(Constructor, displayName) { + Constructor.displayName = displayName; + }, + mixins: function(Constructor, mixins) { + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + mixSpecIntoComponent(Constructor, mixins[i]); + } + } + }, + childContextTypes: function(Constructor, childContextTypes) { + if (true) { + validateTypeDef(Constructor, childContextTypes, 'childContext'); + } + Constructor.childContextTypes = _assign( + {}, + Constructor.childContextTypes, + childContextTypes + ); + }, + contextTypes: function(Constructor, contextTypes) { + if (true) { + validateTypeDef(Constructor, contextTypes, 'context'); + } + Constructor.contextTypes = _assign( + {}, + Constructor.contextTypes, + contextTypes + ); + }, + /** + * Special case getDefaultProps which should move into statics but requires + * automatic merging. + */ + getDefaultProps: function(Constructor, getDefaultProps) { + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps = createMergedResultFunction( + Constructor.getDefaultProps, + getDefaultProps + ); + } else { + Constructor.getDefaultProps = getDefaultProps; + } + }, + propTypes: function(Constructor, propTypes) { + if (true) { + validateTypeDef(Constructor, propTypes, 'prop'); + } + Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); + }, + statics: function(Constructor, statics) { + mixStaticSpecIntoComponent(Constructor, statics); + }, + autobind: function() {} + }; + + function validateTypeDef(Constructor, typeDef, location) { + for (var propName in typeDef) { + if (typeDef.hasOwnProperty(propName)) { + // use a warning instead of an _invariant so components + // don't show up in prod but only in __DEV__ + if (true) { + warning( + typeof typeDef[propName] === 'function', + '%s: %s type `%s` is invalid; it must be a function, usually from ' + + 'React.PropTypes.', + Constructor.displayName || 'ReactClass', + ReactPropTypeLocationNames[location], + propName + ); + } + } + } + } + + function validateMethodOverride(isAlreadyDefined, name) { + var specPolicy = ReactClassInterface.hasOwnProperty(name) + ? ReactClassInterface[name] + : null; + + // Disallow overriding of base class methods unless explicitly allowed. + if (ReactClassMixin.hasOwnProperty(name)) { + _invariant( + specPolicy === 'OVERRIDE_BASE', + 'ReactClassInterface: You are attempting to override ' + + '`%s` from your class specification. Ensure that your method names ' + + 'do not overlap with React methods.', + name + ); + } + + // Disallow defining methods more than once unless explicitly allowed. + if (isAlreadyDefined) { + _invariant( + specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', + 'ReactClassInterface: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be due ' + + 'to a mixin.', + name + ); + } + } + + /** + * Mixin helper which handles policy validation and reserved + * specification keys when building React classes. + */ + function mixSpecIntoComponent(Constructor, spec) { + if (!spec) { + if (true) { + var typeofSpec = typeof spec; + var isMixinValid = typeofSpec === 'object' && spec !== null; + + if (true) { + warning( + isMixinValid, + "%s: You're attempting to include a mixin that is either null " + + 'or not an object. Check the mixins included by the component, ' + + 'as well as any mixins they include themselves. ' + + 'Expected object but got %s.', + Constructor.displayName || 'ReactClass', + spec === null ? null : typeofSpec + ); + } + } + + return; + } + + _invariant( + typeof spec !== 'function', + "ReactClass: You're attempting to " + + 'use a component class or function as a mixin. Instead, just use a ' + + 'regular object.' + ); + _invariant( + !isValidElement(spec), + "ReactClass: You're attempting to " + + 'use a component as a mixin. Instead, just use a regular object.' + ); + + var proto = Constructor.prototype; + var autoBindPairs = proto.__reactAutoBindPairs; + + // By handling mixins before any other properties, we ensure the same + // chaining order is applied to methods with DEFINE_MANY policy, whether + // mixins are listed before or after these methods in the spec. + if (spec.hasOwnProperty(MIXINS_KEY)) { + RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); + } + + for (var name in spec) { + if (!spec.hasOwnProperty(name)) { + continue; + } + + if (name === MIXINS_KEY) { + // We have already handled mixins in a special case above. + continue; + } + + var property = spec[name]; + var isAlreadyDefined = proto.hasOwnProperty(name); + validateMethodOverride(isAlreadyDefined, name); + + if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { + RESERVED_SPEC_KEYS[name](Constructor, property); + } else { + // Setup methods on prototype: + // The following member methods should not be automatically bound: + // 1. Expected ReactClass methods (in the "interface"). + // 2. Overridden methods (that were mixed in). + var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); + var isFunction = typeof property === 'function'; + var shouldAutoBind = + isFunction && + !isReactClassMethod && + !isAlreadyDefined && + spec.autobind !== false; + + if (shouldAutoBind) { + autoBindPairs.push(name, property); + proto[name] = property; + } else { + if (isAlreadyDefined) { + var specPolicy = ReactClassInterface[name]; + + // These cases should already be caught by validateMethodOverride. + _invariant( + isReactClassMethod && + (specPolicy === 'DEFINE_MANY_MERGED' || + specPolicy === 'DEFINE_MANY'), + 'ReactClass: Unexpected spec policy %s for key %s ' + + 'when mixing in component specs.', + specPolicy, + name + ); + + // For methods which are defined more than once, call the existing + // methods before calling the new property, merging if appropriate. + if (specPolicy === 'DEFINE_MANY_MERGED') { + proto[name] = createMergedResultFunction(proto[name], property); + } else if (specPolicy === 'DEFINE_MANY') { + proto[name] = createChainedFunction(proto[name], property); + } + } else { + proto[name] = property; + if (true) { + // Add verbose displayName to the function, which helps when looking + // at profiling tools. + if (typeof property === 'function' && spec.displayName) { + proto[name].displayName = spec.displayName + '_' + name; + } + } + } + } + } + } + } + + function mixStaticSpecIntoComponent(Constructor, statics) { + if (!statics) { + return; + } + + for (var name in statics) { + var property = statics[name]; + if (!statics.hasOwnProperty(name)) { + continue; + } + + var isReserved = name in RESERVED_SPEC_KEYS; + _invariant( + !isReserved, + 'ReactClass: You are attempting to define a reserved ' + + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + + 'as an instance property instead; it will still be accessible on the ' + + 'constructor.', + name + ); + + var isAlreadyDefined = name in Constructor; + if (isAlreadyDefined) { + var specPolicy = ReactClassStaticInterface.hasOwnProperty(name) + ? ReactClassStaticInterface[name] + : null; + + _invariant( + specPolicy === 'DEFINE_MANY_MERGED', + 'ReactClass: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be ' + + 'due to a mixin.', + name + ); + + Constructor[name] = createMergedResultFunction(Constructor[name], property); + + return; + } + + Constructor[name] = property; + } + } + + /** + * Merge two objects, but throw if both contain the same key. + * + * @param {object} one The first object, which is mutated. + * @param {object} two The second object + * @return {object} one after it has been mutated to contain everything in two. + */ + function mergeIntoWithNoDuplicateKeys(one, two) { + _invariant( + one && two && typeof one === 'object' && typeof two === 'object', + 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' + ); + + for (var key in two) { + if (two.hasOwnProperty(key)) { + _invariant( + one[key] === undefined, + 'mergeIntoWithNoDuplicateKeys(): ' + + 'Tried to merge two objects with the same key: `%s`. This conflict ' + + 'may be due to a mixin; in particular, this may be caused by two ' + + 'getInitialState() or getDefaultProps() methods returning objects ' + + 'with clashing keys.', + key + ); + one[key] = two[key]; + } + } + return one; + } + + /** + * Creates a function that invokes two functions and merges their return values. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createMergedResultFunction(one, two) { + return function mergedResult() { + var a = one.apply(this, arguments); + var b = two.apply(this, arguments); + if (a == null) { + return b; + } else if (b == null) { + return a; + } + var c = {}; + mergeIntoWithNoDuplicateKeys(c, a); + mergeIntoWithNoDuplicateKeys(c, b); + return c; + }; + } + + /** + * Creates a function that invokes two functions and ignores their return vales. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createChainedFunction(one, two) { + return function chainedFunction() { + one.apply(this, arguments); + two.apply(this, arguments); + }; + } + + /** + * Binds a method to the component. + * + * @param {object} component Component whose method is going to be bound. + * @param {function} method Method to be bound. + * @return {function} The bound method. + */ + function bindAutoBindMethod(component, method) { + var boundMethod = method.bind(component); + if (true) { + boundMethod.__reactBoundContext = component; + boundMethod.__reactBoundMethod = method; + boundMethod.__reactBoundArguments = null; + var componentName = component.constructor.displayName; + var _bind = boundMethod.bind; + boundMethod.bind = function(newThis) { + for ( + var _len = arguments.length, + args = Array(_len > 1 ? _len - 1 : 0), + _key = 1; + _key < _len; + _key++ + ) { + args[_key - 1] = arguments[_key]; + } + + // User is trying to bind() an autobound method; we effectively will + // ignore the value of "this" that the user is trying to use, so + // let's warn. + if (newThis !== component && newThis !== null) { + if (true) { + warning( + false, + 'bind(): React component methods may only be bound to the ' + + 'component instance. See %s', + componentName + ); + } + } else if (!args.length) { + if (true) { + warning( + false, + 'bind(): You are binding a component method to the component. ' + + 'React does this for you automatically in a high-performance ' + + 'way, so you can safely remove this call. See %s', + componentName + ); + } + return boundMethod; + } + var reboundMethod = _bind.apply(boundMethod, arguments); + reboundMethod.__reactBoundContext = component; + reboundMethod.__reactBoundMethod = method; + reboundMethod.__reactBoundArguments = args; + return reboundMethod; + }; + } + return boundMethod; + } + + /** + * Binds all auto-bound methods in a component. + * + * @param {object} component Component whose method is going to be bound. + */ + function bindAutoBindMethods(component) { + var pairs = component.__reactAutoBindPairs; + for (var i = 0; i < pairs.length; i += 2) { + var autoBindKey = pairs[i]; + var method = pairs[i + 1]; + component[autoBindKey] = bindAutoBindMethod(component, method); + } + } + + var IsMountedPreMixin = { + componentDidMount: function() { + this.__isMounted = true; + } + }; + + var IsMountedPostMixin = { + componentWillUnmount: function() { + this.__isMounted = false; + } + }; + + /** + * Add more to the ReactClass base class. These are all legacy features and + * therefore not already part of the modern ReactComponent. + */ + var ReactClassMixin = { + /** + * TODO: This will be deprecated because state should always keep a consistent + * type signature and the only use case for this, is to avoid that. + */ + replaceState: function(newState, callback) { + this.updater.enqueueReplaceState(this, newState, callback); + }, + + /** + * Checks whether or not this composite component is mounted. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function() { + if (true) { + warning( + this.__didWarnIsMounted, + '%s: isMounted is deprecated. Instead, make sure to clean up ' + + 'subscriptions and pending requests in componentWillUnmount to ' + + 'prevent memory leaks.', + (this.constructor && this.constructor.displayName) || + this.name || + 'Component' + ); + this.__didWarnIsMounted = true; + } + return !!this.__isMounted; + } + }; + + var ReactClassComponent = function() {}; + _assign( + ReactClassComponent.prototype, + ReactComponent.prototype, + ReactClassMixin + ); + + /** + * Creates a composite component class given a class specification. + * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass + * + * @param {object} spec Class specification (which must define `render`). + * @return {function} Component constructor function. + * @public + */ + function createClass(spec) { + // To keep our warnings more understandable, we'll use a little hack here to + // ensure that Constructor.name !== 'Constructor'. This makes sure we don't + // unnecessarily identify a class without displayName as 'Constructor'. + var Constructor = identity(function(props, context, updater) { + // This constructor gets overridden by mocks. The argument is used + // by mocks to assert on what gets mounted. + + if (true) { + warning( + this instanceof Constructor, + 'Something is calling a React component directly. Use a factory or ' + + 'JSX instead. See: https://fb.me/react-legacyfactory' + ); + } + + // Wire up auto-binding + if (this.__reactAutoBindPairs.length) { + bindAutoBindMethods(this); + } + + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + + this.state = null; + + // ReactClasses doesn't have constructors. Instead, they use the + // getInitialState and componentWillMount methods for initialization. + + var initialState = this.getInitialState ? this.getInitialState() : null; + if (true) { + // We allow auto-mocks to proceed as if they're returning null. + if ( + initialState === undefined && + this.getInitialState._isMockFunction + ) { + // This is probably bad practice. Consider warning here and + // deprecating this convenience. + initialState = null; + } + } + _invariant( + typeof initialState === 'object' && !Array.isArray(initialState), + '%s.getInitialState(): must return an object or null', + Constructor.displayName || 'ReactCompositeComponent' + ); + + this.state = initialState; + }); + Constructor.prototype = new ReactClassComponent(); + Constructor.prototype.constructor = Constructor; + Constructor.prototype.__reactAutoBindPairs = []; + + injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); + + mixSpecIntoComponent(Constructor, IsMountedPreMixin); + mixSpecIntoComponent(Constructor, spec); + mixSpecIntoComponent(Constructor, IsMountedPostMixin); + + // Initialize the defaultProps property after all mixins have been merged. + if (Constructor.getDefaultProps) { + Constructor.defaultProps = Constructor.getDefaultProps(); + } + + if (true) { + // This is a tag to indicate that the use of these method names is ok, + // since it's used with createClass. If it's not, then it's likely a + // mistake so we'll warn you to use the static property, property + // initializer or constructor respectively. + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps.isReactClassApproved = {}; + } + if (Constructor.prototype.getInitialState) { + Constructor.prototype.getInitialState.isReactClassApproved = {}; + } + } + + _invariant( + Constructor.prototype.render, + 'createClass(...): Class specification must implement a `render` method.' + ); + + if (true) { + warning( + !Constructor.prototype.componentShouldUpdate, + '%s has a method called ' + + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + + 'The name is phrased as a question because the function is ' + + 'expected to return a value.', + spec.displayName || 'A component' + ); + warning( + !Constructor.prototype.componentWillRecieveProps, + '%s has a method called ' + + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', + spec.displayName || 'A component' + ); + warning( + !Constructor.prototype.UNSAFE_componentWillRecieveProps, + '%s has a method called UNSAFE_componentWillRecieveProps(). ' + + 'Did you mean UNSAFE_componentWillReceiveProps()?', + spec.displayName || 'A component' + ); + } + + // Reduce time spent doing lookups by setting these on the prototype. + for (var methodName in ReactClassInterface) { + if (!Constructor.prototype[methodName]) { + Constructor.prototype[methodName] = null; + } + } + + return Constructor; + } + + return createClass; +} + +module.exports = factory; + + +/***/ }), + +/***/ "./node_modules/create-react-class/index.js": +/*!**************************************************!*\ + !*** ./node_modules/create-react-class/index.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + + +var React = __webpack_require__(/*! react */ "react"); +var factory = __webpack_require__(/*! ./factory */ "./node_modules/create-react-class/factory.js"); + +if (typeof React === 'undefined') { + throw Error( + 'create-react-class could not find the React object. If you are using script tags, ' + + 'make sure that React is being loaded before create-react-class.' + ); +} + +// Hack to grab NoopUpdateQueue from isomorphic React +var ReactNoopUpdateQueue = new React.Component().updater; + +module.exports = factory( + React.Component, + React.isValidElement, + ReactNoopUpdateQueue +); + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/columnProperties.js": +/*!****************************************************************!*\ + !*** ./node_modules/griddle-react/modules/columnProperties.js ***! + \****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + +var map = __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js"); +var filter = __webpack_require__(/*! lodash/filter */ "./node_modules/lodash/filter.js"); +var find = __webpack_require__(/*! lodash/find */ "./node_modules/lodash/find.js"); +var sortBy = __webpack_require__(/*! lodash/sortBy */ "./node_modules/lodash/sortBy.js"); +var difference = __webpack_require__(/*! lodash/difference */ "./node_modules/lodash/difference.js"); + +var ColumnProperties = (function () { + function ColumnProperties() { + var allColumns = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + var filteredColumns = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1]; + var childrenColumnName = arguments.length <= 2 || arguments[2] === undefined ? "children" : arguments[2]; + var columnMetadata = arguments.length <= 3 || arguments[3] === undefined ? [] : arguments[3]; + var metadataColumns = arguments.length <= 4 || arguments[4] === undefined ? [] : arguments[4]; + + _classCallCheck(this, ColumnProperties); + + this.allColumns = allColumns; + this.filteredColumns = filteredColumns; + this.childrenColumnName = childrenColumnName; + this.columnMetadata = columnMetadata; + this.metadataColumns = metadataColumns; + } + + _createClass(ColumnProperties, [{ + key: 'getMetadataColumns', + value: function getMetadataColumns() { + var meta = map(filter(this.columnMetadata, { visible: false }), function (item) { + return item.columnName; + }); + if (meta.indexOf(this.childrenColumnName) < 0) { + meta.push(this.childrenColumnName); + } + return meta.concat(this.metadataColumns); + } + }, { + key: 'getVisibleColumnCount', + value: function getVisibleColumnCount() { + return this.getColumns().length; + } + }, { + key: 'getColumnMetadataByName', + value: function getColumnMetadataByName(name) { + return find(this.columnMetadata, { columnName: name }); + } + }, { + key: 'hasColumnMetadata', + value: function hasColumnMetadata() { + return this.columnMetadata !== null && this.columnMetadata.length > 0; + } + }, { + key: 'getMetadataColumnProperty', + value: function getMetadataColumnProperty(columnName, propertyName, defaultValue) { + var meta = this.getColumnMetadataByName(columnName); + + //send back the default value if meta isn't there + if (typeof meta === "undefined" || meta === null) return defaultValue; + + return meta.hasOwnProperty(propertyName) ? meta[propertyName] : defaultValue; + } + }, { + key: 'orderColumns', + value: function orderColumns(cols) { + var _this = this; + + var ORDER_MAX = 100; + + var orderedColumns = sortBy(cols, function (item) { + var metaItem = find(_this.columnMetadata, { columnName: item }); + + if (typeof metaItem === 'undefined' || metaItem === null || isNaN(metaItem.order)) { + return ORDER_MAX; + } + + return metaItem.order; + }); + + return orderedColumns; + } + }, { + key: 'getColumns', + value: function getColumns() { + //if we didn't set default or filter + var filteredColumns = this.filteredColumns.length === 0 ? this.allColumns : this.filteredColumns; + + filteredColumns = difference(filteredColumns, this.metadataColumns); + + filteredColumns = this.orderColumns(filteredColumns); + + return filteredColumns; + } + }]); + + return ColumnProperties; +})(); + +module.exports = ColumnProperties; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/customFilterContainer.jsx.js": +/*!*************************************************************************!*\ + !*** ./node_modules/griddle-react/modules/customFilterContainer.jsx.js ***! + \*************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); + +var CustomFilterContainer = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "placeholderText": "" + }; + }, + render: function render() { + var that = this; + + if (typeof that.props.customFilterComponent !== 'function') { + console.log("Couldn't find valid template."); + return React.createElement('div', null); + } + + return React.createElement(that.props.customFilterComponent, { + changeFilter: this.props.changeFilter, + results: this.props.results, + currentResults: this.props.currentResults, + placeholderText: this.props.placeholderText }); + } +}); + +module.exports = CustomFilterContainer; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/customPaginationContainer.jsx.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/griddle-react/modules/customPaginationContainer.jsx.js ***! + \*****************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + Griddle - Simple Grid Component for React + https://github.com/DynamicTyped/Griddle + Copyright (c) 2014 Ryan Lanciaux | DynamicTyped + + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i];for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + }return target; +}; + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); + +var CustomPaginationContainer = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "maxPage": 0, + "nextText": "", + "previousText": "", + "currentPage": 0, + "customPagerComponent": {}, + "customPagerComponentOptions": {} + }; + }, + render: function render() { + var that = this; + + if (typeof that.props.customPagerComponent !== 'function') { + console.log("Couldn't find valid template."); + return React.createElement('div', null); + } + + return React.createElement(that.props.customPagerComponent, _extends({}, this.props.customPagerComponentOptions, { maxPage: this.props.maxPage, nextText: this.props.nextText, previousText: this.props.previousText, currentPage: this.props.currentPage, setPage: this.props.setPage, previous: this.props.previous, next: this.props.next })); + } +}); + +module.exports = CustomPaginationContainer; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/customRowComponentContainer.jsx.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/griddle-react/modules/customRowComponentContainer.jsx.js ***! + \*******************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + Griddle - Simple Grid Component for React + https://github.com/DynamicTyped/Griddle + Copyright (c) 2014 Ryan Lanciaux | DynamicTyped + + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); + +var CustomRowComponentContainer = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "data": [], + "metadataColumns": [], + "className": "", + "customComponent": {}, + "globalData": {} + }; + }, + render: function render() { + var that = this; + + if (typeof that.props.customComponent !== 'function') { + console.log("Couldn't find valid template."); + return React.createElement('div', { className: this.props.className }); + } + + var nodes = this.props.data.map(function (row, index) { + return React.createElement(that.props.customComponent, { data: row, metadataColumns: that.props.metadataColumns, key: index, globalData: that.props.globalData }); + }); + + var footer = this.props.showPager && this.props.pagingContent; + return React.createElement('div', { className: this.props.className, style: this.props.style }, nodes); + } +}); + +module.exports = CustomRowComponentContainer; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/deep.js": +/*!****************************************************!*\ + !*** ./node_modules/griddle-react/modules/deep.js ***! + \****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var forEach = __webpack_require__(/*! lodash/forEach */ "./node_modules/lodash/forEach.js"); +var isObject = __webpack_require__(/*! lodash/isObject */ "./node_modules/lodash/isObject.js"); +var isArray = __webpack_require__(/*! lodash/isArray */ "./node_modules/lodash/isArray.js"); +var isFunction = __webpack_require__(/*! lodash/isFunction */ "./node_modules/lodash/isFunction.js"); +var isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ "./node_modules/lodash/isPlainObject.js"); +var forOwn = __webpack_require__(/*! lodash/forOwn */ "./node_modules/lodash/forOwn.js"); + +// Credits: https://github.com/documentcloud/underscore-contrib +// Sub module: underscore.object.selectors +// License: MIT (https://github.com/documentcloud/underscore-contrib/blob/master/LICENSE) +// https://github.com/documentcloud/underscore-contrib/blob/master/underscore.object.selectors.js + +// Will take a path like 'element[0][1].subElement["Hey!.What?"]["[hey]"]' +// and return ["element", "0", "1", "subElement", "Hey!.What?", "[hey]"] +function keysFromPath(path) { + // from http://codereview.stackexchange.com/a/63010/8176 + /** + * Repeatedly capture either: + * - a bracketed expression, discarding optional matching quotes inside, or + * - an unbracketed expression, delimited by a dot or a bracket. + */ + var re = /\[("|')(.+)\1\]|([^.\[\]]+)/g; + + var elements = []; + var result; + while ((result = re.exec(path)) !== null) { + elements.push(result[2] || result[3]); + } + return elements; +} + +// Gets the value at any depth in a nested object based on the +// path described by the keys given. Keys may be given as an array +// or as a dot-separated string. +function getPath(obj, ks) { + if (typeof ks == "string") { + if (obj[ks] !== undefined) { + return obj[ks]; + } + ks = keysFromPath(ks); + } + + var i = -1, + length = ks.length; + + // If the obj is null or undefined we have to break as + // a TypeError will result trying to access any property + // Otherwise keep incrementally access the next property in + // ks until complete + while (++i < length && obj != null) { + obj = obj[ks[i]]; + } + return i === length ? obj : void 0; +} + +// Based on the origin underscore _.pick function +// Credit: https://github.com/jashkenas/underscore/blob/master/underscore.js +function powerPick(object, keys) { + var result = {}, + obj = object, + iteratee; + iteratee = function (key, obj) { + return key in obj; + }; + + obj = Object(obj); + + for (var i = 0, length = keys.length; i < length; i++) { + var key = keys[i]; + if (iteratee(key, obj)) result[key] = getPath(obj, key); + } + + return result; +} + +// Gets all the keys for a flattened object structure. +// Doesn't flatten arrays. +// Input: +// { +// a: { +// x: 1, +// y: 2 +// }, +// b: [3, 4], +// c: 5 +// } +// Output: +// [ +// "a.x", +// "a.y", +// "b", +// "c" +// ] +function getKeys(obj, prefix) { + var keys = []; + + forEach(obj, function (value, key) { + var fullKey = prefix ? prefix + "." + key : key; + if (isObject(value) && !isArray(value) && !isFunction(value) && !(value instanceof Date)) { + keys = keys.concat(getKeys(value, fullKey)); + } else { + keys.push(fullKey); + } + }); + + return keys; +} + +// Recursivly traverse plain objects and arrays calling `fn` on each +// non-object/non-array leaf node. +function iterObject(thing, fn) { + if (isArray(thing)) { + forEach(thing, function (item) { + iterObject(item, fn); + }); + } else if (isPlainObject(thing)) { + forOwn(thing, function (item) { + iterObject(item, fn); + }); + } else { + fn(thing); + } +} + +// Recursivly traverse plain objects and arrays and build a list of all +// non-object/non-array leaf nodes. +// +// Input: +// { "array": [1, "two", {"tree": 3}], "string": "a string" } +// +// Output: +// [1, 'two', 3, 'a string'] +// +function getObjectValues(thing) { + var results = []; + iterObject(thing, function (value) { + results.push(value); + }); + return results; +} + +module.exports = { + pick: powerPick, + getAt: getPath, + keys: getKeys, + getObjectValues: getObjectValues +}; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridFilter.jsx.js": +/*!**************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridFilter.jsx.js ***! + \**************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); + +var GridFilter = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "placeholderText": "" + }; + }, + handleChange: function handleChange(event) { + this.props.changeFilter(event.target.value); + }, + render: function render() { + return React.createElement('div', { className: 'filter-container' }, React.createElement('input', { type: 'text', name: 'filter', placeholder: this.props.placeholderText, className: 'form-control', onChange: this.handleChange })); + } +}); + +module.exports = GridFilter; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridNoData.jsx.js": +/*!**************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridNoData.jsx.js ***! + \**************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); + +var GridNoData = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "noDataMessage": "No Data" + }; + }, + render: function render() { + var that = this; + + return React.createElement('div', null, this.props.noDataMessage); + } +}); + +module.exports = GridNoData; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridPagination.jsx.js": +/*!******************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridPagination.jsx.js ***! + \******************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var assign = __webpack_require__(/*! lodash/assign */ "./node_modules/lodash/assign.js"); + +//needs props maxPage, currentPage, nextFunction, prevFunction +var GridPagination = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "maxPage": 0, + "nextText": "", + "previousText": "", + "currentPage": 0, + "useGriddleStyles": true, + "nextClassName": "griddle-next", + "previousClassName": "griddle-previous", + "nextIconComponent": null, + "previousIconComponent": null + }; + }, + pageChange: function pageChange(event) { + this.props.setPage(parseInt(event.target.value, 10) - 1); + }, + render: function render() { + var previous = ""; + var next = ""; + + if (this.props.currentPage > 0) { + previous = React.createElement('button', { type: 'button', onClick: this.props.previous, style: this.props.useGriddleStyles ? { "color": "#222", border: "none", background: "none", margin: "0 0 0 10px" } : null }, this.props.previousIconComponent, this.props.previousText); + } + + if (this.props.currentPage !== this.props.maxPage - 1) { + next = React.createElement('button', { type: 'button', onClick: this.props.next, style: this.props.useGriddleStyles ? { "color": "#222", border: "none", background: "none", margin: "0 10px 0 0" } : null }, this.props.nextText, this.props.nextIconComponent); + } + + var leftStyle = null; + var middleStyle = null; + var rightStyle = null; + + if (this.props.useGriddleStyles === true) { + var baseStyle = { + "float": "left", + minHeight: "1px", + marginTop: "5px" + }; + + rightStyle = assign({ textAlign: "right", width: "34%" }, baseStyle); + middleStyle = assign({ textAlign: "center", width: "33%" }, baseStyle); + leftStyle = assign({ width: "33%" }, baseStyle); + } + + var options = []; + + for (var i = 1; i <= this.props.maxPage; i++) { + options.push(React.createElement('option', { value: i, key: i }, i)); + } + + return React.createElement('div', { style: this.props.useGriddleStyles ? { minHeight: "35px" } : null }, React.createElement('div', { className: this.props.previousClassName, style: leftStyle }, previous), React.createElement('div', { className: 'griddle-page', style: middleStyle }, React.createElement('select', { value: this.props.currentPage + 1, onChange: this.pageChange }, options), ' / ', this.props.maxPage), React.createElement('div', { className: this.props.nextClassName, style: rightStyle }, next)); + } +}); + +module.exports = GridPagination; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridRow.jsx.js": +/*!***********************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridRow.jsx.js ***! + \***********************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var ColumnProperties = __webpack_require__(/*! ./columnProperties.js */ "./node_modules/griddle-react/modules/columnProperties.js"); +var deep = __webpack_require__(/*! ./deep.js */ "./node_modules/griddle-react/modules/deep.js"); +var isFunction = __webpack_require__(/*! lodash/isFunction */ "./node_modules/lodash/isFunction.js"); +var zipObject = __webpack_require__(/*! lodash/zipObject */ "./node_modules/lodash/zipObject.js"); +var assign = __webpack_require__(/*! lodash/assign */ "./node_modules/lodash/assign.js"); +var defaults = __webpack_require__(/*! lodash/defaults */ "./node_modules/lodash/defaults.js"); +var toPairs = __webpack_require__(/*! lodash/toPairs */ "./node_modules/lodash/toPairs.js"); +var without = __webpack_require__(/*! lodash/without */ "./node_modules/lodash/without.js"); + +var GridRow = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "isChildRow": false, + "showChildren": false, + "data": {}, + "columnSettings": null, + "rowSettings": null, + "hasChildren": false, + "useGriddleStyles": true, + "useGriddleIcons": true, + "isSubGriddle": false, + "paddingHeight": null, + "rowHeight": null, + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "parentRowCollapsedComponent": "â–¶", + "parentRowExpandedComponent": "â–¼", + "onRowClick": null, + "multipleSelectionSettings": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null + }; + }, + componentWillMount: function componentWillMount() { + if (this.props.onRowWillMount !== null && isFunction(this.props.onRowWillMount)) { + this.props.onRowWillMount(this); + } + }, + componentWillUnmount: function componentWillUnmount() { + if (this.props.onRowWillUnmount !== null && isFunction(this.props.onRowWillUnmount)) { + this.props.onRowWillUnmount(this); + } + }, + handleClick: function handleClick(e) { + if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { + this.props.onRowClick(this, e); + } else if (this.props.hasChildren) { + this.props.toggleChildren(); + } + }, + handleMouseEnter: function handleMouseEnter(e) { + if (this.props.onRowMouseEnter !== null && isFunction(this.props.onRowMouseEnter)) { + this.props.onRowMouseEnter(this, e); + } + }, + handleMouseLeave: function handleMouseLeave(e) { + if (this.props.onRowMouseLeave !== null && isFunction(this.props.onRowMouseLeave)) { + this.props.onRowMouseLeave(this, e); + } + }, + handleSelectionChange: function handleSelectionChange(e) { + //hack to get around warning that's not super useful in this case + return; + }, + handleSelectClick: function handleSelectClick(e) { + if (this.props.multipleSelectionSettings.isMultipleSelection) { + if (e.target.type === "checkbox") { + this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, this.refs.selected.checked); + } else { + this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, !this.refs.selected.checked); + } + } + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridRow: The columnSettings prop is null and it shouldn't be"); + } + }, + formatData: function formatData(data) { + if (typeof data === 'boolean') { + return String(data); + } + return data; + }, + render: function render() { + var _this = this; + + this.verifyProps(); + var that = this; + var columnStyles = null; + + if (this.props.useGriddleStyles) { + columnStyles = { + margin: "0px", + padding: that.props.paddingHeight + "px 5px " + that.props.paddingHeight + "px 5px", + height: that.props.rowHeight ? this.props.rowHeight - that.props.paddingHeight * 2 + "px" : null, + backgroundColor: "#FFF", + borderTopColor: "#DDD", + color: "#222" + }; + } + + var columns = this.props.columnSettings.getColumns(); + + // make sure that all the columns we need have default empty values + // otherwise they will get clipped + var defaultValues = zipObject(columns, []); + + // creates a 'view' on top the data so we will not alter the original data but will allow us to add default values to missing columns + var dataView = assign({}, this.props.data); + + defaults(dataView, defaultValues); + var data = toPairs(deep.pick(dataView, without(columns, 'children'))); + var nodes = data.map(function (col, index) { + var returnValue = null; + var meta = _this.props.columnSettings.getColumnMetadataByName(col[0]); + + //todo: Make this not as ridiculous looking + var firstColAppend = index === 0 && _this.props.hasChildren && _this.props.showChildren === false && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px", marginRight: "5px" } : null }, _this.props.parentRowCollapsedComponent) : index === 0 && _this.props.hasChildren && _this.props.showChildren && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px" } : null }, _this.props.parentRowExpandedComponent) : ""; + + if (index === 0 && _this.props.isChildRow && _this.props.useGriddleStyles) { + columnStyles = assign(columnStyles, { paddingLeft: 10 }); + } + + if (_this.props.columnSettings.hasColumnMetadata() && typeof meta !== 'undefined' && meta !== null) { + if (typeof meta.customComponent !== 'undefined' && meta.customComponent !== null) { + var customComponent = React.createElement(meta.customComponent, { data: col[1], rowData: dataView, metadata: meta }); + returnValue = React.createElement('td', { onClick: _this.handleClick, onMouseEnter: _this.handleMouseEnter, onMouseLeave: _this.handleMouseLeave, className: meta.cssClassName, key: index, style: columnStyles }, customComponent); + } else { + returnValue = React.createElement('td', { onClick: _this.handleClick, onMouseEnter: _this.handleMouseEnter, onMouseLeave: _this.handleMouseLeave, className: meta.cssClassName, key: index, style: columnStyles }, firstColAppend, _this.formatData(col[1])); + } + } + + return returnValue || React.createElement('td', { onClick: _this.handleClick, onMouseEnter: _this.handleMouseEnter, onMouseLeave: _this.handleMouseLeave, key: index, style: columnStyles }, firstColAppend, col[1]); + }); + + // Don't compete with onRowClick, but if no onRowClick function then + // clicking on the row should trigger select + var trOnClick, tdOnClick; + if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { + trOnClick = null; + tdOnClick = this.handleSelectClick; + } else { + if (this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { + trOnClick = this.handleSelectClick; + tdOnClick = null; + } else { + trOnClick = null; + tdOnClick = null; + } + } + + if (nodes && this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { + var selectedRowIds = this.props.multipleSelectionSettings.getSelectedRowIds(); + + nodes.unshift(React.createElement('td', { + key: 'selection', + style: columnStyles, + className: 'griddle-select griddle-select-cell', + onClick: tdOnClick + }, React.createElement('input', { + type: 'checkbox', + checked: this.props.multipleSelectionSettings.getIsRowChecked(dataView), + onChange: this.handleSelectionChange, + ref: 'selected' + }))); + } + + //Get the row from the row settings. + var className = that.props.rowSettings && that.props.rowSettings.getBodyRowMetadataClass(that.props.data) || "standard-row"; + + if (that.props.isChildRow) { + className = "child-row"; + } else if (that.props.hasChildren) { + className = that.props.showChildren ? this.props.parentRowExpandedClassName : this.props.parentRowCollapsedClassName; + } + + return React.createElement('tr', { onClick: trOnClick, className: className }, nodes); + } +}); + +module.exports = GridRow; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridRowContainer.jsx.js": +/*!********************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridRowContainer.jsx.js ***! + \********************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var ColumnProperties = __webpack_require__(/*! ./columnProperties.js */ "./node_modules/griddle-react/modules/columnProperties.js"); +var pick = __webpack_require__(/*! lodash/pick */ "./node_modules/lodash/pick.js"); + +var GridRowContainer = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "useGriddleStyles": true, + "useGriddleIcons": true, + "isSubGriddle": false, + "columnSettings": null, + "rowSettings": null, + "paddingHeight": null, + "rowHeight": null, + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "parentRowCollapsedComponent": "â–¶", + "parentRowExpandedComponent": "â–¼", + "onRowClick": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null, + "multipleSelectionSettings": null + }; + }, + getInitialState: function getInitialState() { + return { + "data": {}, + "showChildren": false + }; + }, + componentWillReceiveProps: function componentWillReceiveProps() { + this.setShowChildren(false); + }, + toggleChildren: function toggleChildren() { + this.setShowChildren(this.state.showChildren === false); + }, + setShowChildren: function setShowChildren(visible) { + this.setState({ + showChildren: visible + }); + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be"); + } + }, + render: function render() { + this.verifyProps(); + var that = this; + if (typeof this.props.data === "undefined") { + return React.createElement('tbody', null); + } + var arr = []; + + var columns = this.props.columnSettings.getColumns(); + + arr.push(React.createElement(this.props.rowSettings.rowComponent, { + useGriddleStyles: this.props.useGriddleStyles, + isSubGriddle: this.props.isSubGriddle, + data: this.props.rowSettings.isCustom ? pick(this.props.data, columns) : this.props.data, + rowData: this.props.rowSettings.isCustom ? this.props.data : null, + columnSettings: this.props.columnSettings, + rowSettings: this.props.rowSettings, + hasChildren: that.props.hasChildren, + toggleChildren: that.toggleChildren, + showChildren: that.state.showChildren, + key: that.props.uniqueId + '_base_row', + useGriddleIcons: that.props.useGriddleIcons, + parentRowExpandedClassName: this.props.parentRowExpandedClassName, + parentRowCollapsedClassName: this.props.parentRowCollapsedClassName, + parentRowExpandedComponent: this.props.parentRowExpandedComponent, + parentRowCollapsedComponent: this.props.parentRowCollapsedComponent, + paddingHeight: that.props.paddingHeight, + rowHeight: that.props.rowHeight, + onRowClick: that.props.onRowClick, + onRowMouseEnter: that.props.onRowMouseEnter, + onRowMouseLeave: that.props.onRowMouseLeave, + multipleSelectionSettings: this.props.multipleSelectionSettings, + onRowWillMount: that.props.onRowWillMount, + onRowWillUnmount: that.props.onRowWillUnmount })); + + var children = null; + + if (that.state.showChildren) { + children = that.props.hasChildren && this.props.data["children"].map(function (row, index) { + var key = that.props.rowSettings.getRowKey(row, index); + + if (typeof row["children"] !== "undefined") { + var Griddle = that.constructor.Griddle; + return React.createElement('tr', { key: key, style: { paddingLeft: 5 } }, React.createElement('td', { colSpan: that.props.columnSettings.getVisibleColumnCount(), className: 'griddle-parent', style: that.props.useGriddleStyles ? { border: "none", "padding": "0 0 0 5px" } : null }, React.createElement(Griddle, { + rowMetadata: { key: 'id' }, + isSubGriddle: true, + results: [row], + columns: that.props.columnSettings.getColumns(), + tableClassName: that.props.tableClassName, + parentRowExpandedClassName: that.props.parentRowExpandedClassName, + parentRowCollapsedClassName: that.props.parentRowCollapsedClassName, + showTableHeading: false, + showPager: false, + columnMetadata: that.props.columnSettings.columnMetadata, + parentRowExpandedComponent: that.props.parentRowExpandedComponent, + parentRowCollapsedComponent: that.props.parentRowCollapsedComponent, + paddingHeight: that.props.paddingHeight, + rowHeight: that.props.rowHeight + }))); + } + + return React.createElement(that.props.rowSettings.rowComponent, { + useGriddleStyles: that.props.useGriddleStyles, + isSubGriddle: that.props.isSubGriddle, + data: row, + columnSettings: that.props.columnSettings, + isChildRow: true, + columnMetadata: that.props.columnSettings.columnMetadata, + key: key + }); + }); + } + + return that.props.hasChildren === false ? arr[0] : React.createElement('tbody', null, that.state.showChildren ? arr.concat(children) : arr); + } +}); + +module.exports = GridRowContainer; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridSettings.jsx.js": +/*!****************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridSettings.jsx.js ***! + \****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var includes = __webpack_require__(/*! lodash/includes */ "./node_modules/lodash/includes.js"); +var without = __webpack_require__(/*! lodash/without */ "./node_modules/lodash/without.js"); +var find = __webpack_require__(/*! lodash/find */ "./node_modules/lodash/find.js"); + +var GridSettings = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "columns": [], + "columnMetadata": [], + "selectedColumns": [], + "settingsText": "", + "maxRowsText": "", + "resultsPerPage": 0, + "enableToggleCustom": false, + "useCustomComponent": false, + "useGriddleStyles": true, + "toggleCustomComponent": function toggleCustomComponent() {} + }; + }, + setPageSize: function setPageSize(event) { + var value = parseInt(event.target.value, 10); + this.props.setPageSize(value); + }, + handleChange: function handleChange(event) { + var columnName = event.target.dataset ? event.target.dataset.name : event.target.getAttribute('data-name'); + if (event.target.checked === true && includes(this.props.selectedColumns, columnName) === false) { + this.props.selectedColumns.push(columnName); + this.props.setColumns(this.props.selectedColumns); + } else { + /* redraw with the selected columns minus the one just unchecked */ + this.props.setColumns(without(this.props.selectedColumns, columnName)); + } + }, + render: function render() { + var that = this; + + var nodes = []; + //don't show column selector if we're on a custom component + if (that.props.useCustomComponent === false) { + nodes = this.props.columns.map(function (col, index) { + var checked = includes(that.props.selectedColumns, col); + //check column metadata -- if this one is locked make it disabled and don't put an onChange event + var meta = find(that.props.columnMetadata, { columnName: col }); + var displayName = col; + + if (typeof meta !== "undefined" && typeof meta.displayName !== "undefined" && meta.displayName != null) { + displayName = meta.displayName; + } + + if (typeof meta !== "undefined" && meta != null && meta.locked) { + return React.createElement('div', { className: 'column checkbox' }, React.createElement('label', null, React.createElement('input', { type: 'checkbox', disabled: true, name: 'check', checked: checked, 'data-name': col }), displayName)); + } else if (typeof meta !== "undefined" && meta != null && typeof meta.visible !== "undefined" && meta.visible === false) { + return null; + } + return React.createElement('div', { className: 'griddle-column-selection checkbox', key: col, style: that.props.useGriddleStyles ? { "float": "left", width: "20%" } : null }, React.createElement('label', null, React.createElement('input', { type: 'checkbox', name: 'check', onChange: that.handleChange, checked: checked, 'data-name': col }), displayName)); + }); + } + + var toggleCustom = that.props.enableToggleCustom ? React.createElement('div', { className: 'form-group' }, React.createElement('label', { htmlFor: 'maxRows' }, React.createElement('input', { type: 'checkbox', checked: this.props.useCustomComponent, onChange: this.props.toggleCustomComponent }), ' ', this.props.enableCustomFormatText)) : ""; + + var setPageSize = this.props.showSetPageSize ? React.createElement('div', null, React.createElement('label', { htmlFor: 'maxRows' }, this.props.maxRowsText, ':', React.createElement('select', { onChange: this.setPageSize, value: this.props.resultsPerPage }, React.createElement('option', { value: '5' }, '5'), React.createElement('option', { value: '10' }, '10'), React.createElement('option', { value: '25' }, '25'), React.createElement('option', { value: '50' }, '50'), React.createElement('option', { value: '100' }, '100')))) : ""; + + return React.createElement('div', { className: 'griddle-settings', style: this.props.useGriddleStyles ? { backgroundColor: "#FFF", border: "1px solid #DDD", color: "#222", padding: "10px", marginBottom: "10px" } : null }, React.createElement('h6', null, this.props.settingsText), React.createElement('div', { className: 'griddle-columns', style: this.props.useGriddleStyles ? { clear: "both", display: "table", width: "100%", borderBottom: "1px solid #EDEDED", marginBottom: "10px" } : null }, nodes), setPageSize, toggleCustom); + } +}); + +module.exports = GridSettings; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridTable.jsx.js": +/*!*************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridTable.jsx.js ***! + \*************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var GridTitle = __webpack_require__(/*! ./gridTitle.jsx */ "./node_modules/griddle-react/modules/gridTitle.jsx.js"); +var GridRowContainer = __webpack_require__(/*! ./gridRowContainer.jsx */ "./node_modules/griddle-react/modules/gridRowContainer.jsx.js"); +var ColumnProperties = __webpack_require__(/*! ./columnProperties.js */ "./node_modules/griddle-react/modules/columnProperties.js"); +var RowProperties = __webpack_require__(/*! ./rowProperties.js */ "./node_modules/griddle-react/modules/rowProperties.js"); + +var GridTable = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "data": [], + "columnSettings": null, + "rowSettings": null, + "sortSettings": null, + "multipleSelectionSettings": null, + "className": "", + "enableInfiniteScroll": false, + "nextPage": null, + "hasMorePages": false, + "useFixedHeader": false, + "useFixedLayout": true, + "paddingHeight": null, + "rowHeight": null, + "filterByColumn": null, + "infiniteScrollLoadTreshold": null, + "bodyHeight": null, + "useGriddleStyles": true, + "useGriddleIcons": true, + "isSubGriddle": false, + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "parentRowCollapsedComponent": "â–¶", + "parentRowExpandedComponent": "â–¼", + "externalLoadingComponent": null, + "externalIsLoading": false, + "onRowClick": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null + }; + }, + getInitialState: function getInitialState() { + return { + scrollTop: 0, + scrollHeight: this.props.bodyHeight, + clientHeight: this.props.bodyHeight + }; + }, + componentDidMount: function componentDidMount() { + // After the initial render, see if we need to load additional pages. + this.gridScroll(); + }, + componentDidUpdate: function componentDidUpdate(prevProps, prevState) { + // After the subsequent renders, see if we need to load additional pages. + this.gridScroll(); + }, + gridScroll: function gridScroll() { + if (this.props.enableInfiniteScroll && !this.props.externalIsLoading) { + // If the scroll height is greater than the current amount of rows displayed, update the page. + var scrollable = this.refs.scrollable; + var scrollTop = scrollable.scrollTop; + var scrollHeight = scrollable.scrollHeight; + var clientHeight = scrollable.clientHeight; + + // If the scroll position changed and the difference is greater than a row height + if (this.props.rowHeight !== null && this.state.scrollTop !== scrollTop && Math.abs(this.state.scrollTop - scrollTop) >= this.getAdjustedRowHeight()) { + var newState = { + scrollTop: scrollTop, + scrollHeight: scrollHeight, + clientHeight: clientHeight + }; + + // Set the state to the new state + this.setState(newState); + } + + // Determine the diff by subtracting the amount scrolled by the total height, taking into consideratoin + // the spacer's height. + var scrollHeightDiff = scrollHeight - (scrollTop + clientHeight) - this.props.infiniteScrollLoadTreshold; + + // Make sure that we load results a little before reaching the bottom. + var compareHeight = scrollHeightDiff * 0.6; + + if (compareHeight <= this.props.infiniteScrollLoadTreshold) { + this.props.nextPage(); + } + } + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridTable: The columnSettings prop is null and it shouldn't be"); + } + if (this.props.rowSettings === null) { + console.error("gridTable: The rowSettings prop is null and it shouldn't be"); + } + }, + getAdjustedRowHeight: function getAdjustedRowHeight() { + return this.props.rowHeight + this.props.paddingHeight * 2; // account for padding. + }, + getNodeContent: function getNodeContent() { + this.verifyProps(); + var that = this; + + //figure out if we need to wrap the group in one tbody or many + var anyHasChildren = false; + + // If the data is still being loaded, don't build the nodes unless this is an infinite scroll table. + if (!this.props.externalIsLoading || this.props.enableInfiniteScroll) { + var nodeData = that.props.data; + var aboveSpacerRow = null; + var belowSpacerRow = null; + var usingDefault = false; + + // If we have a row height specified, only render what's going to be visible. + if (this.props.enableInfiniteScroll && this.props.rowHeight !== null && this.refs.scrollable !== undefined) { + var adjustedHeight = that.getAdjustedRowHeight(); + var visibleRecordCount = Math.ceil(that.state.clientHeight / adjustedHeight); + + // Inspired by : http://jsfiddle.net/vjeux/KbWJ2/9/ + var displayStart = Math.max(0, Math.floor(that.state.scrollTop / adjustedHeight) - visibleRecordCount * 0.25); + var displayEnd = Math.min(displayStart + visibleRecordCount * 1.25, this.props.data.length - 1); + + // Split the amount of nodes. + nodeData = nodeData.slice(displayStart, displayEnd + 1); + + // Set the above and below nodes. + var aboveSpacerRowStyle = { height: displayStart * adjustedHeight + "px" }; + aboveSpacerRow = React.createElement('tr', { key: 'above-' + aboveSpacerRowStyle.height, style: aboveSpacerRowStyle }); + var belowSpacerRowStyle = { height: (this.props.data.length - displayEnd) * adjustedHeight + "px" }; + belowSpacerRow = React.createElement('tr', { key: 'below-' + belowSpacerRowStyle.height, style: belowSpacerRowStyle }); + } + + var nodes = nodeData.map(function (row, index) { + var hasChildren = typeof row["children"] !== "undefined" && row["children"].length > 0; + var uniqueId = that.props.rowSettings.getRowKey(row, index); + + //at least one item in the group has children. + if (hasChildren) { + anyHasChildren = hasChildren; + } + + return React.createElement(GridRowContainer, { + useGriddleStyles: that.props.useGriddleStyles, + isSubGriddle: that.props.isSubGriddle, + parentRowExpandedClassName: that.props.parentRowExpandedClassName, + parentRowCollapsedClassName: that.props.parentRowCollapsedClassName, + parentRowExpandedComponent: that.props.parentRowExpandedComponent, + parentRowCollapsedComponent: that.props.parentRowCollapsedComponent, + data: row, + key: uniqueId + '-container', + uniqueId: uniqueId, + columnSettings: that.props.columnSettings, + rowSettings: that.props.rowSettings, + paddingHeight: that.props.paddingHeight, + multipleSelectionSettings: that.props.multipleSelectionSettings, + rowHeight: that.props.rowHeight, + hasChildren: hasChildren, + tableClassName: that.props.className, + onRowClick: that.props.onRowClick, + onRowMouseEnter: that.props.onRowMouseEnter, + onRowMouseLeave: that.props.onRowMouseLeave, + onRowWillMount: that.props.onRowWillMount, + onRowWillUnmount: that.props.onRowWillUnmount + }); + }); + + // no data section + if (this.props.showNoData) { + var colSpan = this.props.columnSettings.getVisibleColumnCount(); + nodes.push(React.createElement('tr', { key: 'no-data-section' }, React.createElement('td', { colSpan: colSpan }, this.props.noDataSection))); + } + + // Add the spacer rows for nodes we're not rendering. + if (aboveSpacerRow) { + nodes.unshift(aboveSpacerRow); + } + if (belowSpacerRow) { + nodes.push(belowSpacerRow); + } + + // Send back the nodes. + return { + nodes: nodes, + anyHasChildren: anyHasChildren + }; + } else { + return null; + } + }, + render: function render() { + var that = this; + var nodes = []; + + // for if we need to wrap the group in one tbody or many + var anyHasChildren = false; + + // Grab the nodes to render + var nodeContent = this.getNodeContent(); + if (nodeContent) { + nodes = nodeContent.nodes; + anyHasChildren = nodeContent.anyHasChildren; + } + + var gridStyle = null; + var loadingContent = null; + var tableStyle = { + width: "100%" + }; + + if (this.props.useFixedLayout) { + tableStyle.tableLayout = "fixed"; + } + + if (this.props.enableInfiniteScroll) { + // If we're enabling infinite scrolling, we'll want to include the max height of the grid body + allow scrolling. + gridStyle = { + "position": "relative", + "overflowY": "scroll", + "height": this.props.bodyHeight + "px", + "width": "100%" + }; + } + + // If we're currently loading, populate the loading content + if (this.props.externalIsLoading) { + var defaultLoadingStyle = null; + var defaultColSpan = null; + + if (this.props.useGriddleStyles) { + defaultLoadingStyle = { + textAlign: "center", + paddingBottom: "40px" + }; + } + + defaultColSpan = this.props.columnSettings.getVisibleColumnCount(); + + var loadingComponent = this.props.externalLoadingComponent ? React.createElement(this.props.externalLoadingComponent, null) : React.createElement('div', null, 'Loading...'); + + loadingContent = React.createElement('tbody', null, React.createElement('tr', null, React.createElement('td', { style: defaultLoadingStyle, colSpan: defaultColSpan }, loadingComponent))); + } + + //construct the table heading component + var tableHeading = this.props.showTableHeading ? React.createElement(GridTitle, { useGriddleStyles: this.props.useGriddleStyles, useGriddleIcons: this.props.useGriddleIcons, + sortSettings: this.props.sortSettings, + multipleSelectionSettings: this.props.multipleSelectionSettings, + columnSettings: this.props.columnSettings, + filterByColumn: this.props.filterByColumn, + rowSettings: this.props.rowSettings }) : undefined; + + //check to see if any of the rows have children... if they don't wrap everything in a tbody so the browser doesn't auto do this + if (!anyHasChildren) { + nodes = React.createElement('tbody', null, nodes); + } + + var pagingContent = React.createElement('tbody', null); + if (this.props.showPager) { + var pagingStyles = this.props.useGriddleStyles ? { + padding: "0px", + backgroundColor: "#EDEDED", + border: "0px", + color: "#222", + height: this.props.showNoData ? "20px" : null + } : null; + pagingContent = React.createElement('tbody', null, React.createElement('tr', null, React.createElement('td', { colSpan: this.props.multipleSelectionSettings.isMultipleSelection ? this.props.columnSettings.getVisibleColumnCount() + 1 : this.props.columnSettings.getVisibleColumnCount(), style: pagingStyles, className: 'footer-container' }, !this.props.showNoData ? this.props.pagingContent : null))); + } + + // If we have a fixed header, split into two tables. + if (this.props.useFixedHeader) { + if (this.props.useGriddleStyles) { + tableStyle.tableLayout = "fixed"; + } + + return React.createElement('div', null, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading), React.createElement('div', { ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, nodes, loadingContent, pagingContent))); + } + + return React.createElement('div', { ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading, nodes, loadingContent, pagingContent)); + } +}); + +module.exports = GridTable; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridTitle.jsx.js": +/*!*************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridTitle.jsx.js ***! + \*************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE + */ + + +var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i];for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + }return target; +}; + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var ColumnProperties = __webpack_require__(/*! ./columnProperties.js */ "./node_modules/griddle-react/modules/columnProperties.js"); +var assign = __webpack_require__(/*! lodash/assign */ "./node_modules/lodash/assign.js"); + +var DefaultHeaderComponent = createReactClass({ + render: function render() { + return React.createElement('span', null, this.props.displayName); + } +}); + +var GridTitle = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "columnSettings": null, + "filterByColumn": function filterByColumn() {}, + "rowSettings": null, + "sortSettings": null, + "multipleSelectionSettings": null, + "headerStyle": null, + "useGriddleStyles": true, + "useGriddleIcons": true, + "headerStyles": {} + }; + }, + componentWillMount: function componentWillMount() { + this.verifyProps(); + }, + sort: function sort(column) { + var that = this; + return function (event) { + that.props.sortSettings.changeSort(column); + }; + }, + toggleSelectAll: function toggleSelectAll(event) { + this.props.multipleSelectionSettings.toggleSelectAll(); + }, + handleSelectionChange: function handleSelectionChange(event) { + //hack to get around warning message that's not helpful in this case + return; + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridTitle: The columnSettings prop is null and it shouldn't be"); + } + + if (this.props.sortSettings === null) { + console.error("gridTitle: The sortSettings prop is null and it shouldn't be"); + } + }, + render: function render() { + this.verifyProps(); + var that = this; + var titleStyles = {}; + + var nodes = this.props.columnSettings.getColumns().map(function (col, index) { + var defaultTitleStyles = {}; + var columnSort = ""; + var columnIsSortable = that.props.columnSettings.getMetadataColumnProperty(col, "sortable", true); + var sortComponent = columnIsSortable ? that.props.sortSettings.sortDefaultComponent : null; + + if (that.props.sortSettings.sortColumn == col && that.props.sortSettings.sortDirection === 'asc') { + columnSort = that.props.sortSettings.sortAscendingClassName; + sortComponent = that.props.useGriddleIcons && that.props.sortSettings.sortAscendingComponent; + } else if (that.props.sortSettings.sortColumn == col && that.props.sortSettings.sortDirection === 'desc') { + columnSort += that.props.sortSettings.sortDescendingClassName; + sortComponent = that.props.useGriddleIcons && that.props.sortSettings.sortDescendingComponent; + } + + var meta = that.props.columnSettings.getColumnMetadataByName(col); + var displayName = that.props.columnSettings.getMetadataColumnProperty(col, "displayName", col); + var HeaderComponent = that.props.columnSettings.getMetadataColumnProperty(col, "customHeaderComponent", DefaultHeaderComponent); + var headerProps = that.props.columnSettings.getMetadataColumnProperty(col, "customHeaderComponentProps", {}); + + columnSort = meta == null ? columnSort : (columnSort && columnSort + " " || columnSort) + that.props.columnSettings.getMetadataColumnProperty(col, "cssClassName", ""); + + if (that.props.useGriddleStyles) { + defaultTitleStyles = { + backgroundColor: "#EDEDEF", + border: "0px", + borderBottom: "1px solid #DDD", + color: "#222", + padding: "5px", + cursor: columnIsSortable ? "pointer" : "default" + }; + } + titleStyles = meta && meta.titleStyles ? assign({}, defaultTitleStyles, meta.titleStyles) : assign({}, defaultTitleStyles); + + var ComponentClass = displayName ? 'th' : 'td'; + return React.createElement(ComponentClass, { onClick: columnIsSortable ? that.sort(col) : null, 'data-title': col, className: columnSort, key: col, + style: titleStyles }, React.createElement(HeaderComponent, _extends({ columnName: col, displayName: displayName, + filterByColumn: that.props.filterByColumn }, headerProps)), sortComponent); + }); + + if (nodes && this.props.multipleSelectionSettings.isMultipleSelection) { + nodes.unshift(React.createElement('th', { key: 'selection', onClick: this.toggleSelectAll, style: titleStyles, className: 'griddle-select griddle-select-title' }, React.createElement('input', { + type: 'checkbox', + checked: this.props.multipleSelectionSettings.getIsSelectAllChecked(), + onChange: this.handleSelectionChange + }))); + } + + //Get the row from the row settings. + var className = that.props.rowSettings && that.props.rowSettings.getHeaderRowMetadataClass() || null; + + return React.createElement('thead', null, React.createElement('tr', { + className: className, + style: this.props.headerStyles }, nodes)); + } +}); + +module.exports = GridTitle; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/griddle.jsx.js": +/*!***********************************************************!*\ + !*** ./node_modules/griddle-react/modules/griddle.jsx.js ***! + \***********************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + Griddle - Simple Grid Component for React + https://github.com/DynamicTyped/Griddle + Copyright (c) 2014 Ryan Lanciaux | DynamicTyped + + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i];for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + }return target; +}; + +var React = __webpack_require__(/*! react */ "react"); +var PropTypes = __webpack_require__(/*! prop-types */ "prop-types"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var GridTable = __webpack_require__(/*! ./gridTable.jsx */ "./node_modules/griddle-react/modules/gridTable.jsx.js"); +var GridFilter = __webpack_require__(/*! ./gridFilter.jsx */ "./node_modules/griddle-react/modules/gridFilter.jsx.js"); +var GridPagination = __webpack_require__(/*! ./gridPagination.jsx */ "./node_modules/griddle-react/modules/gridPagination.jsx.js"); +var GridSettings = __webpack_require__(/*! ./gridSettings.jsx */ "./node_modules/griddle-react/modules/gridSettings.jsx.js"); +var GridNoData = __webpack_require__(/*! ./gridNoData.jsx */ "./node_modules/griddle-react/modules/gridNoData.jsx.js"); +var GridRow = __webpack_require__(/*! ./gridRow.jsx */ "./node_modules/griddle-react/modules/gridRow.jsx.js"); +var GridRowContainer = __webpack_require__(/*! ./gridRowContainer.jsx */ "./node_modules/griddle-react/modules/gridRowContainer.jsx.js"); +var CustomRowComponentContainer = __webpack_require__(/*! ./customRowComponentContainer.jsx */ "./node_modules/griddle-react/modules/customRowComponentContainer.jsx.js"); +var CustomPaginationContainer = __webpack_require__(/*! ./customPaginationContainer.jsx */ "./node_modules/griddle-react/modules/customPaginationContainer.jsx.js"); +var CustomFilterContainer = __webpack_require__(/*! ./customFilterContainer.jsx */ "./node_modules/griddle-react/modules/customFilterContainer.jsx.js"); +var ColumnProperties = __webpack_require__(/*! ./columnProperties */ "./node_modules/griddle-react/modules/columnProperties.js"); +var RowProperties = __webpack_require__(/*! ./rowProperties */ "./node_modules/griddle-react/modules/rowProperties.js"); +var deep = __webpack_require__(/*! ./deep */ "./node_modules/griddle-react/modules/deep.js"); + +var drop = __webpack_require__(/*! lodash/drop */ "./node_modules/lodash/drop.js"); +var dropRight = __webpack_require__(/*! lodash/dropRight */ "./node_modules/lodash/dropRight.js"); +var find = __webpack_require__(/*! lodash/find */ "./node_modules/lodash/find.js"); +var first = __webpack_require__(/*! lodash/take */ "./node_modules/lodash/take.js"); +var forEach = __webpack_require__(/*! lodash/forEach */ "./node_modules/lodash/forEach.js"); +var initial = __webpack_require__(/*! lodash/initial */ "./node_modules/lodash/initial.js"); +var intersection = __webpack_require__(/*! lodash/intersection */ "./node_modules/lodash/intersection.js"); +var isArray = __webpack_require__(/*! lodash/isArray */ "./node_modules/lodash/isArray.js"); +var isEmpty = __webpack_require__(/*! lodash/isEmpty */ "./node_modules/lodash/isEmpty.js"); +var isNull = __webpack_require__(/*! lodash/isNull */ "./node_modules/lodash/isNull.js"); +var isUndefined = __webpack_require__(/*! lodash/isUndefined */ "./node_modules/lodash/isUndefined.js"); +var omit = __webpack_require__(/*! lodash/omit */ "./node_modules/lodash/omit.js"); +var map = __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js"); +var extend = __webpack_require__(/*! lodash/assign */ "./node_modules/lodash/assign.js"); +var _filter = __webpack_require__(/*! lodash/filter */ "./node_modules/lodash/filter.js"); + +var _orderBy = __webpack_require__(/*! lodash/orderBy */ "./node_modules/lodash/orderBy.js"); +var _property = __webpack_require__(/*! lodash/property */ "./node_modules/lodash/property.js"); +var _get = __webpack_require__(/*! lodash/get */ "./node_modules/lodash/get.js"); +var _some = __webpack_require__(/*! lodash/some */ "./node_modules/lodash/some.js"); + +var Griddle = createReactClass({ + statics: { + GridTable: GridTable, + GridFilter: GridFilter, + GridPagination: GridPagination, + GridSettings: GridSettings, + GridRow: GridRow + }, + columnSettings: null, + rowSettings: null, + getDefaultProps: function getDefaultProps() { + return { + "columns": [], + "gridMetadata": null, + "columnMetadata": [], + "rowMetadata": null, + "results": [], // Used if all results are already loaded. + "initialSort": "", + "gridClassName": "", + "tableClassName": "", + "customRowComponentClassName": "", + "settingsText": "Settings", + "filterPlaceholderText": "Filter Results", + "nextText": "Next", + "previousText": "Previous", + "maxRowsText": "Rows per page", + "enableCustomFormatText": "Enable Custom Formatting", + //this column will determine which column holds subgrid data + //it will be passed through with the data object but will not be rendered + "childrenColumnName": "children", + //Any column in this list will be treated as metadata and will be passed through with the data but won't be rendered + "metadataColumns": [], + "showFilter": false, + "showSettings": false, + "useCustomRowComponent": false, + "useCustomGridComponent": false, + "useCustomPagerComponent": false, + "useCustomFilterer": false, + "useCustomFilterComponent": false, + "useGriddleStyles": true, + "useGriddleIcons": true, + "customRowComponent": null, + "customGridComponent": null, + "customPagerComponent": {}, + "customFilterComponent": null, + "customFilterer": null, + "globalData": null, + "enableToggleCustom": false, + "noDataMessage": "There is no data to display.", + "noDataClassName": "griddle-nodata", + "customNoDataComponent": null, + "customNoDataComponentProps": null, + "allowEmptyGrid": false, + "showTableHeading": true, + "showPager": true, + "useFixedHeader": false, + "useExternal": false, + "externalSetPage": null, + "externalChangeSort": null, + "externalSetFilter": null, + "externalSetPageSize": null, + "externalMaxPage": null, + "externalCurrentPage": null, + "externalSortColumn": null, + "externalSortAscending": true, + "externalLoadingComponent": null, + "externalIsLoading": false, + "enableInfiniteScroll": false, + "bodyHeight": null, + "paddingHeight": 5, + "rowHeight": 25, + "infiniteScrollLoadTreshold": 50, + "useFixedLayout": true, + "isSubGriddle": false, + "enableSort": true, + "onRowClick": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null, + /* css class names */ + "sortAscendingClassName": "sort-ascending", + "sortDescendingClassName": "sort-descending", + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "settingsToggleClassName": "settings", + "nextClassName": "griddle-next", + "previousClassName": "griddle-previous", + "headerStyles": {}, + /* icon components */ + "sortAscendingComponent": " â–²", + "sortDescendingComponent": " â–¼", + "sortDefaultComponent": null, + "parentRowCollapsedComponent": "â–¶", + "parentRowExpandedComponent": "â–¼", + "settingsIconComponent": "", + "nextIconComponent": "", + "previousIconComponent": "", + "isMultipleSelection": false, //currently does not support subgrids + "selectedRowIds": [], + "uniqueIdentifier": "id", + "onSelectionChange": null, + "columnFilterFunc": null + }; + }, + propTypes: { + isMultipleSelection: PropTypes.bool, + selectedRowIds: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.arrayOf(PropTypes.string)]), + uniqueIdentifier: PropTypes.string, + onSelectionChange: PropTypes.func, + columnFilterFunc: PropTypes.func + }, + defaultFilter: function defaultFilter(results, filter) { + var that = this; + return _filter(results, function (item) { + var arr = deep.keys(item); + for (var i = 0; i < arr.length; i++) { + var isFilterable = that.columnSettings.getMetadataColumnProperty(arr[i], "filterable", true); + if (isFilterable && (deep.getAt(item, arr[i]) || "").toString().toLowerCase().indexOf(filter.toLowerCase()) >= 0) { + return true; + } + } + return false; + }); + }, + + defaultColumnFilter: function defaultColumnFilter(columnName, value, filter) { + var filters = map(isArray(filter) ? filter : [filter], function (filter) { + return (filter || '').toLowerCase(); + }); + return _some(deep.getObjectValues(value), function (value) { + value = value.toString().toLowerCase(); + return _some(filters, function (filter) { + return value.indexOf(filter) >= 0; + }); + }); + }, + + filterByColumnFilters: function filterByColumnFilters(columnFilters) { + var filterFunction = this.props.columnFilterFunc || this.defaultColumnFilter; + var filteredResults = Object.keys(columnFilters).reduce(function (previous, current) { + return _filter(previous, function (item) { + var value = deep.getAt(item, current || ""); + var filter = columnFilters[current]; + return filterFunction(current || '', value, filter); + }); + }, this.props.results); + + var newState = { + columnFilters: columnFilters + }; + + if (columnFilters) { + newState.filteredResults = filteredResults; + newState.maxPage = this.getMaxPage(newState.filteredResults); + } else if (this.state.filter) { + newState.filteredResults = this.props.useCustomFilterer ? this.props.customFilterer(this.props.results, filter) : this.defaultFilter(this.props.results, filter); + } else { + newState.filteredResults = null; + } + + this.setState(newState); + }, + + filterByColumn: function filterByColumn(filter, column) { + var columnFilters = this.state.columnFilters; + + //if filter is "" remove it from the columnFilters object + if (columnFilters.hasOwnProperty(column) && !filter) { + columnFilters = omit(columnFilters, column); + } else { + var newObject = {}; + newObject[column] = filter; + columnFilters = extend({}, columnFilters, newObject); + } + + this.filterByColumnFilters(columnFilters); + }, + + /* if we have a filter display the max page and results accordingly */ + setFilter: function setFilter(filter) { + var updatedResults = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + + if (this.props.useExternal) { + this.props.externalSetFilter(filter); + return; + } + + var that = this, + updatedState = { + page: 0, + filter: filter + }; + + // Obtain the state results. + updatedState.filteredResults = this.props.useCustomFilterer ? this.props.customFilterer(updatedResults || this.props.results, filter) : this.defaultFilter(updatedResults || this.props.results, filter); + + // Update the max page. + updatedState.maxPage = that.getMaxPage(updatedState.filteredResults); + + //if filter is null or undefined reset the filter. + if (isUndefined(filter) || isNull(filter) || isEmpty(filter)) { + updatedState.filter = filter; + updatedState.filteredResults = null; + } + + // Set the state. + that.setState(updatedState); + + this._resetSelectedRows(); + }, + setPageSize: function setPageSize(size) { + if (this.props.useExternal) { + this.setState({ + resultsPerPage: size + }); + this.props.externalSetPageSize(size); + return; + } + //make this better. + this.state.resultsPerPage = size; + this.setMaxPage(); + }, + toggleColumnChooser: function toggleColumnChooser() { + this.setState({ + showColumnChooser: !this.state.showColumnChooser + }); + }, + isNullOrUndefined: function isNullOrUndefined(value) { + return value === undefined || value === null; + }, + shouldUseCustomRowComponent: function shouldUseCustomRowComponent() { + return this.isNullOrUndefined(this.state.useCustomRowComponent) ? this.props.useCustomRowComponent : this.state.useCustomRowComponent; + }, + shouldUseCustomGridComponent: function shouldUseCustomGridComponent() { + return this.isNullOrUndefined(this.state.useCustomGridComponent) ? this.props.useCustomGridComponent : this.state.useCustomGridComponent; + }, + toggleCustomComponent: function toggleCustomComponent() { + if (this.state.customComponentType === "grid") { + this.setState({ + useCustomGridComponent: !this.shouldUseCustomGridComponent() + }); + } else if (this.state.customComponentType === "row") { + this.setState({ + useCustomRowComponent: !this.shouldUseCustomRowComponent() + }); + } + }, + getMaxPage: function getMaxPage(results, totalResults) { + if (this.props.useExternal) { + return this.props.externalMaxPage; + } + + if (!totalResults) { + totalResults = (results || this.getCurrentResults()).length; + } + var maxPage = Math.ceil(totalResults / this.state.resultsPerPage); + return maxPage; + }, + setMaxPage: function setMaxPage(results) { + var maxPage = this.getMaxPage(results); + //re-render if we have new max page value + if (this.state.maxPage !== maxPage) { + this.setState({ page: 0, maxPage: maxPage, filteredColumns: this.columnSettings.filteredColumns }); + } + }, + setPage: function setPage(number) { + if (this.props.useExternal) { + this.props.externalSetPage(number); + return; + } + + //check page size and move the filteredResults to pageSize * pageNumber + if (number * this.state.resultsPerPage <= this.state.resultsPerPage * this.state.maxPage) { + var that = this, + state = { + page: number + }; + + that.setState(state); + } + + //When infinite scrolling is enabled, uncheck the "select all" checkbox, since more unchecked rows will be appended at the end + if (this.props.enableInfiniteScroll) { + this.setState({ + isSelectAllChecked: false + }); + } + }, + setColumns: function setColumns(columns) { + this.columnSettings.filteredColumns = isArray(columns) ? columns : [columns]; + + this.setState({ + filteredColumns: this.columnSettings.filteredColumns + }); + }, + nextPage: function nextPage() { + var currentPage = this.getCurrentPage(); + if (currentPage < this.getCurrentMaxPage() - 1) { + this.setPage(currentPage + 1); + } + }, + previousPage: function previousPage() { + var currentPage = this.getCurrentPage(); + if (currentPage > 0) { + this.setPage(currentPage - 1); + } + }, + changeSort: function changeSort(column) { + if (this.props.enableSort === false) { + return; + } + + if (this.props.useExternal) { + var isAscending = this.props.externalSortColumn === column ? !this.props.externalSortAscending : true; + this.setState({ + sortColumn: column, + sortDirection: isAscending ? 'asc' : 'desc' + }); + this.props.externalChangeSort(column, isAscending); + return; + } + var columnMeta = find(this.props.columnMetadata, { columnName: column }) || {}; + var sortDirectionCycle = columnMeta.sortDirectionCycle ? columnMeta.sortDirectionCycle : [null, 'asc', 'desc']; + var sortDirection = null; + // Find the current position in the cycle (or -1). + var i = sortDirectionCycle.indexOf(this.state.sortDirection && column === this.state.sortColumn ? this.state.sortDirection : null); + + // Proceed to the next position in the cycle (or start at the beginning). + i = (i + 1) % sortDirectionCycle.length; + + if (sortDirectionCycle[i]) { + sortDirection = sortDirectionCycle[i]; + } else { + sortDirection = null; + } + + var state = { + page: 0, + sortColumn: column, + sortDirection: sortDirection + }; + + this.setState(state); + }, + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + // Check if results props changed + if (nextProps.results !== this.props.results) { + this.setFilter(this.state.filter, nextProps.results); + } + + this.setMaxPage(nextProps.results); + if (nextProps.resultsPerPage !== this.props.resultsPerPage) { + this.setPageSize(nextProps.resultsPerPage); + } + //This will updaet the column Metadata + this.columnSettings.columnMetadata = nextProps.columnMetadata; + if (nextProps.results.length > 0) { + var deepKeys = deep.keys(nextProps.results[0]); + + var is_same = this.columnSettings.allColumns.length == deepKeys.length && this.columnSettings.allColumns.every(function (element, index) { + return element === deepKeys[index]; + }); + + if (!is_same) { + this.columnSettings.allColumns = deepKeys; + } + } else if (this.columnSettings.allColumns.length > 0) { + this.columnSettings.allColumns = []; + } + + if (nextProps.selectedRowIds) { + var visibleRows = this.getDataForRender(this.getCurrentResults(nextProps.results), this.columnSettings.getColumns(), true); + + this.setState({ + isSelectAllChecked: this._getAreAllRowsChecked(nextProps.selectedRowIds, map(visibleRows, this.props.uniqueIdentifier)), + selectedRowIds: nextProps.selectedRowIds + }); + } + }, + getInitialState: function getInitialState() { + var state = { + maxPage: 0, + page: 0, + filteredResults: null, + filteredColumns: [], + filter: "", + //this sets the individual column filters + columnFilters: {}, + resultsPerPage: this.props.resultsPerPage || 5, + showColumnChooser: false, + isSelectAllChecked: false, + selectedRowIds: this.props.selectedRowIds + }; + return state; + }, + componentWillMount: function componentWillMount() { + this.verifyExternal(); + this.verifyCustom(); + + this.columnSettings = new ColumnProperties(this.props.results.length > 0 ? deep.keys(this.props.results[0]) : [], this.props.columns, this.props.childrenColumnName, this.props.columnMetadata, this.props.metadataColumns); + + this.rowSettings = new RowProperties(this.props.rowMetadata, this.props.useCustomTableRowComponent && this.props.customTableRowComponent ? this.props.customTableRowComponent : GridRow, this.props.useCustomTableRowComponent); + + if (this.props.initialSort) { + // shouldn't change Sort on init for external + if (this.props.useExternal) { + this.setState({ + sortColumn: this.props.externalSortColumn, + sortDirection: this.props.externalSortAscending ? 'asc' : 'desc' + }); + } else { + this.changeSort(this.props.initialSort); + } + } + this.setMaxPage(); + + //don't like the magic strings + if (this.shouldUseCustomGridComponent()) { + this.setState({ + customComponentType: "grid" + }); + } else if (this.shouldUseCustomRowComponent()) { + this.setState({ + customComponentType: "row" + }); + } else { + this.setState({ + filteredColumns: this.columnSettings.filteredColumns + }); + } + }, + componentDidMount: function componentDidMount() { + if (this.props.componentDidMount && typeof this.props.componentDidMount === "function") { + return this.props.componentDidMount(); + } + }, + componentDidUpdate: function componentDidUpdate() { + if (this.props.componentDidUpdate && typeof this.props.componentDidUpdate === "function") { + return this.props.componentDidUpdate(this.state); + } + }, + //todo: clean these verify methods up + verifyExternal: function verifyExternal() { + if (this.props.useExternal === true) { + //hooray for big ugly nested if + if (this.props.externalSetPage === null) { + console.error("useExternal is set to true but there is no externalSetPage function specified."); + } + + if (this.props.externalChangeSort === null) { + console.error("useExternal is set to true but there is no externalChangeSort function specified."); + } + + if (this.props.externalSetFilter === null) { + console.error("useExternal is set to true but there is no externalSetFilter function specified."); + } + + if (this.props.externalSetPageSize === null) { + console.error("useExternal is set to true but there is no externalSetPageSize function specified."); + } + + if (this.props.externalMaxPage === null) { + console.error("useExternal is set to true but externalMaxPage is not set."); + } + + if (this.props.externalCurrentPage === null) { + console.error("useExternal is set to true but externalCurrentPage is not set. Griddle will not page correctly without that property when using external data."); + } + } + }, + //TODO: Do this with propTypes + verifyCustom: function verifyCustom() { + if (this.props.useCustomGridComponent === true && this.props.customGridComponent === null) { + console.error("useCustomGridComponent is set to true but no custom component was specified."); + } + if (this.props.useCustomRowComponent === true && this.props.customRowComponent === null) { + console.error("useCustomRowComponent is set to true but no custom component was specified."); + } + if (this.props.useCustomGridComponent === true && this.props.useCustomRowComponent === true) { + console.error("Cannot currently use both customGridComponent and customRowComponent."); + } + if (this.props.useCustomFilterer === true && this.props.customFilterer === null) { + console.error("useCustomFilterer is set to true but no custom filter function was specified."); + } + if (this.props.useCustomFilterComponent === true && this.props.customFilterComponent === null) { + console.error("useCustomFilterComponent is set to true but no customFilterComponent was specified."); + } + }, + getDataForRender: function getDataForRender(data, cols, pageList) { + var _this = this; + + var that = this; + + if (!this.props.useExternal) { + if (this.state.sortColumn !== "") { + var column = this.state.sortColumn; + var sortColumn = _filter(this.props.columnMetadata, { columnName: column }); + var customCompareFn; + var multiSort = { + columns: [], + orders: [] + }; + + if (sortColumn.length > 0) { + customCompareFn = sortColumn[0].hasOwnProperty("customCompareFn") && sortColumn[0]["customCompareFn"]; + if (sortColumn[0]["multiSort"]) { + multiSort = sortColumn[0]["multiSort"]; + } + } + + if (this.state.sortDirection) { + if (typeof customCompareFn === 'function') { + if (customCompareFn.length === 2) { + data = data.sort(function (a, b) { + return customCompareFn(_get(a, column), _get(b, column)); + }); + + if (this.state.sortDirection === 'desc') { + data.reverse(); + } + } else if (customCompareFn.length === 1) { + data = _orderBy(data, function (item) { + return customCompareFn(_get(item, column)); + }, [this.state.sortDirection]); + } + } else { + var iteratees = [function (row) { + return (_get(row, column) || '').toString().toLowerCase(); + }]; + var orders = [this.state.sortDirection]; + multiSort.columns.forEach(function (col, i) { + iteratees.push(function (row) { + return (_get(row, col) || '').toString().toLowerCase(); + }); + if (multiSort.orders[i] === 'asc' || multiSort.orders[i] === 'desc') { + orders.push(multiSort.orders[i]); + } else { + orders.push(_this.state.sortDirection); + } + }); + + data = _orderBy(data, iteratees, orders); + } + } + } + + var currentPage = this.getCurrentPage(); + + if (!this.props.useExternal && pageList && this.state.resultsPerPage * (currentPage + 1) <= this.state.resultsPerPage * this.state.maxPage && currentPage >= 0) { + if (this.isInfiniteScrollEnabled()) { + // If we're doing infinite scroll, grab all results up to the current page. + data = first(data, (currentPage + 1) * this.state.resultsPerPage); + } else { + //the 'rest' is grabbing the whole array from index on and the 'initial' is getting the first n results + var rest = drop(data, currentPage * this.state.resultsPerPage); + data = (dropRight || initial)(rest, rest.length - this.state.resultsPerPage); + } + } + } + + var transformedData = []; + + for (var i = 0; i < data.length; i++) { + var mappedData = data[i]; + + if (typeof mappedData[that.props.childrenColumnName] !== "undefined" && mappedData[that.props.childrenColumnName].length > 0) { + //internally we're going to use children instead of whatever it is so we don't have to pass the custom name around + mappedData["children"] = that.getDataForRender(mappedData[that.props.childrenColumnName], cols, false); + + if (that.props.childrenColumnName !== "children") { + delete mappedData[that.props.childrenColumnName]; + } + } + + transformedData.push(mappedData); + } + return transformedData; + }, + getCurrentResults: function getCurrentResults(results) { + return this.state.filteredResults || results || this.props.results; + }, + getCurrentPage: function getCurrentPage() { + return this.props.externalCurrentPage || this.state.page; + }, + getCurrentSort: function getCurrentSort() { + return this.props.useExternal ? this.props.externalSortColumn : this.state.sortColumn; + }, + getCurrentSortAscending: function getCurrentSortAscending() { + return this.props.useExternal ? this.props.externalSortAscending : this.state.sortDirection === 'asc'; + }, + getCurrentMaxPage: function getCurrentMaxPage() { + return this.props.useExternal ? this.props.externalMaxPage : this.state.maxPage; + }, + //This takes the props relating to sort and puts them in one object + getSortObject: function getSortObject() { + return { + enableSort: this.props.enableSort, + changeSort: this.changeSort, + sortColumn: this.getCurrentSort(), + sortAscending: this.getCurrentSortAscending(), + sortDirection: this.state.sortDirection, + sortAscendingClassName: this.props.sortAscendingClassName, + sortDescendingClassName: this.props.sortDescendingClassName, + sortAscendingComponent: this.props.sortAscendingComponent, + sortDescendingComponent: this.props.sortDescendingComponent, + sortDefaultComponent: this.props.sortDefaultComponent + }; + }, + _toggleSelectAll: function _toggleSelectAll() { + var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true), + newIsSelectAllChecked = !this.state.isSelectAllChecked, + newSelectedRowIds = JSON.parse(JSON.stringify(this.state.selectedRowIds)); + + var self = this; + forEach(visibleRows, function (row) { + self._updateSelectedRowIds(row[self.props.uniqueIdentifier], newSelectedRowIds, newIsSelectAllChecked); + }, this); + + this.setState({ + isSelectAllChecked: newIsSelectAllChecked, + selectedRowIds: newSelectedRowIds + }); + + if (this.props.onSelectionChange) { + this.props.onSelectionChange(newSelectedRowIds, newIsSelectAllChecked); + } + }, + _toggleSelectRow: function _toggleSelectRow(row, isChecked) { + var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true), + newSelectedRowIds = JSON.parse(JSON.stringify(this.state.selectedRowIds)); + + this._updateSelectedRowIds(row[this.props.uniqueIdentifier], newSelectedRowIds, isChecked); + + var newIsSelectAllChecked = this._getAreAllRowsChecked(newSelectedRowIds, map(visibleRows, this.props.uniqueIdentifier)); + + this.setState({ + isSelectAllChecked: newIsSelectAllChecked, + selectedRowIds: newSelectedRowIds + }); + + if (this.props.onSelectionChange) { + this.props.onSelectionChange(newSelectedRowIds, newIsSelectAllChecked); + } + }, + _updateSelectedRowIds: function _updateSelectedRowIds(id, selectedRowIds, isChecked) { + + var isFound; + + if (isChecked) { + isFound = find(selectedRowIds, function (item) { + return id === item; + }); + + if (isFound === undefined) { + selectedRowIds.push(id); + } + } else { + selectedRowIds.splice(selectedRowIds.indexOf(id), 1); + } + }, + _getIsSelectAllChecked: function _getIsSelectAllChecked() { + + return this.state.isSelectAllChecked; + }, + _getAreAllRowsChecked: function _getAreAllRowsChecked(selectedRowIds, visibleRowIds) { + + return visibleRowIds.length === intersection(visibleRowIds, selectedRowIds).length; + }, + _getIsRowChecked: function _getIsRowChecked(row) { + + return this.state.selectedRowIds.indexOf(row[this.props.uniqueIdentifier]) > -1 ? true : false; + }, + getSelectedRowIds: function getSelectedRowIds() { + + return this.state.selectedRowIds; + }, + _resetSelectedRows: function _resetSelectedRows() { + + this.setState({ + isSelectAllChecked: false, + selectedRowIds: [] + }); + }, + //This takes the props relating to multiple selection and puts them in one object + getMultipleSelectionObject: function getMultipleSelectionObject() { + + return { + isMultipleSelection: find(this.props.results, function (result) { + return 'children' in result; + }) ? false : this.props.isMultipleSelection, //does not support subgrids + toggleSelectAll: this._toggleSelectAll, + getIsSelectAllChecked: this._getIsSelectAllChecked, + toggleSelectRow: this._toggleSelectRow, + getSelectedRowIds: this.getSelectedRowIds, + getIsRowChecked: this._getIsRowChecked + }; + }, + isInfiniteScrollEnabled: function isInfiniteScrollEnabled() { + // If a custom pager is included, don't allow for infinite scrolling. + if (this.props.useCustomPagerComponent) { + return false; + } + + // Otherwise, send back the property. + return this.props.enableInfiniteScroll; + }, + getClearFixStyles: function getClearFixStyles() { + return { + clear: "both", + display: "table", + width: "100%" + }; + }, + getSettingsStyles: function getSettingsStyles() { + return { + "float": "left", + width: "50%", + textAlign: "right" + }; + }, + getFilterStyles: function getFilterStyles() { + return { + "float": "left", + width: "50%", + textAlign: "left", + color: "#222", + minHeight: "1px" + }; + }, + getFilter: function getFilter() { + return this.props.showFilter && this.shouldUseCustomGridComponent() === false ? this.props.useCustomFilterComponent ? React.createElement(CustomFilterContainer, { changeFilter: this.setFilter, placeholderText: this.props.filterPlaceholderText, customFilterComponent: this.props.customFilterComponent, results: this.props.results, currentResults: this.getCurrentResults() }) : React.createElement(GridFilter, { changeFilter: this.setFilter, placeholderText: this.props.filterPlaceholderText }) : ""; + }, + getSettings: function getSettings() { + return this.props.showSettings ? React.createElement('button', { type: 'button', className: this.props.settingsToggleClassName, onClick: this.toggleColumnChooser, + style: this.props.useGriddleStyles ? { background: "none", border: "none", padding: 0, margin: 0, fontSize: 14 } : null }, this.props.settingsText, this.props.settingsIconComponent) : ""; + }, + getTopSection: function getTopSection(filter, settings) { + if (this.props.showFilter === false && this.props.showSettings === false) { + return ""; + } + + var filterStyles = null, + settingsStyles = null, + topContainerStyles = null; + + if (this.props.useGriddleStyles) { + filterStyles = this.getFilterStyles(); + settingsStyles = this.getSettingsStyles(); + + topContainerStyles = this.getClearFixStyles(); + } + + return React.createElement('div', { className: 'top-section', style: topContainerStyles }, React.createElement('div', { className: 'griddle-filter', style: filterStyles }, filter), React.createElement('div', { className: 'griddle-settings-toggle', style: settingsStyles }, settings)); + }, + getPagingSection: function getPagingSection(currentPage, maxPage) { + if ((this.props.showPager && !this.isInfiniteScrollEnabled() && !this.shouldUseCustomGridComponent()) === false) { + return undefined; + } + + return React.createElement('div', { className: 'griddle-footer' }, this.props.useCustomPagerComponent ? React.createElement(CustomPaginationContainer, { customPagerComponentOptions: this.props.customPagerComponentOptions, next: this.nextPage, previous: this.previousPage, currentPage: currentPage, maxPage: maxPage, setPage: this.setPage, nextText: this.props.nextText, previousText: this.props.previousText, customPagerComponent: this.props.customPagerComponent }) : React.createElement(GridPagination, { useGriddleStyles: this.props.useGriddleStyles, next: this.nextPage, previous: this.previousPage, nextClassName: this.props.nextClassName, nextIconComponent: this.props.nextIconComponent, previousClassName: this.props.previousClassName, previousIconComponent: this.props.previousIconComponent, currentPage: currentPage, maxPage: maxPage, setPage: this.setPage, nextText: this.props.nextText, previousText: this.props.previousText })); + }, + getColumnSelectorSection: function getColumnSelectorSection(keys, cols) { + return this.state.showColumnChooser ? React.createElement(GridSettings, { columns: keys, selectedColumns: cols, setColumns: this.setColumns, settingsText: this.props.settingsText, + settingsIconComponent: this.props.settingsIconComponent, maxRowsText: this.props.maxRowsText, setPageSize: this.setPageSize, + showSetPageSize: !this.shouldUseCustomGridComponent(), resultsPerPage: this.state.resultsPerPage, enableToggleCustom: this.props.enableToggleCustom, + toggleCustomComponent: this.toggleCustomComponent, useCustomComponent: this.shouldUseCustomRowComponent() || this.shouldUseCustomGridComponent(), + useGriddleStyles: this.props.useGriddleStyles, enableCustomFormatText: this.props.enableCustomFormatText, columnMetadata: this.props.columnMetadata }) : ""; + }, + getCustomGridSection: function getCustomGridSection() { + return React.createElement(this.props.customGridComponent, _extends({ data: this.props.results, className: this.props.customGridComponentClassName }, this.props.gridMetadata)); + }, + getCustomRowSection: function getCustomRowSection(data, cols, meta, pagingContent, globalData) { + return React.createElement('div', null, React.createElement(CustomRowComponentContainer, { data: data, columns: cols, metadataColumns: meta, globalData: globalData, + className: this.props.customRowComponentClassName, customComponent: this.props.customRowComponent, + style: this.props.useGriddleStyles ? this.getClearFixStyles() : null }), this.props.showPager && pagingContent); + }, + getStandardGridSection: function getStandardGridSection(data, cols, meta, pagingContent, hasMorePages) { + var sortProperties = this.getSortObject(); + var multipleSelectionProperties = this.getMultipleSelectionObject(); + + // no data section + var showNoData = this.shouldShowNoDataSection(data); + var noDataSection = this.getNoDataSection(); + + return React.createElement('div', { className: 'griddle-body' }, React.createElement(GridTable, { useGriddleStyles: this.props.useGriddleStyles, + noDataSection: noDataSection, + showNoData: showNoData, + columnSettings: this.columnSettings, + rowSettings: this.rowSettings, + sortSettings: sortProperties, + multipleSelectionSettings: multipleSelectionProperties, + filterByColumn: this.filterByColumn, + isSubGriddle: this.props.isSubGriddle, + useGriddleIcons: this.props.useGriddleIcons, + useFixedLayout: this.props.useFixedLayout, + showPager: this.props.showPager, + pagingContent: pagingContent, + data: data, + className: this.props.tableClassName, + enableInfiniteScroll: this.isInfiniteScrollEnabled(), + nextPage: this.nextPage, + showTableHeading: this.props.showTableHeading, + useFixedHeader: this.props.useFixedHeader, + parentRowCollapsedClassName: this.props.parentRowCollapsedClassName, + parentRowExpandedClassName: this.props.parentRowExpandedClassName, + parentRowCollapsedComponent: this.props.parentRowCollapsedComponent, + parentRowExpandedComponent: this.props.parentRowExpandedComponent, + bodyHeight: this.props.bodyHeight, + paddingHeight: this.props.paddingHeight, + rowHeight: this.props.rowHeight, + infiniteScrollLoadTreshold: this.props.infiniteScrollLoadTreshold, + externalLoadingComponent: this.props.externalLoadingComponent, + externalIsLoading: this.props.externalIsLoading, + hasMorePages: hasMorePages, + onRowClick: this.props.onRowClick, + onRowMouseEnter: this.props.onRowMouseEnter, + onRowMouseLeave: this.props.onRowMouseLeave, + onRowWillMount: this.props.onRowWillMount, + onRowWillUnmount: this.props.onRowWillUnmount })); + }, + getContentSection: function getContentSection(data, cols, meta, pagingContent, hasMorePages, globalData) { + if (this.shouldUseCustomGridComponent() && this.props.customGridComponent !== null) { + return this.getCustomGridSection(); + } else if (this.shouldUseCustomRowComponent()) { + return this.getCustomRowSection(data, cols, meta, pagingContent, globalData); + } else { + return this.getStandardGridSection(data, cols, meta, pagingContent, hasMorePages); + } + }, + getNoDataSection: function getNoDataSection() { + if (this.props.customNoDataComponent != null) { + return React.createElement('div', { className: this.props.noDataClassName }, React.createElement(this.props.customNoDataComponent, this.props.customNoDataComponentProps)); + } + return React.createElement(GridNoData, { noDataMessage: this.props.noDataMessage }); + }, + shouldShowNoDataSection: function shouldShowNoDataSection(results) { + if (this.props.allowEmptyGrid) { + return false; + } + + return this.props.useExternal === false && (typeof results === 'undefined' || results.length === 0) || this.props.useExternal === true && this.props.externalIsLoading === false && results.length === 0; + }, + render: function render() { + var that = this, + results = this.getCurrentResults(); // Attempt to assign to the filtered results, if we have any. + + var headerTableClassName = this.props.tableClassName + " table-header"; + + //figure out if we want to show the filter section + var filter = this.getFilter(); + var settings = this.getSettings(); + + //if we have neither filter or settings don't need to render this stuff + var topSection = this.getTopSection(filter, settings); + + var keys = []; + var cols = this.columnSettings.getColumns(); + //figure out which columns are displayed and show only those + var data = this.getDataForRender(results, cols, true); + + var meta = this.columnSettings.getMetadataColumns(); + + if (this.props.columnMetadata) { + // Get column keys from column metadata + forEach(this.props.columnMetadata, function (meta) { + if (!(typeof meta.visible === 'boolean' && meta.visible === false)) { + keys.push(meta.columnName); + } + }); + } else { + // Grab the column keys from the first results + keys = deep.keys(omit(results[0], meta)); + } + + // sort keys by order + keys = this.columnSettings.orderColumns(keys); + + // Grab the current and max page values. + var currentPage = this.getCurrentPage(); + var maxPage = this.getCurrentMaxPage(); + + // Determine if we need to enable infinite scrolling on the table. + var hasMorePages = currentPage + 1 < maxPage; + + // Grab the paging content if it's to be displayed + var pagingContent = this.getPagingSection(currentPage, maxPage); + + var resultContent = this.getContentSection(data, cols, meta, pagingContent, hasMorePages, this.props.globalData); + + var columnSelector = this.getColumnSelectorSection(keys, cols); + + var gridClassName = this.props.gridClassName.length > 0 ? "griddle " + this.props.gridClassName : "griddle"; + //add custom to the class name so we can style it differently + gridClassName += this.shouldUseCustomRowComponent() ? " griddle-custom" : ""; + + return React.createElement('div', { className: gridClassName }, topSection, columnSelector, React.createElement('div', { className: 'griddle-container', style: this.props.useGriddleStyles && !this.props.isSubGriddle ? { border: "1px solid #DDD" } : null }, resultContent)); + } +}); + +GridRowContainer.Griddle = module.exports = Griddle; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/rowProperties.js": +/*!*************************************************************!*\ + !*** ./node_modules/griddle-react/modules/rowProperties.js ***! + \*************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + +var _uniqueId = __webpack_require__(/*! lodash/uniqueId */ "./node_modules/lodash/uniqueId.js"); + +var RowProperties = (function () { + function RowProperties() { + var rowMetadata = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + var rowComponent = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var isCustom = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2]; + + _classCallCheck(this, RowProperties); + + this.rowMetadata = rowMetadata; + this.rowComponent = rowComponent; + this.isCustom = isCustom; + // assign unique Id to each griddle instance + } + + _createClass(RowProperties, [{ + key: 'getRowKey', + value: function getRowKey(row, key) { + var uniqueId; + + if (this.hasRowMetadataKey()) { + uniqueId = row[this.rowMetadata.key]; + } else { + uniqueId = _uniqueId("grid_row"); + } + + //todo: add error handling + + return uniqueId; + } + }, { + key: 'hasRowMetadataKey', + value: function hasRowMetadataKey() { + return this.hasRowMetadata() && this.rowMetadata.key !== null && this.rowMetadata.key !== undefined; + } + }, { + key: 'getBodyRowMetadataClass', + value: function getBodyRowMetadataClass(rowData) { + if (this.hasRowMetadata() && this.rowMetadata.bodyCssClassName !== null && this.rowMetadata.bodyCssClassName !== undefined) { + if (typeof this.rowMetadata.bodyCssClassName === 'function') { + return this.rowMetadata.bodyCssClassName(rowData); + } else { + return this.rowMetadata.bodyCssClassName; + } + } + return null; + } + }, { + key: 'getHeaderRowMetadataClass', + value: function getHeaderRowMetadataClass() { + return this.hasRowMetadata() && this.rowMetadata.headerCssClassName !== null && this.rowMetadata.headerCssClassName !== undefined ? this.rowMetadata.headerCssClassName : null; + } + }, { + key: 'hasRowMetadata', + value: function hasRowMetadata() { + return this.rowMetadata !== null; + } + }]); + + return RowProperties; +})(); + +module.exports = RowProperties; + + +/***/ }), + +/***/ "./node_modules/lodash/_DataView.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_DataView.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'); + +module.exports = DataView; + + +/***/ }), + +/***/ "./node_modules/lodash/_Hash.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/_Hash.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var hashClear = __webpack_require__(/*! ./_hashClear */ "./node_modules/lodash/_hashClear.js"), + hashDelete = __webpack_require__(/*! ./_hashDelete */ "./node_modules/lodash/_hashDelete.js"), + hashGet = __webpack_require__(/*! ./_hashGet */ "./node_modules/lodash/_hashGet.js"), + hashHas = __webpack_require__(/*! ./_hashHas */ "./node_modules/lodash/_hashHas.js"), + hashSet = __webpack_require__(/*! ./_hashSet */ "./node_modules/lodash/_hashSet.js"); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +module.exports = Hash; + + +/***/ }), + +/***/ "./node_modules/lodash/_ListCache.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_ListCache.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "./node_modules/lodash/_listCacheClear.js"), + listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "./node_modules/lodash/_listCacheDelete.js"), + listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "./node_modules/lodash/_listCacheGet.js"), + listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "./node_modules/lodash/_listCacheHas.js"), + listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "./node_modules/lodash/_listCacheSet.js"); + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +module.exports = ListCache; + + +/***/ }), + +/***/ "./node_modules/lodash/_Map.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/_Map.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); + +module.exports = Map; + + +/***/ }), + +/***/ "./node_modules/lodash/_MapCache.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_MapCache.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var mapCacheClear = __webpack_require__(/*! ./_mapCacheClear */ "./node_modules/lodash/_mapCacheClear.js"), + mapCacheDelete = __webpack_require__(/*! ./_mapCacheDelete */ "./node_modules/lodash/_mapCacheDelete.js"), + mapCacheGet = __webpack_require__(/*! ./_mapCacheGet */ "./node_modules/lodash/_mapCacheGet.js"), + mapCacheHas = __webpack_require__(/*! ./_mapCacheHas */ "./node_modules/lodash/_mapCacheHas.js"), + mapCacheSet = __webpack_require__(/*! ./_mapCacheSet */ "./node_modules/lodash/_mapCacheSet.js"); + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +module.exports = MapCache; + + +/***/ }), + +/***/ "./node_modules/lodash/_Promise.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_Promise.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var Promise = getNative(root, 'Promise'); + +module.exports = Promise; + + +/***/ }), + +/***/ "./node_modules/lodash/_Set.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/_Set.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); + +module.exports = Set; + + +/***/ }), + +/***/ "./node_modules/lodash/_SetCache.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_SetCache.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/lodash/_MapCache.js"), + setCacheAdd = __webpack_require__(/*! ./_setCacheAdd */ "./node_modules/lodash/_setCacheAdd.js"), + setCacheHas = __webpack_require__(/*! ./_setCacheHas */ "./node_modules/lodash/_setCacheHas.js"); + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +module.exports = SetCache; + + +/***/ }), + +/***/ "./node_modules/lodash/_Stack.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/_Stack.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"), + stackClear = __webpack_require__(/*! ./_stackClear */ "./node_modules/lodash/_stackClear.js"), + stackDelete = __webpack_require__(/*! ./_stackDelete */ "./node_modules/lodash/_stackDelete.js"), + stackGet = __webpack_require__(/*! ./_stackGet */ "./node_modules/lodash/_stackGet.js"), + stackHas = __webpack_require__(/*! ./_stackHas */ "./node_modules/lodash/_stackHas.js"), + stackSet = __webpack_require__(/*! ./_stackSet */ "./node_modules/lodash/_stackSet.js"); + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +module.exports = Stack; + + +/***/ }), + +/***/ "./node_modules/lodash/_Symbol.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/_Symbol.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/** Built-in value references. */ +var Symbol = root.Symbol; + +module.exports = Symbol; + + +/***/ }), + +/***/ "./node_modules/lodash/_Uint8Array.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_Uint8Array.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/** Built-in value references. */ +var Uint8Array = root.Uint8Array; + +module.exports = Uint8Array; + + +/***/ }), + +/***/ "./node_modules/lodash/_WeakMap.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_WeakMap.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var WeakMap = getNative(root, 'WeakMap'); + +module.exports = WeakMap; + + +/***/ }), + +/***/ "./node_modules/lodash/_apply.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/_apply.js ***! + \***************************************/ +/***/ (function(module) { + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +module.exports = apply; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayEach.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_arrayEach.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEach; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayFilter.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_arrayFilter.js ***! + \*********************************************/ +/***/ (function(module) { + +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = arrayFilter; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayIncludes.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_arrayIncludes.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ "./node_modules/lodash/_baseIndexOf.js"); + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; +} + +module.exports = arrayIncludes; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayIncludesWith.js": +/*!***************************************************!*\ + !*** ./node_modules/lodash/_arrayIncludesWith.js ***! + \***************************************************/ +/***/ (function(module) { + +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +module.exports = arrayIncludesWith; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayLikeKeys.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_arrayLikeKeys.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseTimes = __webpack_require__(/*! ./_baseTimes */ "./node_modules/lodash/_baseTimes.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"), + isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/lodash/isTypedArray.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +module.exports = arrayLikeKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayMap.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_arrayMap.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +module.exports = arrayMap; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayPush.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_arrayPush.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +module.exports = arrayPush; + + +/***/ }), + +/***/ "./node_modules/lodash/_arraySome.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_arraySome.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +module.exports = arraySome; + + +/***/ }), + +/***/ "./node_modules/lodash/_assignValue.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_assignValue.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/lodash/_baseAssignValue.js"), + eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +module.exports = assignValue; + + +/***/ }), + +/***/ "./node_modules/lodash/_assocIndexOf.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_assocIndexOf.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"); + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +module.exports = assocIndexOf; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseAssign.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseAssign.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} + +module.exports = baseAssign; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseAssignIn.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseAssignIn.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); + +/** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); +} + +module.exports = baseAssignIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseAssignValue.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseAssignValue.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var defineProperty = __webpack_require__(/*! ./_defineProperty */ "./node_modules/lodash/_defineProperty.js"); + +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } +} + +module.exports = baseAssignValue; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseClone.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseClone.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/lodash/_Stack.js"), + arrayEach = __webpack_require__(/*! ./_arrayEach */ "./node_modules/lodash/_arrayEach.js"), + assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + baseAssign = __webpack_require__(/*! ./_baseAssign */ "./node_modules/lodash/_baseAssign.js"), + baseAssignIn = __webpack_require__(/*! ./_baseAssignIn */ "./node_modules/lodash/_baseAssignIn.js"), + cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ "./node_modules/lodash/_cloneBuffer.js"), + copyArray = __webpack_require__(/*! ./_copyArray */ "./node_modules/lodash/_copyArray.js"), + copySymbols = __webpack_require__(/*! ./_copySymbols */ "./node_modules/lodash/_copySymbols.js"), + copySymbolsIn = __webpack_require__(/*! ./_copySymbolsIn */ "./node_modules/lodash/_copySymbolsIn.js"), + getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "./node_modules/lodash/_getAllKeys.js"), + getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ "./node_modules/lodash/_getAllKeysIn.js"), + getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + initCloneArray = __webpack_require__(/*! ./_initCloneArray */ "./node_modules/lodash/_initCloneArray.js"), + initCloneByTag = __webpack_require__(/*! ./_initCloneByTag */ "./node_modules/lodash/_initCloneByTag.js"), + initCloneObject = __webpack_require__(/*! ./_initCloneObject */ "./node_modules/lodash/_initCloneObject.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), + isMap = __webpack_require__(/*! ./isMap */ "./node_modules/lodash/isMap.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + isSet = __webpack_require__(/*! ./isSet */ "./node_modules/lodash/isSet.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; +} + +module.exports = baseClone; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseCreate.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseCreate.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); + +/** Built-in value references. */ +var objectCreate = Object.create; + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); + +module.exports = baseCreate; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseDifference.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_baseDifference.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var SetCache = __webpack_require__(/*! ./_SetCache */ "./node_modules/lodash/_SetCache.js"), + arrayIncludes = __webpack_require__(/*! ./_arrayIncludes */ "./node_modules/lodash/_arrayIncludes.js"), + arrayIncludesWith = __webpack_require__(/*! ./_arrayIncludesWith */ "./node_modules/lodash/_arrayIncludesWith.js"), + arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + cacheHas = __webpack_require__(/*! ./_cacheHas */ "./node_modules/lodash/_cacheHas.js"); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ +function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; +} + +module.exports = baseDifference; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseEach.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseEach.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "./node_modules/lodash/_baseForOwn.js"), + createBaseEach = __webpack_require__(/*! ./_createBaseEach */ "./node_modules/lodash/_createBaseEach.js"); + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +module.exports = baseEach; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseFilter.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseFilter.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/lodash/_baseEach.js"); + +/** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; +} + +module.exports = baseFilter; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseFindIndex.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_baseFindIndex.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +module.exports = baseFindIndex; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseFlatten.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseFlatten.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"), + isFlattenable = __webpack_require__(/*! ./_isFlattenable */ "./node_modules/lodash/_isFlattenable.js"); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +module.exports = baseFlatten; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseFor.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_baseFor.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var createBaseFor = __webpack_require__(/*! ./_createBaseFor */ "./node_modules/lodash/_createBaseFor.js"); + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +module.exports = baseFor; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseForOwn.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseForOwn.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseFor = __webpack_require__(/*! ./_baseFor */ "./node_modules/lodash/_baseFor.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +module.exports = baseForOwn; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseGet.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_baseGet.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +module.exports = baseGet; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseGetAllKeys.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_baseGetAllKeys.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +module.exports = baseGetAllKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseGetTag.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseGetTag.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), + getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"), + objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js"); + +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +module.exports = baseGetTag; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseHasIn.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseHasIn.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +module.exports = baseHasIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIndexOf.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseIndexOf.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ "./node_modules/lodash/_baseFindIndex.js"), + baseIsNaN = __webpack_require__(/*! ./_baseIsNaN */ "./node_modules/lodash/_baseIsNaN.js"), + strictIndexOf = __webpack_require__(/*! ./_strictIndexOf */ "./node_modules/lodash/_strictIndexOf.js"); + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); +} + +module.exports = baseIndexOf; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIntersection.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_baseIntersection.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var SetCache = __webpack_require__(/*! ./_SetCache */ "./node_modules/lodash/_SetCache.js"), + arrayIncludes = __webpack_require__(/*! ./_arrayIncludes */ "./node_modules/lodash/_arrayIncludes.js"), + arrayIncludesWith = __webpack_require__(/*! ./_arrayIncludesWith */ "./node_modules/lodash/_arrayIncludesWith.js"), + arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + cacheHas = __webpack_require__(/*! ./_cacheHas */ "./node_modules/lodash/_cacheHas.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ +function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseIntersection; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsArguments.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseIsArguments.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +module.exports = baseIsArguments; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsEqual.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseIsEqual.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsEqualDeep = __webpack_require__(/*! ./_baseIsEqualDeep */ "./node_modules/lodash/_baseIsEqualDeep.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); +} + +module.exports = baseIsEqual; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsEqualDeep.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseIsEqualDeep.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/lodash/_Stack.js"), + equalArrays = __webpack_require__(/*! ./_equalArrays */ "./node_modules/lodash/_equalArrays.js"), + equalByTag = __webpack_require__(/*! ./_equalByTag */ "./node_modules/lodash/_equalByTag.js"), + equalObjects = __webpack_require__(/*! ./_equalObjects */ "./node_modules/lodash/_equalObjects.js"), + getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), + isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/lodash/isTypedArray.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} + +module.exports = baseIsEqualDeep; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsMap.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseIsMap.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]'; + +/** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ +function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; +} + +module.exports = baseIsMap; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsMatch.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseIsMatch.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/lodash/_Stack.js"), + baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ "./node_modules/lodash/_baseIsEqual.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; +} + +module.exports = baseIsMatch; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsNaN.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseIsNaN.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +module.exports = baseIsNaN; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsNative.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseIsNative.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/lodash/isFunction.js"), + isMasked = __webpack_require__(/*! ./_isMasked */ "./node_modules/lodash/_isMasked.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + toSource = __webpack_require__(/*! ./_toSource */ "./node_modules/lodash/_toSource.js"); + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +module.exports = baseIsNative; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsSet.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseIsSet.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var setTag = '[object Set]'; + +/** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ +function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; +} + +module.exports = baseIsSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsTypedArray.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_baseIsTypedArray.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +module.exports = baseIsTypedArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIteratee.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseIteratee.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseMatches = __webpack_require__(/*! ./_baseMatches */ "./node_modules/lodash/_baseMatches.js"), + baseMatchesProperty = __webpack_require__(/*! ./_baseMatchesProperty */ "./node_modules/lodash/_baseMatchesProperty.js"), + identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + property = __webpack_require__(/*! ./property */ "./node_modules/lodash/property.js"); + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +module.exports = baseIteratee; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseKeys.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseKeys.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"), + nativeKeys = __webpack_require__(/*! ./_nativeKeys */ "./node_modules/lodash/_nativeKeys.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +module.exports = baseKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseKeysIn.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseKeysIn.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"), + nativeKeysIn = __webpack_require__(/*! ./_nativeKeysIn */ "./node_modules/lodash/_nativeKeysIn.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +module.exports = baseKeysIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseMap.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_baseMap.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/lodash/_baseEach.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"); + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +module.exports = baseMap; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseMatches.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseMatches.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsMatch = __webpack_require__(/*! ./_baseIsMatch */ "./node_modules/lodash/_baseIsMatch.js"), + getMatchData = __webpack_require__(/*! ./_getMatchData */ "./node_modules/lodash/_getMatchData.js"), + matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ "./node_modules/lodash/_matchesStrictComparable.js"); + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +module.exports = baseMatches; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseMatchesProperty.js": +/*!*****************************************************!*\ + !*** ./node_modules/lodash/_baseMatchesProperty.js ***! + \*****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ "./node_modules/lodash/_baseIsEqual.js"), + get = __webpack_require__(/*! ./get */ "./node_modules/lodash/get.js"), + hasIn = __webpack_require__(/*! ./hasIn */ "./node_modules/lodash/hasIn.js"), + isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/lodash/_isKey.js"), + isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ "./node_modules/lodash/_isStrictComparable.js"), + matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ "./node_modules/lodash/_matchesStrictComparable.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; +} + +module.exports = baseMatchesProperty; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseOrderBy.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseOrderBy.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + baseMap = __webpack_require__(/*! ./_baseMap */ "./node_modules/lodash/_baseMap.js"), + baseSortBy = __webpack_require__(/*! ./_baseSortBy */ "./node_modules/lodash/_baseSortBy.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + compareMultiple = __webpack_require__(/*! ./_compareMultiple */ "./node_modules/lodash/_compareMultiple.js"), + identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee) { + if (isArray(iteratee)) { + return function(value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + } + } + return iteratee; + }); + } else { + iteratees = [identity]; + } + + var index = -1; + iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +module.exports = baseOrderBy; + + +/***/ }), + +/***/ "./node_modules/lodash/_basePick.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_basePick.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var basePickBy = __webpack_require__(/*! ./_basePickBy */ "./node_modules/lodash/_basePickBy.js"), + hasIn = __webpack_require__(/*! ./hasIn */ "./node_modules/lodash/hasIn.js"); + +/** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ +function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); +} + +module.exports = basePick; + + +/***/ }), + +/***/ "./node_modules/lodash/_basePickBy.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_basePickBy.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"), + baseSet = __webpack_require__(/*! ./_baseSet */ "./node_modules/lodash/_baseSet.js"), + castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"); + +/** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ +function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; +} + +module.exports = basePickBy; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseProperty.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseProperty.js ***! + \**********************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = baseProperty; + + +/***/ }), + +/***/ "./node_modules/lodash/_basePropertyDeep.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_basePropertyDeep.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"); + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +module.exports = basePropertyDeep; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseRest.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseRest.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"), + overRest = __webpack_require__(/*! ./_overRest */ "./node_modules/lodash/_overRest.js"), + setToString = __webpack_require__(/*! ./_setToString */ "./node_modules/lodash/_setToString.js"); + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} + +module.exports = baseRest; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSet.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_baseSet.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ +function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; +} + +module.exports = baseSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSetToString.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseSetToString.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var constant = __webpack_require__(/*! ./constant */ "./node_modules/lodash/constant.js"), + defineProperty = __webpack_require__(/*! ./_defineProperty */ "./node_modules/lodash/_defineProperty.js"), + identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"); + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +module.exports = baseSetToString; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSlice.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseSlice.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +module.exports = baseSlice; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSome.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseSome.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/lodash/_baseEach.js"); + +/** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; +} + +module.exports = baseSome; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSortBy.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseSortBy.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +module.exports = baseSortBy; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseTimes.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseTimes.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +module.exports = baseTimes; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseToPairs.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseToPairs.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"); + +/** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ +function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); +} + +module.exports = baseToPairs; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseToString.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseToString.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), + arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = baseToString; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseTrim.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseTrim.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var trimmedEndIndex = __webpack_require__(/*! ./_trimmedEndIndex */ "./node_modules/lodash/_trimmedEndIndex.js"); + +/** Used to match leading whitespace. */ +var reTrimStart = /^\s+/; + +/** + * The base implementation of `_.trim`. + * + * @private + * @param {string} string The string to trim. + * @returns {string} Returns the trimmed string. + */ +function baseTrim(string) { + return string + ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') + : string; +} + +module.exports = baseTrim; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseUnary.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseUnary.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +module.exports = baseUnary; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseUnset.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseUnset.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + last = __webpack_require__(/*! ./last */ "./node_modules/lodash/last.js"), + parent = __webpack_require__(/*! ./_parent */ "./node_modules/lodash/_parent.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ +function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; +} + +module.exports = baseUnset; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseValues.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseValues.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"); + +/** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ +function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); +} + +module.exports = baseValues; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseZipObject.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_baseZipObject.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ +function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; +} + +module.exports = baseZipObject; + + +/***/ }), + +/***/ "./node_modules/lodash/_cacheHas.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_cacheHas.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +module.exports = cacheHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_castArrayLikeObject.js": +/*!*****************************************************!*\ + !*** ./node_modules/lodash/_castArrayLikeObject.js ***! + \*****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ "./node_modules/lodash/isArrayLikeObject.js"); + +/** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ +function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; +} + +module.exports = castArrayLikeObject; + + +/***/ }), + +/***/ "./node_modules/lodash/_castFunction.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_castFunction.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"); + +/** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ +function castFunction(value) { + return typeof value == 'function' ? value : identity; +} + +module.exports = castFunction; + + +/***/ }), + +/***/ "./node_modules/lodash/_castPath.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_castPath.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/lodash/_isKey.js"), + stringToPath = __webpack_require__(/*! ./_stringToPath */ "./node_modules/lodash/_stringToPath.js"), + toString = __webpack_require__(/*! ./toString */ "./node_modules/lodash/toString.js"); + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); +} + +module.exports = castPath; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneArrayBuffer.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_cloneArrayBuffer.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "./node_modules/lodash/_Uint8Array.js"); + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +module.exports = cloneArrayBuffer; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneBuffer.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_cloneBuffer.js ***! + \*********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; +} + +module.exports = cloneBuffer; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneDataView.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_cloneDataView.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/lodash/_cloneArrayBuffer.js"); + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +module.exports = cloneDataView; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneRegExp.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_cloneRegExp.js ***! + \*********************************************/ +/***/ (function(module) { + +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +module.exports = cloneRegExp; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneSymbol.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_cloneSymbol.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +module.exports = cloneSymbol; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneTypedArray.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_cloneTypedArray.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/lodash/_cloneArrayBuffer.js"); + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +module.exports = cloneTypedArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_compareAscending.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_compareAscending.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +module.exports = compareAscending; + + +/***/ }), + +/***/ "./node_modules/lodash/_compareMultiple.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_compareMultiple.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var compareAscending = __webpack_require__(/*! ./_compareAscending */ "./node_modules/lodash/_compareAscending.js"); + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +module.exports = compareMultiple; + + +/***/ }), + +/***/ "./node_modules/lodash/_copyArray.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_copyArray.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +module.exports = copyArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_copyObject.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_copyObject.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/lodash/_baseAssignValue.js"); + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +module.exports = copyObject; + + +/***/ }), + +/***/ "./node_modules/lodash/_copySymbols.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_copySymbols.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/lodash/_getSymbols.js"); + +/** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +module.exports = copySymbols; + + +/***/ }), + +/***/ "./node_modules/lodash/_copySymbolsIn.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_copySymbolsIn.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "./node_modules/lodash/_getSymbolsIn.js"); + +/** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); +} + +module.exports = copySymbolsIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_coreJsData.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_coreJsData.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +module.exports = coreJsData; + + +/***/ }), + +/***/ "./node_modules/lodash/_createAssigner.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_createAssigner.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/lodash/_isIterateeCall.js"); + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +module.exports = createAssigner; + + +/***/ }), + +/***/ "./node_modules/lodash/_createBaseEach.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_createBaseEach.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"); + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +module.exports = createBaseEach; + + +/***/ }), + +/***/ "./node_modules/lodash/_createBaseFor.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_createBaseFor.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +module.exports = createBaseFor; + + +/***/ }), + +/***/ "./node_modules/lodash/_createFind.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_createFind.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ +function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; +} + +module.exports = createFind; + + +/***/ }), + +/***/ "./node_modules/lodash/_createToPairs.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_createToPairs.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseToPairs = __webpack_require__(/*! ./_baseToPairs */ "./node_modules/lodash/_baseToPairs.js"), + getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + mapToArray = __webpack_require__(/*! ./_mapToArray */ "./node_modules/lodash/_mapToArray.js"), + setToPairs = __webpack_require__(/*! ./_setToPairs */ "./node_modules/lodash/_setToPairs.js"); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ +function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; +} + +module.exports = createToPairs; + + +/***/ }), + +/***/ "./node_modules/lodash/_customOmitClone.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_customOmitClone.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isPlainObject = __webpack_require__(/*! ./isPlainObject */ "./node_modules/lodash/isPlainObject.js"); + +/** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ +function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; +} + +module.exports = customOmitClone; + + +/***/ }), + +/***/ "./node_modules/lodash/_defineProperty.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_defineProperty.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"); + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; + + +/***/ }), + +/***/ "./node_modules/lodash/_equalArrays.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_equalArrays.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var SetCache = __webpack_require__(/*! ./_SetCache */ "./node_modules/lodash/_SetCache.js"), + arraySome = __webpack_require__(/*! ./_arraySome */ "./node_modules/lodash/_arraySome.js"), + cacheHas = __webpack_require__(/*! ./_cacheHas */ "./node_modules/lodash/_cacheHas.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +module.exports = equalArrays; + + +/***/ }), + +/***/ "./node_modules/lodash/_equalByTag.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_equalByTag.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), + Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "./node_modules/lodash/_Uint8Array.js"), + eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"), + equalArrays = __webpack_require__(/*! ./_equalArrays */ "./node_modules/lodash/_equalArrays.js"), + mapToArray = __webpack_require__(/*! ./_mapToArray */ "./node_modules/lodash/_mapToArray.js"), + setToArray = __webpack_require__(/*! ./_setToArray */ "./node_modules/lodash/_setToArray.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]'; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +module.exports = equalByTag; + + +/***/ }), + +/***/ "./node_modules/lodash/_equalObjects.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_equalObjects.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "./node_modules/lodash/_getAllKeys.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +module.exports = equalObjects; + + +/***/ }), + +/***/ "./node_modules/lodash/_flatRest.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_flatRest.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var flatten = __webpack_require__(/*! ./flatten */ "./node_modules/lodash/flatten.js"), + overRest = __webpack_require__(/*! ./_overRest */ "./node_modules/lodash/_overRest.js"), + setToString = __webpack_require__(/*! ./_setToString */ "./node_modules/lodash/_setToString.js"); + +/** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ +function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); +} + +module.exports = flatRest; + + +/***/ }), + +/***/ "./node_modules/lodash/_freeGlobal.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_freeGlobal.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; + +module.exports = freeGlobal; + + +/***/ }), + +/***/ "./node_modules/lodash/_getAllKeys.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_getAllKeys.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "./node_modules/lodash/_baseGetAllKeys.js"), + getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/lodash/_getSymbols.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +module.exports = getAllKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_getAllKeysIn.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_getAllKeysIn.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "./node_modules/lodash/_baseGetAllKeys.js"), + getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "./node_modules/lodash/_getSymbolsIn.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); + +/** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); +} + +module.exports = getAllKeysIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_getMapData.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_getMapData.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isKeyable = __webpack_require__(/*! ./_isKeyable */ "./node_modules/lodash/_isKeyable.js"); + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +module.exports = getMapData; + + +/***/ }), + +/***/ "./node_modules/lodash/_getMatchData.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_getMatchData.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ "./node_modules/lodash/_isStrictComparable.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +module.exports = getMatchData; + + +/***/ }), + +/***/ "./node_modules/lodash/_getNative.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_getNative.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsNative = __webpack_require__(/*! ./_baseIsNative */ "./node_modules/lodash/_baseIsNative.js"), + getValue = __webpack_require__(/*! ./_getValue */ "./node_modules/lodash/_getValue.js"); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +module.exports = getNative; + + +/***/ }), + +/***/ "./node_modules/lodash/_getPrototype.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_getPrototype.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var overArg = __webpack_require__(/*! ./_overArg */ "./node_modules/lodash/_overArg.js"); + +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); + +module.exports = getPrototype; + + +/***/ }), + +/***/ "./node_modules/lodash/_getRawTag.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_getRawTag.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +module.exports = getRawTag; + + +/***/ }), + +/***/ "./node_modules/lodash/_getSymbols.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_getSymbols.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ "./node_modules/lodash/_arrayFilter.js"), + stubArray = __webpack_require__(/*! ./stubArray */ "./node_modules/lodash/stubArray.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +module.exports = getSymbols; + + +/***/ }), + +/***/ "./node_modules/lodash/_getSymbolsIn.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_getSymbolsIn.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"), + getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/lodash/_getPrototype.js"), + getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/lodash/_getSymbols.js"), + stubArray = __webpack_require__(/*! ./stubArray */ "./node_modules/lodash/stubArray.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; +}; + +module.exports = getSymbolsIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_getTag.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/_getTag.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var DataView = __webpack_require__(/*! ./_DataView */ "./node_modules/lodash/_DataView.js"), + Map = __webpack_require__(/*! ./_Map */ "./node_modules/lodash/_Map.js"), + Promise = __webpack_require__(/*! ./_Promise */ "./node_modules/lodash/_Promise.js"), + Set = __webpack_require__(/*! ./_Set */ "./node_modules/lodash/_Set.js"), + WeakMap = __webpack_require__(/*! ./_WeakMap */ "./node_modules/lodash/_WeakMap.js"), + baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + toSource = __webpack_require__(/*! ./_toSource */ "./node_modules/lodash/_toSource.js"); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; + +var dataViewTag = '[object DataView]'; + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +module.exports = getTag; + + +/***/ }), + +/***/ "./node_modules/lodash/_getValue.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_getValue.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +module.exports = getValue; + + +/***/ }), + +/***/ "./node_modules/lodash/_hasPath.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_hasPath.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"), + isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +module.exports = hasPath; + + +/***/ }), + +/***/ "./node_modules/lodash/_hashClear.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_hashClear.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +module.exports = hashClear; + + +/***/ }), + +/***/ "./node_modules/lodash/_hashDelete.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_hashDelete.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +module.exports = hashDelete; + + +/***/ }), + +/***/ "./node_modules/lodash/_hashGet.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_hashGet.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +module.exports = hashGet; + + +/***/ }), + +/***/ "./node_modules/lodash/_hashHas.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_hashHas.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +module.exports = hashHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_hashSet.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_hashSet.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +module.exports = hashSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_initCloneArray.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_initCloneArray.js ***! + \************************************************/ +/***/ (function(module) { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +module.exports = initCloneArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_initCloneByTag.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_initCloneByTag.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/lodash/_cloneArrayBuffer.js"), + cloneDataView = __webpack_require__(/*! ./_cloneDataView */ "./node_modules/lodash/_cloneDataView.js"), + cloneRegExp = __webpack_require__(/*! ./_cloneRegExp */ "./node_modules/lodash/_cloneRegExp.js"), + cloneSymbol = __webpack_require__(/*! ./_cloneSymbol */ "./node_modules/lodash/_cloneSymbol.js"), + cloneTypedArray = __webpack_require__(/*! ./_cloneTypedArray */ "./node_modules/lodash/_cloneTypedArray.js"); + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } +} + +module.exports = initCloneByTag; + + +/***/ }), + +/***/ "./node_modules/lodash/_initCloneObject.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_initCloneObject.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseCreate = __webpack_require__(/*! ./_baseCreate */ "./node_modules/lodash/_baseCreate.js"), + getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/lodash/_getPrototype.js"), + isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"); + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +module.exports = initCloneObject; + + +/***/ }), + +/***/ "./node_modules/lodash/_isFlattenable.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_isFlattenable.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** Built-in value references. */ +var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +module.exports = isFlattenable; + + +/***/ }), + +/***/ "./node_modules/lodash/_isIndex.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_isIndex.js ***! + \*****************************************/ +/***/ (function(module) { + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +module.exports = isIndex; + + +/***/ }), + +/***/ "./node_modules/lodash/_isIterateeCall.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_isIterateeCall.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +module.exports = isIterateeCall; + + +/***/ }), + +/***/ "./node_modules/lodash/_isKey.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/_isKey.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +module.exports = isKey; + + +/***/ }), + +/***/ "./node_modules/lodash/_isKeyable.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_isKeyable.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +module.exports = isKeyable; + + +/***/ }), + +/***/ "./node_modules/lodash/_isMasked.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_isMasked.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var coreJsData = __webpack_require__(/*! ./_coreJsData */ "./node_modules/lodash/_coreJsData.js"); + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +module.exports = isMasked; + + +/***/ }), + +/***/ "./node_modules/lodash/_isPrototype.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_isPrototype.js ***! + \*********************************************/ +/***/ (function(module) { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +module.exports = isPrototype; + + +/***/ }), + +/***/ "./node_modules/lodash/_isStrictComparable.js": +/*!****************************************************!*\ + !*** ./node_modules/lodash/_isStrictComparable.js ***! + \****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +module.exports = isStrictComparable; + + +/***/ }), + +/***/ "./node_modules/lodash/_listCacheClear.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_listCacheClear.js ***! + \************************************************/ +/***/ (function(module) { + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +module.exports = listCacheClear; + + +/***/ }), + +/***/ "./node_modules/lodash/_listCacheDelete.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_listCacheDelete.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +module.exports = listCacheDelete; + + +/***/ }), + +/***/ "./node_modules/lodash/_listCacheGet.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_listCacheGet.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +module.exports = listCacheGet; + + +/***/ }), + +/***/ "./node_modules/lodash/_listCacheHas.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_listCacheHas.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +module.exports = listCacheHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_listCacheSet.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_listCacheSet.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +module.exports = listCacheSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapCacheClear.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_mapCacheClear.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Hash = __webpack_require__(/*! ./_Hash */ "./node_modules/lodash/_Hash.js"), + ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"), + Map = __webpack_require__(/*! ./_Map */ "./node_modules/lodash/_Map.js"); + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +module.exports = mapCacheClear; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapCacheDelete.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_mapCacheDelete.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +module.exports = mapCacheDelete; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapCacheGet.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_mapCacheGet.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +module.exports = mapCacheGet; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapCacheHas.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_mapCacheHas.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +module.exports = mapCacheHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapCacheSet.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_mapCacheSet.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +module.exports = mapCacheSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapToArray.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_mapToArray.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +module.exports = mapToArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_matchesStrictComparable.js": +/*!*********************************************************!*\ + !*** ./node_modules/lodash/_matchesStrictComparable.js ***! + \*********************************************************/ +/***/ (function(module) { + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +module.exports = matchesStrictComparable; + + +/***/ }), + +/***/ "./node_modules/lodash/_memoizeCapped.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_memoizeCapped.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var memoize = __webpack_require__(/*! ./memoize */ "./node_modules/lodash/memoize.js"); + +/** Used as the maximum memoize cache size. */ +var MAX_MEMOIZE_SIZE = 500; + +/** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ +function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; +} + +module.exports = memoizeCapped; + + +/***/ }), + +/***/ "./node_modules/lodash/_nativeCreate.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_nativeCreate.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"); + +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); + +module.exports = nativeCreate; + + +/***/ }), + +/***/ "./node_modules/lodash/_nativeKeys.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_nativeKeys.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var overArg = __webpack_require__(/*! ./_overArg */ "./node_modules/lodash/_overArg.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +module.exports = nativeKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_nativeKeysIn.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_nativeKeysIn.js ***! + \**********************************************/ +/***/ (function(module) { + +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +module.exports = nativeKeysIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_nodeUtil.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_nodeUtil.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js"); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +module.exports = nodeUtil; + + +/***/ }), + +/***/ "./node_modules/lodash/_objectToString.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_objectToString.js ***! + \************************************************/ +/***/ (function(module) { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +module.exports = objectToString; + + +/***/ }), + +/***/ "./node_modules/lodash/_overArg.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_overArg.js ***! + \*****************************************/ +/***/ (function(module) { + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +module.exports = overArg; + + +/***/ }), + +/***/ "./node_modules/lodash/_overRest.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_overRest.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var apply = __webpack_require__(/*! ./_apply */ "./node_modules/lodash/_apply.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +module.exports = overRest; + + +/***/ }), + +/***/ "./node_modules/lodash/_parent.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/_parent.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"), + baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"); + +/** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ +function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); +} + +module.exports = parent; + + +/***/ }), + +/***/ "./node_modules/lodash/_root.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/_root.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js"); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +module.exports = root; + + +/***/ }), + +/***/ "./node_modules/lodash/_setCacheAdd.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_setCacheAdd.js ***! + \*********************************************/ +/***/ (function(module) { + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +module.exports = setCacheAdd; + + +/***/ }), + +/***/ "./node_modules/lodash/_setCacheHas.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_setCacheHas.js ***! + \*********************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +module.exports = setCacheHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_setToArray.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_setToArray.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +module.exports = setToArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_setToPairs.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_setToPairs.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ +function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; +} + +module.exports = setToPairs; + + +/***/ }), + +/***/ "./node_modules/lodash/_setToString.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_setToString.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseSetToString = __webpack_require__(/*! ./_baseSetToString */ "./node_modules/lodash/_baseSetToString.js"), + shortOut = __webpack_require__(/*! ./_shortOut */ "./node_modules/lodash/_shortOut.js"); + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +module.exports = setToString; + + +/***/ }), + +/***/ "./node_modules/lodash/_shortOut.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_shortOut.js ***! + \******************************************/ +/***/ (function(module) { + +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeNow = Date.now; + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + +module.exports = shortOut; + + +/***/ }), + +/***/ "./node_modules/lodash/_stackClear.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_stackClear.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"); + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +module.exports = stackClear; + + +/***/ }), + +/***/ "./node_modules/lodash/_stackDelete.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_stackDelete.js ***! + \*********************************************/ +/***/ (function(module) { + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +module.exports = stackDelete; + + +/***/ }), + +/***/ "./node_modules/lodash/_stackGet.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_stackGet.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +module.exports = stackGet; + + +/***/ }), + +/***/ "./node_modules/lodash/_stackHas.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_stackHas.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +module.exports = stackHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_stackSet.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_stackSet.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"), + Map = __webpack_require__(/*! ./_Map */ "./node_modules/lodash/_Map.js"), + MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/lodash/_MapCache.js"); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +module.exports = stackSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_strictIndexOf.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_strictIndexOf.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +module.exports = strictIndexOf; + + +/***/ }), + +/***/ "./node_modules/lodash/_stringToPath.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_stringToPath.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var memoizeCapped = __webpack_require__(/*! ./_memoizeCapped */ "./node_modules/lodash/_memoizeCapped.js"); + +/** Used to match property names within property paths. */ +var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +module.exports = stringToPath; + + +/***/ }), + +/***/ "./node_modules/lodash/_toKey.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/_toKey.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = toKey; + + +/***/ }), + +/***/ "./node_modules/lodash/_toSource.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_toSource.js ***! + \******************************************/ +/***/ (function(module) { + +/** Used for built-in method references. */ +var funcProto = Function.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +module.exports = toSource; + + +/***/ }), + +/***/ "./node_modules/lodash/_trimmedEndIndex.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_trimmedEndIndex.js ***! + \*************************************************/ +/***/ (function(module) { + +/** Used to match a single whitespace character. */ +var reWhitespace = /\s/; + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the last non-whitespace character. + */ +function trimmedEndIndex(string) { + var index = string.length; + + while (index-- && reWhitespace.test(string.charAt(index))) {} + return index; +} + +module.exports = trimmedEndIndex; + + +/***/ }), + +/***/ "./node_modules/lodash/assign.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/assign.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + createAssigner = __webpack_require__(/*! ./_createAssigner */ "./node_modules/lodash/_createAssigner.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ +var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } +}); + +module.exports = assign; + + +/***/ }), + +/***/ "./node_modules/lodash/constant.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/constant.js ***! + \*****************************************/ +/***/ (function(module) { + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +module.exports = constant; + + +/***/ }), + +/***/ "./node_modules/lodash/defaults.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/defaults.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"), + isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/lodash/_isIterateeCall.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; +}); + +module.exports = defaults; + + +/***/ }), + +/***/ "./node_modules/lodash/difference.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/difference.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseDifference = __webpack_require__(/*! ./_baseDifference */ "./node_modules/lodash/_baseDifference.js"), + baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js"), + baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ "./node_modules/lodash/isArrayLikeObject.js"); + +/** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ +var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; +}); + +module.exports = difference; + + +/***/ }), + +/***/ "./node_modules/lodash/drop.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/drop.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"), + toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/lodash/toInteger.js"); + +/** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); +} + +module.exports = drop; + + +/***/ }), + +/***/ "./node_modules/lodash/dropRight.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/dropRight.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"), + toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/lodash/toInteger.js"); + +/** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); +} + +module.exports = dropRight; + + +/***/ }), + +/***/ "./node_modules/lodash/eq.js": +/*!***********************************!*\ + !*** ./node_modules/lodash/eq.js ***! + \***********************************/ +/***/ (function(module) { + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +module.exports = eq; + + +/***/ }), + +/***/ "./node_modules/lodash/filter.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/filter.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ "./node_modules/lodash/_arrayFilter.js"), + baseFilter = __webpack_require__(/*! ./_baseFilter */ "./node_modules/lodash/_baseFilter.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] + */ +function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = filter; + + +/***/ }), + +/***/ "./node_modules/lodash/find.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/find.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var createFind = __webpack_require__(/*! ./_createFind */ "./node_modules/lodash/_createFind.js"), + findIndex = __webpack_require__(/*! ./findIndex */ "./node_modules/lodash/findIndex.js"); + +/** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ +var find = createFind(findIndex); + +module.exports = find; + + +/***/ }), + +/***/ "./node_modules/lodash/findIndex.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/findIndex.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ "./node_modules/lodash/_baseFindIndex.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/lodash/toInteger.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ +function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); +} + +module.exports = findIndex; + + +/***/ }), + +/***/ "./node_modules/lodash/flatten.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/flatten.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js"); + +/** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ +function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; +} + +module.exports = flatten; + + +/***/ }), + +/***/ "./node_modules/lodash/forEach.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/forEach.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayEach = __webpack_require__(/*! ./_arrayEach */ "./node_modules/lodash/_arrayEach.js"), + baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/lodash/_baseEach.js"), + castFunction = __webpack_require__(/*! ./_castFunction */ "./node_modules/lodash/_castFunction.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, castFunction(iteratee)); +} + +module.exports = forEach; + + +/***/ }), + +/***/ "./node_modules/lodash/forOwn.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/forOwn.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "./node_modules/lodash/_baseForOwn.js"), + castFunction = __webpack_require__(/*! ./_castFunction */ "./node_modules/lodash/_castFunction.js"); + +/** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forOwn(object, iteratee) { + return object && baseForOwn(object, castFunction(iteratee)); +} + +module.exports = forOwn; + + +/***/ }), + +/***/ "./node_modules/lodash/get.js": +/*!************************************!*\ + !*** ./node_modules/lodash/get.js ***! + \************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"); + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; + + +/***/ }), + +/***/ "./node_modules/lodash/hasIn.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/hasIn.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseHasIn = __webpack_require__(/*! ./_baseHasIn */ "./node_modules/lodash/_baseHasIn.js"), + hasPath = __webpack_require__(/*! ./_hasPath */ "./node_modules/lodash/_hasPath.js"); + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +module.exports = hasIn; + + +/***/ }), + +/***/ "./node_modules/lodash/identity.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/identity.js ***! + \*****************************************/ +/***/ (function(module) { + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; + + +/***/ }), + +/***/ "./node_modules/lodash/includes.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/includes.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ "./node_modules/lodash/_baseIndexOf.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + isString = __webpack_require__(/*! ./isString */ "./node_modules/lodash/isString.js"), + toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/lodash/toInteger.js"), + values = __webpack_require__(/*! ./values */ "./node_modules/lodash/values.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ +function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); +} + +module.exports = includes; + + +/***/ }), + +/***/ "./node_modules/lodash/initial.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/initial.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"); + +/** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ +function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; +} + +module.exports = initial; + + +/***/ }), + +/***/ "./node_modules/lodash/intersection.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/intersection.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseIntersection = __webpack_require__(/*! ./_baseIntersection */ "./node_modules/lodash/_baseIntersection.js"), + baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + castArrayLikeObject = __webpack_require__(/*! ./_castArrayLikeObject */ "./node_modules/lodash/_castArrayLikeObject.js"); + +/** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ +var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; +}); + +module.exports = intersection; + + +/***/ }), + +/***/ "./node_modules/lodash/isArguments.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/isArguments.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ "./node_modules/lodash/_baseIsArguments.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +module.exports = isArguments; + + +/***/ }), + +/***/ "./node_modules/lodash/isArray.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/isArray.js ***! + \****************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +module.exports = isArray; + + +/***/ }), + +/***/ "./node_modules/lodash/isArrayLike.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/isArrayLike.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/lodash/isFunction.js"), + isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js"); + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +module.exports = isArrayLike; + + +/***/ }), + +/***/ "./node_modules/lodash/isArrayLikeObject.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/isArrayLikeObject.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +module.exports = isArrayLikeObject; + + +/***/ }), + +/***/ "./node_modules/lodash/isBuffer.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isBuffer.js ***! + \*****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"), + stubFalse = __webpack_require__(/*! ./stubFalse */ "./node_modules/lodash/stubFalse.js"); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +module.exports = isBuffer; + + +/***/ }), + +/***/ "./node_modules/lodash/isEmpty.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/isEmpty.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseKeys = __webpack_require__(/*! ./_baseKeys */ "./node_modules/lodash/_baseKeys.js"), + getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), + isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"), + isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/lodash/isTypedArray.js"); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ +function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; +} + +module.exports = isEmpty; + + +/***/ }), + +/***/ "./node_modules/lodash/isFunction.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/isFunction.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); + +/** `Object#toString` result references. */ +var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +module.exports = isFunction; + + +/***/ }), + +/***/ "./node_modules/lodash/isLength.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isLength.js ***! + \*****************************************/ +/***/ (function(module) { + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = isLength; + + +/***/ }), + +/***/ "./node_modules/lodash/isMap.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/isMap.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsMap = __webpack_require__(/*! ./_baseIsMap */ "./node_modules/lodash/_baseIsMap.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/lodash/_nodeUtil.js"); + +/* Node.js helper references. */ +var nodeIsMap = nodeUtil && nodeUtil.isMap; + +/** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ +var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + +module.exports = isMap; + + +/***/ }), + +/***/ "./node_modules/lodash/isNull.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/isNull.js ***! + \***************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ +function isNull(value) { + return value === null; +} + +module.exports = isNull; + + +/***/ }), + +/***/ "./node_modules/lodash/isObject.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isObject.js ***! + \*****************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +module.exports = isObject; + + +/***/ }), + +/***/ "./node_modules/lodash/isObjectLike.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/isObjectLike.js ***! + \*********************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +module.exports = isObjectLike; + + +/***/ }), + +/***/ "./node_modules/lodash/isPlainObject.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/isPlainObject.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/lodash/_getPrototype.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +module.exports = isPlainObject; + + +/***/ }), + +/***/ "./node_modules/lodash/isSet.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/isSet.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsSet = __webpack_require__(/*! ./_baseIsSet */ "./node_modules/lodash/_baseIsSet.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/lodash/_nodeUtil.js"); + +/* Node.js helper references. */ +var nodeIsSet = nodeUtil && nodeUtil.isSet; + +/** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ +var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + +module.exports = isSet; + + +/***/ }), + +/***/ "./node_modules/lodash/isString.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isString.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var stringTag = '[object String]'; + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); +} + +module.exports = isString; + + +/***/ }), + +/***/ "./node_modules/lodash/isSymbol.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isSymbol.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); +} + +module.exports = isSymbol; + + +/***/ }), + +/***/ "./node_modules/lodash/isTypedArray.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/isTypedArray.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsTypedArray = __webpack_require__(/*! ./_baseIsTypedArray */ "./node_modules/lodash/_baseIsTypedArray.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/lodash/_nodeUtil.js"); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +module.exports = isTypedArray; + + +/***/ }), + +/***/ "./node_modules/lodash/isUndefined.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/isUndefined.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ +function isUndefined(value) { + return value === undefined; +} + +module.exports = isUndefined; + + +/***/ }), + +/***/ "./node_modules/lodash/keys.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/keys.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "./node_modules/lodash/_arrayLikeKeys.js"), + baseKeys = __webpack_require__(/*! ./_baseKeys */ "./node_modules/lodash/_baseKeys.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +module.exports = keys; + + +/***/ }), + +/***/ "./node_modules/lodash/keysIn.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/keysIn.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "./node_modules/lodash/_arrayLikeKeys.js"), + baseKeysIn = __webpack_require__(/*! ./_baseKeysIn */ "./node_modules/lodash/_baseKeysIn.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"); + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +module.exports = keysIn; + + +/***/ }), + +/***/ "./node_modules/lodash/last.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/last.js ***! + \*************************************/ +/***/ (function(module) { + +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; +} + +module.exports = last; + + +/***/ }), + +/***/ "./node_modules/lodash/map.js": +/*!************************************!*\ + !*** ./node_modules/lodash/map.js ***! + \************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + baseMap = __webpack_require__(/*! ./_baseMap */ "./node_modules/lodash/_baseMap.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ +function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, baseIteratee(iteratee, 3)); +} + +module.exports = map; + + +/***/ }), + +/***/ "./node_modules/lodash/memoize.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/memoize.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/lodash/_MapCache.js"); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Expose `MapCache`. +memoize.Cache = MapCache; + +module.exports = memoize; + + +/***/ }), + +/***/ "./node_modules/lodash/omit.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/omit.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseClone = __webpack_require__(/*! ./_baseClone */ "./node_modules/lodash/_baseClone.js"), + baseUnset = __webpack_require__(/*! ./_baseUnset */ "./node_modules/lodash/_baseUnset.js"), + castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + customOmitClone = __webpack_require__(/*! ./_customOmitClone */ "./node_modules/lodash/_customOmitClone.js"), + flatRest = __webpack_require__(/*! ./_flatRest */ "./node_modules/lodash/_flatRest.js"), + getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ "./node_modules/lodash/_getAllKeysIn.js"); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + +/** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ +var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; + } + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; +}); + +module.exports = omit; + + +/***/ }), + +/***/ "./node_modules/lodash/orderBy.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/orderBy.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseOrderBy = __webpack_require__(/*! ./_baseOrderBy */ "./node_modules/lodash/_baseOrderBy.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ +function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); +} + +module.exports = orderBy; + + +/***/ }), + +/***/ "./node_modules/lodash/pick.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/pick.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var basePick = __webpack_require__(/*! ./_basePick */ "./node_modules/lodash/_basePick.js"), + flatRest = __webpack_require__(/*! ./_flatRest */ "./node_modules/lodash/_flatRest.js"); + +/** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ +var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); +}); + +module.exports = pick; + + +/***/ }), + +/***/ "./node_modules/lodash/property.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/property.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseProperty = __webpack_require__(/*! ./_baseProperty */ "./node_modules/lodash/_baseProperty.js"), + basePropertyDeep = __webpack_require__(/*! ./_basePropertyDeep */ "./node_modules/lodash/_basePropertyDeep.js"), + isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/lodash/_isKey.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = property; + + +/***/ }), + +/***/ "./node_modules/lodash/some.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/some.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arraySome = __webpack_require__(/*! ./_arraySome */ "./node_modules/lodash/_arraySome.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + baseSome = __webpack_require__(/*! ./_baseSome */ "./node_modules/lodash/_baseSome.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/lodash/_isIterateeCall.js"); + +/** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ +function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = some; + + +/***/ }), + +/***/ "./node_modules/lodash/sortBy.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/sortBy.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js"), + baseOrderBy = __webpack_require__(/*! ./_baseOrderBy */ "./node_modules/lodash/_baseOrderBy.js"), + baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/lodash/_isIterateeCall.js"); + +/** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 30 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] + */ +var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); +}); + +module.exports = sortBy; + + +/***/ }), + +/***/ "./node_modules/lodash/stubArray.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/stubArray.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +module.exports = stubArray; + + +/***/ }), + +/***/ "./node_modules/lodash/stubFalse.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/stubFalse.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = stubFalse; + + +/***/ }), + +/***/ "./node_modules/lodash/take.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/take.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"), + toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/lodash/toInteger.js"); + +/** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ +function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); +} + +module.exports = take; + + +/***/ }), + +/***/ "./node_modules/lodash/toFinite.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/toFinite.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var toNumber = __webpack_require__(/*! ./toNumber */ "./node_modules/lodash/toNumber.js"); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_INTEGER = 1.7976931348623157e+308; + +/** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ +function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; +} + +module.exports = toFinite; + + +/***/ }), + +/***/ "./node_modules/lodash/toInteger.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/toInteger.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var toFinite = __webpack_require__(/*! ./toFinite */ "./node_modules/lodash/toFinite.js"); + +/** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ +function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; +} + +module.exports = toInteger; + + +/***/ }), + +/***/ "./node_modules/lodash/toNumber.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/toNumber.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseTrim = __webpack_require__(/*! ./_baseTrim */ "./node_modules/lodash/_baseTrim.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = baseTrim(value); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +module.exports = toNumber; + + +/***/ }), + +/***/ "./node_modules/lodash/toPairs.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/toPairs.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var createToPairs = __webpack_require__(/*! ./_createToPairs */ "./node_modules/lodash/_createToPairs.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ +var toPairs = createToPairs(keys); + +module.exports = toPairs; + + +/***/ }), + +/***/ "./node_modules/lodash/toPath.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/toPath.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + copyArray = __webpack_require__(/*! ./_copyArray */ "./node_modules/lodash/_copyArray.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"), + stringToPath = __webpack_require__(/*! ./_stringToPath */ "./node_modules/lodash/_stringToPath.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"), + toString = __webpack_require__(/*! ./toString */ "./node_modules/lodash/toString.js"); + +/** + * Converts `value` to a property path array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {*} value The value to convert. + * @returns {Array} Returns the new property path array. + * @example + * + * _.toPath('a.b.c'); + * // => ['a', 'b', 'c'] + * + * _.toPath('a[0].b.c'); + * // => ['a', '0', 'b', 'c'] + */ +function toPath(value) { + if (isArray(value)) { + return arrayMap(value, toKey); + } + return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); +} + +module.exports = toPath; + + +/***/ }), + +/***/ "./node_modules/lodash/toString.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/toString.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseToString = __webpack_require__(/*! ./_baseToString */ "./node_modules/lodash/_baseToString.js"); + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +module.exports = toString; + + +/***/ }), + +/***/ "./node_modules/lodash/uniqueId.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/uniqueId.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var toString = __webpack_require__(/*! ./toString */ "./node_modules/lodash/toString.js"); + +/** Used to generate unique IDs. */ +var idCounter = 0; + +/** + * Generates a unique ID. If `prefix` is given, the ID is appended to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {string} [prefix=''] The value to prefix the ID with. + * @returns {string} Returns the unique ID. + * @example + * + * _.uniqueId('contact_'); + * // => 'contact_104' + * + * _.uniqueId(); + * // => '105' + */ +function uniqueId(prefix) { + var id = ++idCounter; + return toString(prefix) + id; +} + +module.exports = uniqueId; + + +/***/ }), + +/***/ "./node_modules/lodash/values.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/values.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseValues = __webpack_require__(/*! ./_baseValues */ "./node_modules/lodash/_baseValues.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ +function values(object) { + return object == null ? [] : baseValues(object, keys(object)); +} + +module.exports = values; + + +/***/ }), + +/***/ "./node_modules/lodash/without.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/without.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseDifference = __webpack_require__(/*! ./_baseDifference */ "./node_modules/lodash/_baseDifference.js"), + baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ "./node_modules/lodash/isArrayLikeObject.js"); + +/** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ +var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; +}); + +module.exports = without; + + +/***/ }), + +/***/ "./node_modules/lodash/zipObject.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/zipObject.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + baseZipObject = __webpack_require__(/*! ./_baseZipObject */ "./node_modules/lodash/_baseZipObject.js"); + +/** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ +function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); +} + +module.exports = zipObject; + + +/***/ }), + +/***/ "./node_modules/object-assign/index.js": +/*!*********************************************!*\ + !*** ./node_modules/object-assign/index.js ***! + \*********************************************/ +/***/ (function(module) { + +"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + + +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; + + +/***/ }), + +/***/ "./node_modules/react-selectable/dist/react-selectable.js": +/*!****************************************************************!*\ + !*** ./node_modules/react-selectable/dist/react-selectable.js ***! + \****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +!function(e,t){if(true)module.exports=t(__webpack_require__(/*! react */ "react"),__webpack_require__(/*! react-dom */ "react-dom"));else { var r, n; }}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=12)}([function(e,t,n){"use strict";function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(s===setTimeout)return setTimeout(e,0);if((s===r||!s)&&setTimeout)return s=setTimeout,setTimeout(e,0);try{return s(e,0)}catch(t){try{return s.call(null,e,0)}catch(t){return s.call(this,e,0)}}}function u(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){b&&y&&(b=!1,y.length?h=y.concat(h):v=-1,h.length&&c())}function c(){if(!b){var e=i(a);b=!0;for(var t=h.length;t;){for(y=h,h=[];++v1)for(var n=1;n1?t-1:0),r=1;r2?n-2:0),o=2;o1&&void 0!==arguments[1]&&arguments[1],n=this.props,r=n.tolerance,o=n.onSelection,i=n.onEndSelection,u=[],a=(0,l.findDOMNode)(this.refs.selectbox);a&&(this._registry.forEach(function(e){e.domNode&&(0,x.default)(a,e.domNode,r)&&!u.includes(e.key)&&u.push(e.key)}),t?"function"==typeof i&&i(u,e):"function"==typeof o&&o(u,e))}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.enabled,r=e.fixedPosition,o=e.className,i=e.selectingClassName,u=this.state,a=u.isBoxSelecting,c=u.boxLeft,l=u.boxTop,s=u.boxWidth,p=u.boxHeight,d=this.props.component;if(!n)return f.default.createElement(d,{className:o},t);var h={left:c,top:l,width:s,height:p,zIndex:9e3,position:r?"fixed":"absolute",cursor:"default"},b={backgroundColor:"transparent",border:"1px dashed #999",width:"100%",height:"100%",float:"left"},v={position:"relative",overflow:"visible"};return f.default.createElement(d,{className:(0,y.default)(o,a?i:null),style:v},a?f.default.createElement("div",{style:h,ref:"selectbox"},f.default.createElement("span",{style:b})):null,t)}}]),t}(c.Component);j.propTypes={children:p.default.node,onBeginSelection:p.default.func,onEndSelection:p.default.func,onSelection:p.default.func,component:p.default.node,tolerance:p.default.number,fixedPosition:p.default.bool,preventDefault:p.default.bool,onNonItemClick:p.default.func,enabled:p.default.bool,className:p.default.string,selectingClassName:p.default.string},j.defaultProps={component:"div",tolerance:0,fixedPosition:!1,preventDefault:!0,enabled:!0},j.childContextTypes={selectable:p.default.object},t.default=j},function(e,t,n){"use strict";(function(t){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=n(1),i=n(2),u=n(8),a=n(15),c=n(3),f=n(16);e.exports=function(e,n){function l(e){var t=e&&(N&&e[N]||e[P]);if("function"==typeof t)return t}function s(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function p(e){this.message=e,this.stack=""}function d(e){function r(r,f,l,s,d,y,h){if(s=s||k,y=y||l,h!==c)if(n)i(!1,"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");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var b=s+":"+l;!o[b]&&a<3&&(u(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",y,s),o[b]=!0,a++)}return null==f[l]?r?new p(null===f[l]?"The "+d+" `"+y+"` is marked as required in `"+s+"`, but its value is `null`.":"The "+d+" `"+y+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(f,l,s,d,y)}if("production"!==t.env.NODE_ENV)var o={},a=0;var f=r.bind(null,!1);return f.isRequired=r.bind(null,!0),f}function y(e){function t(t,n,r,o,i,u){var a=t[n];if(S(a)!==e)return new p("Invalid "+o+" `"+i+"` of type `"+j(a)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return d(t)}function h(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var u=t[n];if(!Array.isArray(u)){return new p("Invalid "+o+" `"+i+"` of type `"+S(u)+"` supplied to `"+r+"`, expected an array.")}for(var a=0;an+a||t+o-cr+u)};t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=e instanceof HTMLElement?(0,o.default)(e):e,u=t instanceof HTMLElement?(0,o.default)(t):t;return i(r.top,r.left,u.top,u.left,r.offsetWidth,r.offsetHeight,u.offsetWidth,u.offsetHeight,n)}},function(e,t,n){"use strict";(function(t){function n(e,t,n){function r(t){var n=h,r=b;return h=b=void 0,w=t,m=e.apply(r,n)}function i(e){return w=e,g=setTimeout(l,t),j?r(e):m}function u(e){var n=e-_,r=e-w,o=t-n;return E?O(o,v-r):o}function c(e){var n=e-_,r=e-w;return void 0===_||n>=t||n<0||E&&r>=v}function l(){var e=S();if(c(e))return s(e);g=setTimeout(l,u(e))}function s(e){return g=void 0,T&&h?r(e):(h=b=void 0,m)}function p(){void 0!==g&&clearTimeout(g),w=0,h=_=b=g=void 0}function d(){return void 0===g?m:s(S())}function y(){var e=S(),n=c(e);if(h=arguments,b=this,_=e,n){if(void 0===g)return i(_);if(E)return g=setTimeout(l,t),r(_)}return void 0===g&&(g=setTimeout(l,t)),m}var h,b,v,m,g,_,w=0,j=!1,E=!1,T=!0;if("function"!=typeof e)throw new TypeError(f);return t=a(t)||0,o(n)&&(j=!!n.leading,E="maxWait"in n,v=E?x(a(n.maxWait)||0,t):v,T="trailing"in n?!!n.trailing:T),y.cancel=p,y.flush=d,y}function r(e,t,r){var i=!0,u=!0;if("function"!=typeof e)throw new TypeError(f);return o(r)&&(i="leading"in r?!!r.leading:i,u="trailing"in r?!!r.trailing:u),n(e,t,{leading:i,maxWait:t,trailing:u})}function o(e){var t=void 0===e?"undefined":c(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==(void 0===e?"undefined":c(e))}function u(e){return"symbol"==(void 0===e?"undefined":c(e))||i(e)&&w.call(e)==s}function a(e){if("number"==typeof e)return e;if(u(e))return l;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(p,"");var n=y.test(e);return n||h.test(e)?b(e.slice(2),n?2:8):d.test(e)?l:+e}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f="Expected a function",l=NaN,s="[object Symbol]",p=/^\s+|\s+$/g,d=/^[-+]0x[0-9a-f]+$/i,y=/^0b[01]+$/i,h=/^0o[0-7]+$/i,b=parseInt,v="object"==(void 0===t?"undefined":c(t))&&t&&t.Object===Object&&t,m="object"==("undefined"==typeof self?"undefined":c(self))&&self&&self.Object===Object&&self,g=v||m||Function("return this")(),_=Object.prototype,w=_.toString,x=Math.max,O=Math.min,S=function(){return g.Date.now()};e.exports=r}).call(t,n(21))},function(e,t,n){"use strict";var r,o="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};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":o(window))&&(r=window)}e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function u(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)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n"; + + +let $4ca367182776f80b$var$defaultOptions = { + /** + * Has to be specified on elements other than form (or when the form doesn't + * have an `action` attribute). + * + * You can also provide a function that will be called with `files` and + * `dataBlocks` and must return the url as string. + */ url: null, + /** + * Can be changed to `"put"` if necessary. You can also provide a function + * that will be called with `files` and must return the method (since `v3.12.0`). + */ method: "post", + /** + * Will be set on the XHRequest. + */ withCredentials: false, + /** + * The timeout for the XHR requests in milliseconds (since `v4.4.0`). + * If set to null or 0, no timeout is going to be set. + */ timeout: null, + /** + * How many file uploads to process in parallel (See the + * Enqueuing file uploads documentation section for more info) + */ parallelUploads: 2, + /** + * Whether to send multiple files in one request. If + * this it set to true, then the fallback file input element will + * have the `multiple` attribute as well. This option will + * also trigger additional events (like `processingmultiple`). See the events + * documentation section for more information. + */ uploadMultiple: false, + /** + * Whether you want files to be uploaded in chunks to your server. This can't be + * used in combination with `uploadMultiple`. + * + * See [chunksUploaded](#config-chunksUploaded) for the callback to finalise an upload. + */ chunking: false, + /** + * If `chunking` is enabled, this defines whether **every** file should be chunked, + * even if the file size is below chunkSize. This means, that the additional chunk + * form data will be submitted and the `chunksUploaded` callback will be invoked. + */ forceChunking: false, + /** + * If `chunking` is `true`, then this defines the chunk size in bytes. + */ chunkSize: 2097152, + /** + * If `true`, the individual chunks of a file are being uploaded simultaneously. + * The limit of concurrent connections is governed by `parallelUploads`. + */ parallelChunkUploads: false, + /** + * Whether a chunk should be retried if it fails. + */ retryChunks: false, + /** + * If `retryChunks` is true, how many times should it be retried. + */ retryChunksLimit: 3, + /** + * The maximum filesize (in MiB) that is allowed to be uploaded. + */ maxFilesize: 256, + /** + * The name of the file param that gets transferred. + * **NOTE**: If you have the option `uploadMultiple` set to `true`, then + * Dropzone will append `[]` to the name. + */ paramName: "file", + /** + * Whether thumbnails for images should be generated + */ createImageThumbnails: true, + /** + * In MB. When the filename exceeds this limit, the thumbnail will not be generated. + */ maxThumbnailFilesize: 10, + /** + * If `null`, the ratio of the image will be used to calculate it. + */ thumbnailWidth: 120, + /** + * The same as `thumbnailWidth`. If both are null, images will not be resized. + */ thumbnailHeight: 120, + /** + * How the images should be scaled down in case both, `thumbnailWidth` and `thumbnailHeight` are provided. + * Can be either `contain` or `crop`. + */ thumbnailMethod: "crop", + /** + * If set, images will be resized to these dimensions before being **uploaded**. + * If only one, `resizeWidth` **or** `resizeHeight` is provided, the original aspect + * ratio of the file will be preserved. + * + * The `options.transformFile` function uses these options, so if the `transformFile` function + * is overridden, these options don't do anything. + */ resizeWidth: null, + /** + * See `resizeWidth`. + */ resizeHeight: null, + /** + * The mime type of the resized image (before it gets uploaded to the server). + * If `null` the original mime type will be used. To force jpeg, for example, use `image/jpeg`. + * See `resizeWidth` for more information. + */ resizeMimeType: null, + /** + * The quality of the resized images. See `resizeWidth`. + */ resizeQuality: 0.8, + /** + * How the images should be scaled down in case both, `resizeWidth` and `resizeHeight` are provided. + * Can be either `contain` or `crop`. + */ resizeMethod: "contain", + /** + * The base that is used to calculate the **displayed** filesize. You can + * change this to 1024 if you would rather display kibibytes, mebibytes, + * etc... 1024 is technically incorrect, because `1024 bytes` are `1 kibibyte` + * not `1 kilobyte`. You can change this to `1024` if you don't care about + * validity. + */ filesizeBase: 1000, + /** + * If not `null` defines how many files this Dropzone handles. If it exceeds, + * the event `maxfilesexceeded` will be called. The dropzone element gets the + * class `dz-max-files-reached` accordingly so you can provide visual + * feedback. + */ maxFiles: null, + /** + * An optional object to send additional headers to the server. Eg: + * `{ "My-Awesome-Header": "header value" }` + */ headers: null, + /** + * Should the default headers be set or not? + * Accept: application/json <- for requesting json response + * Cache-Control: no-cache <- Request shouldn't be cached + * X-Requested-With: XMLHttpRequest <- We sent the request via XMLHttpRequest + */ defaultHeaders: true, + /** + * If `true`, the dropzone element itself will be clickable, if `false` + * nothing will be clickable. + * + * You can also pass an HTML element, a CSS selector (for multiple elements) + * or an array of those. In that case, all of those elements will trigger an + * upload when clicked. + */ clickable: true, + /** + * Whether hidden files in directories should be ignored. + */ ignoreHiddenFiles: true, + /** + * The default implementation of `accept` checks the file's mime type or + * extension against this list. This is a comma separated list of mime + * types or file extensions. + * + * Eg.: `image/*,application/pdf,.psd` + * + * If the Dropzone is `clickable` this option will also be used as + * [`accept`](https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept) + * parameter on the hidden file input as well. + */ acceptedFiles: null, + /** + * If false, files will be added to the queue but the queue will not be + * processed automatically. + * This can be useful if you need some additional user input before sending + * files (or if you want want all files sent at once). + * If you're ready to send the file simply call `myDropzone.processQueue()`. + * + * See the [enqueuing file uploads](#enqueuing-file-uploads) documentation + * section for more information. + */ autoProcessQueue: true, + /** + * If false, files added to the dropzone will not be queued by default. + * You'll have to call `enqueueFile(file)` manually. + */ autoQueue: true, + /** + * If `true`, this will add a link to every file preview to remove or cancel (if + * already uploading) the file. The `dictCancelUpload`, `dictCancelUploadConfirmation` + * and `dictRemoveFile` options are used for the wording. + */ addRemoveLinks: false, + /** + * Defines where to display the file previews – if `null` the + * Dropzone element itself is used. Can be a plain `HTMLElement` or a CSS + * selector. The element should have the `dropzone-previews` class so + * the previews are displayed properly. + */ previewsContainer: null, + /** + * Set this to `true` if you don't want previews to be shown. + */ disablePreviews: false, + /** + * This is the element the hidden input field (which is used when clicking on the + * dropzone to trigger file selection) will be appended to. This might + * be important in case you use frameworks to switch the content of your page. + * + * Can be a selector string, or an element directly. + */ hiddenInputContainer: "body", + /** + * If null, no capture type will be specified + * If camera, mobile devices will skip the file selection and choose camera + * If microphone, mobile devices will skip the file selection and choose the microphone + * If camcorder, mobile devices will skip the file selection and choose the camera in video mode + * On apple devices multiple must be set to false. AcceptedFiles may need to + * be set to an appropriate mime type (e.g. "image/*", "audio/*", or "video/*"). + */ capture: null, + /** + * **Deprecated**. Use `renameFile` instead. + */ renameFilename: null, + /** + * A function that is invoked before the file is uploaded to the server and renames the file. + * This function gets the `File` as argument and can use the `file.name`. The actual name of the + * file that gets used during the upload can be accessed through `file.upload.filename`. + */ renameFile: null, + /** + * If `true` the fallback will be forced. This is very useful to test your server + * implementations first and make sure that everything works as + * expected without dropzone if you experience problems, and to test + * how your fallbacks will look. + */ forceFallback: false, + /** + * The text used before any files are dropped. + */ dictDefaultMessage: "Drop files here to upload", + /** + * The text that replaces the default message text it the browser is not supported. + */ dictFallbackMessage: "Your browser does not support drag'n'drop file uploads.", + /** + * The text that will be added before the fallback form. + * If you provide a fallback element yourself, or if this option is `null` this will + * be ignored. + */ dictFallbackText: "Please use the fallback form below to upload your files like in the olden days.", + /** + * If the filesize is too big. + * `{{filesize}}` and `{{maxFilesize}}` will be replaced with the respective configuration values. + */ dictFileTooBig: "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.", + /** + * If the file doesn't match the file type. + */ dictInvalidFileType: "You can't upload files of this type.", + /** + * If the server response was invalid. + * `{{statusCode}}` will be replaced with the servers status code. + */ dictResponseError: "Server responded with {{statusCode}} code.", + /** + * If `addRemoveLinks` is true, the text to be used for the cancel upload link. + */ dictCancelUpload: "Cancel upload", + /** + * The text that is displayed if an upload was manually canceled + */ dictUploadCanceled: "Upload canceled.", + /** + * If `addRemoveLinks` is true, the text to be used for confirmation when cancelling upload. + */ dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?", + /** + * If `addRemoveLinks` is true, the text to be used to remove a file. + */ dictRemoveFile: "Remove file", + /** + * If this is not null, then the user will be prompted before removing a file. + */ dictRemoveFileConfirmation: null, + /** + * Displayed if `maxFiles` is st and exceeded. + * The string `{{maxFiles}}` will be replaced by the configuration value. + */ dictMaxFilesExceeded: "You cannot upload any more files.", + /** + * Allows you to translate the different units. Starting with `tb` for terabytes and going down to + * `b` for bytes. + */ dictFileSizeUnits: { + tb: "TB", + gb: "GB", + mb: "MB", + kb: "KB", + b: "b" + }, + /** + * Called when dropzone initialized + * You can add event listeners here + */ init () {}, + /** + * Can be an **object** of additional parameters to transfer to the server, **or** a `Function` + * that gets invoked with the `files`, `xhr` and, if it's a chunked upload, `chunk` arguments. In case + * of a function, this needs to return a map. + * + * The default implementation does nothing for normal uploads, but adds relevant information for + * chunked uploads. + * + * This is the same as adding hidden input fields in the form element. + */ params (files, xhr, chunk) { + if (chunk) return { + dzuuid: chunk.file.upload.uuid, + dzchunkindex: chunk.index, + dztotalfilesize: chunk.file.size, + dzchunksize: this.options.chunkSize, + dztotalchunkcount: chunk.file.upload.totalChunkCount, + dzchunkbyteoffset: chunk.index * this.options.chunkSize + }; + }, + /** + * A function that gets a [file](https://developer.mozilla.org/en-US/docs/DOM/File) + * and a `done` function as parameters. + * + * If the done function is invoked without arguments, the file is "accepted" and will + * be processed. If you pass an error message, the file is rejected, and the error + * message will be displayed. + * This function will not be called if the file is too big or doesn't match the mime types. + */ accept (file, done) { + return done(); + }, + /** + * The callback that will be invoked when all chunks have been uploaded for a file. + * It gets the file for which the chunks have been uploaded as the first parameter, + * and the `done` function as second. `done()` needs to be invoked when everything + * needed to finish the upload process is done. + */ chunksUploaded: function(file, done) { + done(); + }, + /** + * Sends the file as binary blob in body instead of form data. + * If this is set, the `params` option will be ignored. + * It's an error to set this to `true` along with `uploadMultiple` since + * multiple files cannot be in a single binary body. + */ binaryBody: false, + /** + * Gets called when the browser is not supported. + * The default implementation shows the fallback input field and adds + * a text. + */ fallback () { + // This code should pass in IE7... :( + let messageElement; + this.element.className = `${this.element.className} dz-browser-not-supported`; + for (let child of this.element.getElementsByTagName("div"))if (/(^| )dz-message($| )/.test(child.className)) { + messageElement = child; + child.className = "dz-message"; // Removes the 'dz-default' class + break; + } + if (!messageElement) { + messageElement = (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).createElement('
'); + this.element.appendChild(messageElement); + } + let span = messageElement.getElementsByTagName("span")[0]; + if (span) { + if (span.textContent != null) span.textContent = this.options.dictFallbackMessage; + else if (span.innerText != null) span.innerText = this.options.dictFallbackMessage; + } + return this.element.appendChild(this.getFallbackForm()); + }, + /** + * Gets called to calculate the thumbnail dimensions. + * + * It gets `file`, `width` and `height` (both may be `null`) as parameters and must return an object containing: + * + * - `srcWidth` & `srcHeight` (required) + * - `trgWidth` & `trgHeight` (required) + * - `srcX` & `srcY` (optional, default `0`) + * - `trgX` & `trgY` (optional, default `0`) + * + * Those values are going to be used by `ctx.drawImage()`. + */ resize (file, width, height, resizeMethod) { + let info = { + srcX: 0, + srcY: 0, + srcWidth: file.width, + srcHeight: file.height + }; + let srcRatio = file.width / file.height; + // Automatically calculate dimensions if not specified + if (width == null && height == null) { + width = info.srcWidth; + height = info.srcHeight; + } else if (width == null) width = height * srcRatio; + else if (height == null) height = width / srcRatio; + // Make sure images aren't upscaled + width = Math.min(width, info.srcWidth); + height = Math.min(height, info.srcHeight); + let trgRatio = width / height; + if (info.srcWidth > width || info.srcHeight > height) { + // Image is bigger and needs rescaling + if (resizeMethod === "crop") { + if (srcRatio > trgRatio) { + info.srcHeight = file.height; + info.srcWidth = info.srcHeight * trgRatio; + } else { + info.srcWidth = file.width; + info.srcHeight = info.srcWidth / trgRatio; + } + } else if (resizeMethod === "contain") { + // Method 'contain' + if (srcRatio > trgRatio) height = width / srcRatio; + else width = height * srcRatio; + } else throw new Error(`Unknown resizeMethod '${resizeMethod}'`); + } + info.srcX = (file.width - info.srcWidth) / 2; + info.srcY = (file.height - info.srcHeight) / 2; + info.trgWidth = width; + info.trgHeight = height; + return info; + }, + /** + * Can be used to transform the file (for example, resize an image if necessary). + * + * The default implementation uses `resizeWidth` and `resizeHeight` (if provided) and resizes + * images according to those dimensions. + * + * Gets the `file` as the first parameter, and a `done()` function as the second, that needs + * to be invoked with the file when the transformation is done. + */ transformFile (file, done) { + if ((this.options.resizeWidth || this.options.resizeHeight) && file.type.match(/image.*/)) return this.resizeImage(file, this.options.resizeWidth, this.options.resizeHeight, this.options.resizeMethod, done); + else return done(file); + }, + /** + * A string that contains the template used for each dropped + * file. Change it to fulfill your needs but make sure to properly + * provide all elements. + * + * If you want to use an actual HTML element instead of providing a String + * as a config option, you could create a div with the id `tpl`, + * put the template inside it and provide the element like this: + * + * document + * .querySelector('#tpl') + * .innerHTML + * + */ previewTemplate: (0, (/*@__PURE__*/$parcel$interopDefault($6ad14d34cb5b5425$exports))), + /* + Those functions register themselves to the events on init and handle all + the user interface specific stuff. Overwriting them won't break the upload + but can break the way it's displayed. + You can overwrite them if you don't like the default behavior. If you just + want to add an additional event handler, register it on the dropzone object + and don't overwrite those options. + */ // Those are self explanatory and simply concern the DragnDrop. + drop (e) { + return this.element.classList.remove("dz-drag-hover"); + }, + dragstart (e) {}, + dragend (e) { + return this.element.classList.remove("dz-drag-hover"); + }, + dragenter (e) { + return this.element.classList.add("dz-drag-hover"); + }, + dragover (e) { + return this.element.classList.add("dz-drag-hover"); + }, + dragleave (e) { + return this.element.classList.remove("dz-drag-hover"); + }, + paste (e) {}, + // Called whenever there are no files left in the dropzone anymore, and the + // dropzone should be displayed as if in the initial state. + reset () { + return this.element.classList.remove("dz-started"); + }, + // Called when a file is added to the queue + // Receives `file` + addedfile (file) { + if (this.element === this.previewsContainer) this.element.classList.add("dz-started"); + if (this.previewsContainer && !this.options.disablePreviews) { + file.previewElement = (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).createElement(this.options.previewTemplate.trim()); + file.previewTemplate = file.previewElement; // Backwards compatibility + this.previewsContainer.appendChild(file.previewElement); + for (var node of file.previewElement.querySelectorAll("[data-dz-name]"))node.textContent = file.name; + for (node of file.previewElement.querySelectorAll("[data-dz-size]"))node.innerHTML = this.filesize(file.size); + if (this.options.addRemoveLinks) { + file._removeLink = (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).createElement(`${this.options.dictRemoveFile}`); + file.previewElement.appendChild(file._removeLink); + } + let removeFileEvent = (e)=>{ + e.preventDefault(); + e.stopPropagation(); + if (file.status === (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).UPLOADING) return (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).confirm(this.options.dictCancelUploadConfirmation, ()=>this.removeFile(file)); + else { + if (this.options.dictRemoveFileConfirmation) return (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).confirm(this.options.dictRemoveFileConfirmation, ()=>this.removeFile(file)); + else return this.removeFile(file); + } + }; + for (let removeLink of file.previewElement.querySelectorAll("[data-dz-remove]"))removeLink.addEventListener("click", removeFileEvent); + } + }, + // Called whenever a file is removed. + removedfile (file) { + if (file.previewElement != null && file.previewElement.parentNode != null) file.previewElement.parentNode.removeChild(file.previewElement); + return this._updateMaxFilesReachedClass(); + }, + // Called when a thumbnail has been generated + // Receives `file` and `dataUrl` + thumbnail (file, dataUrl) { + if (file.previewElement) { + file.previewElement.classList.remove("dz-file-preview"); + for (let thumbnailElement of file.previewElement.querySelectorAll("[data-dz-thumbnail]")){ + thumbnailElement.alt = file.name; + thumbnailElement.src = dataUrl; + } + return setTimeout(()=>file.previewElement.classList.add("dz-image-preview"), 1); + } + }, + // Called whenever an error occurs + // Receives `file` and `message` + error (file, message) { + if (file.previewElement) { + file.previewElement.classList.add("dz-error"); + if (typeof message !== "string" && message.error) message = message.error; + for (let node of file.previewElement.querySelectorAll("[data-dz-errormessage]"))node.textContent = message; + } + }, + errormultiple () {}, + // Called when a file gets processed. Since there is a queue, not all added + // files are processed immediately. + // Receives `file` + processing (file) { + if (file.previewElement) { + file.previewElement.classList.add("dz-processing"); + if (file._removeLink) return file._removeLink.innerHTML = this.options.dictCancelUpload; + } + }, + processingmultiple () {}, + // Called whenever the upload progress gets updated. + // Receives `file`, `progress` (percentage 0-100) and `bytesSent`. + // To get the total number of bytes of the file, use `file.size` + uploadprogress (file, progress, bytesSent) { + if (file.previewElement) for (let node of file.previewElement.querySelectorAll("[data-dz-uploadprogress]"))node.nodeName === "PROGRESS" ? node.value = progress : node.style.width = `${progress}%`; + }, + // Called whenever the total upload progress gets updated. + // Called with totalUploadProgress (0-100), totalBytes and totalBytesSent + totaluploadprogress () {}, + // Called just before the file is sent. Gets the `xhr` object as second + // parameter, so you can modify it (for example to add a CSRF token) and a + // `formData` object to add additional information. + sending () {}, + sendingmultiple () {}, + // When the complete upload is finished and successful + // Receives `file` + success (file) { + if (file.previewElement) return file.previewElement.classList.add("dz-success"); + }, + successmultiple () {}, + // When the upload is canceled. + canceled (file) { + return this.emit("error", file, this.options.dictUploadCanceled); + }, + canceledmultiple () {}, + // When the upload is finished, either with success or an error. + // Receives `file` + complete (file) { + if (file._removeLink) file._removeLink.innerHTML = this.options.dictRemoveFile; + if (file.previewElement) return file.previewElement.classList.add("dz-complete"); + }, + completemultiple () {}, + maxfilesexceeded () {}, + maxfilesreached () {}, + queuecomplete () {}, + addedfiles () {} +}; +var $4ca367182776f80b$export$2e2bcd8739ae039 = $4ca367182776f80b$var$defaultOptions; + + +class $3ed269f2f0fb224b$export$2e2bcd8739ae039 extends (0, $4040acfd8584338d$export$2e2bcd8739ae039) { + static initClass() { + // Exposing the emitter class, mainly for tests + this.prototype.Emitter = (0, $4040acfd8584338d$export$2e2bcd8739ae039); + /* + This is a list of all available events you can register on a dropzone object. + + You can register an event handler like this: + + dropzone.on("dragEnter", function() { }); + + */ this.prototype.events = [ + "drop", + "dragstart", + "dragend", + "dragenter", + "dragover", + "dragleave", + "addedfile", + "addedfiles", + "removedfile", + "thumbnail", + "error", + "errormultiple", + "processing", + "processingmultiple", + "uploadprogress", + "totaluploadprogress", + "sending", + "sendingmultiple", + "success", + "successmultiple", + "canceled", + "canceledmultiple", + "complete", + "completemultiple", + "reset", + "maxfilesexceeded", + "maxfilesreached", + "queuecomplete" + ]; + this.prototype._thumbnailQueue = []; + this.prototype._processingThumbnail = false; + } + constructor(el, options){ + super(); + let fallback, left; + this.element = el; + this.clickableElements = []; + this.listeners = []; + this.files = []; // All files + if (typeof this.element === "string") this.element = document.querySelector(this.element); + // make sure we actually have an HTML Element + if (this.element === null || !this.element instanceof HTMLElement) throw new Error("Invalid dropzone element: not an instance of HTMLElement."); + if (this.element.dropzone) throw new Error("Dropzone already attached."); + // Now add this dropzone to the instances. + $3ed269f2f0fb224b$export$2e2bcd8739ae039.instances.push(this); + // Put the dropzone inside the element itself. + this.element.dropzone = this; + let elementOptions = (left = $3ed269f2f0fb224b$export$2e2bcd8739ae039.optionsForElement(this.element)) != null ? left : {}; + this.options = Object.assign({}, (0, $4ca367182776f80b$export$2e2bcd8739ae039), elementOptions, options != null ? options : {}); + this.options.previewTemplate = this.options.previewTemplate.replace(/\n*/g, ""); + // If the browser failed, just call the fallback and leave + if (this.options.forceFallback || !$3ed269f2f0fb224b$export$2e2bcd8739ae039.isBrowserSupported()) return this.options.fallback.call(this); + // @options.url = @element.getAttribute "action" unless @options.url? + if (this.options.url == null) this.options.url = this.element.getAttribute("action"); + if (!this.options.url) throw new Error("No URL provided."); + if (this.options.uploadMultiple && this.options.chunking) throw new Error("You cannot set both: uploadMultiple and chunking."); + if (this.options.binaryBody && this.options.uploadMultiple) throw new Error("You cannot set both: binaryBody and uploadMultiple."); + if (typeof this.options.method === "string") this.options.method = this.options.method.toUpperCase(); + if ((fallback = this.getExistingFallback()) && fallback.parentNode) // Remove the fallback + fallback.parentNode.removeChild(fallback); + // Display previews in the previewsContainer element or the Dropzone element unless explicitly set to false + if (this.options.previewsContainer !== false) { + if (this.options.previewsContainer) this.previewsContainer = $3ed269f2f0fb224b$export$2e2bcd8739ae039.getElement(this.options.previewsContainer, "previewsContainer"); + else this.previewsContainer = this.element; + } + if (this.options.clickable) { + if (this.options.clickable === true) this.clickableElements = [ + this.element + ]; + else this.clickableElements = $3ed269f2f0fb224b$export$2e2bcd8739ae039.getElements(this.options.clickable, "clickable"); + } + this.init(); + } + // Returns all files that have been accepted + getAcceptedFiles() { + return this.files.filter((file)=>file.accepted).map((file)=>file); + } + // Returns all files that have been rejected + // Not sure when that's going to be useful, but added for completeness. + getRejectedFiles() { + return this.files.filter((file)=>!file.accepted).map((file)=>file); + } + getFilesWithStatus(status) { + return this.files.filter((file)=>file.status === status).map((file)=>file); + } + // Returns all files that are in the queue + getQueuedFiles() { + return this.getFilesWithStatus($3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED); + } + getUploadingFiles() { + return this.getFilesWithStatus($3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING); + } + getAddedFiles() { + return this.getFilesWithStatus($3ed269f2f0fb224b$export$2e2bcd8739ae039.ADDED); + } + // Files that are either queued or uploading + getActiveFiles() { + return this.files.filter((file)=>file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING || file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED).map((file)=>file); + } + // The function that gets called when Dropzone is initialized. You + // can (and should) setup event listeners inside this function. + init() { + // In case it isn't set already + if (this.element.tagName === "form") this.element.setAttribute("enctype", "multipart/form-data"); + if (this.element.classList.contains("dropzone") && !this.element.querySelector(".dz-message")) this.element.appendChild($3ed269f2f0fb224b$export$2e2bcd8739ae039.createElement(`
`)); + if (this.clickableElements.length) { + let setupHiddenFileInput = ()=>{ + if (this.hiddenFileInput) this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput); + this.hiddenFileInput = document.createElement("input"); + this.hiddenFileInput.setAttribute("type", "file"); + this.hiddenFileInput.setAttribute("form", this.element.id); + if (this.options.maxFiles === null || this.options.maxFiles > 1) this.hiddenFileInput.setAttribute("multiple", "multiple"); + this.hiddenFileInput.className = "dz-hidden-input"; + if (this.options.acceptedFiles !== null) this.hiddenFileInput.setAttribute("accept", this.options.acceptedFiles); + if (this.options.capture !== null) this.hiddenFileInput.setAttribute("capture", this.options.capture); + // Making sure that no one can "tab" into this field. + this.hiddenFileInput.setAttribute("tabindex", "-1"); + // Add arialabel for a11y + this.hiddenFileInput.setAttribute("aria-label", "dropzone hidden input"); + // Not setting `display="none"` because some browsers don't accept clicks + // on elements that aren't displayed. + this.hiddenFileInput.style.visibility = "hidden"; + this.hiddenFileInput.style.position = "absolute"; + this.hiddenFileInput.style.top = "0"; + this.hiddenFileInput.style.left = "0"; + this.hiddenFileInput.style.height = "0"; + this.hiddenFileInput.style.width = "0"; + $3ed269f2f0fb224b$export$2e2bcd8739ae039.getElement(this.options.hiddenInputContainer, "hiddenInputContainer").appendChild(this.hiddenFileInput); + this.hiddenFileInput.addEventListener("change", ()=>{ + let { files: files } = this.hiddenFileInput; + if (files.length) for (let file of files)this.addFile(file); + this.emit("addedfiles", files); + setupHiddenFileInput(); + }); + }; + setupHiddenFileInput(); + } + this.URL = window.URL !== null ? window.URL : window.webkitURL; + // Setup all event listeners on the Dropzone object itself. + // They're not in @setupEventListeners() because they shouldn't be removed + // again when the dropzone gets disabled. + for (let eventName of this.events)this.on(eventName, this.options[eventName]); + this.on("uploadprogress", ()=>this.updateTotalUploadProgress()); + this.on("removedfile", ()=>this.updateTotalUploadProgress()); + this.on("canceled", (file)=>this.emit("complete", file)); + // Emit a `queuecomplete` event if all files finished uploading. + this.on("complete", (file)=>{ + if (this.getAddedFiles().length === 0 && this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) // This needs to be deferred so that `queuecomplete` really triggers after `complete` + return setTimeout(()=>this.emit("queuecomplete"), 0); + }); + const containsFiles = function(e) { + return e.dataTransfer.types && e.dataTransfer.types.includes("Files"); + }; + let noPropagation = function(e) { + // If there are no files, we don't want to stop + // propagation so we don't interfere with other + // drag and drop behaviour. + if (!containsFiles(e)) return; + e.stopPropagation(); + return e.preventDefault(); + }; + // Create the listeners + this.listeners = [ + { + element: this.element, + events: { + dragstart: (e)=>{ + return this.emit("dragstart", e); + }, + dragenter: (e)=>{ + noPropagation(e); + return this.emit("dragenter", e); + }, + dragover: (e)=>{ + // Makes it possible to drag files from chrome's download bar + // http://stackoverflow.com/questions/19526430/drag-and-drop-file-uploads-from-chrome-downloads-bar + const efct = e.dataTransfer.effectAllowed; + e.dataTransfer.dropEffect = "move" === efct || "linkMove" === efct ? "move" : "copy"; + noPropagation(e); + return this.emit("dragover", e); + }, + dragleave: (e)=>{ + return this.emit("dragleave", e); + }, + drop: (e)=>{ + noPropagation(e); + return this.drop(e); + }, + dragend: (e)=>{ + return this.emit("dragend", e); + } + } + } + ]; + this.clickableElements.forEach((clickableElement)=>{ + return this.listeners.push({ + element: clickableElement, + events: { + click: (evt)=>{ + // Only the actual dropzone or the message element should trigger file selection + if (clickableElement !== this.element || evt.target === this.element || $3ed269f2f0fb224b$export$2e2bcd8739ae039.elementInside(evt.target, this.element.querySelector(".dz-message"))) this.hiddenFileInput.click(); // Forward the click + return true; + } + } + }); + }); + this.enable(); + return this.options.init.call(this); + } + // Not fully tested yet + destroy() { + this.disable(); + this.removeAllFiles(true); + if (this.hiddenFileInput != null ? this.hiddenFileInput.parentNode : undefined) { + this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput); + this.hiddenFileInput = null; + } + delete this.element.dropzone; + return $3ed269f2f0fb224b$export$2e2bcd8739ae039.instances.splice($3ed269f2f0fb224b$export$2e2bcd8739ae039.instances.indexOf(this), 1); + } + updateTotalUploadProgress() { + let totalUploadProgress; + let totalBytesSent = 0; + let totalBytes = 0; + let activeFiles = this.getActiveFiles(); + if (activeFiles.length) { + for (let file of this.getActiveFiles()){ + totalBytesSent += file.upload.bytesSent; + totalBytes += file.upload.total; + } + totalUploadProgress = 100 * totalBytesSent / totalBytes; + } else totalUploadProgress = 100; + return this.emit("totaluploadprogress", totalUploadProgress, totalBytes, totalBytesSent); + } + // @options.paramName can be a function taking one parameter rather than a string. + // A parameter name for a file is obtained simply by calling this with an index number. + _getParamName(n) { + if (typeof this.options.paramName === "function") return this.options.paramName(n); + else return `${this.options.paramName}${this.options.uploadMultiple ? `[${n}]` : ""}`; + } + // If @options.renameFile is a function, + // the function will be used to rename the file.name before appending it to the formData. + // MacOS 14+ screenshots contain narrow non-breaking space (U+202F) characters in filenames + // (e.g., "Screenshot 2024-01-30 at 10.32.07 AM.png" where the space after "07" and before "AM" is U+202F). + // This function now replaces these with regular spaces to prevent upload issues and maintain compatibility with MacOS + _renameFile(file) { + const cleanFile = { + ...file, + name: file.name.replace(/\u202F/g, " ") + }; + if (typeof this.options.renameFile !== "function") return cleanFile.name; + return this.options.renameFile(cleanFile); + } + // Returns a form that can be used as fallback if the browser does not support DragnDrop + // + // If the dropzone is already a form, only the input field and button are returned. Otherwise a complete form element is provided. + // This code has to pass in IE7 :( + getFallbackForm() { + let existingFallback, form; + if (existingFallback = this.getExistingFallback()) return existingFallback; + let fieldsString = '
'; + if (this.options.dictFallbackText) fieldsString += `

${this.options.dictFallbackText}

`; + fieldsString += `
`; + let fields = $3ed269f2f0fb224b$export$2e2bcd8739ae039.createElement(fieldsString); + if (this.element.tagName !== "FORM") { + form = $3ed269f2f0fb224b$export$2e2bcd8739ae039.createElement(`
`); + form.appendChild(fields); + } else { + // Make sure that the enctype and method attributes are set properly + this.element.setAttribute("enctype", "multipart/form-data"); + this.element.setAttribute("method", this.options.method); + } + return form != null ? form : fields; + } + // Returns the fallback elements if they exist already + // + // This code has to pass in IE7 :( + getExistingFallback() { + let getFallback = function(elements) { + for (let el of elements){ + if (/(^| )fallback($| )/.test(el.className)) return el; + } + }; + for (let tagName of [ + "div", + "form" + ]){ + var fallback; + if (fallback = getFallback(this.element.getElementsByTagName(tagName))) return fallback; + } + } + // Activates all listeners stored in @listeners + setupEventListeners() { + return this.listeners.map((elementListeners)=>(()=>{ + let result = []; + for(let event in elementListeners.events){ + let listener = elementListeners.events[event]; + result.push(elementListeners.element.addEventListener(event, listener, false)); + } + return result; + })()); + } + // Deactivates all listeners stored in @listeners + removeEventListeners() { + return this.listeners.map((elementListeners)=>(()=>{ + let result = []; + for(let event in elementListeners.events){ + let listener = elementListeners.events[event]; + result.push(elementListeners.element.removeEventListener(event, listener, false)); + } + return result; + })()); + } + // Removes all event listeners and cancels all files in the queue or being processed. + disable() { + this.clickableElements.forEach((element)=>element.classList.remove("dz-clickable")); + this.removeEventListeners(); + this.disabled = true; + return this.files.map((file)=>this.cancelUpload(file)); + } + enable() { + delete this.disabled; + this.clickableElements.forEach((element)=>element.classList.add("dz-clickable")); + return this.setupEventListeners(); + } + // Returns a nicely formatted filesize + filesize(size) { + let selectedSize = 0; + let selectedUnit = "b"; + if (size > 0) { + let units = [ + "tb", + "gb", + "mb", + "kb", + "b" + ]; + for(let i = 0; i < units.length; i++){ + let unit = units[i]; + let cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10; + if (size >= cutoff) { + selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i); + selectedUnit = unit; + break; + } + } + selectedSize = Math.round(10 * selectedSize) / 10; // Cutting of digits + } + return `${selectedSize} ${this.options.dictFileSizeUnits[selectedUnit]}`; + } + // Adds or removes the `dz-max-files-reached` class from the form. + _updateMaxFilesReachedClass() { + if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) { + if (this.getAcceptedFiles().length === this.options.maxFiles) this.emit("maxfilesreached", this.files); + return this.element.classList.add("dz-max-files-reached"); + } else return this.element.classList.remove("dz-max-files-reached"); + } + drop(e) { + if (!e.dataTransfer) return; + this.emit("drop", e); + // Convert the FileList to an Array + // This is necessary for IE11 + let files = []; + for(let i = 0; i < e.dataTransfer.files.length; i++)files[i] = e.dataTransfer.files[i]; + // Even if it's a folder, files.length will contain the folders. + if (files.length) { + let { items: items } = e.dataTransfer; + if (items && items.length && items[0].webkitGetAsEntry != null) // The browser supports dropping of folders, so handle items instead of files + this._addFilesFromItems(items); + else this.handleFiles(files); + } + this.emit("addedfiles", files); + } + paste(e) { + if ($3ed269f2f0fb224b$var$__guard__(e != null ? e.clipboardData : undefined, (x)=>x.items) == null) return; + this.emit("paste", e); + let { items: items } = e.clipboardData; + if (items.length) return this._addFilesFromItems(items); + } + handleFiles(files) { + for (let file of files)this.addFile(file); + } + // When a folder is dropped (or files are pasted), items must be handled + // instead of files. + _addFilesFromItems(items) { + return (()=>{ + let result = []; + for (let item of items){ + var entry; + if (item.webkitGetAsEntry != null && (entry = item.webkitGetAsEntry())) { + if (entry.isFile) result.push(this.addFile(item.getAsFile())); + else if (entry.isDirectory) // Append all files from that directory to files + result.push(this._addFilesFromDirectory(entry, entry.name)); + else result.push(undefined); + } else if (item.getAsFile != null) { + if (item.kind == null || item.kind === "file") result.push(this.addFile(item.getAsFile())); + else result.push(undefined); + } else result.push(undefined); + } + return result; + })(); + } + // Goes through the directory, and adds each file it finds recursively + _addFilesFromDirectory(directory, path) { + let dirReader = directory.createReader(); + let errorHandler = (error)=>$3ed269f2f0fb224b$var$__guardMethod__(console, "log", (o)=>o.log(error)); + var readEntries = ()=>{ + return dirReader.readEntries((entries)=>{ + if (entries.length > 0) { + for (let entry of entries){ + if (entry.isFile) entry.file((file)=>{ + if (this.options.ignoreHiddenFiles && file.name.substring(0, 1) === ".") return; + file.fullPath = `${path}/${file.name}`; + return this.addFile(file); + }); + else if (entry.isDirectory) this._addFilesFromDirectory(entry, `${path}/${entry.name}`); + } + // Recursively call readEntries() again, since browser only handle + // the first 100 entries. + // See: https://developer.mozilla.org/en-US/docs/Web/API/DirectoryReader#readEntries + readEntries(); + } + return null; + }, errorHandler); + }; + return readEntries(); + } + // If `done()` is called without argument the file is accepted + // If you call it with an error message, the file is rejected + // (This allows for asynchronous validation) + // + // This function checks the filesize, and if the file.type passes the + // `acceptedFiles` check. + accept(file, done) { + if (this.options.maxFilesize && file.size > this.options.maxFilesize * 1048576) done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize)); + else if (!$3ed269f2f0fb224b$export$2e2bcd8739ae039.isValidFile(file, this.options.acceptedFiles)) done(this.options.dictInvalidFileType); + else if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) { + done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}", this.options.maxFiles)); + this.emit("maxfilesexceeded", file); + } else this.options.accept.call(this, file, done); + } + addFile(file) { + file.upload = { + // note: this only works if window.isSecureContext is true, which includes localhost in http + uuid: window.isSecureContext ? self.crypto.randomUUID() : $3ed269f2f0fb224b$export$2e2bcd8739ae039.uuidv4(), + progress: 0, + // Setting the total upload size to file.size for the beginning + // It's actual different than the size to be transmitted. + total: file.size, + bytesSent: 0, + filename: this._renameFile(file) + }; + this.files.push(file); + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.ADDED; + this.emit("addedfile", file); + this._enqueueThumbnail(file); + this.accept(file, (error)=>{ + if (error) { + file.accepted = false; + this._errorProcessing([ + file + ], error); // Will set the file.status + } else { + file.accepted = true; + if (this.options.autoQueue) this.enqueueFile(file); + // Will set .accepted = true + } + this._updateMaxFilesReachedClass(); + }); + } + // Wrapper for enqueueFile + enqueueFiles(files) { + for (let file of files)this.enqueueFile(file); + return null; + } + enqueueFile(file) { + if (file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.ADDED && file.accepted === true) { + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED; + if (this.options.autoProcessQueue) return setTimeout(()=>this.processQueue(), 0); // Deferring the call + } else throw new Error("This file can't be queued because it has already been processed or was rejected."); + } + _enqueueThumbnail(file) { + if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1048576) { + this._thumbnailQueue.push(file); + return setTimeout(()=>this._processThumbnailQueue(), 0); // Deferring the call + } + } + _processThumbnailQueue() { + if (this._processingThumbnail || this._thumbnailQueue.length === 0) return; + this._processingThumbnail = true; + let file = this._thumbnailQueue.shift(); + return this.createThumbnail(file, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, true, (dataUrl)=>{ + this.emit("thumbnail", file, dataUrl); + this._processingThumbnail = false; + return this._processThumbnailQueue(); + }); + } + // Can be called by the user to remove a file + removeFile(file) { + if (file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING) this.cancelUpload(file); + this.files = $3ed269f2f0fb224b$var$without(this.files, file); + this.emit("removedfile", file); + if (this.files.length === 0) return this.emit("reset"); + } + // Removes all files that aren't currently processed from the list + removeAllFiles(cancelIfNecessary) { + // Create a copy of files since removeFile() changes the @files array. + if (cancelIfNecessary == null) cancelIfNecessary = false; + for (let file of this.files.slice())if (file.status !== $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING || cancelIfNecessary) this.removeFile(file); + return null; + } + // Resizes an image before it gets sent to the server. This function is the default behavior of + // `options.transformFile` if `resizeWidth` or `resizeHeight` are set. The callback is invoked with + // the resized blob. + resizeImage(file, width, height, resizeMethod, callback) { + return this.createThumbnail(file, width, height, resizeMethod, true, (dataUrl, canvas)=>{ + if (canvas == null) // The image has not been resized + return callback(file); + else { + let { resizeMimeType: resizeMimeType } = this.options; + if (resizeMimeType == null) resizeMimeType = file.type; + let resizedDataURL = canvas.toDataURL(resizeMimeType, this.options.resizeQuality); + if (resizeMimeType === "image/jpeg" || resizeMimeType === "image/jpg") // Now add the original EXIF information + resizedDataURL = $3ed269f2f0fb224b$var$restoreExif(file.dataURL, resizedDataURL); + return callback($3ed269f2f0fb224b$export$2e2bcd8739ae039.dataURItoBlob(resizedDataURL)); + } + }, true); + } + createThumbnail(file, width, height, resizeMethod, fixOrientation, callback, ignoreExif = false) { + let fileReader = new FileReader(); + fileReader.onload = ()=>{ + file.dataURL = fileReader.result; + // Don't bother creating a thumbnail for SVG images since they're vector + if (file.type === "image/svg+xml") { + if (callback != null) callback(fileReader.result); + return; + } + this.createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, undefined, ignoreExif); + }; + fileReader.readAsDataURL(file); + } + // `mockFile` needs to have these attributes: + // + // { name: 'name', size: 12345, imageUrl: '' } + // + // `callback` will be invoked when the image has been downloaded and displayed. + // `crossOrigin` will be added to the `img` tag when accessing the file. + displayExistingFile(mockFile, imageUrl, callback, crossOrigin, resizeThumbnail = true) { + this.emit("addedfile", mockFile); + this.emit("complete", mockFile); + if (!resizeThumbnail) { + this.emit("thumbnail", mockFile, imageUrl); + if (callback) callback(); + } else { + let onDone = (thumbnail)=>{ + this.emit("thumbnail", mockFile, thumbnail); + if (callback) callback(); + }; + mockFile.dataURL = imageUrl; + this.createThumbnailFromUrl(mockFile, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, this.options.fixOrientation, onDone, crossOrigin); + } + } + createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin, ignoreExif = false) { + // Not using `new Image` here because of a bug in latest Chrome versions. + // See https://github.com/enyo/dropzone/pull/226 + let img = document.createElement("img"); + if (crossOrigin) img.crossOrigin = crossOrigin; + // fixOrientation is not needed anymore with browsers handling imageOrientation + fixOrientation = getComputedStyle(document.body)["imageOrientation"] == "from-image" ? false : fixOrientation; + img.onload = ()=>{ + let loadExif = (callback)=>callback(1); + if (typeof EXIF !== "undefined" && EXIF !== null && fixOrientation) loadExif = (callback)=>EXIF.getData(img, function() { + return callback(EXIF.getTag(this, "Orientation")); + }); + return loadExif((orientation)=>{ + file.width = img.width; + file.height = img.height; + let resizeInfo = this.options.resize.call(this, file, width, height, resizeMethod); + let canvas = document.createElement("canvas"); + let ctx = canvas.getContext("2d"); + canvas.width = resizeInfo.trgWidth; + canvas.height = resizeInfo.trgHeight; + if (orientation > 4) { + canvas.width = resizeInfo.trgHeight; + canvas.height = resizeInfo.trgWidth; + } + switch(orientation){ + case 2: + // horizontal flip + ctx.translate(canvas.width, 0); + ctx.scale(-1, 1); + break; + case 3: + // 180° rotate left + ctx.translate(canvas.width, canvas.height); + ctx.rotate(Math.PI); + break; + case 4: + // vertical flip + ctx.translate(0, canvas.height); + ctx.scale(1, -1); + break; + case 5: + // vertical flip + 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.scale(1, -1); + break; + case 6: + // 90° rotate right + ctx.rotate(0.5 * Math.PI); + ctx.translate(0, -canvas.width); + break; + case 7: + // horizontal flip + 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.translate(canvas.height, -canvas.width); + ctx.scale(-1, 1); + break; + case 8: + // 90° rotate left + ctx.rotate(-0.5 * Math.PI); + ctx.translate(-canvas.height, 0); + break; + } + // This is a bugfix for iOS' scaling bug. + $3ed269f2f0fb224b$var$drawImageIOSFix(ctx, img, resizeInfo.srcX != null ? resizeInfo.srcX : 0, resizeInfo.srcY != null ? resizeInfo.srcY : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, resizeInfo.trgX != null ? resizeInfo.trgX : 0, resizeInfo.trgY != null ? resizeInfo.trgY : 0, resizeInfo.trgWidth, resizeInfo.trgHeight); + let thumbnail = canvas.toDataURL("image/png"); + if (callback != null) return callback(thumbnail, canvas); + }); + }; + if (callback != null) img.onerror = callback; + var dataURL = file.dataURL; + if (ignoreExif) dataURL = $3ed269f2f0fb224b$var$removeExif(dataURL); + return img.src = dataURL; + } + // Goes through the queue and processes files if there aren't too many already. + processQueue() { + let { parallelUploads: parallelUploads } = this.options; + let processingLength = this.getUploadingFiles().length; + let i = processingLength; + // There are already at least as many files uploading than should be + if (processingLength >= parallelUploads) return; + let queuedFiles = this.getQueuedFiles(); + if (!(queuedFiles.length > 0)) return; + if (this.options.uploadMultiple) // The files should be uploaded in one request + return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength)); + else while(i < parallelUploads){ + if (!queuedFiles.length) return; + // Nothing left to process + this.processFile(queuedFiles.shift()); + i++; + } + } + // Wrapper for `processFiles` + processFile(file) { + return this.processFiles([ + file + ]); + } + // Loads the file, then calls finishedLoading() + processFiles(files) { + for (let file of files){ + file.processing = true; // Backwards compatibility + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING; + this.emit("processing", file); + } + if (this.options.uploadMultiple) this.emit("processingmultiple", files); + return this.uploadFiles(files); + } + _getFilesWithXhr(xhr) { + let files; + return files = this.files.filter((file)=>file.xhr === xhr).map((file)=>file); + } + // Cancels the file upload and sets the status to CANCELED + // **if** the file is actually being uploaded. + // If it's still in the queue, the file is being removed from it and the status + // set to CANCELED. + cancelUpload(file) { + if (file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING) { + let groupedFiles = this._getFilesWithXhr(file.xhr); + for (let groupedFile of groupedFiles)groupedFile.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.CANCELED; + if (typeof file.xhr !== "undefined") file.xhr.abort(); + for (let groupedFile of groupedFiles)this.emit("canceled", groupedFile); + if (this.options.uploadMultiple) this.emit("canceledmultiple", groupedFiles); + } else if (file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.ADDED || file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED) { + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.CANCELED; + this.emit("canceled", file); + if (this.options.uploadMultiple) this.emit("canceledmultiple", [ + file + ]); + } + if (this.options.autoProcessQueue) return this.processQueue(); + } + resolveOption(option, ...args) { + if (typeof option === "function") return option.apply(this, args); + return option; + } + uploadFile(file) { + return this.uploadFiles([ + file + ]); + } + uploadFiles(files) { + this._transformFiles(files, (transformedFiles)=>{ + if (this.options.chunking) { + // Chunking is not allowed to be used with `uploadMultiple` so we know + // that there is only __one__file. + let transformedFile = transformedFiles[0]; + files[0].upload.chunked = this.options.chunking && (this.options.forceChunking || transformedFile.size > this.options.chunkSize); + files[0].upload.totalChunkCount = Math.ceil(transformedFile.size / this.options.chunkSize); + if (transformedFile.size === 0) files[0].upload.totalChunkCount = 1; + } + if (files[0].upload.chunked) { + // This file should be sent in chunks! + // If the chunking option is set, we **know** that there can only be **one** file, since + // uploadMultiple is not allowed with this option. + let file = files[0]; + let transformedFile = transformedFiles[0]; + file.upload.chunks = []; + let handleNextChunk = ()=>{ + let chunkIndex = 0; + // Find the next item in file.upload.chunks that is not defined yet. + while(file.upload.chunks[chunkIndex] !== undefined)chunkIndex++; + // This means, that all chunks have already been started. + if (chunkIndex >= file.upload.totalChunkCount) return; + let start = chunkIndex * this.options.chunkSize; + let end = Math.min(start + this.options.chunkSize, transformedFile.size); + let dataBlock = { + name: this._getParamName(0), + data: transformedFile.webkitSlice ? transformedFile.webkitSlice(start, end) : transformedFile.slice(start, end), + filename: file.upload.filename, + chunkIndex: chunkIndex + }; + file.upload.chunks[chunkIndex] = { + file: file, + index: chunkIndex, + dataBlock: dataBlock, + status: $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING, + progress: 0, + retries: 0 + }; + this._uploadData(files, [ + dataBlock + ]); + }; + file.upload.finishedChunkUpload = (chunk, response)=>{ + let allFinished = true; + chunk.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.SUCCESS; + // Clear the data from the chunk + chunk.dataBlock = null; + chunk.response = chunk.xhr.responseText; + chunk.responseHeaders = chunk.xhr.getAllResponseHeaders(); + // Leaving this reference to xhr will cause memory leaks. + chunk.xhr = null; + for(let i = 0; i < file.upload.totalChunkCount; i++){ + if (file.upload.chunks[i] === undefined) return handleNextChunk(); + if (file.upload.chunks[i].status !== $3ed269f2f0fb224b$export$2e2bcd8739ae039.SUCCESS) allFinished = false; + } + if (allFinished) this.options.chunksUploaded(file, ()=>{ + this._finished(files, response, null); + }); + }; + if (this.options.parallelChunkUploads) { + // we want to limit parallelChunkUploads to the same value as parallelUploads option + const parallelCount = Math.min(this.options.parallelChunkUploads === true ? this.options.parallelUploads : this.options.parallelChunkUploads, file.upload.totalChunkCount); + for(let i = 0; i < parallelCount; i++)handleNextChunk(); + } else handleNextChunk(); + } else { + let dataBlocks = []; + for(let i = 0; i < files.length; i++)dataBlocks[i] = { + name: this._getParamName(i), + data: transformedFiles[i], + filename: files[i].upload.filename + }; + this._uploadData(files, dataBlocks); + } + }); + } + /// Returns the right chunk for given file and xhr + _getChunk(file, xhr) { + for(let i = 0; i < file.upload.totalChunkCount; i++){ + if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].xhr === xhr) return file.upload.chunks[i]; + } + } + // This function actually uploads the file(s) to the server. + // + // If dataBlocks contains the actual data to upload (meaning, that this could + // either be transformed files, or individual chunks for chunked upload) then + // they will be used for the actual data to upload. + _uploadData(files, dataBlocks) { + let xhr = new XMLHttpRequest(); + // Put the xhr object in the file objects to be able to reference it later. + for (let file of files)file.xhr = xhr; + if (files[0].upload.chunked) // Put the xhr object in the right chunk object, so it can be associated + // later, and found with _getChunk. + files[0].upload.chunks[dataBlocks[0].chunkIndex].xhr = xhr; + let method = this.resolveOption(this.options.method, files, dataBlocks); + let url = this.resolveOption(this.options.url, files, dataBlocks); + xhr.open(method, url, true); + // Setting the timeout after open because of IE11 issue: https://gitlab.com/meno/dropzone/issues/8 + let timeout = this.resolveOption(this.options.timeout, files); + if (timeout) xhr.timeout = this.resolveOption(this.options.timeout, files); + // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179 + xhr.withCredentials = !!this.options.withCredentials; + xhr.onload = (e)=>{ + this._finishedUploading(files, xhr, e); + }; + xhr.ontimeout = ()=>{ + this._handleUploadError(files, xhr, `Request timedout after ${this.options.timeout / 1000} seconds`); + }; + xhr.onerror = ()=>{ + this._handleUploadError(files, xhr); + }; + // Some browsers do not have the .upload property + let progressObj = xhr.upload != null ? xhr.upload : xhr; + progressObj.onprogress = (e)=>this._updateFilesUploadProgress(files, xhr, e); + let headers = this.options.defaultHeaders ? { + Accept: "application/json", + "Cache-Control": "no-cache", + "X-Requested-With": "XMLHttpRequest" + } : {}; + if (this.options.binaryBody) headers["Content-Type"] = files[0].type; + if (this.options.headers) Object.assign(headers, this.options.headers); + for(let headerName in headers){ + let headerValue = headers[headerName]; + if (headerValue) xhr.setRequestHeader(headerName, headerValue); + } + if (this.options.binaryBody) { + // Since the file is going to be sent as binary body, it doesn't make + // any sense to generate `FormData` for it. + for (let file of files)this.emit("sending", file, xhr); + if (this.options.uploadMultiple) this.emit("sendingmultiple", files, xhr); + this.submitRequest(xhr, null, files); + } else { + let formData = new FormData(); + // Adding all @options parameters + if (this.options.params) { + let additionalParams = this.options.params; + if (typeof additionalParams === "function") additionalParams = additionalParams.call(this, files, xhr, files[0].upload.chunked ? this._getChunk(files[0], xhr) : null); + for(let key in additionalParams){ + let value = additionalParams[key]; + if (Array.isArray(value)) // The additional parameter contains an array, + // so lets iterate over it to attach each value + // individually. + for(let i = 0; i < value.length; i++)formData.append(key, value[i]); + else formData.append(key, value); + } + } + // Let the user add additional data if necessary + for (let file of files)this.emit("sending", file, xhr, formData); + if (this.options.uploadMultiple) this.emit("sendingmultiple", files, xhr, formData); + this._addFormElementData(formData); + // Finally add the files + // Has to be last because some servers (eg: S3) expect the file to be the last parameter + for(let i = 0; i < dataBlocks.length; i++){ + let dataBlock = dataBlocks[i]; + formData.append(dataBlock.name, dataBlock.data, dataBlock.filename); + } + this.submitRequest(xhr, formData, files); + } + } + // Transforms all files with this.options.transformFile and invokes done with the transformed files when done. + _transformFiles(files, done) { + let transformedFiles = []; + // Clumsy way of handling asynchronous calls, until I get to add a proper Future library. + let doneCounter = 0; + for(let i = 0; i < files.length; i++)this.options.transformFile.call(this, files[i], (transformedFile)=>{ + transformedFiles[i] = transformedFile; + if (++doneCounter === files.length) done(transformedFiles); + }); + } + // Takes care of adding other input elements of the form to the AJAX request + _addFormElementData(formData) { + // Take care of other input elements + if (this.element.tagName === "FORM") for (let input of this.element.querySelectorAll("input, textarea, select, button")){ + let inputName = input.getAttribute("name"); + let inputType = input.getAttribute("type"); + if (inputType) inputType = inputType.toLowerCase(); + // If the input doesn't have a name, we can't use it. + if (typeof inputName === "undefined" || inputName === null) continue; + if (input.tagName === "SELECT" && input.hasAttribute("multiple")) { + // Possibly multiple values + for (let option of input.options)if (option.selected) formData.append(inputName, option.value); + } else if (!inputType || inputType !== "checkbox" && inputType !== "radio" || input.checked) formData.append(inputName, input.value); + } + } + // Invoked when there is new progress information about given files. + // If e is not provided, it is assumed that the upload is finished. + _updateFilesUploadProgress(files, xhr, e) { + if (!files[0].upload.chunked) // Handle file uploads without chunking + for (let file of files){ + if (file.upload.total && file.upload.bytesSent && file.upload.bytesSent == file.upload.total) continue; + if (e) { + file.upload.progress = 100 * e.loaded / e.total; + file.upload.total = e.total; + file.upload.bytesSent = e.loaded; + } else { + // No event, so we're at 100% + file.upload.progress = 100; + file.upload.bytesSent = file.upload.total; + } + this.emit("uploadprogress", file, file.upload.progress, file.upload.bytesSent); + } + else { + // Handle chunked file uploads + // Chunked upload is not compatible with uploading multiple files in one + // request, so we know there's only one file. + let file = files[0]; + // Since this is a chunked upload, we need to update the appropriate chunk + // progress. + let chunk = this._getChunk(file, xhr); + if (e) { + chunk.progress = 100 * e.loaded / e.total; + chunk.total = e.total; + chunk.bytesSent = e.loaded; + } else { + // No event, so we're at 100% + chunk.progress = 100; + chunk.bytesSent = chunk.total; + } + // Now tally the *file* upload progress from its individual chunks + file.upload.progress = 0; + file.upload.total = 0; + file.upload.bytesSent = 0; + for(let i = 0; i < file.upload.totalChunkCount; i++)if (file.upload.chunks[i] && typeof file.upload.chunks[i].progress !== "undefined") { + file.upload.progress += file.upload.chunks[i].progress; + file.upload.total += file.upload.chunks[i].total; + file.upload.bytesSent += file.upload.chunks[i].bytesSent; + } + // Since the process is a percentage, we need to divide by the amount of + // chunks we've used. + file.upload.progress = file.upload.progress / file.upload.totalChunkCount; + this.emit("uploadprogress", file, file.upload.progress, file.upload.bytesSent); + } + } + _finishedUploading(files, xhr, e) { + let response; + if (files[0].status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.CANCELED) return; + if (xhr.readyState !== 4) return; + if (xhr.responseType !== "arraybuffer" && xhr.responseType !== "blob") { + response = xhr.responseText; + if (xhr.getResponseHeader("content-type") && ~xhr.getResponseHeader("content-type").indexOf("application/json")) try { + response = JSON.parse(response); + } catch (error) { + e = error; + response = "Invalid JSON response from server."; + } + } + this._updateFilesUploadProgress(files, xhr); + if (!(200 <= xhr.status && xhr.status < 300)) this._handleUploadError(files, xhr, response); + else if (files[0].upload.chunked) files[0].upload.finishedChunkUpload(this._getChunk(files[0], xhr), response); + else this._finished(files, response, e); + } + _handleUploadError(files, xhr, response) { + if (files[0].status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.CANCELED) return; + if (files[0].upload.chunked && this.options.retryChunks) { + let chunk = this._getChunk(files[0], xhr); + if (chunk.retries++ < this.options.retryChunksLimit) { + this._uploadData(files, [ + chunk.dataBlock + ]); + return; + } else console.warn("Retried this chunk too often. Giving up."); + } + this._errorProcessing(files, response || this.options.dictResponseError.replace("{{statusCode}}", xhr.status), xhr); + } + submitRequest(xhr, formData, files) { + if (xhr.readyState != 1) { + console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED."); + return; + } + if (this.options.binaryBody) { + if (files[0].upload.chunked) { + const chunk = this._getChunk(files[0], xhr); + xhr.send(chunk.dataBlock.data); + } else xhr.send(files[0]); + } else xhr.send(formData); + } + // Called internally when processing is finished. + // Individual callbacks have to be called in the appropriate sections. + _finished(files, responseText, e) { + for (let file of files){ + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.SUCCESS; + this.emit("success", file, responseText, e); + this.emit("complete", file); + } + if (this.options.uploadMultiple) { + this.emit("successmultiple", files, responseText, e); + this.emit("completemultiple", files); + } + if (this.options.autoProcessQueue) return this.processQueue(); + } + // Called internally when processing is finished. + // Individual callbacks have to be called in the appropriate sections. + _errorProcessing(files, message, xhr) { + for (let file of files){ + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.ERROR; + this.emit("error", file, message, xhr); + this.emit("complete", file); + } + if (this.options.uploadMultiple) { + this.emit("errormultiple", files, message, xhr); + this.emit("completemultiple", files); + } + if (this.options.autoProcessQueue) return this.processQueue(); + } + static uuidv4() { + return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c)=>(+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16)); + } +} +$3ed269f2f0fb224b$export$2e2bcd8739ae039.initClass(); +// This is a map of options for your different dropzones. Add configurations +// to this object for your different dropzone elements. +// +// Example: +// +// Dropzone.options.myDropzoneElementId = { maxFilesize: 1 }; +// +// And in html: +// +//
+$3ed269f2f0fb224b$export$2e2bcd8739ae039.options = {}; +// Returns the options for an element or undefined if none available. +$3ed269f2f0fb224b$export$2e2bcd8739ae039.optionsForElement = function(element) { + // Get the `Dropzone.options.elementId` for this element if it exists + if (element.getAttribute("id") && typeof $3ed269f2f0fb224b$export$2e2bcd8739ae039.options !== "undefined") return $3ed269f2f0fb224b$export$2e2bcd8739ae039.options[$3ed269f2f0fb224b$var$camelize(element.getAttribute("id"))]; + else return undefined; +}; +// Holds a list of all dropzone instances +$3ed269f2f0fb224b$export$2e2bcd8739ae039.instances = []; +// Returns the dropzone for given element if any +$3ed269f2f0fb224b$export$2e2bcd8739ae039.forElement = function(element) { + if (typeof element === "string") element = document.querySelector(element); + if ((element != null ? element.dropzone : undefined) == null) throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone."); + return element.dropzone; +}; +// Looks for all .dropzone elements and creates a dropzone for them +$3ed269f2f0fb224b$export$2e2bcd8739ae039.discover = function() { + let dropzones; + if (document.querySelectorAll) dropzones = document.querySelectorAll(".dropzone"); + else { + dropzones = []; + // IE :( + let checkElements = (elements)=>(()=>{ + let result = []; + for (let el of elements)if (/(^| )dropzone($| )/.test(el.className)) result.push(dropzones.push(el)); + else result.push(undefined); + return result; + })(); + checkElements(document.getElementsByTagName("div")); + checkElements(document.getElementsByTagName("form")); + } + return (()=>{ + let result = []; + for (let dropzone of dropzones)// Create a dropzone unless auto discover has been disabled for specific element + if ($3ed269f2f0fb224b$export$2e2bcd8739ae039.optionsForElement(dropzone) !== false) result.push(new $3ed269f2f0fb224b$export$2e2bcd8739ae039(dropzone)); + else result.push(undefined); + return result; + })(); +}; +// Checks if the browser is supported by simply checking if Promise is here: a good cutoff +$3ed269f2f0fb224b$export$2e2bcd8739ae039.isBrowserSupported = function() { + return typeof Promise !== "undefined"; +}; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.dataURItoBlob = function(dataURI) { + // convert base64 to raw binary data held in a string + // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this + let byteString = atob(dataURI.split(",")[1]); + // separate out the mime component + let mimeString = dataURI.split(",")[0].split(":")[1].split(";")[0]; + // write the bytes of the string to an ArrayBuffer + let ab = new ArrayBuffer(byteString.length); + let ia = new Uint8Array(ab); + for(let i = 0, end = byteString.length, asc = 0 <= end; asc ? i <= end : i >= end; asc ? i++ : i--)ia[i] = byteString.charCodeAt(i); + // write the ArrayBuffer to a blob + return new Blob([ + ab + ], { + type: mimeString + }); +}; +// Returns an array without the rejected item +const $3ed269f2f0fb224b$var$without = (list, rejectedItem)=>list.filter((item)=>item !== rejectedItem).map((item)=>item); +// abc-def_ghi -> abcDefGhi +const $3ed269f2f0fb224b$var$camelize = (str)=>str.replace(/[\-_](\w)/g, (match)=>match.charAt(1).toUpperCase()); +// Creates an element from string +$3ed269f2f0fb224b$export$2e2bcd8739ae039.createElement = function(string) { + let div = document.createElement("div"); + div.innerHTML = string; + return div.childNodes[0]; +}; +// Tests if given element is inside (or simply is) the container +$3ed269f2f0fb224b$export$2e2bcd8739ae039.elementInside = function(element, container) { + if (element === container) return true; + // Coffeescript doesn't support do/while loops + while(element = element.parentNode){ + if (element === container) return true; + } + return false; +}; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.getElement = function(el, name) { + let element; + if (typeof el === "string") element = document.querySelector(el); + else if (el.nodeType != null) element = el; + if (element == null) throw new Error(`Invalid \`${name}\` option provided. Please provide a CSS selector or a plain HTML element.`); + return element; +}; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.getElements = function(els, name) { + let el, elements; + if (els instanceof Array) { + elements = []; + try { + for (el of els)elements.push(this.getElement(el, name)); + } catch (e) { + elements = null; + } + } else if (typeof els === "string") { + elements = []; + for (el of document.querySelectorAll(els))elements.push(el); + } else if (els.nodeType != null) elements = [ + els + ]; + if (elements == null || !elements.length) throw new Error(`Invalid \`${name}\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`); + return elements; +}; +// Asks the user the question and calls accepted or rejected accordingly +// +// The default implementation just uses `window.confirm` and then calls the +// appropriate callback. +$3ed269f2f0fb224b$export$2e2bcd8739ae039.confirm = function(question, accepted, rejected) { + if (window.confirm(question)) return accepted(); + else if (rejected != null) return rejected(); +}; +// Validates the mime type like this: +// +// https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept +$3ed269f2f0fb224b$export$2e2bcd8739ae039.isValidFile = function(file, acceptedFiles) { + if (!acceptedFiles) return true; + // If there are no accepted mime types, it's OK + acceptedFiles = acceptedFiles.split(","); + let mimeType = file.type; + let baseMimeType = mimeType.replace(/\/.*$/, ""); + for (let validType of acceptedFiles){ + validType = validType.trim(); + if (validType.charAt(0) === ".") { + if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) return true; + } else if (/\/\*$/.test(validType)) { + // This is something like a image/* mime type + if (baseMimeType === validType.replace(/\/.*$/, "")) return true; + } else { + if (mimeType === validType) return true; + } + } + return false; +}; +// Augment jQuery +if (typeof jQuery !== "undefined" && jQuery !== null) jQuery.fn.dropzone = function(options) { + return this.each(function() { + return new $3ed269f2f0fb224b$export$2e2bcd8739ae039(this, options); + }); +}; +// Dropzone file status codes +$3ed269f2f0fb224b$export$2e2bcd8739ae039.ADDED = "added"; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED = "queued"; +// For backwards compatibility. Now, if a file is accepted, it's either queued +// or uploading. +$3ed269f2f0fb224b$export$2e2bcd8739ae039.ACCEPTED = $3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING = "uploading"; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.PROCESSING = $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING; // alias +$3ed269f2f0fb224b$export$2e2bcd8739ae039.CANCELED = "canceled"; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.ERROR = "error"; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.SUCCESS = "success"; +/* + + Bugfix for iOS 6 and 7 + Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios + based on the work of https://github.com/stomita/ios-imagefile-megapixel + + */ // Detecting vertical squash in loaded image. +// Fixes a bug which squash image vertically while drawing into canvas for some images. +// This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel +let $3ed269f2f0fb224b$var$detectVerticalSquash = function(img) { + let ih = img.naturalHeight; + let canvas = document.createElement("canvas"); + canvas.width = 1; + canvas.height = ih; + let ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0); + let { data: data } = ctx.getImageData(1, 0, 1, ih); + // search image edge pixel position in case it is squashed vertically. + let sy = 0; + let ey = ih; + let py = ih; + while(py > sy){ + let alpha = data[(py - 1) * 4 + 3]; + if (alpha === 0) ey = py; + else sy = py; + py = ey + sy >> 1; + } + let ratio = py / ih; + if (ratio === 0) return 1; + else return ratio; +}; +// A replacement for context.drawImage +// (args are for source and destination). +var $3ed269f2f0fb224b$var$drawImageIOSFix = function(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) { + let vertSquashRatio = $3ed269f2f0fb224b$var$detectVerticalSquash(img); + return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio); +}; +// Inspired by MinifyJpeg +// Source: http://www.perry.cz/files/ExifRestorer.js +// http://elicon.blog57.fc2.com/blog-entry-206.html +function $3ed269f2f0fb224b$var$removeExif(origFileBase64) { + var marker = "data:image/jpeg;base64,"; + if (!origFileBase64.startsWith(marker)) return origFileBase64; + var origFile = window.atob(origFileBase64.slice(marker.length)); + if (!origFile.startsWith("\xff\xd8\xff")) return origFileBase64; + // loop through the JPEG file segments and copy all but Exif segments into the filtered file. + var head = 0; + var filteredFile = ""; + while(head < origFile.length){ + if (origFile.slice(head, head + 2) == "\xff\xda") { + // this is the start of the image data, we don't expect exif data after that. + filteredFile += origFile.slice(head); + break; + } else if (origFile.slice(head, head + 2) == "\xff\xd8") { + // this is the global start marker. + filteredFile += origFile.slice(head, head + 2); + head += 2; + } else { + // we have a segment of variable size. + var length = origFile.charCodeAt(head + 2) * 256 + origFile.charCodeAt(head + 3); + var endPoint = head + length + 2; + var segment = origFile.slice(head, endPoint); + if (!segment.startsWith("\xff\xe1")) filteredFile += segment; + head = endPoint; + } + } + return marker + window.btoa(filteredFile); +} +function $3ed269f2f0fb224b$var$restoreExif(origFileBase64, resizedFileBase64) { + var marker = "data:image/jpeg;base64,"; + if (!(origFileBase64.startsWith(marker) && resizedFileBase64.startsWith(marker))) return resizedFileBase64; + var origFile = window.atob(origFileBase64.slice(marker.length)); + if (!origFile.startsWith("\xff\xd8\xff")) return resizedFileBase64; + // Go through the JPEG file segments one by one and collect any Exif segments we find. + var head = 0; + var exifData = ""; + while(head < origFile.length){ + if (origFile.slice(head, head + 2) == "\xff\xda") break; + else if (origFile.slice(head, head + 2) == "\xff\xd8") // this is the global start marker. + head += 2; + else { + // we have a segment of variable size. + var length = origFile.charCodeAt(head + 2) * 256 + origFile.charCodeAt(head + 3); + var endPoint = head + length + 2; + var segment = origFile.slice(head, endPoint); + if (segment.startsWith("\xff\xe1")) exifData += segment; + head = endPoint; + } + } + if (exifData == "") return resizedFileBase64; + var resizedFile = window.atob(resizedFileBase64.slice(marker.length)); + if (!resizedFile.startsWith("\xff\xd8\xff")) return resizedFileBase64; + // The first file segment is always header information so insert the Exif data as second segment. + var splitPoint = 4 + resizedFile.charCodeAt(4) * 256 + resizedFile.charCodeAt(5); + resizedFile = resizedFile.slice(0, splitPoint) + exifData + resizedFile.slice(splitPoint); + return marker + window.btoa(resizedFile); +} +function $3ed269f2f0fb224b$var$__guard__(value, transform) { + return typeof value !== "undefined" && value !== null ? transform(value) : undefined; +} +function $3ed269f2f0fb224b$var$__guardMethod__(obj, methodName, transform) { + if (typeof obj !== "undefined" && obj !== null && typeof obj[methodName] === "function") return transform(obj, methodName); + else return undefined; +} + + + +//# sourceMappingURL=dropzone.mjs.map + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ id: moduleId, +/******/ loaded: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ !function() { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function() { return module['default']; } : +/******/ function() { return module; }; +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ !function() { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/node module decorator */ +/******/ !function() { +/******/ __webpack_require__.nmd = function(module) { +/******/ module.paths = []; +/******/ if (!module.children) module.children = []; +/******/ return module; +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. +!function() { +"use strict"; +var exports = __webpack_exports__; +/*!***************************************************!*\ + !*** ./client/src/entwine/TinyMCE_sslink-file.js ***! + \***************************************************/ + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _TinyMCEActionRegistrar = _interopRequireDefault(__webpack_require__(/*! lib/TinyMCEActionRegistrar */ "lib/TinyMCEActionRegistrar")); +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _client = __webpack_require__(/*! react-dom/client */ "react-dom/client"); +var _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ "jquery")); +var _ShortcodeSerialiser = _interopRequireDefault(__webpack_require__(/*! lib/ShortcodeSerialiser */ "lib/ShortcodeSerialiser")); +var _InsertMediaModal = _interopRequireDefault(__webpack_require__(/*! containers/InsertMediaModal/InsertMediaModal */ "./client/src/containers/InsertMediaModal/InsertMediaModal.js")); +var _Injector = _interopRequireWildcard(__webpack_require__(/*! lib/Injector */ "lib/Injector")); +var modalActions = _interopRequireWildcard(__webpack_require__(/*! state/modal/ModalActions */ "./client/src/state/modal/ModalActions.js")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const commandName = 'sslinkfile'; +const plugin = { + init(editor) { + _TinyMCEActionRegistrar.default.addAction('sslink', { + text: _i18n.default._t('AssetAdmin.LINKLABEL_FILE', 'Link to a file'), + onAction: activeEditor => activeEditor.execCommand(commandName), + priority: 80 + }, editor.getParam('editorIdentifier')).addCommandWithUrlTest(commandName, /^\[file_link/); + editor.addCommand(commandName, () => { + const field = (0, _jquery.default)(`#${editor.id}`).entwine('ss'); + field.openLinkFileDialog(); + }); + } +}; +const modalId = 'insert-link__dialog-wrapper--file'; +const InjectableInsertMediaModal = (0, _Injector.loadComponent)(_InsertMediaModal.default); +_jquery.default.entwine('ss', $ => { + $('textarea.htmleditor').entwine({ + openLinkFileDialog() { + let dialog = $(`#${modalId}`); + if (!dialog.length) { + dialog = $(`
`); + $('body').append(dialog); + } + dialog.addClass('insert-link__dialog-wrapper'); + dialog.setElement(this); + dialog.open(); + } + }); + $(`.js-injector-boot #${modalId}`).entwine({ + ReactRoot: null, + renderModal(isOpen) { + var _this = this; + const { + dispatch + } = _Injector.default.reducer.store; + dispatch(modalActions.initFormStack('insert-link', 'admin')); + const handleHide = () => { + dispatch(modalActions.reset()); + this.close(); + }; + const handleInsert = function () { + return _this.handleInsert(...arguments); + }; + const attrs = this.getOriginalAttributes(); + const folderId = this.getFolderId(); + const requireLinkText = this.getRequireLinkText(); + let root = this.getReactRoot(); + if (!root) { + root = (0, _client.createRoot)(this[0]); + this.setReactRoot(root); + } + root.render(_react.default.createElement(InjectableInsertMediaModal, { + isOpen: isOpen, + type: "insert-link", + folderId: folderId, + onInsert: handleInsert, + onClosed: handleHide, + title: false, + bodyClassName: "modal__dialog", + className: "insert-link__dialog-wrapper--internal", + fileAttributes: attrs, + requireLinkText: requireLinkText + })); + }, + buildAttributes(data) { + const shortcode = _ShortcodeSerialiser.default.serialise({ + name: 'file_link', + properties: { + id: data.ID + } + }, true); + const anchor = data.Anchor && data.Anchor.length ? `#${data.Anchor}` : ''; + const href = `${shortcode}${anchor}`; + return { + href, + target: data.TargetBlank ? '_blank' : '', + title: data.Description + }; + }, + getFolderId() { + const $field = this.getElement(); + if (!$field) { + return null; + } + const folderId = Number($field.data('config').upload_folder_id); + return isNaN(folderId) ? null : folderId; + }, + getOriginalAttributes() { + const editor = this.getElement().getEditor(); + const node = $(editor.getSelectedNode()); + const hrefParts = (node.attr('href') || '').split('#'); + if (!hrefParts[0]) { + return {}; + } + const shortcode = _ShortcodeSerialiser.default.match('file_link', false, hrefParts[0]); + if (!shortcode) { + return {}; + } + return { + ID: shortcode.properties.id ? parseInt(shortcode.properties.id, 10) : 0, + Anchor: hrefParts[1] || '', + Description: node.attr('title'), + TargetBlank: !!node.attr('target') + }; + } + }); +}); +tinymce.PluginManager.add(commandName, editor => plugin.init(editor)); +var _default = exports["default"] = plugin; +}(); +/******/ })() +; +//# sourceMappingURL=TinyMCE_sslink-file.js.map \ No newline at end of file diff --git a/client/dist/js/TinyMCE_ssmedia.js b/client/dist/js/TinyMCE_ssmedia.js index e8eb943e3..91624fac4 100644 --- a/client/dist/js/TinyMCE_ssmedia.js +++ b/client/dist/js/TinyMCE_ssmedia.js @@ -1 +1,25803 @@ -!function(){var e={853:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=u(n(5815)),i=u(n(4600)),s=u(n(1669)),l=n(5716),a=u(n(6935));function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}let c=0;class p extends r.Component{constructor(e){super(e),this.dropzone=null,this.dragging=!1,this.handleAccept=this.handleAccept.bind(this),this.handleAddedFile=this.handleAddedFile.bind(this),this.handleDragEnter=this.handleDragEnter.bind(this),this.handleDragLeave=this.handleDragLeave.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleUploadComplete=this.handleUploadComplete.bind(this),this.handleError=this.handleError.bind(this),this.handleSending=this.handleSending.bind(this),this.handleSuccess=this.handleSuccess.bind(this),this.handleQueueComplete=this.handleQueueComplete.bind(this),this.loadImage=this.loadImage.bind(this),this.handleMaxFilesExceeded=this.handleMaxFilesExceeded.bind(this)}componentDidMount(){this.dropzone=new i.default(this.dropzoneRef,Object.assign({},this.getDefaultOptions(),this.props.options));const{name:e}=this.props;e&&this.dropzone.hiddenFileInput&&this.dropzone.hiddenFileInput.classList.add(`dz-input-${e}`),void 0!==this.props.promptOnRemove&&this.setPromptOnRemove(this.props.promptOnRemove)}componentDidUpdate(e){const{name:t}=this.props;t&&this.dropzone.hiddenFileInput&&this.dropzone.hiddenFileInput.classList.add(`dz-input-${t}`),this.props.canUpload&&e.options!==this.props.options&&this.dropzone&&(this.dropzone.enable(),this.dropzone.options=Object.assign({},this.getDefaultOptions(),this.dropzone.options,this.props.options))}componentWillUnmount(){this.dropzone.files=[],this.dropzone.destroy()}getDefaultOptions(){let e=null,t=this.props.uploadSelector;if(!t&&this.props.uploadButton&&(t=".asset-dropzone__upload-button"),t){const n=(0,s.default)(this.dropzoneRef).find(t);n&&n.length&&(e=n.toArray())}return{accept:this.handleAccept,addedfile:this.handleAddedFile,dragenter:this.handleDragEnter,dragleave:this.handleDragLeave,drop:this.handleDrop,maxfilesexceeded:this.handleMaxFilesExceeded,uploadprogress:this.handleUploadProgress,complete:this.handleUploadComplete,dictDefaultMessage:o.default._t("AssetAdmin.DROPZONE_DEFAULT_MESSAGE","Drop files here to upload"),dictFallbackMessage:o.default._t("AssetAdmin.DROPZONE_FALLBACK_MESSAGE","Your browser does not support drag'n'drop file uploads."),dictFallbackText:o.default._t("AssetAdmin.DROPZONE_FALLBACK_TEXT","Please use the fallback form below to upload your files like in the olden days."),dictInvalidFileType:o.default._t("AssetAdmin.DROPZONE_INVALID_FILE_TYPE","You can't upload files of this type."),dictResponseError:o.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error."),dictCancelUpload:o.default._t("AssetAdmin.DROPZONE_CANCEL_UPLOAD","Cancel upload"),dictCancelUploadConfirmation:o.default._t("AssetAdmin.DROPZONE_CANCEL_UPLOAD_CONFIRMATION","Are you sure you want to cancel this upload?"),dictRemoveFile:o.default._t("AssetAdmin.DROPZONE_REMOVE_FILE","Remove file"),dictMaxFilesExceeded:o.default._t("AssetAdmin.DROPZONE_MAX_FILES_EXCEEDED","You can not upload any more files."),error:this.handleError,sending:this.handleSending,success:this.handleSuccess,queuecomplete:this.handleQueueComplete,thumbnailHeight:150,thumbnailWidth:200,timeout:0,clickable:e}}getFileCategory(e){return e.split("/")[0]}getLoadPreview(e){return new Promise((t=>{const n=new FileReader;n.onload=n=>{if("image"===this.getFileCategory(e.type)){const e=new Image;t(this.loadImage(e,n.target.result))}else t({})},n.readAsDataURL(e)}))}getFileTitle(e){return e.replace(/[.][^.]+$/,"").replace(/-_/," ")}setPromptOnRemove(e){this.dropzone.options.dictRemoveFileConfirmation=e}handleDragEnter(e){this.props.canUpload&&(this.dragging=!0,this.forceUpdate(),"function"==typeof this.props.onDragEnter&&this.props.onDragEnter(e))}handleDragLeave(e){const t=this.dropzoneRef;this.props.canUpload&&e.target===t&&(this.dragging=!1,this.forceUpdate(),"function"==typeof this.props.onDragLeave&&this.props.onDragLeave(e,t))}handleUploadProgress(e,t,n){"function"==typeof this.props.onUploadProgress&&this.props.onUploadProgress(e,t,n)}handleUploadComplete(e){"function"==typeof this.props.onUploadComplete&&this.props.onUploadComplete(e.status)}handleDrop(e){this.dragging=!1,this.forceUpdate(),"function"==typeof this.props.onDrop&&this.props.onDrop(e)}handleSending(e,t,n){"function"==typeof this.props.updateFormData&&this.props.updateFormData(n),n.append("SecurityID",this.props.securityID),n.append("ParentID",this.props.folderId);const r=Object.assign({},t,{abort:()=>{this.dropzone.cancelUpload(e),t.abort()}});"function"==typeof this.props.onSending&&this.props.onSending(e,r,n)}handleMaxFilesExceeded(e){return"function"!=typeof this.props.onMaxFilesExceeded||this.props.onMaxFilesExceeded(e)}generateQueuedId(){return c+=1,c}handleAccept(e,t){return("function"!=typeof this.props.canFileUpload||this.props.canFileUpload(e))&&this.props.canUpload?t():t(o.default._t("AssetAdmin.DROPZONE_CANNOT_UPLOAD","Uploading not permitted."))}handleAddedFile(e){e._queuedId=this.generateQueuedId();const t={category:this.getFileCategory(e.type),filename:e.name,queuedId:e._queuedId,size:e.size,title:this.getFileTitle(e.name),extension:(0,l.getFileExtension)(e.name),type:e.type,uploadedToFolderId:this.props.folderId};this.props.onAddedFile(t);return this.getLoadPreview(e).then((e=>{const n={height:e.height,width:e.width,url:e.thumbnailURL,thumbnail:e.thumbnailURL,smallThumbnail:e.thumbnailURL};return"function"==typeof this.props.onPreviewLoaded&&this.props.onPreviewLoaded(t,n),{...t,...n}}))}loadImage(e,t){return new Promise((n=>{const r=document.createElement("canvas"),o=r.getContext("2d");e.onload=()=>{const t=2*this.props.preview.width,i=2*this.props.preview.height,s=e.naturalWidth/e.naturalHeight;e.naturalWidth{this.dropzoneRef=e}},this.props.uploadButton&&r.default.createElement("button",t,o.default._t("AssetAdmin.DROPZONE_UPLOAD")),this.props.children)}}p.propTypes={folderId:a.default.number.isRequired,onAccept:a.default.func,onAddedFile:a.default.func.isRequired,onDragEnter:a.default.func,onDragLeave:a.default.func,onDrop:a.default.func,onError:a.default.func.isRequired,onPreviewLoaded:a.default.func,onSending:a.default.func,onSuccess:a.default.func.isRequired,onMaxFilesExceeded:a.default.func,updateFormData:a.default.func,canFileUpload:a.default.func,onQueueComplete:a.default.func,options:a.default.shape({url:a.default.string.isRequired}),promptOnRemove:a.default.string,securityID:a.default.string.isRequired,uploadButton:a.default.bool,uploadSelector:a.default.string,canUpload:a.default.bool.isRequired,preview:a.default.shape({width:a.default.number,height:a.default.number}),className:a.default.string},p.defaultProps={uploadButton:!0};t.default=p},3229:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=c(n(5815)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),i=n(9040),s=n(5207),l=n(3556),a=c(n(6923)),u=c(n(6935));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function c(e){return e&&e.__esModule?e:{default:e}}class p extends o.Component{constructor(e){super(e),this.handleChangeValue=this.handleChangeValue.bind(this),this.renderChild=this.renderChild.bind(this)}getOptionByValue(e){return this.props.actions.find((t=>t.value===e))}handleChangeValue(e){let t=null;const n=this.getOptionByValue(e.target.value);return null===n?null:(t="function"==typeof n.confirm?n.confirm(this.props.items).then((()=>n.callback(e,this.props.items))).catch((e=>{if("cancelled"!==e)throw e})):n.callback(e,this.props.items)||Promise.resolve(),t)}renderChild(e,t){const n=(0,a.default)("bulk-actions__action",e.className||"font-icon-info-circled",{btn:t<2,"bulk-actions__action--more":t>2});return t<2?o.default.createElement(l.Button,{className:n,key:e.value,onClick:this.handleChangeValue,value:e.value,color:e.color},e.label):o.default.createElement(l.DropdownItem,{type:"button",className:n,key:e.value,onClick:this.handleChangeValue,value:e.value},e.label)}render(){if(!this.props.items.length)return null;let e=this.props.actions.filter((e=>!e.canApply||e.canApply(this.props.items)));if(e=e.map(this.renderChild),!e.length)return null;const{ActionMenu:t,showCount:n}=this.props,i=r.default._t("AssetAdmin.BULK_ACTIONS_SELECT_ALL","Select all"),s=r.default.sprintf(r.default._t("AssetAdmin.BULK_ACTIONS_SELECTED","%s selected"),this.props.items.length),a=r.default._t("AssetAdmin.BULK_ACTIONS_CLEAR_SELECTION","Clear selection");return o.default.createElement("div",{className:"bulk-actions fieldholder-small"},n&&o.default.createElement(o.default.Fragment,null,o.default.createElement(l.Button,{className:"bulk-actions-counter font-icon-cross-mark",onClick:this.props.onClearSelection,title:a},s),o.default.createElement("div",{className:"bulk-actions-select-all"},o.default.createElement(l.Button,{onClick:this.props.onSelectAll},i))),e.slice(0,2),e.length>2&&t?o.default.createElement(t,{id:"BulkActions",className:"bulk-actions__more-actions-menu"},e.slice(2)):e.slice(2))}}t.Component=p,p.propTypes={items:u.default.array,actions:u.default.arrayOf(u.default.shape({value:u.default.string.isRequired,label:u.default.string.isRequired,className:u.default.string,destructive:u.default.bool,callback:u.default.func,canApply:u.default.func,confirm:u.default.func})),ActionMenu:u.default.elementType,showCount:u.default.bool,onClearSelection:u.default.func.isRequired,onSelectAll:u.default.func.isRequired},p.defaultProps={items:[],actions:[],ActionMenu:null,total:null,showCount:!0,totalReachedMessage:r.default._t("")};const h=(0,i.connect)((function(e){return{gallery:e.assetAdmin.gallery}}))(p);t.default=(0,s.inject)(["ActionMenu"],(e=>({ActionMenu:e})),(()=>"BulkActions"))(h)},1037:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Folder=t.File=t.Component=void 0;var r=S(n(5815)),o=C(n(1594)),i=S(n(6923)),s=S(n(6379)),l=S(n(6022)),a=S(n(2063)),u=S(n(2932)),d=S(n(2926)),c=S(n(1990)),p=S(n(4350)),h=n(9040),f=n(9367),m=n(4172),g=C(n(769)),y=S(n(1838)),v=S(n(6935));function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}function C(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function S(e){return e&&e.__esModule?e:{default:e}}function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t{e.preventDefault()};class x extends o.Component{constructor(e){super(e),this.handleSelect=this.handleSelect.bind(this),this.handleActivate=this.handleActivate.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancelUpload=this.handleCancelUpload.bind(this)}componentDidUpdate(){_(this.props)&&this.props.actions.imageLoad.loadImage(this.props.item.thumbnail,this.props.sectionConfig.imageRetry)}getThumbnailStyles(){const{item:{thumbnail:e,version:t},bustCache:n}=this.props;if(!this.isImage()||!e||this.missing())return{};const r=!1===n||!t||e.startsWith("data:image/")?e:`${e}?vid=${t}`;switch(this.props.loadState){case y.default.SUCCESS:case y.default.DISABLED:return{backgroundImage:`url(${r})`};default:return{}}}getErrorMessage(){let e=null;const{item:t,loadState:n}=this.props;if(this.hasError()?e=t.message.value:this.missing()?e=r.default._t("AssetAdmin.FILE_MISSING","File cannot be found"):n===y.default.FAILED&&(e=r.default._t("AssetAdmin.FILE_LOAD_ERROR","Thumbnail not available")),null!==e){return e=this.getItemFunction("updateErrorMessage")(e,this.props),o.default.createElement("span",{className:"gallery-item__error-message"},e)}return null}getThumbnailClassNames(){const e=["gallery-item__thumbnail"];switch(this.isImageSmallerThanThumbnail()&&e.push("gallery-item__thumbnail--small"),!this.props.item.thumbnail&&this.isImage()&&e.push("gallery-item__thumbnail--no-preview"),this.props.loadState){case y.default.LOADING:case y.default.WAITING:e.push("gallery-item__thumbnail--loading");break;case y.default.FAILED:e.push("gallery-item__thumbnail--error")}return e.join(" ")}getItemClassNames(){const e=this.props.item.category||"false",t=this.props.selectable&&(this.props.item.selected||this.props.isDragging);return(0,i.default)({"gallery-item":!0,[`gallery-item--${e}`]:!0,"gallery-item--max-selected":this.props.maxSelected&&!t,"gallery-item--missing":this.missing(),"gallery-item--selectable":this.props.selectable,"gallery-item--selected":t,"gallery-item--dropping":this.props.isDropping,"gallery-item--highlighted":this.props.item.highlighted,"gallery-item--error":this.hasError(),"gallery-item--dragging":this.props.isDragging})}getItemFunction(e){const{item:t}=this.props;return"function"==typeof t[e]?t[e]:this.props[e]}getStatusFlags(){let e=[];const{item:t}=this.props;"folder"!==t.type&&(t.draft?e.push({key:"status-draft",title:r.default._t("File.DRAFT","Draft"),className:"gallery-item--draft"}):t.modified&&e.push({key:"status-modified",title:r.default._t("File.MODIFIED","Modified"),className:"gallery-item--modified"}));return e=this.getItemFunction("updateStatusFlags")(e,this.props),o.default.createElement("div",{className:"gallery-item__status-flags"},e.map((e=>o.default.createElement("span",e))))}getStatusIcons(){const{item:e}=this.props,t=[];return e.hasRestrictedAccess&&t.push({key:"status-restricted",fileID:e.id,hasRestrictedAccess:!0,placement:"top",disableTooltip:"folder"===e.type,includeBackground:"folder"!==e.type}),e.isTrackedFormUpload&&"folder"!==e.type&&t.push({key:"status-tracked-form-upload",fileID:e.id,isTrackedFormUpload:!0,hasRestrictedAccess:e.hasRestrictedAccess,placement:"top",includeBackground:!0}),o.default.createElement("div",{className:"gallery-item__status-icons"},t.map((e=>o.default.createElement(c.default,e))))}getProgressBar(){let e=null;const{item:t}=this.props,n={className:"gallery-item__progress-bar",style:{width:`${t.progress}%`}};this.hasError()||!this.uploading()||this.complete()||(e=o.default.createElement("div",{className:"gallery-item__upload-progress"},o.default.createElement("div",n)));return e=this.getItemFunction("updateProgressBar")(e,this.props),e}isImageSmallerThanThumbnail(){if(!this.isImage()||this.missing())return!1;const e=this.props.item.width,t=this.props.item.height;return t&&e&&t0}missing(){return!this.exists()&&this.saved()}uploading(){return this.props.item.queuedId&&!this.saved()}exists(){return this.props.item.exists}isImage(){return"image"===this.props.item.category}canBatchSelect(){return this.props.selectable&&this.props.item.canEdit}hasError(){let e=!1;return this.props.item.message&&(e="error"===this.props.item.message.type),e}handleActivate(e){e.stopPropagation(),"function"==typeof this.props.onActivate&&this.saved()&&this.props.onActivate(e,this.props.item)}handleSelect(e){e.stopPropagation(),e.preventDefault(),"function"==typeof this.props.onSelect&&this.props.onSelect(e,this.props.item)}handleKeyDown(e){s.default.SPACE_KEY_CODE===e.keyCode&&(e.preventDefault(),this.canBatchSelect()&&this.handleSelect(e)),s.default.RETURN_KEY_CODE===e.keyCode&&this.handleActivate(e)}handleCancelUpload(e){e.stopPropagation(),e.preventDefault(),this.hasError()?this.props.onRemoveErroredUpload(this.props.item):this.props.onCancelUpload&&this.props.onCancelUpload(this.props.item)}render(){let e=null,t=null,n=null;const{id:i,queuedId:s}=this.props.item,l=i?`item-${i}`:`queued-${s}`;if(this.props.selectable&&(this.canBatchSelect()&&(e=this.handleSelect),t="font-icon-tick"),this.uploading())e=this.handleCancelUpload,t="font-icon-cancel";else if(this.exists()){const e=r.default._t("AssetAdmin.VIEW","View");n=o.default.createElement("div",{className:"gallery-item--overlay font-icon-eye"},e)}const a=this.props.badge,u={className:"gallery-item__checkbox",type:"checkbox",title:r.default._t("AssetAdmin.SELECT","Select"),tabIndex:-1,onMouseDown:w,id:l},c=["gallery-item__checkbox-label",t];this.canBatchSelect()||(u.disabled=!0,c.push("gallery-item__checkbox-label--disabled"));const p={className:c.join(" "),onClick:e};return o.default.createElement("div",{className:this.getItemClassNames(),"data-id":this.props.item.id,tabIndex:0,role:"button",onKeyDown:this.handleKeyDown,onClick:this.handleActivate},!!a&&o.default.createElement(d.default,{className:"gallery-item__badge",status:a.status,message:a.message}),o.default.createElement("div",{ref:e=>{this.thumbnail=e},className:this.getThumbnailClassNames(),style:this.getThumbnailStyles()},n,this.getStatusFlags(),this.getStatusIcons()),this.getProgressBar(),this.getErrorMessage(),this.props.children,o.default.createElement("div",{className:"gallery-item__title",ref:e=>{this.title=e}},o.default.createElement("label",E({},p,{htmlFor:l}),o.default.createElement("input",u)),this.props.item.title))}}t.Component=x,x.propTypes={sectionConfig:p.default,item:l.default,loadState:v.default.oneOf(Object.values(y.default)),bustCache:v.default.bool,highlighted:v.default.bool,selected:v.default.bool,isDropping:v.default.bool,isDragging:v.default.bool,message:v.default.shape({value:v.default.string,type:v.default.string}),selectable:v.default.bool,onActivate:v.default.func,onSelect:v.default.func,onCancelUpload:v.default.func,onRemoveErroredUpload:v.default.func,badge:v.default.shape({status:v.default.string,message:v.default.string}),updateStatusFlags:v.default.func,updateProgressBar:v.default.func,updateErrorMessage:v.default.func},x.defaultProps={item:{},sectionConfig:{imageRetry:{}},updateStatusFlags:e=>e,updateProgressBar:e=>e,updateErrorMessage:e=>e,bustCache:!0};const F=(0,h.connect)((function(e,t){const{bustCache:n}=e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));let r=y.default.DISABLED;if(_(t)){const n=e.assetAdmin.imageLoad.files.find((e=>t.item.thumbnail===e.url));r=n&&n.status||y.default.NONE}return{bustCache:n,loadState:r}}),(function(e){return{actions:{imageLoad:(0,f.bindActionCreators)(g,e)}}}))(x),A="GalleryItem",O=t.File=(0,m.createSelectable)((0,a.default)(A)(F));t.Folder=(0,m.createSelectable)((0,u.default)(A)(O));t.default=F},2914:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=a(n(6935)),i=n(1820),s=a(n(2926)),l=a(n(1037));function a(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?r.default.createElement("div",{key:"1",className:"gallery-item__drag-shadow"}):null,t>2?r.default.createElement("div",{key:"2",className:"gallery-item__drag-shadow gallery-item__drag-shadow--second"}):null];return r.default.createElement("div",{className:"gallery-item__drag-layer"},r.default.createElement("div",{className:"gallery-item__drag-layer-item",style:this.getOffset()},r.default.createElement("div",{className:"gallery-item__drag-layer-preview"},n,r.default.createElement(l.default,d({},e.props,{isDragging:!0}))),t>1?r.default.createElement(s.default,{className:"gallery-item__drag-layer-count",status:"info",message:`${t}`}):null))}}c.propTypes={item:o.default.object,offset:o.default.shape({x:o.default.number.isRequired,y:o.default.number.isRequired}),isDragging:o.default.bool.isRequired};t.default=(0,i.DragLayer)((e=>({item:e.getItem(),offset:e.getInitialClientOffset(),dragged:e.getDifferenceFromInitialOffset(),isDragging:e.isDragging()})))(c)},2063:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t={canDrag(e){return e.canDrag},beginDrag(e){const{id:t}=e.item;"function"==typeof e.onDrag&&e.onDrag(!0,t);const n=e.selectedFiles.concat([]);return n.includes(t)||n.push(t),{selected:n,props:e}},endDrag(e){const{id:t}=e.item;"function"==typeof e.onDrag&&e.onDrag(!1,t)}},n=(0,s.DragSource)(e,t,((e,t)=>({connectDragPreview:e.dragPreview(),connectDragSource:e.dragSource(),isDragging:t.isDragging()})));return e=>{class t extends o.Component{componentDidMount(){this.props.connectDragPreview((0,l.getEmptyImage)(),{captureDraggingState:!0})}render(){const{connectDragSource:t}=this.props,n=o.default.createElement(e,this.props);return"string"==typeof n.type?t(n):t(o.default.createElement("div",{className:"gallery-item__draggable"},n))}}return t.propTypes={connectDragSource:i.default.func.isRequired,connectDragPreview:i.default.func.isRequired,item:i.default.shape({id:i.default.number.isRequired}).isRequired,onDrag:i.default.func,selectedFiles:i.default.arrayOf(i.default.number)},n(t)}};var r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),i=(r=n(6935))&&r.__esModule?r:{default:r},s=n(1820),l=n(8724);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}},2932:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t={drop(e,t){if(t.canDrop()){const n=t.getItem();e.onDropFiles(e.item.id,n.selected)}},canDrop(e,t){return!t.getItem().selected.includes(e.item.id)}},n=(0,s.DropTarget)(e,t,((e,t)=>{const n=t.isOver();return{isDropping:n&&t.canDrop(),connectDropTarget:e.dropTarget(),isOver:n}}));return e=>{class t extends o.Component{render(){const{connectDropTarget:t}=this.props,n=o.default.createElement(e,this.props);return"string"==typeof n.type?t(n):t(o.default.createElement("div",{className:"gallery-item__droppable"},n))}}return t.propTypes={connectDropTarget:i.default.func.isRequired,item:i.default.shape({id:i.default.number.isRequired}).isRequired},n(t)}};var r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),i=(r=n(6935))&&r.__esModule?r:{default:r},s=n(1820);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}},6379:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(5815))&&r.__esModule?r:{default:r};t.default={ACTIONS:{CREATE_FOLDER:"create-folder",EDIT_FILE:"edit"},MOVE_SUCCESS_DURATION:3e3,CSS_TRANSITION_TIME:300,SMALL_THUMBNAIL_HEIGHT:60,SMALL_THUMBNAIL_WIDTH:60,THUMBNAIL_HEIGHT:150,THUMBNAIL_WIDTH:200,BULK_ACTIONS:[{value:"delete",label:o.default._t("AssetAdmin.BULK_ACTIONS_DELETE","Delete"),className:"font-icon-trash",destructive:!0,callback:null,canApply:e=>e.every((e=>e&&e.canDelete))},{value:"archive",label:o.default._t("AssetAdmin.BULK_ACTIONS_ARCHIVE","Archive"),className:"font-icon-box",destructive:!0,callback:null,canApply:e=>e.every((e=>e&&e.canDelete))},{value:"edit",label:o.default._t("AssetAdmin.BULK_ACTIONS_EDIT","Edit"),className:"font-icon-edit",destructive:!1,canApply:e=>1===e.length,callback:null},{value:"move",label:o.default._t("AssetAdmin.BULK_ACTIONS_MOVE","Move"),className:"font-icon-folder-move",canApply:e=>e.every((e=>e&&e.canEdit)),destructive:!1,callback:null},{value:"publish",label:o.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH","Publish"),className:"font-icon-rocket",destructive:!1,callback:null,canApply:e=>e.some((e=>e&&e.modified))&&e.every((e=>e.canEdit&&"folder"!==e.type)),confirm:null},{value:"unpublish",label:o.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH","Unpublish"),className:"font-icon-cancel-circled",destructive:!1,callback:null,canApply:e=>e.some((e=>e.published))&&e.every((e=>e.canEdit&&"folder"!==e.type)),confirm:null},{value:"insert",label:o.default._t("AssetAdmin.BULK_ACTIONS_INSERT","Insert"),className:"font-icon-plus-circled btn-primary",destructive:!1,callback:null,canApply:e=>e.length,confirm:null}],BULK_ACTIONS_PLACEHOLDER:o.default._t("AssetAdmin.BULK_ACTIONS_PLACEHOLDER"),SPACE_KEY_CODE:32,RETURN_KEY_CODE:13,DEFAULT_PREVIEW:"framework/client/dist/images/app_icons/generic_92.png",MODAL_MOVE:"MODAL_MOVE"}},7917:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=I(n(1594)),o=A(n(6935)),i=n(9040),s=n(9367),l=A(n(5609)),a=A(n(5815)),u=A(n(6923)),d=I(n(4201)),c=I(n(8918)),p=I(n(1369)),h=I(n(9517)),f=A(n(1869)),m=A(n(5789)),g=A(n(2294)),y=I(n(6303)),v=A(n(6175)),b=A(n(6379)),C=A(n(4350)),S=A(n(6177)),E=I(n(4461)),_=A(n(8268)),w=A(n(4014)),x=A(n(175)),F=A(n(2308));function A(e){return e&&e.__esModule?e:{default:e}}function O(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(O=function(e){return e?n:t})(e)}function I(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=O(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}class D extends r.Component{constructor(e){super(e),this.handleOpenFile=this.handleOpenFile.bind(this),this.handleCloseFile=this.handleCloseFile.bind(this),this.handleDelete=this.handleDelete.bind(this),this.doPublish=this.doPublish.bind(this),this.doUnpublish=this.doUnpublish.bind(this),this.handleUnpublish=this.handleUnpublish.bind(this),this.handleDoSearch=this.handleDoSearch.bind(this),this.handleClearSearch=this.handleClearSearch.bind(this),this.handleSubmitEditor=this.handleSubmitEditor.bind(this),this.handleOpenFolder=this.handleOpenFolder.bind(this),this.handleSort=this.handleSort.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.createEndpoint=this.createEndpoint.bind(this),this.handleBackButtonClick=this.handleBackButtonClick.bind(this),this.handleFolderIcon=this.handleFolderIcon.bind(this),this.handleBrowse=this.handleBrowse.bind(this),this.handleViewChange=this.handleViewChange.bind(this),this.handleUpload=this.handleUpload.bind(this),this.handleUploadQueue=this.handleUploadQueue.bind(this),this.handleCreateFolder=this.handleCreateFolder.bind(this),this.handleMoveFilesSuccess=this.handleMoveFilesSuccess.bind(this),this.refetchFolder=this.refetchFolder.bind(this),this.state={loading:!1,folder:null,files:[],totalCount:0,forceRefetch:!1}}componentDidMount(){this.refetchFolder()}componentDidUpdate(e){(this.props.folderId!==e.folderId||this.props.fileId!==e.fileId&&0!==this.props.fileId||this.state.forceRefetch)&&this.refetchFolder(),this.state.forceRefetch&&this.setState({forceRefetch:!1})}getFolderId(){return null!==this.props.folderId?this.props.folderId:this.state.folder?this.state.folder.id:0}refetchFolder(){const e=this.getFolderId(),t=new URLSearchParams(window.location.search),n=[];t.forEach(((e,t)=>{"page"!==t&&"filter"!==t.substring(0,6)&&"sort"!==t.substring(0,4)||n.push(`${t}=${e}`)}));let r="";n.length&&(r=`?${n.join("&")}`);const o=`${S.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdminOpen").endpoints.read.url}/${e}${r}`;l.default.get(o).then((async e=>{const t=await e.json();this.setState({loading:!1,folder:t,files:t.children.nodes,totalCount:t.children.pageInfo.totalCount})})).catch((async e=>{this.setState({loading:!1,folder:null,files:[],totalCount:0});const t=await(0,w.default)(e);this.props.actions.toasts.error(t)}))}getFiles(){const{queuedFiles:e,folderId:t}=this.props,n=this.state.files,r=[...e.items.filter((e=>!(e.id&&n.find((t=>t.id===e.id))||e.hasOwnProperty("uploadedToFolderId")&&e.uploadedToFolderId!==t))),...n],o=r.filter((e=>"folder"===e.type)),i=r.filter((e=>"folder"!==e.type));return o.concat(i)}handleBrowse(e,t,n){"function"==typeof this.props.onBrowse&&(this.props.onBrowse(e,t,n),this.setState({forceRefetch:!0})),e!==this.getFolderId()&&this.props.actions.gallery.deselectFiles()}handleSetPage(e){this.handleBrowse(this.getFolderId(),this.props.fileId,Object.assign({},this.props.query,{page:e})),this.setState({forceRefetch:!0})}handleDoSearch(e){this.props.actions.gallery.deselectFiles(),this.props.actions.queuedFiles.purgeUploadQueue(),this.handleBrowse(e.currentFolderOnly?this.getFolderId():0,null,{filter:e,view:this.props.query.view})}handleClearSearch(e){this.props.actions.displaySearch.closeSearch(),this.props.actions.gallery.deselectFiles(),this.props.actions.queuedFiles.purgeUploadQueue(),this.refetchFolder();const t=this.state.folder;this.handleOpenFolder(e,t)}handleSort(e){this.handleBrowse(this.getFolderId(),this.props.fileId,{...this.props.query,sort:e,limit:void 0,page:void 0}),this.setState({forceRefetch:!0})}handleViewChange(e){this.handleBrowse(this.getFolderId(),this.props.fileId,Object.assign({},this.props.query,{view:e}))}createEndpoint(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return l.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:this.props.securityId}}:{}))}handleBackButtonClick(e){e.preventDefault(),this.props.actions.gallery.deselectFiles();const t=this.state.folder;t?this.handleOpenFolder(t.parentId||0):this.handleOpenFolder(0)}resetFile(e){e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId),this.props.fileId===e.id&&this.props.resetFileDetails(this.getFolderId(),e.id,this.props.query)}handleFolderIcon(){this.handleOpenFile(this.getFolderId())}handleOpenFile(e){this.handleBrowse(this.getFolderId(),e,this.props.query)}handleSubmitEditor(e,t,n){let r=null;if("action_insert"===t&&"select"===this.props.type){const t=this.getFiles().find((t=>t.id===parseInt(e.ID,10)));return this.props.onInsertMany(null,[t]),this.setState({forceRefetch:!0}),Promise.resolve()}if("function"==typeof this.props.onSubmitEditor){const o=this.findFile(this.props.fileId);r=this.props.onSubmitEditor(e,t,n,o)}else r=n();if(!r)throw new Error("Promise was not returned for submitting");return this.setState({forceRefetch:!0}),r.then((e=>("action_createfolder"===t?"admin"===this.props.type?this.handleOpenFile(e.record.id):this.handleOpenFolder(this.getFolderId()):"action_save"!==t&&"action_publish"!==t||this.getFolderId()===e.record.parent.id||this.handleBrowse(e.record.parent.id,e.record.id,null),e)))}handleCloseFile(){this.handleBrowse(this.getFolderId(),null,this.props.query)}handleOpenFolder(e){const{page:t,filter:n,...r}=this.props.query;this.handleBrowse(e,null,r)}handleDelete(e){this.props.actions.confirmDeletion.deleting();const t=e.map((e=>{const t=this.findFile(e);if(!t)throw new Error(`File selected for deletion cannot be found: ${e}`);return t.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(t.queuedId),t})).map((e=>e.id)),n=this.state.folder,r=n?n.id:0,o=this.props.sectionConfig.endpoints.delete.url;return l.default.post(o,{ids:t},{"X-SecurityID":S.default.get("SecurityID")}).then((()=>{this.handleBrowse(r,null,this.props.query);this.props.queuedFiles.items.filter((e=>t.includes(e.id))).forEach((e=>{e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}));let e="AssetAdmin.BULK_ACTIONS_DELETE_SUCCESS_02",n="%s folders/files were successfully deleted.";this.props.sectionConfig.filesAreVersioned&&this.props.sectionConfig.archiveFiles&&(e="AssetAdmin.BULK_ACTIONS_ARCHIVE_SUCCESS_02",n="%s folders/files were successfully archived."),this.props.actions.toasts.success(a.default.sprintf(a.default._t(e,n),t.length)),this.props.actions.gallery.deselectFiles(),this.refetchFolder()})).catch((async e=>{const t=await(0,w.default)(e);this.props.actions.toasts.error(t)})).finally((()=>this.props.actions.confirmDeletion.reset()))}doUnpublish(e){const t=e.map((e=>{const t=this.findFile(e);if(!t)throw new Error(`File selected for unpublishing cannot be found: ${e}`);if("folder"===t.type)throw new Error("Cannot unpublish folders");return t})),n=t.map((e=>e.id)),r=n.map((e=>`ids[]=${e}`)).join("&");let o=`${this.props.sectionConfig.endpoints.readLiveOwnerCounts.url}?${r}`;return l.default.get(o).then((async e=>{const t=(await e.json()).filter((e=>e.count>0)),n=t.slice(0,4).map((e=>e.message)),r=t.slice(5).length;let o="";if(r>0&&(o=a.default.inject(a.default._t("AssetAdmin.BULK_OWNED_WARNING_REMAINING","And {count} other file(s)"),{count:r})),n.length){const e=[a.default.inject(a.default._t("AssetAdmin.BULK_OWNED_WARNING_HEADING","{count} file(s) are being used by other published content."),{count:n.length}),...n,o,a.default._t("AssetAdmin.BULK_OWNED_WARNING_FOOTER","Unpublishing will only remove files from the published version of the content. They will remain on the draft version. Unpublish anyway?")].filter((e=>e)).join("\n\n");if(!confirm(e))return Promise.reject()}return Promise.resolve()})).then((()=>(o=this.props.sectionConfig.endpoints.unpublish.url,l.default.post(o,{ids:n},{"X-SecurityID":S.default.get("SecurityID")}).catch((async e=>{const t=await(0,w.default)(e);this.props.actions.toasts.error(t)}))))).then((()=>(this.refetchFolder(),t))).catch((async e=>{const t=await(0,w.default)(e);return this.props.actions.toasts.error(t),[]}))}handleUnpublish(e){return this.doUnpublish(e).then((e=>{const{fileId:t}=this.props;this.refetchFolder().then((()=>{t&&e.find((e=>e.id===t))&&this.props.resetFileDetails(this.getFolderId(),t,this.props.query)}))}))}doPublish(e){const t=e.map((e=>{const t=this.findFile(e);if(!t)throw new Error(`File selected for publishing cannot be found: ${e}`);if("folder"===t.type)throw new Error("Cannot publish folders");return t})),n=t.map((e=>e.id)),r=this.props.sectionConfig.endpoints.publish.url;return l.default.post(r,{ids:n},{"X-SecurityID":S.default.get("SecurityID")}).then((()=>(t.forEach((e=>this.resetFile(e))),this.refetchFolder(),t))).catch((async e=>{const t=await(0,w.default)(e);this.props.actions.toasts.error(t)}))}findFile(e){return this.getFiles().find((t=>t.id===parseInt(e,10)))}handleUpload(){}handleUploadQueue(){this.props.fileId&&this.refetchFolder()}handleCreateFolder(){this.props.onBrowse(this.getFolderId(),null,this.props.query,b.default.ACTIONS.CREATE_FOLDER)}handleMoveFilesSuccess(e,t){this.props.queuedFiles.items.filter((e=>t.includes(e.id))).forEach((e=>{e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)})),this.props.actions.gallery.deselectFiles(),this.refetchFolder()}renderGallery(){const{GalleryComponent:e}=this.props,t=this.props.sectionConfig,n=t.endpoints.createFile.url,o=t.endpoints.createFile.method,i=this.props.query&&parseInt(this.props.query.limit||t.limit,10),s=this.props.query&&parseInt(this.props.query.page||1,10),l=this.props.query&&this.props.query.sort,a=this.props.query&&this.props.query.view,u=this.props.query.filter||{},d=this.state.folder,c=this.state.loading;return r.default.createElement(e,{files:this.getFiles(),fileId:this.props.fileId,folderId:this.getFolderId(),folder:d,type:this.props.type,limit:i,page:s,totalCount:this.state.totalCount,view:a,filters:u,createFileApiUrl:n,createFileApiMethod:o,onInsertMany:this.props.onInsertMany,onPublish:this.doPublish,onUnpublish:this.doUnpublish,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSuccessfulUpload:this.handleUpload,onSuccessfulUploadQueue:this.handleUploadQueue,onCreateFolder:this.handleCreateFolder,onMoveFilesSuccess:this.handleMoveFilesSuccess,onClearSearch:this.handleClearSearch,onSort:this.handleSort,onSetPage:this.handleSetPage,onViewChange:this.handleViewChange,sort:l,sectionConfig:t,loading:c,maxFilesSelect:this.props.maxFiles,dialog:this.props.dialog})}renderEditor(){const{sectionConfig:e,viewAction:t,type:n,fileId:o,dialog:i,requireLinkText:s,fileSelected:l,EditorComponent:a}=this.props,{schemaUrl:u,targetId:d}=(0,_.default)({config:e,viewAction:t,folderId:this.getFolderId(),type:n,fileId:o});if(!u)return null;const c=[];s&&c.push({name:"requireLinkText",value:!0}),l&&c.push({name:"fileSelected",value:!0});const p={dialog:i,fileId:d,schemaUrl:u,schemaUrlQueries:c,onClose:this.handleCloseFile,onSubmit:this.handleSubmitEditor,onUnpublish:this.handleUnpublish};return r.default.createElement(a,p)}render(){const{folderId:e,query:t,getUrl:n,type:o,maxFiles:i,toolbarChildren:s,SearchComponent:l,BulkDeleteConfirmationComponent:a}=this.props;if(null===this.state.folder)return null;const d=Boolean(e||(0,y.hasFilters)(t.filter)),c=this.props.sectionConfig.form.fileSearchForm.schemaUrl,p=t.filter||{},h=(0,u.default)("fill-height asset-admin","select"===o&&{"asset-admin--single-select":1===i,"asset-admin--multi-select":1!==i}),f=(0,y.hasFilters)(t.filter)||this.props.showSearch,m=this.props.actions.displaySearch?this.props.actions.displaySearch.toggleSearch:void 0,b=this.state.folder,C={folder:b,query:t,getUrl:n,onBrowse:this.handleBrowse,onFolderIcon:this.handleFolderIcon};return r.default.createElement("div",{className:h},r.default.createElement(g.default,{showBackButton:d,onBackButtonClick:this.handleBackButtonClick},b&&r.default.createElement(F.default,C),r.default.createElement("div",{className:"asset-admin__toolbar-extra pull-xs-right fill-width vertical-align-items"},r.default.createElement(v.default,{toggled:f,onToggle:m}),s)),f&&r.default.createElement(l,{onSearch:this.handleDoSearch,id:"AssetSearchForm",formSchemaUrl:c,onHide:this.handleClearSearch,displayBehavior:"HIDEABLE",filters:p,name:"name"}),r.default.createElement("div",{className:"flexbox-area-grow fill-width fill-height gallery"},this.renderGallery(),this.renderEditor()),r.default.createElement(a,{onConfirm:this.handleDelete,filesAreVersioned:this.props.sectionConfig.filesAreVersioned,archiveFiles:this.props.sectionConfig.archiveFiles}))}}t.Component=D,D.propTypes={dialog:o.default.bool,sectionConfig:C.default,fileId:o.default.number,folderId:o.default.number,resetFileDetails:o.default.func,onBrowse:o.default.func,onReplaceUrl:o.default.func,onInsertMany:o.default.func,getUrl:o.default.func,query:o.default.shape({sort:o.default.string,limit:o.default.oneOfType([o.default.number,o.default.string]),page:o.default.oneOfType([o.default.number,o.default.string]),filter:o.default.object}),onSubmitEditor:o.default.func,type:o.default.oneOf(["insert-media","insert-link","select","admin"]),queuedFiles:o.default.shape({items:o.default.array.isRequired}),filesTotalCount:o.default.number,loading:o.default.bool,actions:o.default.object,maxFiles:o.default.number,fileSelected:o.default.bool,EditorComponent:o.default.oneOfType([o.default.object,o.default.func]),GalleryComponent:o.default.oneOfType([o.default.object,o.default.func]),SearchComponent:o.default.oneOfType([o.default.object,o.default.func]),BulkDeleteConfirmationComponent:o.default.oneOfType([o.default.object,o.default.func])},D.defaultProps={type:"admin",query:{sort:"",limit:null,page:0,filter:{}},maxFiles:null,EditorComponent:f.default,GalleryComponent:m.default,SearchComponent:y.default,BulkDeleteConfirmationComponent:x.default};t.default=(0,s.compose)((0,i.connect)((function(e,t){const{formSchema:n}=e.assetAdmin.modal;return{securityId:e.config.SecurityID,queuedFiles:e.assetAdmin.queuedFiles,showSearch:e.assetAdmin.displaySearch.isOpen,type:n&&n.type||t.type}}),(function(e){return{actions:{gallery:(0,s.bindActionCreators)(d,e),toasts:(0,s.bindActionCreators)(c,e),displaySearch:(0,s.bindActionCreators)(h,e),queuedFiles:(0,s.bindActionCreators)(p,e),confirmDeletion:(0,s.bindActionCreators)(E,e)}}})))(D)},2308:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(1594)),o=a(n(6935)),i=a(n(5815)),s=n(6418),l=n(6303);function a(e){return e&&e.__esModule?e:{default:e}}const u=e=>{let{folder:t,query:n,getUrl:o,onBrowse:s,onFolderIcon:a,PlainBreadcrumbComponent:u}=e;const d=function(){for(var e=arguments.length,t=new Array(e),n=0;n{e.preventDefault(),s(...t)}},c=function(){return o&&o(...arguments)},p=[{text:i.default._t("AssetAdmin.FILES","Files"),href:c(0,null,n),onClick:d(0,null,n)}];if(t&&t.id){t.ancestors&&t.ancestors.forEach((e=>{p.push({text:e.title,href:c(e.id,null,n),onClick:d(e.id,null,n)})}));const e=[{className:"icon font-icon-edit-list",onClick:e=>{e.preventDefault(),a()}}];t.hasRestrictedAccess&&e.push({nodeName:"FileStatusIcon",hasRestrictedAccess:!0}),p.push({text:t.title,href:c(t.id,null,n),onClick:d(t.id,null,n),icons:e})}return(0,l.hasFilters)(n.filter)&&p.push({text:i.default._t("LeftAndMain.SEARCHRESULTS","Search results")}),r.default.createElement(u,{multiline:!0,crumbs:p})};u.propTypes={onBrowse:o.default.func,onFolderIcon:o.default.func,getUrl:o.default.func,query:o.default.shape({sort:o.default.string,limit:o.default.oneOfType([o.default.number,o.default.string]),page:o.default.oneOfType([o.default.number,o.default.string]),filter:o.default.object,view:o.default.string}),folder:o.default.shape({id:o.default.number,title:o.default.string,ancestors:o.default.array,parentId:o.default.number,canView:o.default.bool,canEdit:o.default.bool}),PlainBreadcrumbComponent:o.default.oneOfType([o.default.object,o.default.func])},u.defaultProps={PlainBreadcrumbComponent:s.Component};t.default=u},4736:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0,t.buildUrl=v,t.default=void 0;var r=g(n(1594)),o=n(8926),i=n(9040),s=g(n(6478)),l=f(n(7917)),a=n(5716),u=f(n(7675)),d=f(n(6379)),c=f(n(4350)),p=n(5125),h=f(n(6935));function f(e){return e&&e.__esModule?e:{default:e}}function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}function g(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}const y=Object.keys(d.default.ACTIONS).map((e=>d.default.ACTIONS[e]));function v(e){let{base:t,folderId:n,fileId:r,query:o,action:i}=e;if(i&&-1===y.indexOf(i))throw new Error(`Invalid action provided: ${i}`);let s=null;s=r?(0,p.joinUrlPaths)(t,`show/${n}/${d.default.ACTIONS.EDIT_FILE}/${r}`):n?(0,p.joinUrlPaths)(t,`show/${n}`):t,i===d.default.ACTIONS.CREATE_FOLDER&&(s=(0,p.joinUrlPaths)(t,`show/${n||0}/${i}`));return o&&Object.keys(o).length>0&&(s=`${s}?${u.default.stringify(o)}`),s}class b extends r.Component{constructor(e){super(e),this.handleBrowse=this.handleBrowse.bind(this),this.handleReplaceUrl=this.handleReplaceUrl.bind(this),this.handleResetDetails=this.handleResetDetails.bind(this),this.getUrl=this.getUrl.bind(this)}getUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.default.ACTIONS.EDIT_FILE;const o=parseInt(e||0,10),i=parseInt(t||0,10),s=o!==this.getFolderId(),l=Object.assign({},n);return(s||l.page<=1)&&delete l.page,v({base:`/${this.props.sectionConfig.reactRoutePath}`,folderId:o,fileId:i,query:l,action:r})}getFolderId(){return this.props.router.params&&this.props.router.params.folderId?parseInt(this.props.router.params.folderId,10):0}getFileId(){return this.props.router.params&&this.props.router.params.fileId?parseInt(this.props.router.params.fileId,10):0}getViewAction(){return this.props.router.params&&this.props.router.params.viewAction?this.props.router.params.viewAction:d.default.ACTIONS.EDIT_FILE}getSectionProps(){return{sectionConfig:this.props.sectionConfig,type:"admin",folderId:this.getFolderId(),viewAction:this.getViewAction(),fileId:this.getFileId(),query:this.getQuery(),getUrl:this.getUrl,onBrowse:this.handleBrowse,onReplaceUrl:this.handleReplaceUrl,resetFileDetails:this.handleResetDetails}}getQuery(){return(0,a.decodeQuery)(this.props.router.location.search)}handleBrowse(e,t,n,r){const o=this.getUrl(e,t,n,r);this.props.router.navigate(o)}handleReplaceUrl(e,t,n,r){const o=this.getUrl(e,t,n,r);this.props.router.navigate(o,{replace:!0})}handleResetDetails(e,t,n){const r=this.getUrl(e,t,n),o=this.getUrl(e,null,n);this.props.router.navigate(o,{replace:!0,state:{reset:!0,resetPath:r}})}render(){const{AssetAdminComponent:e}=this.props,t=this.props.router.location.state;return t&&t&&t.reset?r.default.createElement(o.Navigate,{to:t.resetPath,replace:!0}):this.props.sectionConfig?r.default.createElement(e,this.getSectionProps()):null}}t.Component=b,b.propTypes={sectionConfig:c.default,router:s.routerPropTypes,AssetAdminComponent:h.default.oneOfType([h.default.object,h.default.func])},b.defaultProps={AssetAdminComponent:l.default};t.default=(0,s.default)((0,i.connect)((function(e){return{sectionConfig:e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name))}}))(b))},2908:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.AssetAdminStateRouter=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=u(n(6935)),i=n(9040),s=n(4736),l=u(n(6379)),a=n(1021);function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}const c={folderId:null,fileId:null,query:{},action:l.default.ACTIONS.EDIT_FILE};class p extends r.Component{constructor(e){super(e),this.handleBrowse=this.handleBrowse.bind(this),this.getUrl=this.getUrl.bind(this),this.state=Object.assign({},c,{folderId:e.folderId})}getUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.default.ACTIONS.EDIT_FILE;const o=parseInt(e||0,10),i=parseInt(t||0,10),a=this.getFolderId(),u=o!==a&&null!==a,d=Object.assign({},n);return(u||d.page<=1)&&delete d.page,(0,s.buildUrl)({base:this.props.sectionConfig.reactRoutePath,folderId:o,fileId:i,query:d,action:r})}getFolderId(){return null===this.state.folderId?null:parseInt(this.state.folderId||0,10)}getFileId(){return parseInt(this.state.fileId||this.props.fileId||0,10)}getViewAction(){return this.state.action||l.default.ACTIONS.EDIT_FILE}getSectionProps(){const e=Object.assign({},this.props,{folderId:this.getFolderId(),fileId:this.getFileId(),viewAction:this.getViewAction(),query:this.state.query,getUrl:this.getUrl,onBrowse:this.handleBrowse});return delete e.Component,e}handleBrowse(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.default.ACTIONS.EDIT_FILE;if(r&&-1===Object.values(l.default.ACTIONS).indexOf(r))throw new Error(`Invalid action provided: ${r}`);this.state.fileId!==t&&this.props.actions.resetFormStack(),this.setState({folderId:e,fileId:t,query:n,action:r})}render(){const e=this.getSectionProps(),t=this.props.Component;return r.default.createElement(t,e)}}function h(e){return{actions:{resetFormStack:()=>e((0,a.resetFormStack)())}}}t.AssetAdminStateRouter=p,p.propTypes={Component:o.default.elementType,sectionConfig:o.default.shape({url:o.default.string.isRequired}).isRequired,fileId:o.default.number};t.default=function(e){return(0,i.connect)((function(t){const n=t.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));return{Component:e,sectionConfig:n}}),h)(p)}},175:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=C(n(1594)),o=n(9367),i=n(9040),s=v(n(6935)),l=n(5207),a=C(n(4461)),u=C(n(762)),d=C(n(8918)),c=v(n(5815)),p=v(n(6022)),h=v(n(5609)),f=v(n(6177)),m=v(n(4014)),g=v(n(134)),y=v(n(7871));function v(e){return e&&e.__esModule?e:{default:e}}function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}function C(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{LoadingComponent:t,transition:n,files:o,onModalClose:i,onCancel:s,onConfirm:l,filesAreVersioned:a,archiveFiles:d,actions:p}=e;const[v,b]=(0,r.useState)(!0),[C,S]=(0,r.useState)({});(0,r.useEffect)((()=>{const e=f.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"),t=o.map((e=>e.id)).map((e=>`ids[]=${e}`)).join("&"),n=`${e.endpoints.readDescendantCounts.url}?${t}`;b(!0),h.default.get(n).then((async e=>{const t=await e.json();b(!1),S(t)})).catch((async e=>{const t=await(0,m.default)(e);p.toasts.error(t)}))}),[o]);let E=null;const _=a&&d?"AssetAdmin.ARCHIVE":"AssetAdmin.DELETE",w=a&&d?"Archive":"Delete";let x=[{label:c.default._t(_,w),handler:()=>l(o.map((e=>{let{id:t}=e;return t}))),color:"danger"},{label:c.default._t("AssetAdmin.CANCEL","Cancel"),handler:s}];if(v)E=r.default.createElement(t,null);else{const e=C.filter((e=>"folder"===e.type)).length,t=C.filter((e=>"file"===e.type)).length,n=C.reduce(((e,t)=>e+t.count),0),i={topLevelFolderCount:e,topLevelFileCount:t,descendantFileCount:n,filesAreVersioned:a,archiveFiles:d};E=r.default.createElement(y.default,i),t+n>0&&(x=[{label:c.default._t("AssetAdmin.CANCEL","Cancel"),handler:s,color:"primary"},{label:c.default._t(_,w),handler:()=>l(o.map((e=>{let{id:t}=e;return t}))),color:"danger"}])}const F=![u.CANCELING,u.DELETING].includes(n);return r.default.createElement(g.default,{body:E,isOpen:F,actions:x,onCancel:s,onClosed:i,filesAreVersioned:a,archiveFiles:d})};t.Component=E,E.propTypes={LoadingComponent:s.default.elementType,transition:s.default.oneOf(["canceling","deleting",!1]),files:s.default.arrayOf(p.default),descendantFileCounts:s.default.object,onCancel:s.default.func.isRequired,onModalClose:s.default.func.isRequired,onConfirm:s.default.func.isRequired,filesAreVersioned:s.default.bool.isRequired,archiveFiles:s.default.bool.isRequired,actions:s.default.object.isRequired};const _=(0,o.compose)((0,l.inject)(["Loading"],(e=>({LoadingComponent:e}))))(E);t.default=(0,o.compose)((0,i.connect)((e=>{let{assetAdmin:{confirmDeletion:t}}=e;return t}),(e=>({onCancel:()=>e(a.cancel()),onModalClose:()=>e(a.modalClose()),actions:{toasts:(0,o.bindActionCreators)(d,e),confirmation:(0,o.bindActionCreators)(a,e)}}))))((e=>{let{showConfirmation:t,files:n,...o}=e;return t&&n.length>0?r.default.createElement(_,S({},o,{files:n})):null}))},7871:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(5815)),o=s(n(1594)),i=s(n(6935));function s(e){return e&&e.__esModule?e:{default:e}}const l=e=>{let{topLevelFolderCount:t,topLevelFileCount:n,descendantFileCount:i,filesAreVersioned:s,archiveFiles:l}=e,a="AssetAdmin.BULK_ACTIONS_DELETE_WARNING",u="Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.";s&&l&&(a="AssetAdmin.BULK_ACTIONS_ARCHIVE_WARNING",u="Ensure files are removed from content areas prior to archiving them, otherwise they will appear as broken links.");const d=((e,t,n,o,i)=>{const s=t+n;if(s>0){let e="AssetAdmin.BULK_ACTIONS_DELETE_ITEMS_CONFIRM",t=["You're about to delete %s file(s) which may be used in your site's content.","Carefully check the file usage on the files before deleting the file(s)."].join(" ");return o&&i&&(e="AssetAdmin.BULK_ACTIONS_ARCHIVE_ITEMS_CONFIRM",t=["You're about to archive %s file(s) which may be used in your site's content.","Carefully check the file usage on the files before archiving the file(s)."].join(" ")),r.default.sprintf(r.default._t(e,t),s)}if(1===e){let e="AssetAdmin.BULK_ACTIONS_DELETE_FOLDER_CONFIRM",t="Are you sure you want to delete this folder?";return o&&i&&(e="AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDER_CONFIRM",t="Are you sure you want to archive this folder?"),r.default._t(e,t)}let l="AssetAdmin.BULK_ACTIONS_DELETE_FOLDERS_CONFIRM",a="Are you sure you want to delete these folders?";return o&&i&&(l="AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDERS_CONFIRM",a="Are you sure you want to archive these folders?"),r.default._t(l,a)})(t,n,i,s,l);return o.default.createElement(o.default.Fragment,null,o.default.createElement("p",null,d),n+i>0&&o.default.createElement("p",null,r.default._t(a,u)))};l.propTypes={topLevelFolderCount:i.default.number,topLevelFileCount:i.default.number,descendantFileCount:i.default.number},l.defaultProps={topLevelFolderCount:0,topLevelFileCount:0,descendantFileCount:0};t.default=l},134:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(5815)),o=l(n(1594)),i=l(n(6935)),s=n(3556);function l(e){return e&&e.__esModule?e:{default:e}}const a=e=>{let{isOpen:t,body:n,onCancel:i,actions:l,filesAreVersioned:a,archiveFiles:u}=e,d="AssetAdmin.CONFIRM_FILE_DELETION",c="Confirm deletion";return a&&u&&(d="AssetAdmin.CONFIRM_FILE_ARCHIVE",c="Confirm archive"),o.default.createElement(s.Modal,{isOpen:t,toggle:i},o.default.createElement(s.ModalHeader,{toggle:i},r.default._t(d,c)),o.default.createElement(s.ModalBody,null,n),o.default.createElement(s.ModalFooter,null,l.map((e=>{let{label:t,handler:n,color:r}=e;return o.default.createElement(s.Button,{key:t,color:r,onClick:n},t)}))))};a.propTypes={isOpen:i.default.bool.isRequired,body:i.default.node.isRequired,onCancel:i.default.func.isRequired,actions:i.default.arrayOf(i.default.shape({label:i.default.string.isRequired,handler:i.default.func,color:i.default.string})),filesAreVersioned:i.default.bool.isRequired,archiveFiles:i.default.bool.isRequired};t.default=a},1869:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=E(n(5815)),o=n(9040),i=n(9367),s=S(n(1594)),l=E(n(6379)),a=E(n(55)),u=S(n(9077)),d=E(n(6935)),c=n(5207),p=E(n(6177)),h=E(n(5609)),f=S(n(4461)),m=S(n(1021)),g=E(n(6923)),y=E(n(7008)),v=E(n(7675)),b=S(n(1584));function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(C=function(e){return e?n:t})(e)}function S(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=C(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function E(e){return e&&e.__esModule?e:{default:e}}function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;te.json())).then((e=>{this.setState({file:e})}))}getFormSchemaUrl(){const{schemaUrlQueries:e,schemaUrl:t,fileId:n}=this.props,r=y.default.parse(t),o=e.reduce(((e,t)=>{let{name:n,value:r}=t;return{...e,[n]:r}}),{});return y.default.format({...r,pathname:`${r.path}/${n}`,search:v.default.stringify(o)})}handleAction(e){const t=this.state.file;switch(e.currentTarget.name){case"action_replacefile":this.replaceFile(),e.preventDefault();break;case"action_downloadfile":this.downloadFile(),e.preventDefault();break;case"action_delete":this.props.actions.confirmDeletion.confirm([t]),e.preventDefault()}}handleCancelKeyDown(e){e.keyCode!==l.default.SPACE_KEY_CODE&&e.keyCode!==l.default.RETURN_KEY_CODE||this.handleClose(e)}handleSubmit(e,t,n){const{showingSubForm:r,actions:o}=this.props;return"function"==typeof this.props.onSubmit?this.props.onSubmit(e,t,n).finally((()=>{r&&-1!==["action_save","action_publish"].indexOf(t)&&o.modal.popFormStackEntry()})):n()}handleClose(e){const{showingSubForm:t,onClose:n,actions:r}=this.props;t?r.modal.popFormStackEntry():n(),e&&e.preventDefault()}replaceFile(){const e=document.querySelector(".dz-input-PreviewImage");e&&e.click()}downloadFile(){const e=this.state.file;!function(e,t){const n=document.createElement("a");n.download=t,n.href=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}(e.url,e.name),document.getElementById("Form_fileEditForm_PopoverActions").focus()}handleLoadingError(e){this.setState({loadingForm:!1,loadingError:e.errors[0]})}handleLoadingSuccess(){this.setState({loadingForm:!1,loadingError:null})}handleFetchingSchema(){this.setState({loadingForm:!0})}editorHeader(e){let{SchemaComponent:t,...n}=e;const{dialog:r,nextType:o,showingSubForm:i,actions:l,EditorHeaderComponent:a}=this.props,u=this.getFormSchemaUrl(),d=this.state.file;let c=b.buttonStates.SWITCH;r&&d&&"folder"!==d.type&&(c=i?b.buttonStates.ALWAYS_BACK:b.buttonStates.ONLY_BACK);const{formid:p}=n,h=o&&d&&"folder"!==d.type?()=>{l.modal.stashFormValues(p,u),l.modal.pushFormStackEntry(o)}:void 0,f={onCancel:this.handleClose,showButton:c,onDetails:h};return s.default.createElement(a,f,s.default.createElement(t,n))}createFn(e,t){if("AssetEditorHeaderFieldGroup"===t.name){const n=this.editorHeader,r={key:t.id,SchemaComponent:e,...t};return s.default.createElement(n,r)}return s.default.createElement(e,_({key:t.id},t))}render(){if(!this.state.file)return null;const{FormBuilderLoaderComponent:e}=this.props,t=this.getFormSchemaUrl(),n=(0,g.default)("panel","form--no-dividers","editor",{"editor--asset-dropzone--disable":!this.props.enableDropzone},this.props.className);let o=null;if(this.state.loadingError){let e=this.state.loadingError.value;404===this.state.loadingError.code&&(e=r.default._t("AssetAdmin.FILE_MISSING","File cannot be found")),e||(e=r.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")),o=s.default.createElement("div",{className:"editor__file-preview-message--file-missing"},e)}const i=this.props.loadingComponent;return s.default.createElement("div",{className:n},s.default.createElement("div",{className:"editor__details fill-height"},s.default.createElement(e,{identifier:"AssetAdmin.EditForm",schemaUrl:t,onSubmit:this.handleSubmit,onAction:this.handleAction,onLoadingSuccess:this.handleLoadingSuccess,onLoadingError:this.handleLoadingError,onFetchingSchema:this.handleFetchingSchema,createFn:this.createFn,file:this.state.file}),o,this.state.loadingForm&&s.default.createElement(i,null)))}}t.Component=w,w.propTypes={className:d.default.string,fileId:d.default.number.isRequired,enableDropzone:d.default.bool,dialog:d.default.bool,onClose:d.default.func.isRequired,onSubmit:d.default.func.isRequired,schemaUrl:d.default.string.isRequired,schemaUrlQueries:d.default.arrayOf(d.default.shape({name:d.default.string,value:d.default.any})),actions:d.default.object,showingSubForm:d.default.bool,nextType:d.default.string,EditorHeaderComponent:d.default.oneOfType([d.default.object,d.default.func]),FormBuilderLoaderComponent:d.default.oneOfType([d.default.object,d.default.func])},w.defaultProps={EditorHeaderComponent:b.default,FormBuilderLoaderComponent:a.default};t.default=(0,i.compose)((0,c.inject)(["Loading"],(e=>({loadingComponent:e})),(()=>"AssetAdmin.Editor")),(0,o.connect)((function(e){let{assetAdmin:{gallery:t,modal:n}}=e;return{enableDropzone:t.enableDropzone,nextType:n.formSchema&&n.formSchema.nextType,showingSubForm:n.formSchemaStack&&n.formSchemaStack.length>1}}),(function(e){return{actions:{unsavedForms:(0,i.bindActionCreators)(u,e),confirmDeletion:(0,i.bindActionCreators)(f,e),modal:(0,i.bindActionCreators)(m,e)}}})))(w)},1584:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.buttonStates=void 0;var r=u(n(1594)),o=u(n(5815)),i=u(n(551)),s=u(n(2164)),l=u(n(6935)),a=u(n(6923));function u(e){return e&&e.__esModule?e:{default:e}}const d=e=>t=>{t.preventDefault(),e&&e()},c="ALWAYS_BACK",p="ALWAYS_CANCEL",h="SWITCH",f="ONLY_BACK",m="ONLY_CANCEL",g=t.buttonStates={ALWAYS_BACK:c,ALWAYS_CANCEL:p,SWITCH:h,ONLY_BACK:f,ONLY_CANCEL:m,NONE:"NONE"},y=e=>{let{onCancel:t,onDetails:n,showButton:l,children:u}=e;const g=d(t),y=[c,h,f].indexOf(l)>=0,v=[p,h,m].indexOf(l)>=0,b=(0,a.default)("editor-header__back-button","btn--icon-xl",{"editor-header__back-button--md-below":[h,f].indexOf(l)>=0}),C=(0,a.default)("editor-header__cancel-button","btn--icon-xl",{"editor-header__cancel-button--lg-above":[h,m].indexOf(l)>=0});return r.default.createElement("div",{className:"editor-header"},y&&r.default.createElement(s.default,{className:b,onClick:g}),r.default.createElement("div",{className:"editor-header__field"},u),n&&r.default.createElement(i.default,{onClick:d(n),icon:"edit-list",className:"editor-header__edit",outline:!0},o.default._t("AssetAdmin.DETAILS","Details")),v&&r.default.createElement("div",null,r.default.createElement(i.default,{icon:"cancel",className:C,noText:!0,onClick:g},o.default._t("AssetAdmin.CANCEL"))))};y.propTypes={onCancel:l.default.func,onDetails:l.default.func,showButton:l.default.oneOf(Object.keys(g).map((e=>g[e]))),children:l.default.node};t.default=y},5789:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.galleryViewPropTypes=t.galleryViewDefaultProps=t.default=t.Component=void 0;var r=I(n(1669)),o=I(n(5815)),i=O(n(1594)),s=n(9040),l=n(9367),a=I(n(853)),u=I(n(3229)),d=I(n(2853)),c=I(n(6609)),p=I(n(6379)),h=I(n(6621)),f=O(n(4201)),m=O(n(8918)),g=O(n(1369)),y=O(n(4461)),v=n(4172),b=I(n(4350)),C=I(n(6177)),S=I(n(9247)),E=n(5207),_=I(n(6935)),w=I(n(5609)),x=I(n(5769)),F=I(n(3863));function A(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(A=function(e){return e?n:t})(e)}function O(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=A(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function I(e){return e&&e.__esModule?e:{default:e}}const D={DELETE:"delete",ARCHIVE:"archive",EDIT:"edit",MOVE:"move",PUBLISH:"publish",UNPUBLISH:"unpublish",INSERT:"insert",ADMIN:"admin",SELECT:"select"};class N extends i.Component{constructor(e){super(e),this.handleOpenFolder=this.handleOpenFolder.bind(this),this.handleOpenFile=this.handleOpenFile.bind(this),this.handleSelect=this.handleSelect.bind(this),this.handleAddedFile=this.handleAddedFile.bind(this),this.handlePreviewLoaded=this.handlePreviewLoaded.bind(this),this.handleCancelUpload=this.handleCancelUpload.bind(this),this.handleRemoveErroredUpload=this.handleRemoveErroredUpload.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleSending=this.handleSending.bind(this),this.handleSort=this.handleSort.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.handleSuccessfulUpload=this.handleSuccessfulUpload.bind(this),this.handleQueueComplete=this.handleQueueComplete.bind(this),this.handleFailedUpload=this.handleFailedUpload.bind(this),this.handleClearSearch=this.handleClearSearch.bind(this),this.handleEnableDropzone=this.handleEnableDropzone.bind(this),this.handleMoveFiles=this.handleMoveFiles.bind(this),this.handleBulkEdit=this.handleBulkEdit.bind(this),this.handleBulkPublish=this.handleBulkPublish.bind(this),this.handleBulkUnpublish=this.handleBulkUnpublish.bind(this),this.handleBulkMove=this.handleBulkMove.bind(this),this.handleBulkInsert=this.handleBulkInsert.bind(this),this.handleBeginSelection=this.handleBeginSelection.bind(this),this.handleGroupSelect=this.handleGroupSelect.bind(this),this.handleClearSelection=this.handleClearSelection.bind(this),this.handleSelectAll=this.handleSelectAll.bind(this),this.toggleSelectConcat=this.toggleSelectConcat.bind(this),this.getSelectableFiles=this.getSelectableFiles.bind(this)}componentDidMount(){this.initSortDropdown(),window.addEventListener("keydown",this.toggleSelectConcat),window.addEventListener("keyup",this.toggleSelectConcat)}componentDidUpdate(e){this.initSortDropdown(),this.initFlushUploadFiles(e)}componentWillUnmount(){window.removeEventListener("keydown",this.toggleSelectConcat),window.removeEventListener("keyup",this.toggleSelectConcat)}initFlushUploadFiles(e){if("tile"!==this.props.view){this.getSortElement().off("change")}e.folderId!==this.props.folderId&&this.props.actions.queuedFiles.purgeUploadQueue()}getSortElement(){return(0,r.default)(this.gallery).find(".gallery__sort .dropdown")}getSearchMessage(e){const t=[];e.name&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEKEYWORDS","with keywords '{name}'")),e.lastEditedFrom&&e.lastEditedTo?t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEEDITEDBETWEEN","last edited between '{lastEditedFrom}' and '{lastEditedTo}'")):e.lastEditedFrom?t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEEDITEDFROM","last edited after '{lastEditedFrom}'")):e.lastEditedTo&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEEDITEDTO","last edited before '{lastEditedTo}'")),e.appCategory&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGECATEGORY","categorised as '{appCategory}'")),e.currentFolderOnly&&this.props.folder.title&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGELIMIT","limited to the folder '{folder}'"));const n=[t.slice(0,-1).join(`${o.default._t("AssetAdmin.JOIN",",")} `),t.slice(-1)].filter((e=>e)).join(` ${o.default._t("AssetAdmin.JOINLAST","and")} `);if(""===n)return"";const r={parts:o.default.inject(n,Object.assign({folder:this.props.folder.title},e,{appCategory:e.appCategory?e.appCategory.toLowerCase():void 0}))};return o.default.inject(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGE","Search results {parts}"),r)}getSelection(e,t){const n=this.getSelectableFiles(),r=[e,t].map((e=>n.findIndex((t=>t.id===e)))).filter((e=>-1!==e)).sort(((e,t)=>e-t));if(2!==r.length)return r.map((e=>n[e].id));const[o,i]=r;return n.filter(((e,t)=>t>=o&&t<=i)).map((e=>e.id))}getSelectableFiles(){const e=this.props.files.filter((e=>e.id));return this.props.type===D.SELECT?e.filter((e=>"folder"!==e.type)):e}handleBulkInsert(e,t){this.props.onInsertMany(e,t)}handleBulkPublish(e,t){const n=t.map((e=>e.id));return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onPublish(n).then((e=>{this.props.actions.gallery.setLoading(!1),this.props.actions.toasts.success(o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH_SUCCESS","%s folders/files were successfully published."),e.length)),this.props.actions.gallery.deselectFiles()}))):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}handleBulkUnpublish(e,t){const n=t.filter((e=>e.published)).map((e=>e.id));return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onUnpublish(n).then((e=>{this.props.actions.gallery.setLoading(!1),this.props.actions.toasts.success(o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH_SUCCESS","%s folders/files were successfully unpublished."),e.length)),this.props.actions.gallery.deselectFiles()}))):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}initSortDropdown(){if("tile"===this.props.view){const e=this.getSortElement();e.chosen({allow_single_deselect:!0,disable_search_threshold:20}),e.off("change"),e.on("change",(()=>e.find(":selected")[0].click()))}}handleSort(e){this.props.actions.queuedFiles.purgeUploadQueue(),this.props.onSort(e)}handleSetPage(e){this.props.onSetPage(e)}handleCancelUpload(e){e.xhr.abort(),this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}handleRemoveErroredUpload(e){this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}handleAddedFile(e){this.props.actions.queuedFiles.addQueuedFile(e)}handlePreviewLoaded(e,t){this.props.actions.queuedFiles.updateQueuedFile(e.queuedId,t)}handleSending(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{xhr:t})}handleUploadProgress(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{progress:t})}handleSuccessfulUpload(e){const t=JSON.parse(e.xhr.response);if(void 0!==t[0].error)return void this.handleFailedUpload(e);this.props.actions.queuedFiles.succeedUpload(e._queuedId,t[0]),this.props.onSuccessfulUpload&&this.props.onSuccessfulUpload(t);const n=this.props.queuedFiles.items.reduce(((e,t)=>100!==t.progress?e+1:e),0);if(!this.props.fileId&&!this.props.selectedFiles.length&&0===n){const e=t.pop();this.props.onOpenFile(e.id)}}handleQueueComplete(){this.props.onSuccessfulUploadQueue&&this.props.onSuccessfulUploadQueue()}handleFailedUpload(e,t){const n=e.xhr&&e.xhr.status?(0,S.default)(e.xhr.status,e.xhr):"";this.props.actions.queuedFiles.failUpload(e._queuedId,t,n)}itemIsSelected(e){return this.props.selectedFiles.indexOf(e)>-1}toggleSelectConcat(e){this.props.actions.gallery.setConcatenateSelect(this.isConcat(e))}isConcat(e){return e.metaKey||e.ctrlKey||e.shiftKey}itemIsHighlighted(e){return this.props.fileId===e}hasOpenedItem(){return!!this.props.fileId}handleClearSearch(e){this.props.onClearSearch(e)}handleGroupSelect(e,t){const{setSelectedFiles:n,selectFiles:r}=this.props.actions.gallery,o=this.getSelectableFiles(),i=e.filter(((t,n)=>e.indexOf(t)===n&&o.find((e=>e.id===t)))),s=this.props.concatenateSelect||this.isConcat(t);if(null!==this.props.maxFilesSelect){let e=i.length;if(s){e=this.props.selectedFiles.filter((e=>!this.props.selectedFiles.includes(e))).concat(this.props.selectedFiles).length}if(e>=this.props.maxFilesSelect)return}s?r(i):n(i)}handleClearSelection(){this.props.actions.gallery.deselectFiles()}handleSelectAll(){const e=this.props.files.map((e=>e.id));this.handleGroupSelect(e,new Event("na"))}handleBeginSelection(e){let t=e.target;for(;t;){if(t.classList.contains("griddle-footer"))return!1;if(t.classList.contains("gallery__main--selectable"))break;t=t.parentNode}return!0}handleOpenFolder(e,t){e.preventDefault(),this.props.onOpenFolder(t.id)}handleOpenFile(e,t){e.preventDefault(),null!==t.created&&(this.props.selectedFiles.length&&1!==this.props.maxFilesSelect||this.props.type!==D.SELECT||this.handleSelect(e,t),this.props.onOpenFile(t.id,t))}handleSelect(e,t){const n=this.props.maxFilesSelect;let r=this.getSelectableFiles().filter((e=>e.id===t.id)).map((e=>e.id));if(1!==n)if(-1===this.props.selectedFiles.indexOf(t.id)){e.shiftKey&&(r=this.getSelection(this.props.lastSelected,t.id));if(this.props.selectedFiles.filter((e=>!r.includes(e))).concat(r).length>n&&null!==n)return;this.props.actions.gallery.selectFiles(r),this.props.actions.gallery.setLastSelected(t.id)}else this.props.actions.gallery.deselectFiles([t.id]),e.shiftKey&&this.props.actions.gallery.setLastSelected(null);else this.props.actions.gallery.setSelectedFiles(r)}handleEnableDropzone(e){this.props.actions.gallery.setEnableDropzone(e)}handleMoveFiles(e,t){const n=this.props.sectionConfig.endpoints.move.url;return w.default.post(n,{ids:t,folderID:e},{"X-SecurityID":C.default.get("SecurityID")}).then((()=>{const n=p.default.MOVE_SUCCESS_DURATION,r=`+${t.length}`;this.props.actions.gallery.setFileBadge(e,r,"success",n),"function"==typeof this.props.onMoveFilesSuccess&&this.props.onMoveFilesSuccess(e,t)})).catch((()=>{this.props.actions.toasts.error(o.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))}))}handleBulkEdit(e,t){this.handleOpenFile(e,t[0])}handleBulkMove(){this.props.actions.gallery.activateModal(p.default.MODAL_MOVE)}renderTransitionBulkActions(){return this.renderBulkActions()}renderBulkActions(){const{type:e,dialog:t,maxFilesSelect:n,files:r,selectedFiles:o,BulkActionsComponent:s,sectionConfig:l}=this.props,a=e===D.SELECT||t?e=>e.value===D.INSERT:e=>e.value!==D.INSERT,u=l.filesAreVersioned&&l.archiveFiles?e=>e.value!==D.DELETE:e=>e.value!==D.ARCHIVE,d=p.default.BULK_ACTIONS.filter(a).filter(u).map((e=>{if(e.callback)return e;switch(e.value){case D.DELETE:case D.ARCHIVE:return{...e,callback:(e,t)=>{this.props.actions.confirmDeletion.confirm(t)},confirm:void 0};case D.EDIT:return{...e,callback:this.handleBulkEdit};case D.MOVE:return{...e,callback:this.handleBulkMove};case D.PUBLISH:return{...e,callback:this.handleBulkPublish};case D.UNPUBLISH:return{...e,callback:this.handleBulkUnpublish};case D.INSERT:return{...e,callback:this.handleBulkInsert,color:"primary"};default:return e}})),c=o.map((e=>r.find((t=>t&&e===t.id)))).filter((e=>e));return c.length>0&&[D.ADMIN,D.SELECT].includes(e)?i.default.createElement(s,{actions:d,items:c,total:n,key:c.length>0,container:this.gallery,showCount:1!==n,onClearSelection:this.handleClearSelection,onSelectAll:this.handleSelectAll}):null}renderGalleryView(){const e="table"===this.props.view?c.default:d.default,t=this.props.files.map((e=>{const t=this.itemIsSelected(e.id),n=this.itemIsHighlighted(e.id),r=(e.queuedId?`queueId${e.queuedId}`:`id${e.id}`)+(t?"--selected":"");return{...e,selected:t,highlighted:n,key:r}})),{type:n,loading:r,dialog:o,page:s,totalCount:l,limit:a,sort:u,selectedFiles:p,badges:h,maxFilesSelect:f,sectionConfig:m}=this.props,g={selectableItems:n===D.SELECT||n===D.ADMIN&&(!f||f>1),selectableFolders:n!==D.SELECT&&!o,files:t,loading:r,page:s,totalCount:l,limit:a,sort:u,selectedFiles:p,badges:h,onSort:this.handleSort,onSetPage:this.handleSetPage,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSelect:this.handleSelect,onCancelUpload:this.handleCancelUpload,onDropFiles:this.handleMoveFiles,onRemoveErroredUpload:this.handleRemoveErroredUpload,onEnableDropzone:this.handleEnableDropzone,sectionConfig:m,canDrag:n===D.ADMIN,maxFilesSelect:f};return i.default.createElement(e,g)}renderToolbar(){const{GalleryToolbar:e,sort:t,view:n,folder:r,onCreateFolder:o,onOpenFolder:s,onViewChange:l}=this.props,a={onMoveFiles:this.handleMoveFiles,onSort:this.handleSort,onCreateFolder:o,onOpenFolder:s,onViewChange:l,view:n,sort:t,folder:r};return i.default.createElement(e,a)}render(){const{folder:e,loading:t,errorMessage:n,noticeMessage:r}=this.props,s=this.props.LoadingComponent;if(!e)return n?i.default.createElement("div",{className:"gallery__error flexbox-area-grow"},i.default.createElement("div",{className:"gallery__error-message"},i.default.createElement("h3",null,o.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error.")),n&&i.default.createElement("p",null,n))):t?i.default.createElement("div",{className:"flexbox-area-grow"},i.default.createElement(s,null)):i.default.createElement("div",{className:"flexbox-area-grow"},i.default.createElement("div",{className:"editor__file-preview-message--file-missing m-t-3"},o.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")));const l=i.default.createElement("div",{className:"gallery_messages"},n&&i.default.createElement(h.default,{value:n,type:"danger"}),r&&i.default.createElement(h.default,{value:r,type:"success"})),u={height:p.default.THUMBNAIL_HEIGHT,width:p.default.THUMBNAIL_WIDTH},d={url:this.props.createFileApiUrl,method:this.props.createFileApiMethod,paramName:"Upload",clickable:"#upload-button",...this.props.sectionConfig.dropzoneOptions},c=this.props.securityId,f=this.props.folder.canEdit&&this.props.enableDropzone,m=["panel","panel--padded","panel--scrollable","gallery__main","fill-height"];this.props.type===D.INSERT&&m.push("insert-media-modal__main");const g=m;return this.hasOpenedItem()&&g.push("gallery__main--has-opened-item"),i.default.createElement("div",{className:"flexbox-area-grow gallery__outer",ref:e=>{this.gallery=e}},this.renderTransitionBulkActions(),i.default.createElement(F.default,{className:m.join(" ")},this.renderToolbar(),i.default.createElement(v.SelectableGroup,{enabled:"tile"===this.props.view&&this.props.type===D.ADMIN,className:"flexbox-area-grow fill-height gallery__main--selectable",onSelection:this.handleGroupSelect,onNonItemClick:this.handleClearSelection,onBeginSelection:this.handleBeginSelection,preventDefault:!1,fixedPosition:!0},i.default.createElement(a.default,{name:"gallery-container",className:"flexbox-area-grow",canUpload:f,onAddedFile:this.handleAddedFile,onPreviewLoaded:this.handlePreviewLoaded,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onQueueComplete:this.handleQueueComplete,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:u,folderId:this.props.folderId,options:d,securityID:c,uploadButton:!1},l,this.renderGalleryView()))),this.props.loading&&i.default.createElement(s,null),i.default.createElement(x.default,{sectionConfig:this.props.sectionConfig,folderId:this.props.folderId,onSuccess:this.props.onMoveFilesSuccess,onOpenFolder:this.props.onOpenFolder}))}}t.Component=N;const R={page:1,limit:15},M={sectionConfig:b.default,loading:_.default.bool,sort:_.default.string,files:_.default.arrayOf(_.default.shape({id:_.default.number,parent:_.default.shape({id:_.default.number})})).isRequired,selectedFiles:_.default.arrayOf(_.default.number),totalCount:_.default.number,page:_.default.number,limit:_.default.number,badges:_.default.arrayOf(_.default.shape({id:_.default.number,message:_.default.node,status:_.default.string})),onOpenFile:_.default.func.isRequired,onOpenFolder:_.default.func.isRequired,onSort:_.default.func.isRequired,onSetPage:_.default.func.isRequired,maxFilesSelect:_.default.number};t.galleryViewDefaultProps=Object.assign({},R,{selectableItems:!1}),t.galleryViewPropTypes=Object.assign({},M,{selectableItems:_.default.bool,selectableFolders:_.default.bool,onSelect:_.default.func,onCancelUpload:_.default.func,onRemoveErroredUpload:_.default.func,onEnableDropzone:_.default.func});N.defaultProps=Object.assign({},R,{type:D.ADMIN,view:"tile",enableDropzone:!0,dialog:!1,BulkActionsComponent:u.default}),N.propTypes=Object.assign({},M,{onSuccessfulUpload:_.default.func,onSuccessfulUploadQueue:_.default.func,onCreateFolder:_.default.func,onMoveFilesSuccess:_.default.func,onPublish:_.default.func,onUnpublish:_.default.func,type:_.default.oneOf(["insert-media","insert-link",D.SELECT,D.ADMIN]),view:_.default.oneOf(["tile","table"]),lastSelected:_.default.number,dialog:_.default.bool,fileId:_.default.number,folderId:_.default.number.isRequired,folder:_.default.shape({id:_.default.number,title:_.default.string,parentId:_.default.number,canView:_.default.bool,canEdit:_.default.bool}),files:_.default.array,errorMessage:_.default.string,actions:_.default.object,securityId:_.default.string,onViewChange:_.default.func.isRequired,createFileApiUrl:_.default.string,createFileApiMethod:_.default.string,search:_.default.object,enableDropzone:_.default.bool,concatenateSelect:_.default.bool,GalleryToolbar:_.default.elementType,sorters:_.default.arrayOf(_.default.shape({field:_.default.string.isRequired,direction:_.default.oneOf(["asc","desc"]).isRequired,label:_.default.string.isRequired})).isRequired,BulkActionsComponent:_.default.oneOfType([_.default.object,_.default.func])});t.default=(0,l.compose)((0,E.inject)(["GalleryToolbar","Loading"],((e,t)=>({GalleryToolbar:e,LoadingComponent:t})),(()=>"AssetAdmin.Gallery")),(0,s.connect)((function(e,t){let{sort:n}=t;const{selectedFiles:r,errorMessage:o,noticeMessage:i,enableDropzone:s,badges:l,concatenateSelect:a,loading:u,sorters:d,lastSelected:c}=e.assetAdmin.gallery;return!n&&d&&d[0]&&(n=`${d[0].field},${d[0].direction}`),{lastSelected:c,selectedFiles:r,errorMessage:o,noticeMessage:i,enableDropzone:s,badges:l,concatenateSelect:a,loading:t.loading||u,queuedFiles:e.assetAdmin.queuedFiles,securityId:e.config.SecurityID,sorters:d,sort:n}}),(function(e){return{actions:{gallery:(0,l.bindActionCreators)(f,e),toasts:(0,l.bindActionCreators)(m,e),queuedFiles:(0,l.bindActionCreators)(g,e),confirmDeletion:(0,l.bindActionCreators)(y,e)}}})))(N)},3863:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=a(n(6923)),i=a(n(2914)),s=a(n(6935)),l=a(n(5799));function a(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}class d extends r.Component{constructor(e){super(e),this.state={dragging:!1},this.mounted=!1,this.handleDrop=this.handleDrop.bind(this)}componentDidMount(){this.mounted=!0,window.addEventListener("drop",this.handleDrop,!0)}componentDidUpdate(){setTimeout((()=>{if(!this.mounted||!this.context.dragDropManager)return;const e=this.context.dragDropManager.monitor.isDragging();this.state.dragging!==e&&this.setState({dragging:e})}))}componentWillUnmount(){this.mounted=!1,window.removeEventListener("drop",this.handleDrop,!0)}handleDrop(){const e=this.context.dragDropManager,t=e&&e.backend;t&&t.isDraggingNativeItem()&&t.endDragNativeItem()}render(){const{className:e,children:t}=this.props;return r.default.createElement("div",{className:(0,o.default)(e,{"gallery__main--dragging":this.state.dragging})},t,r.default.createElement(i.default,null))}}d.contextTypes={dragDropManager:s.default.object},d.propTypes={className:s.default.string,children:s.default.oneOfType([s.default.arrayOf(s.default.node),s.default.node])};t.default=(0,l.default)(d)},6931:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=b(n(5815)),o=v(n(1594)),i=n(9367),s=n(9040),l=b(n(7917)),a=b(n(2908)),u=b(n(1957)),d=v(n(4201)),c=v(n(1021)),p=b(n(8737)),h=b(n(6923)),f=b(n(6935)),m=b(n(8268)),g=b(n(7675));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}function v(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function b(e){return e&&e.__esModule?e:{default:e}}class C extends o.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this)}componentDidMount(){const{isOpen:e,onBrowse:t,setOverrides:n,fileAttributes:r,folderId:o}=this.props;e?"function"==typeof n&&r.ID&&(n(this.props),t(o,r.ID)):t(o||0)}componentDidUpdate(e){!this.props.isOpen&&e.isOpen&&(this.props.onBrowse(this.props.folderId),this.props.actions.gallery.deselectFiles()),"function"==typeof e.setOverrides&&this.props.isOpen&&!e.isOpen&&(e.setOverrides(this.props),this.props.onBrowse(this.props.folderId,this.props.fileAttributes?this.props.fileAttributes.ID:null))}getSectionProps(){return{...this.props,dialog:!0,toolbarChildren:this.renderToolbarChildren(),onSubmitEditor:this.handleSubmit,onReplaceUrl:this.props.onBrowse}}getModalProps(){const{onHide:e,onInsert:t,sectionConfig:n,schemaUrl:r,className:o,...i}=this.props;return{...i,className:(0,h.default)("insert-media-modal",o),size:"lg",showCloseButton:!1}}handleSubmit(e,t,n,r){return"action_insert"===t?this.props.onInsert(e,r):n()}renderToolbarChildren(){return o.default.createElement("button",{type:"button",className:"close modal__close-button insert-media-modal__close-button",onClick:this.props.onClosed,"aria-label":r.default._t("FormBuilderModal.CLOSE","Close")},o.default.createElement("span",{"aria-hidden":"true"},"×"))}render(){const e=this.getModalProps(),t=this.getSectionProps(),n=this.props.isOpen?o.default.createElement(l.default,t):null;return o.default.createElement(p.default,e,n)}}t.Component=C,C.propTypes={sectionConfig:f.default.shape({url:f.default.string,form:f.default.object}),type:f.default.oneOf(["insert-media","insert-link","select","admin"]),schemaUrl:f.default.string,isOpen:f.default.bool,setOverrides:f.default.func,onInsert:f.default.func.isRequired,fileAttributes:f.default.shape({ID:f.default.number,AltText:f.default.string,Width:f.default.number,Height:f.default.number,Loading:f.default.string,TitleTooltip:f.default.string,Alignment:f.default.string,Description:f.default.string,TargetBlank:f.default.bool}),requireLinkText:f.default.bool,folderId:f.default.number,fileId:f.default.number,viewAction:f.default.string,query:f.default.object,getUrl:f.default.func,onBrowse:f.default.func.isRequired,onClosed:f.default.func,className:f.default.string,actions:f.default.object,maxFiles:f.default.number,fileSelected:f.default.bool},C.defaultProps={className:"",fileAttributes:{},type:"insert-media",folderId:0,maxFiles:1};t.default=(0,i.compose)(a.default,(0,s.connect)((function(e,t){const n=t.sectionConfig;if(!n)return{};let r=0;null!==t.folderId?r=t.folderId:t.folder&&(r=t.folder.id);const o=t.fileAttributes?t.fileAttributes.ID:t.fileId,i=e.assetAdmin.modal.formSchema,s={config:n,viewAction:t.viewAction,folderId:r,type:i&&i.type,fileId:o},{schemaUrl:l,targetId:a}=(0,m.default)(s);if(!l)return{};const u={};t.requireLinkText&&(u.requireLinkText=!0),t.fileSelected&&(u.fileSelected=!0);let d=g.default.stringify(u);return d=d?`?${d}`:"",{schemaUrl:`${l}/${a}${d}`,type:i&&i.type}}),(function(e){return{actions:{gallery:(0,i.bindActionCreators)(d,e),modal:(0,i.bindActionCreators)(c,e)}}})),u.default)(C)},5769:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=m(n(1594)),o=n(9040),i=n(9367),s=m(n(5815)),l=m(n(6379)),a=m(n(6935)),u=n(4201),d=n(8918),c=m(n(8737)),p=m(n(4350)),h=m(n(6177)),f=m(n(5609));function m(e){return e&&e.__esModule?e:{default:e}}class g extends r.default.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this),this.timeout=null}handleSubmit(e){let{FolderID:t}=e;const{selectedFiles:n,onSuccess:r,onClosed:o,setNotice:i,setError:a,setBadge:u}=this.props;let d=this.props.sectionConfig.endpoints.move.url;return f.default.post(d,{ids:n,folderID:t},{"X-SecurityID":h.default.get("SecurityID")}).then((()=>(d=`${this.props.sectionConfig.endpoints.read.url}/${t}`,f.default.get(d)))).then((e=>e.json())).then((e=>{"function"==typeof r&&r(e.id,n),u(e.id,`${n.length}`,"success",l.default.MOVE_SUCCESS_DURATION),i(s.default.sprintf(s.default._t("AssetAdmin.MOVED_ITEMS_TO","Moved %s item(s) to %s"),n.length,e.name),[{label:s.default._t("AssetAdmin.GO_TO_FOLDER","Go to folder"),onClick:()=>this.props.onOpenFolder(e.id)}]),o()})).catch((()=>{a(s.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))}))}render(){const{isOpen:e,onClosed:t,title:n,folderId:o,sectionConfig:i}=this.props,{schemaUrl:s}=i.form.moveForm;return r.default.createElement(c.default,{title:n,isOpen:e,onClosed:t,onSubmit:this.handleSubmit,identifier:"AssetAdmin.MoveForm",schemaUrl:`${s}/${o}`})}}g.propTypes={sectionConfig:p.default,folderId:a.default.number.isRequired,isOpen:a.default.bool,onClosed:a.default.func,setNotice:a.default.func,setBadge:a.default.func,setError:a.default.func,title:a.default.string,onSuccess:a.default.func,onOpenFolder:a.default.func.isRequired,selectedFiles:a.default.array.isRequired},g.defaultProps={isOpen:!1};t.default=(0,i.compose)((0,o.connect)((function(e){const{modal:t,selectedFiles:n}=e.assetAdmin.gallery;return{isOpen:t===l.default.MODAL_MOVE,selectedFiles:n,title:s.default.sprintf(s.default._t("AssetAdmin.MOVE_ITEMS_TO","Move %s item(s) to..."),n.length)}}),(function(e){return{onClosed(){e((0,u.deactivateModal)())},setNotice(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e((0,d.display)({text:t,type:"success",actions:n}))},setError(t){e((0,d.display)({text:t,type:"error"}))},setBadge(){e((0,u.setFileBadge)(...arguments))}}})))(g)},6609:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=p(n(6935)),i=p(n(9888)),s=p(n(5815)),l=p(n(1990)),a=n(5789),u=n(5716),d=n(5207),c=n(9367);function p(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}class f extends r.Component{constructor(e){super(e),this.getColumns=this.getColumns.bind(this),this.handleSort=this.handleSort.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.handleRowClick=this.handleRowClick.bind(this),this.renderSelect=this.renderSelect.bind(this),this.renderTitle=this.renderTitle.bind(this),this.renderStatus=this.renderStatus.bind(this),this.renderNoItemsNotice=this.renderNoItemsNotice.bind(this)}getColumns(){const e=["thumbnail","title","status","size","lastEdited"];return this.props.selectableItems&&e.unshift("selected"),e}getColumnConfig(){return[{columnName:"selected",sortable:!1,displayName:"",cssClassName:"gallery__table-column--select",customComponent:this.renderSelect},{columnName:"thumbnail",sortable:!1,displayName:"",cssClassName:"gallery__table-column--image",customComponent:this.renderThumbnail},{columnName:"title",customCompareFn:()=>0,displayName:s.default._t("File.TITLE","Title"),cssClassName:"gallery__table-column--title",customComponent:this.renderTitle},{columnName:"status",sortable:!1,cssClassName:"sort--disabled",customComponent:this.renderStatus,displayName:s.default._t("File.STATUS","Status")},{columnName:"lastEdited",displayName:s.default._t("File.MODIFIED","Modified"),customComponent:this.renderDate},{columnName:"size",sortable:!1,displayName:s.default._t("File.SIZE","Size"),cssClassName:"sort--disabled",customComponent:this.renderSize}]}getRowMetadata(e){return"gallery__table-row "+(e.highlighted?"gallery__table-row--highlighted":"")}getTableProps(){const[e,t]=this.props.sort.split(",");return{tableClassName:"gallery__table table table-hover",gridClassName:"gallery__main-view--table",rowMetadata:{bodyCssClassName:this.getRowMetadata,key:"key"},sortAscendingComponent:"",sortDescendingComponent:"",useExternal:!0,externalSetPage:this.handleSetPage,externalChangeSort:this.handleSort,externalSetFilter:()=>null,externalSetPageSize:()=>null,externalCurrentPage:this.props.page-1,externalMaxPage:Math.ceil(this.props.totalCount/this.props.limit),externalSortColumn:e,externalSortAscending:"asc"===t,initialSort:e,columns:this.getColumns(),columnMetadata:this.getColumnConfig(),useGriddleStyles:!1,onRowClick:this.handleRowClick,results:this.props.files,customNoDataComponent:this.renderNoItemsNotice}}handleActivate(e,t){"folder"===t.type?this.props.onOpenFolder(e,t):this.props.onOpenFile(e,t)}handleRowClick(e,t){const n=e.props.data;t.currentTarget.classList.contains("gallery__table-column--select")&&(t.stopPropagation(),t.preventDefault(),"function"==typeof this.props.onSelect)?this.props.onSelect(t,n):this.handleActivate(t,n)}handleSort(e,t){const n=t?"asc":"desc";this.props.onSort(`${e},${n}`)}handleSetPage(e){this.props.onSetPage(e+1)}preventFocus(e){e.preventDefault()}renderNoItemsNotice(){return 0!==this.props.files.length||this.props.loading?null:r.default.createElement("p",{className:"gallery__no-item-notice"},s.default._t("AssetAdmin.NOITEMSFOUND"))}renderSize(e){if("folder"===e.rowData.type)return null;const t=(0,u.fileSize)(e.data);return r.default.createElement("span",null,t)}renderStatus(e){let t=[];const n=e.rowData,{VersionedBadge:o}=this.props;return"folder"!==n.type&&(n.draft?t.push({key:"status-draft",status:"draft"}):n.modified&&t.push({key:"status-modified",status:"modified"})),t=t.map((e=>{let{...t}=e;return r.default.createElement(o,t)})),t?r.default.createElement("span",null,t):null}renderProgressBar(e){if(!e.queuedId||e.message&&"error"===e.message.type)return null;if(e.id>0)return r.default.createElement("div",{className:"gallery__progress-bar--complete"});const t={className:"gallery__progress-bar-progress",style:{width:`${e.progress}%`}};return r.default.createElement("div",{className:"gallery__progress-bar"},r.default.createElement("div",t))}renderRestrictedAccess(e){const{hasRestrictedAccess:t}=e,n={fileID:e.id,placement:"top",hasRestrictedAccess:t};return r.default.createElement(l.default,n)}renderTrackedFormUpload(e){const{isTrackedFormUpload:t,hasRestrictedAccess:n}=e,o={fileID:e.id,placement:"top",isTrackedFormUpload:t,hasRestrictedAccess:n};return r.default.createElement(l.default,o)}renderTitle(e){const t=this.renderProgressBar(e.rowData);return r.default.createElement("div",{className:"fill-width"},r.default.createElement("div",{className:"flexbox-area-grow"},r.default.createElement("span",null,e.data),e.rowData.hasRestrictedAccess&&this.renderRestrictedAccess(e.rowData),e.rowData.isTrackedFormUpload&&this.renderTrackedFormUpload(e.rowData)),t)}renderSelect(e){if(this.props.selectableItems&&(this.props.selectableFolders||"folder"!==e.rowData.type)){const t={type:"checkbox",title:s.default._t("AssetAdmin.SELECT"),defaultChecked:e.data,tabIndex:-1,onMouseDown:this.preventFocus};return![null,1].includes(this.props.maxFilesSelect)&&this.props.selectedFiles.length>=this.props.maxFilesSelect&&!e.data&&(t.disabled=!0),r.default.createElement("input",t)}return null}renderDate(e){return"folder"===e.rowData.type?null:(moment.locale(s.default.detectLocale()),r.default.createElement("span",null,moment(e.data).format("L LT")))}renderThumbnail(e){const t=e.data||e.rowData.url,n=e.rowData.queuedId&&!e.rowData.id,o=e.rowData.category||"false",i="gallery__table-image",s=[i],l={};return s.push(`${i}--${o}`),"image"===o&&t&&(l.backgroundImage=`url("${t}")`),n||t||"folder"===o||s.push(`${i}--error`),r.default.createElement("div",{className:s.join(" "),style:l})}render(){return r.default.createElement(i.default,this.getTableProps())}}t.Component=f,f.defaultProps=a.galleryViewDefaultProps,f.propTypes={...a.galleryViewPropTypes,sort:o.default.string.isRequired,VersionedBadge:o.default.elementType};t.default=(0,c.compose)((0,d.inject)(["VersionedBadge"],(e=>({VersionedBadge:e}))))(f)},2853:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=d(n(5815)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),i=n(5207),s=n(5789),l=d(n(9888)),a=d(n(6935));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function d(e){return e&&e.__esModule?e:{default:e}}class c extends o.Component{constructor(e){super(e),this.renderItem=this.renderItem.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.handlePrevPage=this.handlePrevPage.bind(this),this.handleNextPage=this.handleNextPage.bind(this),this.handleDrag=this.handleDrag.bind(this)}handleDrag(e){this.props.onEnableDropzone(!e)}handleSetPage(e){this.props.onSetPage(e+1)}handleNextPage(){const e=this.props.page-1;this.handleSetPage(e+1)}handlePrevPage(){const e=this.props.page-1;0!==e?this.handleSetPage(e-1):this.handleSetPage(e)}folderFilter(e){return"folder"===e.type}fileFilter(e){return"folder"!==e.type}renderPagination(){if(this.props.totalCount<=this.props.limit)return null;const e={setPage:this.handleSetPage,maxPage:Math.ceil(this.props.totalCount/this.props.limit),next:this.handleNextPage,nextText:r.default._t("AssetAdmin.NEXT","Next"),previous:this.handlePrevPage,previousText:r.default._t("AssetAdmin.PREVIOUS","Previous"),currentPage:this.props.page-1,useGriddleStyles:!1};return o.default.createElement("div",{className:"griddle-footer"},o.default.createElement(l.default.GridPagination,e))}renderItem(e){const{File:t,Folder:n,badges:r,sectionConfig:i,selectedFiles:s,selectableItems:l,selectableFolders:a}=this.props,u=r.find((t=>t.id===e.id));let d={sectionConfig:i,key:e.key,selectableKey:e.id,item:e,selectedFiles:s,onDrag:this.handleDrag,badge:u,canDrag:this.props.canDrag};if(e.queuedId&&!e.id){const{onCancelUpload:e,onRemoveErroredUpload:t}=this.props;d={...d,onCancelUpload:e,onRemoveErroredUpload:t}}else{const{onOpenFolder:t,onOpenFile:n}=this.props;d={...d,onActivate:"folder"===e.type?t:n}}if(l&&(a||"folder"!==e.type)){const e=![null,1].includes(this.props.maxFilesSelect)&&this.props.selectedFiles.length>=this.props.maxFilesSelect,t=1===this.props.maxFilesSelect?d.onActivate:this.props.onSelect;d={...d,selectable:!0,onSelect:t,maxSelected:e}}if("folder"===e.type){const{onDropFiles:e}=this.props;return d={...d,onDropFiles:e},o.default.createElement(n,d)}return o.default.createElement(t,d)}render(){return o.default.createElement("div",{className:"gallery__main-view--tile"},o.default.createElement("div",{className:"gallery__folders"},this.props.files.filter(this.folderFilter).map(this.renderItem)),o.default.createElement("div",{className:"gallery__files"},this.props.files.filter(this.fileFilter).map(this.renderItem)),0===this.props.files.length&&!this.props.loading&&o.default.createElement("p",{className:"gallery__no-item-notice"},r.default._t("AssetAdmin.NOITEMSFOUND")),o.default.createElement("div",{className:"gallery__load"},this.renderPagination()))}}t.Component=c,c.defaultProps=s.galleryViewDefaultProps,c.propTypes={...s.galleryViewPropTypes,File:a.default.elementType.isRequired,Folder:a.default.elementType.isRequired};const p=(0,i.inject)(["GalleryItemFile","GalleryItemFolder"],((e,t)=>({File:e,Folder:t})),(()=>"AssetAdmin.Gallery.ThumbnailView"));t.default=p(c)},2499:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.imageSizePresetButtons=function(e,t){return t.map((t=>function(e,t){const{name:n,width:r,text:o}=t,i=`ssmedia${n}`;e.on("init",(()=>{e.formatter.register(i,{selector:"img",attributes:{width:r?r.toString():""}})}));const s=()=>{let t=e.selection.getNode();return"IMG"!==t.tagName&&t.children.item("img")&&(t=t.children.item("img")),t&&"IMG"===t.tagName?t:void 0},l=e=>{const t=s();e.disabled(!(!t||!r)&&t.naturalWidth{if(e.formatter.match(i))return!0;const t=s();if(!r&&t){const e=t.getAttribute("width");return!e||e.toString()===t.naturalWidth.toString()}return!1},u=t=>{const n=t.target,o=()=>{n.active(a())};if(e.on("NodeChange",(()=>{l(n),o()})),l(n),e.formatter&&(e.formatter.formatChanged(i,o),a())){e.formatter.apply(i);const t=s();t&&t.setAttribute("width",r||t.naturalWidth)}},d=()=>{const t=s();t&&(t.removeAttribute("height"),t.removeAttribute("width"),e.formatter.apply(i),r?t.setAttribute("height",t.clientHeight):(t.setAttribute("width",t.naturalWidth),t.setAttribute("height",t.naturalHeight)))};return e.ui.registry.addButton(i,{text:o,onAction:d,onPostRender:u}),i}(e,t)))}},4350:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(6935))&&r.__esModule?r:{default:r};const i=o.default.shape({url:o.default.string,limit:o.default.number,imageRetry:o.default.shape({minRetry:o.default.number,maxRetry:o.default.number,expiry:o.default.number}),form:o.default.object,dropzoneOptions:o.default.object});t.default=i},6022:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(6935))&&r.__esModule?r:{default:r};const i=o.default.shape({canEdit:o.default.bool,canDelete:o.default.bool,canView:o.default.bool,exists:o.default.bool,type:o.default.string,smallThumbnail:o.default.string,thumbnail:o.default.string,width:o.default.number,height:o.default.number,category:o.default.oneOfType([o.default.bool,o.default.string]),id:o.default.number,url:o.default.string,title:o.default.string,progress:o.default.number,visibility:o.default.string,hasRestrictedAccess:o.default.bool,isTrackedFormUpload:o.default.bool});t.default=i},8268:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{config:{form:t},viewAction:n,folderId:r,fileId:o,type:l}=e,a=null,u=null;if(n===i)return a=t.folderCreateForm.schemaUrl,u=r,{schemaUrl:a,targetId:u};if(n===s&&o){switch(l){case"insert-media":a=t.fileInsertForm.schemaUrl;break;case"insert-link":a=t.fileEditorLinkForm.schemaUrl;break;case"select":a=t.fileSelectForm.schemaUrl;break;default:a=t.fileEditForm.schemaUrl}return u=o,{schemaUrl:a,targetId:u}}return{}};var r,o=(r=n(6379))&&r.__esModule?r:{default:r};const{CREATE_FOLDER:i,EDIT_FILE:s}=o.default.ACTIONS},9247:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(413===e)return o.default._t("AssetAdmin.ERROR_FILE_SIZE","File size limit exceeded");if(403===e&&t&&"string"==typeof t.response)return t.response;return o.default._t("AssetAdmin.ERROR_DEFAULT","Something went wrong, please try again")};var r,o=(r=n(5815))&&r.__esModule?r:{default:r}},6405:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={CONFIRM_DELETION_ASK:"CONFIRM_DELETION_ASK",CONFIRM_DELETION_CONFIRM:"CONFIRM_DELETION_CONFIRM",CONFIRM_DELETION_CANCEL:"CONFIRM_DELETION_CANCEL",CONFIRM_DELETION_RESET:"CONFIRM_DELETION_RESET",CONFIRM_DELETION_MODAL_CLOSE:"CONFIRM_DELETION_MODAL_CLOSE"}},4461:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cancel=function(){return{type:o.default.CONFIRM_DELETION_CANCEL,payload:{}}},t.confirm=function(e){return{type:o.default.CONFIRM_DELETION_ASK,payload:{files:e}}},t.deleting=function(){return{type:o.default.CONFIRM_DELETION_CONFIRM,payload:{}}},t.modalClose=function(){return{type:o.default.CONFIRM_DELETION_MODAL_CLOSE,payload:{}}},t.reset=function(){return{type:o.default.CONFIRM_DELETION_RESET,payload:{}}};var r,o=(r=n(6405))&&r.__esModule?r:{default:r}},762:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NO_TRANSITION=t.DELETING=t.CANCELING=void 0;t.NO_TRANSITION=!1,t.CANCELING="canceling",t.DELETING="deleting"},6533:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={TOGGLE_SEARCH:"TOGGLE_SEARCH",OPEN_SEARCH:"OPEN_SEARCH",CLOSE_SEARCH:"CLOSE_SEARCH"}},9517:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.closeSearch=function(){return{type:o.default.CLOSE_SEARCH,payload:null}},t.openSearch=function(){return{type:o.default.OPEN_SEARCH,payload:null}},t.toggleSearch=function(){return{type:o.default.TOGGLE_SEARCH,payload:null}};var r,o=(r=n(6533))&&r.__esModule?r:{default:r}},4913:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=["SET_LAST_SELECTED","SET_SELECTED_FILES","DESELECT_FILES","SELECT_FILES","LOAD_FILE_REQUEST","LOAD_FILE_SUCCESS","HIGHLIGHT_FILES","UPDATE_BATCH_ACTIONS","SET_NOTICE_MESSAGE","SET_ERROR_MESSAGE","SET_ENABLE_DROPZONE","SET_FILE_BADGE","CLEAR_FILE_BADGE","ACTIVATE_MODAL","DEACTIVATE_MODAL","CONCATENATE_SELECT","SET_LOADING"].reduce(((e,t)=>Object.assign(e,{[t]:`GALLERY.${t}`})),{})},4201:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activateModal=function(e){return t=>{t({type:o.default.ACTIVATE_MODAL,payload:e})}},t.clearFileBadge=i,t.deactivateModal=function(){return e=>{e({type:o.default.DEACTIVATE_MODAL})}},t.deselectFiles=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>t({type:o.default.DESELECT_FILES,payload:{ids:e}})},t.loadFile=function(e,t){return n=>{n({type:o.default.LOAD_FILE_SUCCESS,payload:{id:e,file:t}})}},t.selectFiles=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>t({type:o.default.SELECT_FILES,payload:{ids:e}})},t.setConcatenateSelect=function(e){return t=>t({type:o.default.CONCATENATE_SELECT,payload:!!e})},t.setEnableDropzone=function(e){return t=>t({type:o.default.SET_ENABLE_DROPZONE,payload:{enableDropzone:e}})},t.setErrorMessage=function(e){return t=>t({type:o.default.SET_ERROR_MESSAGE,payload:{message:e}})},t.setFileBadge=function(e,t,n,r){return(s,l)=>{const{assetAdmin:a}=l(),u=a.gallery.badges.find((t=>t.id===e));u&&u.timer&&clearTimeout(u.timer);const d=r>0?setTimeout((()=>i(e)(s)),r):null;s({type:o.default.SET_FILE_BADGE,payload:{id:e,message:t,status:n,timer:d}})}},t.setLastSelected=function(e){return t=>{t({type:o.default.SET_LAST_SELECTED,payload:{id:e}})}},t.setLoading=function(e){return t=>{t({type:o.default.SET_LOADING,payload:!!e})}},t.setNoticeMessage=function(e){return t=>t({type:o.default.SET_NOTICE_MESSAGE,payload:{message:e}})},t.setSelectedFiles=function(e){return t=>{t({type:o.default.SET_SELECTED_FILES,payload:{files:e}})}};var r,o=(r=n(4913))&&r.__esModule?r:{default:r};function i(e){return t=>{t({type:o.default.CLEAR_FILE_BADGE,payload:{id:e}})}}},423:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultImageFactory=t.default=void 0;var r=i(n(1838)),o=i(n(8632));function i(e){return e&&e.__esModule?e:{default:e}}const s={minRetry:0,maxRetry:0,expiry:0,onStatusChange:()=>null,onRetry:()=>null,onReset:()=>null,onTimeout:()=>null},l=(e,t,n)=>{const r=new Image;r.onload=t,r.onerror=n,r.src=e};t.defaultImageFactory=l;t.default=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;this.options={...s,...e},this.factory=t}loadImage(e){return this.options.minRetry&&o.default.lock(e)?this.loadImageLoop(e,this.options.minRetry):null}loadImageLoop(e,t){return this.options.onStatusChange(e,r.default.LOADING),new Promise(((t,n)=>this.factory(e,t,n))).then((()=>this.handleSuccess(e))).catch((()=>this.handleError(e,t)))}handleReset(e,t){this.options.onReset(e),t()}handleTimeout(e,t){const n=setTimeout(e,t);return this.options.onTimeout(n,t),n}handleSuccess(e){o.default.unlock(e),this.options.onStatusChange(e,r.default.SUCCESS)}handleFailure(e){return o.default.unlock(e),this.options.onStatusChange(e,r.default.FAILED),this.options.expiry?new Promise((t=>{this.handleTimeout((()=>this.handleReset(e,t)),1e3*this.options.expiry)})):null}handleError(e,t){return t>this.options.maxRetry?this.handleFailure(e):(this.options.onStatusChange(e,r.default.WAITING),this.handleRetry(e,t))}handleRetry(e,t){const n=new Promise((n=>{this.handleTimeout((()=>n(this.loadImageLoop(e,2*t))),1e3*t)}));return this.options.onRetry(e,t,n),n}setOnRetry(e){this.options.onRetry=e}setOnReset(e){this.options.onReset=e}setOnStatusChange(e){this.options.onStatusChange=e}setOnTimeout(e){this.options.onTimeout=e}}},2153:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={SET_STATUS:"IMAGE_LOAD_SET_STATUS",RESET:"IMAGE_LOAD_RESET"}},769:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadImage=function(e,t){return(n,i)=>{if(!e)return null;if(i().assetAdmin.imageLoad.files.find((t=>t.url===e)))return null;const s={...t,onStatusChange:(e,t)=>n({type:r.default.SET_STATUS,payload:{status:t,url:e}}),onReset:e=>n({type:r.default.RESET,payload:{url:e}})};return new o.default(s).loadImage(e)}};var r=i(n(2153)),o=i(n(423));function i(e){return e&&e.__esModule?e:{default:e}}},8632:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;class n{constructor(){this.urls=[]}lock(e){return!(this.urls.indexOf(e)>=0)&&(this.urls=[...this.urls,e],!0)}unlock(e){this.urls=this.urls.filter((t=>t!==e))}}t.Component=n,window.ss=window.ss||{},window.ss.imagelocker=window.ss.imagelocker||new n;t.default=window.ss.imagelocker},1838:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={DISABLED:"DISABLED",NONE:"NONE",SUCCESS:"SUCCESS",LOADING:"LOADING",WAITING:"WAITING",FAILED:"FAILED"}},2613:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={DEFINE_IMAGE_SIZE_PRESETS:"DEFINE_IMAGE_SIZE_PRESETS",INIT_FORM_SCHEMA_STACK:"INIT_FORM_SCHEMA_STACK",POP_FORM_SCHEMA:"POP_FORM_SCHEMA",PUSH_FORM_SCHEMA:"PUSH_FORM_SCHEMA",RESET:"RESET",RESET_FORM_STACK:"RESET_FORM_STACK"}},1021:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defineImageSizePresets=function(e){return{type:i.default.DEFINE_IMAGE_SIZE_PRESETS,payload:{imageSizePresets:e}}},t.initFormStack=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:i.default.INIT_FORM_SCHEMA_STACK,payload:{formSchema:{type:e,nextType:t}}}},t.popFormStackEntry=function(){return{type:i.default.POP_FORM_SCHEMA}},t.pushFormStackEntry=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:i.default.PUSH_FORM_SCHEMA,payload:{formSchema:{type:e,nextType:t}}}},t.reset=function(){return{type:i.default.RESET}},t.resetFormStack=function(){return{type:i.default.RESET_FORM_STACK}},t.stashFormValues=function(e,t){return(n,i)=>{const l=i(),a=(0,r.default)(l.form.formState,`${e}.values`),u=(0,r.default)(l.form.formSchemas,`${t}.schema.fields`);if(a){const e=Object.keys(a).filter((e=>null!==a[e]&&(0,s.default)(e,u))).map((e=>({name:e,value:a[e]})));n((0,o.setSchemaStateOverrides)(t,{fields:e}))}}};var r=l(n(6104)),o=n(2811),i=l(n(2613)),s=l(n(8896));function l(e){return e&&e.__esModule?e:{default:e}}},8896:function(e,t){"use strict";function n(e,t){let r;for(r=0;rt({type:o.default.ADD_QUEUED_FILE,payload:{file:e}})},t.failUpload=function(e,t,n){return r=>{let i=t.message;return t.errors&&t.errors.length&&(i=t.errors[0]),"string"==typeof t&&(i={value:n||t,type:"error"}),r({type:o.default.FAIL_UPLOAD,payload:{queuedId:e,message:i}})}},t.purgeUploadQueue=function(){return e=>e({type:o.default.PURGE_UPLOAD_QUEUE,payload:null})},t.removeQueuedFile=function(e){return t=>t({type:o.default.REMOVE_QUEUED_FILE,payload:{queuedId:e}})},t.succeedUpload=function(e,t){return n=>n({type:o.default.SUCCEED_UPLOAD,payload:{queuedId:e,json:t}})},t.updateQueuedFile=function(e,t){return n=>n({type:o.default.UPDATE_QUEUED_FILE,payload:{queuedId:e,updates:t}})};var r,o=(r=n(5793))&&r.__esModule?r:{default:r}},1804:function(e,t,n){"use strict";var r=n(5228),o={};function i(e,t,n,r,o,i,s,l){if(!e){var a;if(void 0===t)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,i,s,l],d=0;(a=new Error(t.replace(/%s/g,(function(){return u[d++]})))).name="Invariant Violation"}throw a.framesToPop=1,a}}var s="mixins";e.exports=function(e,t,n){var l=[],a={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},u={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},d={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n0}},{key:"getMetadataColumnProperty",value:function(e,t,n){var r=this.getColumnMetadataByName(e);return null==r?n:r.hasOwnProperty(t)?r[t]:n}},{key:"orderColumns",value:function(e){var t=this;return l(e,(function(e){var n=s(t.columnMetadata,{columnName:e});return null==n||isNaN(n.order)?100:n.order}))}},{key:"getColumns",value:function(){var e=0===this.filteredColumns.length?this.allColumns:this.filteredColumns;return e=a(e,this.metadataColumns),e=this.orderColumns(e)}}]),e}();e.exports=u},3715:function(e,t,n){"use strict";var r=n(1594),o=n(2306)({getDefaultProps:function(){return{placeholderText:""}},render:function(){return"function"!=typeof this.props.customFilterComponent?(console.log("Couldn't find valid template."),r.createElement("div",null)):r.createElement(this.props.customFilterComponent,{changeFilter:this.props.changeFilter,results:this.props.results,currentResults:this.props.currentResults,placeholderText:this.props.placeholderText})}});e.exports=o},8465:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t0&&(e=r.createElement("button",{type:"button",onClick:this.props.previous,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 0 0 10px"}:null},this.props.previousIconComponent,this.props.previousText)),this.props.currentPage!==this.props.maxPage-1&&(t=r.createElement("button",{type:"button",onClick:this.props.next,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 10px 0 0"}:null},this.props.nextText,this.props.nextIconComponent));var n=null,o=null,s=null;if(!0===this.props.useGriddleStyles){var l={float:"left",minHeight:"1px",marginTop:"5px"};s=i({textAlign:"right",width:"34%"},l),o=i({textAlign:"center",width:"33%"},l),n=i({width:"33%"},l)}for(var a=[],u=1;u<=this.props.maxPage;u++)a.push(r.createElement("option",{value:u,key:u},u));return r.createElement("div",{style:this.props.useGriddleStyles?{minHeight:"35px"}:null},r.createElement("div",{className:this.props.previousClassName,style:n},e),r.createElement("div",{className:"griddle-page",style:o},r.createElement("select",{value:this.props.currentPage+1,onChange:this.pageChange},a)," / ",this.props.maxPage),r.createElement("div",{className:this.props.nextClassName,style:s},t))}});e.exports=s},1507:function(e,t,n){"use strict";var r=n(1594),o=n(2306),i=(n(493),n(9280)),s=n(1882),l=n(7248),a=n(6139),u=n(4684),d=n(8938),c=n(1648),p=o({getDefaultProps:function(){return{isChildRow:!1,showChildren:!1,data:{},columnSettings:null,rowSettings:null,hasChildren:!1,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"▶",parentRowExpandedComponent:"▼",onRowClick:null,multipleSelectionSettings:null,onRowMouseEnter:null,onRowMouseLeave:null,onRowWillMount:null,onRowWillUnmount:null}},componentWillMount:function(){null!==this.props.onRowWillMount&&s(this.props.onRowWillMount)&&this.props.onRowWillMount(this)},componentWillUnmount:function(){null!==this.props.onRowWillUnmount&&s(this.props.onRowWillUnmount)&&this.props.onRowWillUnmount(this)},handleClick:function(e){null!==this.props.onRowClick&&s(this.props.onRowClick)?this.props.onRowClick(this,e):this.props.hasChildren&&this.props.toggleChildren()},handleMouseEnter:function(e){null!==this.props.onRowMouseEnter&&s(this.props.onRowMouseEnter)&&this.props.onRowMouseEnter(this,e)},handleMouseLeave:function(e){null!==this.props.onRowMouseLeave&&s(this.props.onRowMouseLeave)&&this.props.onRowMouseLeave(this,e)},handleSelectionChange:function(e){},handleSelectClick:function(e){this.props.multipleSelectionSettings.isMultipleSelection&&("checkbox"===e.target.type?this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,this.refs.selected.checked):this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,!this.refs.selected.checked))},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRow: The columnSettings prop is null and it shouldn't be")},formatData:function(e){return"boolean"==typeof e?String(e):e},render:function(){var e=this;this.verifyProps();var t=this,n=null;this.props.useGriddleStyles&&(n={margin:"0px",padding:t.props.paddingHeight+"px 5px "+t.props.paddingHeight+"px 5px",height:t.props.rowHeight?this.props.rowHeight-2*t.props.paddingHeight+"px":null,backgroundColor:"#FFF",borderTopColor:"#DDD",color:"#222"});var o=this.props.columnSettings.getColumns(),p=l(o,[]),h=a({},this.props.data);u(h,p);var f,m,g=d(i.pick(h,c(o,"children"))).map((function(t,o){var i=null,s=e.props.columnSettings.getColumnMetadataByName(t[0]),l=0===o&&e.props.hasChildren&&!1===e.props.showChildren&&e.props.useGriddleIcons?r.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px",marginRight:"5px"}:null},e.props.parentRowCollapsedComponent):0===o&&e.props.hasChildren&&e.props.showChildren&&e.props.useGriddleIcons?r.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px"}:null},e.props.parentRowExpandedComponent):"";if(0===o&&e.props.isChildRow&&e.props.useGriddleStyles&&(n=a(n,{paddingLeft:10})),e.props.columnSettings.hasColumnMetadata()&&null!=s)if(void 0!==s.customComponent&&null!==s.customComponent){var u=r.createElement(s.customComponent,{data:t[1],rowData:h,metadata:s});i=r.createElement("td",{onClick:e.handleClick,onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,className:s.cssClassName,key:o,style:n},u)}else i=r.createElement("td",{onClick:e.handleClick,onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,className:s.cssClassName,key:o,style:n},l,e.formatData(t[1]));return i||r.createElement("td",{onClick:e.handleClick,onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,key:o,style:n},l,t[1])}));if(null!==this.props.onRowClick&&s(this.props.onRowClick)?(f=null,m=this.handleSelectClick):this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection?(f=this.handleSelectClick,m=null):(f=null,m=null),g&&this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection){this.props.multipleSelectionSettings.getSelectedRowIds();g.unshift(r.createElement("td",{key:"selection",style:n,className:"griddle-select griddle-select-cell",onClick:m},r.createElement("input",{type:"checkbox",checked:this.props.multipleSelectionSettings.getIsRowChecked(h),onChange:this.handleSelectionChange,ref:"selected"})))}var y=t.props.rowSettings&&t.props.rowSettings.getBodyRowMetadataClass(t.props.data)||"standard-row";return t.props.isChildRow?y="child-row":t.props.hasChildren&&(y=t.props.showChildren?this.props.parentRowExpandedClassName:this.props.parentRowCollapsedClassName),r.createElement("tr",{onClick:f,className:y},g)}});e.exports=p},4734:function(e,t,n){"use strict";var r=n(1594),o=n(2306),i=(n(493),n(4383)),s=o({getDefaultProps:function(){return{useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,columnSettings:null,rowSettings:null,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"▶",parentRowExpandedComponent:"▼",onRowClick:null,onRowMouseEnter:null,onRowMouseLeave:null,onRowWillMount:null,onRowWillUnmount:null,multipleSelectionSettings:null}},getInitialState:function(){return{data:{},showChildren:!1}},componentWillReceiveProps:function(){this.setShowChildren(!1)},toggleChildren:function(){this.setShowChildren(!1===this.state.showChildren)},setShowChildren:function(e){this.setState({showChildren:e})},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be")},render:function(){this.verifyProps();var e=this;if(void 0===this.props.data)return r.createElement("tbody",null);var t=[],n=this.props.columnSettings.getColumns();t.push(r.createElement(this.props.rowSettings.rowComponent,{useGriddleStyles:this.props.useGriddleStyles,isSubGriddle:this.props.isSubGriddle,data:this.props.rowSettings.isCustom?i(this.props.data,n):this.props.data,rowData:this.props.rowSettings.isCustom?this.props.data:null,columnSettings:this.props.columnSettings,rowSettings:this.props.rowSettings,hasChildren:e.props.hasChildren,toggleChildren:e.toggleChildren,showChildren:e.state.showChildren,key:e.props.uniqueId+"_base_row",useGriddleIcons:e.props.useGriddleIcons,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedComponent:this.props.parentRowExpandedComponent,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight,onRowClick:e.props.onRowClick,onRowMouseEnter:e.props.onRowMouseEnter,onRowMouseLeave:e.props.onRowMouseLeave,multipleSelectionSettings:this.props.multipleSelectionSettings,onRowWillMount:e.props.onRowWillMount,onRowWillUnmount:e.props.onRowWillUnmount}));var o=null;return e.state.showChildren&&(o=e.props.hasChildren&&this.props.data.children.map((function(t,n){var o=e.props.rowSettings.getRowKey(t,n);if(void 0!==t.children){var i=e.constructor.Griddle;return r.createElement("tr",{key:o,style:{paddingLeft:5}},r.createElement("td",{colSpan:e.props.columnSettings.getVisibleColumnCount(),className:"griddle-parent",style:e.props.useGriddleStyles?{border:"none",padding:"0 0 0 5px"}:null},r.createElement(i,{rowMetadata:{key:"id"},isSubGriddle:!0,results:[t],columns:e.props.columnSettings.getColumns(),tableClassName:e.props.tableClassName,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,showTableHeading:!1,showPager:!1,columnMetadata:e.props.columnSettings.columnMetadata,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight})))}return r.createElement(e.props.rowSettings.rowComponent,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,data:t,columnSettings:e.props.columnSettings,isChildRow:!0,columnMetadata:e.props.columnSettings.columnMetadata,key:o})}))),!1===e.props.hasChildren?t[0]:r.createElement("tbody",null,e.state.showChildren?t.concat(o):t)}});e.exports=s},4376:function(e,t,n){"use strict";var r=n(1594),o=n(2306),i=n(9859),s=n(1648),l=n(7309),a=o({getDefaultProps:function(){return{columns:[],columnMetadata:[],selectedColumns:[],settingsText:"",maxRowsText:"",resultsPerPage:0,enableToggleCustom:!1,useCustomComponent:!1,useGriddleStyles:!0,toggleCustomComponent:function(){}}},setPageSize:function(e){var t=parseInt(e.target.value,10);this.props.setPageSize(t)},handleChange:function(e){var t=e.target.dataset?e.target.dataset.name:e.target.getAttribute("data-name");!0===e.target.checked&&!1===i(this.props.selectedColumns,t)?(this.props.selectedColumns.push(t),this.props.setColumns(this.props.selectedColumns)):this.props.setColumns(s(this.props.selectedColumns,t))},render:function(){var e=this,t=[];!1===e.props.useCustomComponent&&(t=this.props.columns.map((function(t,n){var o=i(e.props.selectedColumns,t),s=l(e.props.columnMetadata,{columnName:t}),a=t;return void 0!==s&&void 0!==s.displayName&&null!=s.displayName&&(a=s.displayName),void 0!==s&&null!=s&&s.locked?r.createElement("div",{className:"column checkbox"},r.createElement("label",null,r.createElement("input",{type:"checkbox",disabled:!0,name:"check",checked:o,"data-name":t}),a)):void 0!==s&&null!=s&&void 0!==s.visible&&!1===s.visible?null:r.createElement("div",{className:"griddle-column-selection checkbox",key:t,style:e.props.useGriddleStyles?{float:"left",width:"20%"}:null},r.createElement("label",null,r.createElement("input",{type:"checkbox",name:"check",onChange:e.handleChange,checked:o,"data-name":t}),a))})));var n=e.props.enableToggleCustom?r.createElement("div",{className:"form-group"},r.createElement("label",{htmlFor:"maxRows"},r.createElement("input",{type:"checkbox",checked:this.props.useCustomComponent,onChange:this.props.toggleCustomComponent})," ",this.props.enableCustomFormatText)):"",o=this.props.showSetPageSize?r.createElement("div",null,r.createElement("label",{htmlFor:"maxRows"},this.props.maxRowsText,":",r.createElement("select",{onChange:this.setPageSize,value:this.props.resultsPerPage},r.createElement("option",{value:"5"},"5"),r.createElement("option",{value:"10"},"10"),r.createElement("option",{value:"25"},"25"),r.createElement("option",{value:"50"},"50"),r.createElement("option",{value:"100"},"100")))):"";return r.createElement("div",{className:"griddle-settings",style:this.props.useGriddleStyles?{backgroundColor:"#FFF",border:"1px solid #DDD",color:"#222",padding:"10px",marginBottom:"10px"}:null},r.createElement("h6",null,this.props.settingsText),r.createElement("div",{className:"griddle-columns",style:this.props.useGriddleStyles?{clear:"both",display:"table",width:"100%",borderBottom:"1px solid #EDEDED",marginBottom:"10px"}:null},t),o,n)}});e.exports=a},2991:function(e,t,n){"use strict";var r=n(1594),o=n(2306),i=n(9593),s=n(4734),l=(n(493),n(1545),o({getDefaultProps:function(){return{data:[],columnSettings:null,rowSettings:null,sortSettings:null,multipleSelectionSettings:null,className:"",enableInfiniteScroll:!1,nextPage:null,hasMorePages:!1,useFixedHeader:!1,useFixedLayout:!0,paddingHeight:null,rowHeight:null,filterByColumn:null,infiniteScrollLoadTreshold:null,bodyHeight:null,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"▶",parentRowExpandedComponent:"▼",externalLoadingComponent:null,externalIsLoading:!1,onRowClick:null,onRowMouseEnter:null,onRowMouseLeave:null,onRowWillMount:null,onRowWillUnmount:null}},getInitialState:function(){return{scrollTop:0,scrollHeight:this.props.bodyHeight,clientHeight:this.props.bodyHeight}},componentDidMount:function(){this.gridScroll()},componentDidUpdate:function(e,t){this.gridScroll()},gridScroll:function(){if(this.props.enableInfiniteScroll&&!this.props.externalIsLoading){var e=this.refs.scrollable,t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;if(null!==this.props.rowHeight&&this.state.scrollTop!==t&&Math.abs(this.state.scrollTop-t)>=this.getAdjustedRowHeight()){var o={scrollTop:t,scrollHeight:n,clientHeight:r};this.setState(o)}.6*(n-(t+r)-this.props.infiniteScrollLoadTreshold)<=this.props.infiniteScrollLoadTreshold&&this.props.nextPage()}},verifyProps:function(){null===this.props.columnSettings&&console.error("gridTable: The columnSettings prop is null and it shouldn't be"),null===this.props.rowSettings&&console.error("gridTable: The rowSettings prop is null and it shouldn't be")},getAdjustedRowHeight:function(){return this.props.rowHeight+2*this.props.paddingHeight},getNodeContent:function(){this.verifyProps();var e=this,t=!1;if(!this.props.externalIsLoading||this.props.enableInfiniteScroll){var n=e.props.data,o=null,i=null;if(this.props.enableInfiniteScroll&&null!==this.props.rowHeight&&void 0!==this.refs.scrollable){var l=e.getAdjustedRowHeight(),a=Math.ceil(e.state.clientHeight/l),u=Math.max(0,Math.floor(e.state.scrollTop/l)-.25*a),d=Math.min(u+1.25*a,this.props.data.length-1);n=n.slice(u,d+1);var c={height:u*l+"px"};o=r.createElement("tr",{key:"above-"+c.height,style:c});var p={height:(this.props.data.length-d)*l+"px"};i=r.createElement("tr",{key:"below-"+p.height,style:p})}var h=n.map((function(n,o){var i=void 0!==n.children&&n.children.length>0,l=e.props.rowSettings.getRowKey(n,o);return i&&(t=i),r.createElement(s,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,data:n,key:l+"-container",uniqueId:l,columnSettings:e.props.columnSettings,rowSettings:e.props.rowSettings,paddingHeight:e.props.paddingHeight,multipleSelectionSettings:e.props.multipleSelectionSettings,rowHeight:e.props.rowHeight,hasChildren:i,tableClassName:e.props.className,onRowClick:e.props.onRowClick,onRowMouseEnter:e.props.onRowMouseEnter,onRowMouseLeave:e.props.onRowMouseLeave,onRowWillMount:e.props.onRowWillMount,onRowWillUnmount:e.props.onRowWillUnmount})}));if(this.props.showNoData){var f=this.props.columnSettings.getVisibleColumnCount();h.push(r.createElement("tr",{key:"no-data-section"},r.createElement("td",{colSpan:f},this.props.noDataSection)))}return o&&h.unshift(o),i&&h.push(i),{nodes:h,anyHasChildren:t}}return null},render:function(){var e=[],t=!1,n=this.getNodeContent();n&&(e=n.nodes,t=n.anyHasChildren);var o=null,s=null,l={width:"100%"};if(this.props.useFixedLayout&&(l.tableLayout="fixed"),this.props.enableInfiniteScroll&&(o={position:"relative",overflowY:"scroll",height:this.props.bodyHeight+"px",width:"100%"}),this.props.externalIsLoading){var a,u=null;this.props.useGriddleStyles&&(u={textAlign:"center",paddingBottom:"40px"}),a=this.props.columnSettings.getVisibleColumnCount();var d=this.props.externalLoadingComponent?r.createElement(this.props.externalLoadingComponent,null):r.createElement("div",null,"Loading...");s=r.createElement("tbody",null,r.createElement("tr",null,r.createElement("td",{style:u,colSpan:a},d)))}var c=this.props.showTableHeading?r.createElement(i,{useGriddleStyles:this.props.useGriddleStyles,useGriddleIcons:this.props.useGriddleIcons,sortSettings:this.props.sortSettings,multipleSelectionSettings:this.props.multipleSelectionSettings,columnSettings:this.props.columnSettings,filterByColumn:this.props.filterByColumn,rowSettings:this.props.rowSettings}):void 0;t||(e=r.createElement("tbody",null,e));var p=r.createElement("tbody",null);if(this.props.showPager){var h=this.props.useGriddleStyles?{padding:"0px",backgroundColor:"#EDEDED",border:"0px",color:"#222",height:this.props.showNoData?"20px":null}:null;p=r.createElement("tbody",null,r.createElement("tr",null,r.createElement("td",{colSpan:this.props.multipleSelectionSettings.isMultipleSelection?this.props.columnSettings.getVisibleColumnCount()+1:this.props.columnSettings.getVisibleColumnCount(),style:h,className:"footer-container"},this.props.showNoData?null:this.props.pagingContent)))}return this.props.useFixedHeader?(this.props.useGriddleStyles&&(l.tableLayout="fixed"),r.createElement("div",null,r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&l||null},c),r.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:o},r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&l||null},e,s,p)))):r.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:o},r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&l||null},c,e,s,p))}}));e.exports=l},9593:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t=0)return!0}return!1}))},defaultColumnFilter:function(e,t,n){var r=R(A(n)?n:[n],(function(e){return(e||"").toLowerCase()}));return L(b.getObjectValues(t),(function(e){return e=e.toString().toLowerCase(),L(r,(function(t){return e.indexOf(t)>=0}))}))},filterByColumnFilters:function(e){var t=this.props.columnFilterFunc||this.defaultColumnFilter,n=Object.keys(e).reduce((function(n,r){return P(n,(function(n){var o=b.getAt(n,r||""),i=e[r];return t(r||"",o,i)}))}),this.props.results),r={columnFilters:e};e?(r.filteredResults=n,r.maxPage=this.getMaxPage(r.filteredResults)):this.state.filter?r.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,filter):this.defaultFilter(this.props.results,filter):r.filteredResults=null,this.setState(r)},filterByColumn:function(e,t){var n=this.state.columnFilters;if(n.hasOwnProperty(t)&&!e)n=N(n,t);else{var r={};r[t]=e,n=M({},n,r)}this.filterByColumnFilters(n)},setFilter:function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(this.props.useExternal)this.props.externalSetFilter(e);else{var n={page:0,filter:e};n.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(t||this.props.results,e):this.defaultFilter(t||this.props.results,e),n.maxPage=this.getMaxPage(n.filteredResults),(D(e)||I(e)||O(e))&&(n.filter=e,n.filteredResults=null),this.setState(n),this._resetSelectedRows()}},setPageSize:function(e){if(this.props.useExternal)return this.setState({resultsPerPage:e}),void this.props.externalSetPageSize(e);this.state.resultsPerPage=e,this.setMaxPage()},toggleColumnChooser:function(){this.setState({showColumnChooser:!this.state.showColumnChooser})},isNullOrUndefined:function(e){return null==e},shouldUseCustomRowComponent:function(){return this.isNullOrUndefined(this.state.useCustomRowComponent)?this.props.useCustomRowComponent:this.state.useCustomRowComponent},shouldUseCustomGridComponent:function(){return this.isNullOrUndefined(this.state.useCustomGridComponent)?this.props.useCustomGridComponent:this.state.useCustomGridComponent},toggleCustomComponent:function(){"grid"===this.state.customComponentType?this.setState({useCustomGridComponent:!this.shouldUseCustomGridComponent()}):"row"===this.state.customComponentType&&this.setState({useCustomRowComponent:!this.shouldUseCustomRowComponent()})},getMaxPage:function(e,t){return this.props.useExternal?this.props.externalMaxPage:(t||(t=(e||this.getCurrentResults()).length),Math.ceil(t/this.state.resultsPerPage))},setMaxPage:function(e){var t=this.getMaxPage(e);this.state.maxPage!==t&&this.setState({page:0,maxPage:t,filteredColumns:this.columnSettings.filteredColumns})},setPage:function(e){if(this.props.useExternal)this.props.externalSetPage(e);else{if(e*this.state.resultsPerPage<=this.state.resultsPerPage*this.state.maxPage){var t={page:e};this.setState(t)}this.props.enableInfiniteScroll&&this.setState({isSelectAllChecked:!1})}},setColumns:function(e){this.columnSettings.filteredColumns=A(e)?e:[e],this.setState({filteredColumns:this.columnSettings.filteredColumns})},nextPage:function(){var e=this.getCurrentPage();e0&&this.setPage(e-1)},changeSort:function(e){if(!1!==this.props.enableSort){if(this.props.useExternal){var t=this.props.externalSortColumn!==e||!this.props.externalSortAscending;return this.setState({sortColumn:e,sortDirection:t?"asc":"desc"}),void this.props.externalChangeSort(e,t)}var n=E(this.props.columnMetadata,{columnName:e})||{},r=n.sortDirectionCycle?n.sortDirectionCycle:[null,"asc","desc"],o=r.indexOf(this.state.sortDirection&&e===this.state.sortColumn?this.state.sortDirection:null),i={page:0,sortColumn:e,sortDirection:r[o=(o+1)%r.length]?r[o]:null};this.setState(i)}},componentWillReceiveProps:function(e){if(e.results!==this.props.results&&this.setFilter(this.state.filter,e.results),this.setMaxPage(e.results),e.resultsPerPage!==this.props.resultsPerPage&&this.setPageSize(e.resultsPerPage),this.columnSettings.columnMetadata=e.columnMetadata,e.results.length>0){var t=b.keys(e.results[0]);this.columnSettings.allColumns.length==t.length&&this.columnSettings.allColumns.every((function(e,n){return e===t[n]}))||(this.columnSettings.allColumns=t)}else this.columnSettings.allColumns.length>0&&(this.columnSettings.allColumns=[]);if(e.selectedRowIds){var n=this.getDataForRender(this.getCurrentResults(e.results),this.columnSettings.getColumns(),!0);this.setState({isSelectAllChecked:this._getAreAllRowsChecked(e.selectedRowIds,R(n,this.props.uniqueIdentifier)),selectedRowIds:e.selectedRowIds})}},getInitialState:function(){return{maxPage:0,page:0,filteredResults:null,filteredColumns:[],filter:"",columnFilters:{},resultsPerPage:this.props.resultsPerPage||5,showColumnChooser:!1,isSelectAllChecked:!1,selectedRowIds:this.props.selectedRowIds}},componentWillMount:function(){this.verifyExternal(),this.verifyCustom(),this.columnSettings=new y(this.props.results.length>0?b.keys(this.props.results[0]):[],this.props.columns,this.props.childrenColumnName,this.props.columnMetadata,this.props.metadataColumns),this.rowSettings=new v(this.props.rowMetadata,this.props.useCustomTableRowComponent&&this.props.customTableRowComponent?this.props.customTableRowComponent:p,this.props.useCustomTableRowComponent),this.props.initialSort&&(this.props.useExternal?this.setState({sortColumn:this.props.externalSortColumn,sortDirection:this.props.externalSortAscending?"asc":"desc"}):this.changeSort(this.props.initialSort)),this.setMaxPage(),this.shouldUseCustomGridComponent()?this.setState({customComponentType:"grid"}):this.shouldUseCustomRowComponent()?this.setState({customComponentType:"row"}):this.setState({filteredColumns:this.columnSettings.filteredColumns})},componentDidMount:function(){if(this.props.componentDidMount&&"function"==typeof this.props.componentDidMount)return this.props.componentDidMount()},componentDidUpdate:function(){if(this.props.componentDidUpdate&&"function"==typeof this.props.componentDidUpdate)return this.props.componentDidUpdate(this.state)},verifyExternal:function(){!0===this.props.useExternal&&(null===this.props.externalSetPage&&console.error("useExternal is set to true but there is no externalSetPage function specified."),null===this.props.externalChangeSort&&console.error("useExternal is set to true but there is no externalChangeSort function specified."),null===this.props.externalSetFilter&&console.error("useExternal is set to true but there is no externalSetFilter function specified."),null===this.props.externalSetPageSize&&console.error("useExternal is set to true but there is no externalSetPageSize function specified."),null===this.props.externalMaxPage&&console.error("useExternal is set to true but externalMaxPage is not set."),null===this.props.externalCurrentPage&&console.error("useExternal is set to true but externalCurrentPage is not set. Griddle will not page correctly without that property when using external data."))},verifyCustom:function(){!0===this.props.useCustomGridComponent&&null===this.props.customGridComponent&&console.error("useCustomGridComponent is set to true but no custom component was specified."),!0===this.props.useCustomRowComponent&&null===this.props.customRowComponent&&console.error("useCustomRowComponent is set to true but no custom component was specified."),!0===this.props.useCustomGridComponent&&!0===this.props.useCustomRowComponent&&console.error("Cannot currently use both customGridComponent and customRowComponent."),!0===this.props.useCustomFilterer&&null===this.props.customFilterer&&console.error("useCustomFilterer is set to true but no custom filter function was specified."),!0===this.props.useCustomFilterComponent&&null===this.props.customFilterComponent&&console.error("useCustomFilterComponent is set to true but no customFilterComponent was specified.")},getDataForRender:function(e,t,n){var r=this,o=this;if(!this.props.useExternal){if(""!==this.state.sortColumn){var i,s=this.state.sortColumn,l=P(this.props.columnMetadata,{columnName:s}),a={columns:[],orders:[]};if(l.length>0&&(i=l[0].hasOwnProperty("customCompareFn")&&l[0].customCompareFn,l[0].multiSort&&(a=l[0].multiSort)),this.state.sortDirection)if("function"==typeof i)2===i.length?(e=e.sort((function(e,t){return i(k(e,s),k(t,s))})),"desc"===this.state.sortDirection&&e.reverse()):1===i.length&&(e=T(e,(function(e){return i(k(e,s))}),[this.state.sortDirection]));else{var u=[function(e){return(k(e,s)||"").toString().toLowerCase()}],d=[this.state.sortDirection];a.columns.forEach((function(e,t){u.push((function(t){return(k(t,e)||"").toString().toLowerCase()})),"asc"===a.orders[t]||"desc"===a.orders[t]?d.push(a.orders[t]):d.push(r.state.sortDirection)})),e=T(e,u,d)}}var c=this.getCurrentPage();if(!this.props.useExternal&&n&&this.state.resultsPerPage*(c+1)<=this.state.resultsPerPage*this.state.maxPage&&c>=0)if(this.isInfiniteScrollEnabled())e=_(e,(c+1)*this.state.resultsPerPage);else{var p=C(e,c*this.state.resultsPerPage);e=(S||x)(p,p.length-this.state.resultsPerPage)}}for(var h=[],f=0;f0&&(m.children=o.getDataForRender(m[o.props.childrenColumnName],t,!1),"children"!==o.props.childrenColumnName&&delete m[o.props.childrenColumnName]),h.push(m)}return h},getCurrentResults:function(e){return this.state.filteredResults||e||this.props.results},getCurrentPage:function(){return this.props.externalCurrentPage||this.state.page},getCurrentSort:function(){return this.props.useExternal?this.props.externalSortColumn:this.state.sortColumn},getCurrentSortAscending:function(){return this.props.useExternal?this.props.externalSortAscending:"asc"===this.state.sortDirection},getCurrentMaxPage:function(){return this.props.useExternal?this.props.externalMaxPage:this.state.maxPage},getSortObject:function(){return{enableSort:this.props.enableSort,changeSort:this.changeSort,sortColumn:this.getCurrentSort(),sortAscending:this.getCurrentSortAscending(),sortDirection:this.state.sortDirection,sortAscendingClassName:this.props.sortAscendingClassName,sortDescendingClassName:this.props.sortDescendingClassName,sortAscendingComponent:this.props.sortAscendingComponent,sortDescendingComponent:this.props.sortDescendingComponent,sortDefaultComponent:this.props.sortDefaultComponent}},_toggleSelectAll:function(){var e=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),t=!this.state.isSelectAllChecked,n=JSON.parse(JSON.stringify(this.state.selectedRowIds)),r=this;w(e,(function(e){r._updateSelectedRowIds(e[r.props.uniqueIdentifier],n,t)}),this),this.setState({isSelectAllChecked:t,selectedRowIds:n}),this.props.onSelectionChange&&this.props.onSelectionChange(n,t)},_toggleSelectRow:function(e,t){var n=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),r=JSON.parse(JSON.stringify(this.state.selectedRowIds));this._updateSelectedRowIds(e[this.props.uniqueIdentifier],r,t);var o=this._getAreAllRowsChecked(r,R(n,this.props.uniqueIdentifier));this.setState({isSelectAllChecked:o,selectedRowIds:r}),this.props.onSelectionChange&&this.props.onSelectionChange(r,o)},_updateSelectedRowIds:function(e,t,n){n?void 0===E(t,(function(t){return e===t}))&&t.push(e):t.splice(t.indexOf(e),1)},_getIsSelectAllChecked:function(){return this.state.isSelectAllChecked},_getAreAllRowsChecked:function(e,t){return t.length===F(t,e).length},_getIsRowChecked:function(e){return this.state.selectedRowIds.indexOf(e[this.props.uniqueIdentifier])>-1},getSelectedRowIds:function(){return this.state.selectedRowIds},_resetSelectedRows:function(){this.setState({isSelectAllChecked:!1,selectedRowIds:[]})},getMultipleSelectionObject:function(){return{isMultipleSelection:!E(this.props.results,(function(e){return"children"in e}))&&this.props.isMultipleSelection,toggleSelectAll:this._toggleSelectAll,getIsSelectAllChecked:this._getIsSelectAllChecked,toggleSelectRow:this._toggleSelectRow,getSelectedRowIds:this.getSelectedRowIds,getIsRowChecked:this._getIsRowChecked}},isInfiniteScrollEnabled:function(){return!this.props.useCustomPagerComponent&&this.props.enableInfiniteScroll},getClearFixStyles:function(){return{clear:"both",display:"table",width:"100%"}},getSettingsStyles:function(){return{float:"left",width:"50%",textAlign:"right"}},getFilterStyles:function(){return{float:"left",width:"50%",textAlign:"left",color:"#222",minHeight:"1px"}},getFilter:function(){return this.props.showFilter&&!1===this.shouldUseCustomGridComponent()?this.props.useCustomFilterComponent?o.createElement(g,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText,customFilterComponent:this.props.customFilterComponent,results:this.props.results,currentResults:this.getCurrentResults()}):o.createElement(a,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText}):""},getSettings:function(){return this.props.showSettings?o.createElement("button",{type:"button",className:this.props.settingsToggleClassName,onClick:this.toggleColumnChooser,style:this.props.useGriddleStyles?{background:"none",border:"none",padding:0,margin:0,fontSize:14}:null},this.props.settingsText,this.props.settingsIconComponent):""},getTopSection:function(e,t){if(!1===this.props.showFilter&&!1===this.props.showSettings)return"";var n=null,r=null,i=null;return this.props.useGriddleStyles&&(n=this.getFilterStyles(),r=this.getSettingsStyles(),i=this.getClearFixStyles()),o.createElement("div",{className:"top-section",style:i},o.createElement("div",{className:"griddle-filter",style:n},e),o.createElement("div",{className:"griddle-settings-toggle",style:r},t))},getPagingSection:function(e,t){if(!1!==(this.props.showPager&&!this.isInfiniteScrollEnabled()&&!this.shouldUseCustomGridComponent()))return o.createElement("div",{className:"griddle-footer"},this.props.useCustomPagerComponent?o.createElement(m,{customPagerComponentOptions:this.props.customPagerComponentOptions,next:this.nextPage,previous:this.previousPage,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText,customPagerComponent:this.props.customPagerComponent}):o.createElement(u,{useGriddleStyles:this.props.useGriddleStyles,next:this.nextPage,previous:this.previousPage,nextClassName:this.props.nextClassName,nextIconComponent:this.props.nextIconComponent,previousClassName:this.props.previousClassName,previousIconComponent:this.props.previousIconComponent,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText}))},getColumnSelectorSection:function(e,t){return this.state.showColumnChooser?o.createElement(d,{columns:e,selectedColumns:t,setColumns:this.setColumns,settingsText:this.props.settingsText,settingsIconComponent:this.props.settingsIconComponent,maxRowsText:this.props.maxRowsText,setPageSize:this.setPageSize,showSetPageSize:!this.shouldUseCustomGridComponent(),resultsPerPage:this.state.resultsPerPage,enableToggleCustom:this.props.enableToggleCustom,toggleCustomComponent:this.toggleCustomComponent,useCustomComponent:this.shouldUseCustomRowComponent()||this.shouldUseCustomGridComponent(),useGriddleStyles:this.props.useGriddleStyles,enableCustomFormatText:this.props.enableCustomFormatText,columnMetadata:this.props.columnMetadata}):""},getCustomGridSection:function(){return o.createElement(this.props.customGridComponent,r({data:this.props.results,className:this.props.customGridComponentClassName},this.props.gridMetadata))},getCustomRowSection:function(e,t,n,r,i){return o.createElement("div",null,o.createElement(f,{data:e,columns:t,metadataColumns:n,globalData:i,className:this.props.customRowComponentClassName,customComponent:this.props.customRowComponent,style:this.props.useGriddleStyles?this.getClearFixStyles():null}),this.props.showPager&&r)},getStandardGridSection:function(e,t,n,r,i){var s=this.getSortObject(),a=this.getMultipleSelectionObject(),u=this.shouldShowNoDataSection(e),d=this.getNoDataSection();return o.createElement("div",{className:"griddle-body"},o.createElement(l,{useGriddleStyles:this.props.useGriddleStyles,noDataSection:d,showNoData:u,columnSettings:this.columnSettings,rowSettings:this.rowSettings,sortSettings:s,multipleSelectionSettings:a,filterByColumn:this.filterByColumn,isSubGriddle:this.props.isSubGriddle,useGriddleIcons:this.props.useGriddleIcons,useFixedLayout:this.props.useFixedLayout,showPager:this.props.showPager,pagingContent:r,data:e,className:this.props.tableClassName,enableInfiniteScroll:this.isInfiniteScrollEnabled(),nextPage:this.nextPage,showTableHeading:this.props.showTableHeading,useFixedHeader:this.props.useFixedHeader,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,parentRowExpandedComponent:this.props.parentRowExpandedComponent,bodyHeight:this.props.bodyHeight,paddingHeight:this.props.paddingHeight,rowHeight:this.props.rowHeight,infiniteScrollLoadTreshold:this.props.infiniteScrollLoadTreshold,externalLoadingComponent:this.props.externalLoadingComponent,externalIsLoading:this.props.externalIsLoading,hasMorePages:i,onRowClick:this.props.onRowClick,onRowMouseEnter:this.props.onRowMouseEnter,onRowMouseLeave:this.props.onRowMouseLeave,onRowWillMount:this.props.onRowWillMount,onRowWillUnmount:this.props.onRowWillUnmount}))},getContentSection:function(e,t,n,r,o,i){return this.shouldUseCustomGridComponent()&&null!==this.props.customGridComponent?this.getCustomGridSection():this.shouldUseCustomRowComponent()?this.getCustomRowSection(e,t,n,r,i):this.getStandardGridSection(e,t,n,r,o)},getNoDataSection:function(){return null!=this.props.customNoDataComponent?o.createElement("div",{className:this.props.noDataClassName},o.createElement(this.props.customNoDataComponent,this.props.customNoDataComponentProps)):o.createElement(c,{noDataMessage:this.props.noDataMessage})},shouldShowNoDataSection:function(e){return!this.props.allowEmptyGrid&&(!1===this.props.useExternal&&(void 0===e||0===e.length)||!0===this.props.useExternal&&!1===this.props.externalIsLoading&&0===e.length)},render:function(){var e=this.getCurrentResults(),t=(this.props.tableClassName,this.getFilter()),n=this.getSettings(),r=this.getTopSection(t,n),i=[],s=this.columnSettings.getColumns(),l=this.getDataForRender(e,s,!0),a=this.columnSettings.getMetadataColumns();this.props.columnMetadata?w(this.props.columnMetadata,(function(e){"boolean"==typeof e.visible&&!1===e.visible||i.push(e.columnName)})):i=b.keys(N(e[0],a)),i=this.columnSettings.orderColumns(i);var u=this.getCurrentPage(),d=this.getCurrentMaxPage(),c=u+10?"griddle "+this.props.gridClassName:"griddle";return m+=this.shouldUseCustomRowComponent()?" griddle-custom":"",o.createElement("div",{className:m},r,f,o.createElement("div",{className:"griddle-container",style:this.props.useGriddleStyles&&!this.props.isSubGriddle?{border:"1px solid #DDD"}:null},h))}});h.Griddle=e.exports=j},1545:function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n-1}},9905:function(e){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r=200&&(c=a,p=!1,t=new r(t));e:for(;++d0&&i(d)?n>1?e(d,n-1,i,s,l):r(l,d):s||(l[l.length]=d)}return l}},6649:function(e,t,n){var r=n(3221)();e.exports=r},641:function(e,t,n){var r=n(6649),o=n(5950);e.exports=function(e,t){return e&&r(e,t,o)}},7422:function(e,t,n){var r=n(1769),o=n(7797);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n=120&&y.length>=120)?new r(h&&y):void 0}y=e[0];var v=-1,b=f[0];e:for(;++vo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++rt||s&&l&&u&&!a&&!d||o&&l&&u||!n&&u||!i)return 1;if(!o&&!s&&!d&&e=a?u:u*("desc"==n[o]?-1:1)}return e.index-t.index}},3007:function(e){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n1?n[i-1]:void 0,l=i>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(i--,s):void 0,l&&o(n[0],n[1],l)&&(s=i<3?void 0:s,i=1),t=Object(t);++r-1?l[a?t[u]:u]:void 0}}},2963:function(e,t,n){var r=n(1372),o=n(5861),i=n(317),s=n(799);e.exports=function(e){return function(t){var n=o(t);return"[object Map]"==n?i(t):"[object Set]"==n?s(t):r(t,e(t))}}},3138:function(e,t,n){var r=n(1331);e.exports=function(e){return r(e)?void 0:e}},3243:function(e,t,n){var r=n(6110),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},5911:function(e,t,n){var r=n(8859),o=n(4248),i=n(9219);e.exports=function(e,t,n,s,l,a){var u=1&n,d=e.length,c=t.length;if(d!=c&&!(u&&c>d))return!1;var p=a.get(e),h=a.get(t);if(p&&h)return p==t&&h==e;var f=-1,m=!0,g=2&n?new r:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1}},1175:function(e,t,n){var r=n(6025);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},3040:function(e,t,n){var r=n(1549),o=n(79),i=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},7670:function(e,t,n){var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289:function(e,t,n){var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509:function(e,t,n){var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949:function(e,t,n){var r=n(2651);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},317:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},7197:function(e){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},2224:function(e,t,n){var r=n(104);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},1042:function(e,t,n){var r=n(6110)(Object,"create");e.exports=r},3650:function(e,t,n){var r=n(4335)(Object.keys,Object);e.exports=r},181:function(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},6009:function(e,t,n){e=n.nmd(e);var r=n(4840),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o&&r.process,l=function(){try{var e=i&&i.require&&i.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=l},9350:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},6757:function(e,t,n){var r=n(1033),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,s=-1,l=o(i.length-t,0),a=Array(l);++s0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},1420:function(e,t,n){var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605:function(e){e.exports=function(e){return this.__data__.get(e)}},9817:function(e){e.exports=function(e){return this.__data__.has(e)}},945:function(e,t,n){var r=n(79),o=n(8223),i=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!o||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(e,t),this.size=n.size,this}},6959:function(e){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r2?t[2]:void 0;for(u&&i(t[0],t[1],u)&&(r=1);++n-1:!!d&&r(e,t,n)>-1}},3424:function(e,t,n){var r=n(5160);e.exports=function(e){return(null==e?0:e.length)?r(e,0,-1):[]}},5287:function(e,t,n){var r=n(4932),o=n(7185),i=n(9302),s=n(741),l=i((function(e){var t=r(e,s);return t.length&&t[0]===e[0]?o(t):[]}));e.exports=l},2428:function(e,t,n){var r=n(7534),o=n(346),i=Object.prototype,s=i.hasOwnProperty,l=i.propertyIsEnumerable,a=r(function(){return arguments}())?r:function(e){return o(e)&&s.call(e,"callee")&&!l.call(e,"callee")};e.exports=a},6449:function(e){var t=Array.isArray;e.exports=t},4894:function(e,t,n){var r=n(1882),o=n(294);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},3693:function(e,t,n){var r=n(4894),o=n(346);e.exports=function(e){return o(e)&&r(e)}},3656:function(e,t,n){e=n.nmd(e);var r=n(9325),o=n(9935),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,l=s&&s.exports===i?r.Buffer:void 0,a=(l?l.isBuffer:void 0)||o;e.exports=a},2193:function(e,t,n){var r=n(8984),o=n(5861),i=n(2428),s=n(6449),l=n(4894),a=n(3656),u=n(5527),d=n(7167),c=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(l(e)&&(s(e)||"string"==typeof e||"function"==typeof e.splice||a(e)||d(e)||i(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(c.call(e,n))return!1;return!0}},1882:function(e,t,n){var r=n(2552),o=n(3805);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730:function(e,t,n){var r=n(9172),o=n(7301),i=n(6009),s=i&&i.isMap,l=s?o(s):r;e.exports=l},5187:function(e){e.exports=function(e){return null===e}},3805:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},1331:function(e,t,n){var r=n(2552),o=n(8879),i=n(346),s=Function.prototype,l=Object.prototype,a=s.toString,u=l.hasOwnProperty,d=a.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&a.call(n)==d}},8440:function(e,t,n){var r=n(6038),o=n(7301),i=n(6009),s=i&&i.isSet,l=s?o(s):r;e.exports=l},5015:function(e,t,n){var r=n(2552),o=n(6449),i=n(346);e.exports=function(e){return"string"==typeof e||!o(e)&&i(e)&&"[object String]"==r(e)}},4394:function(e,t,n){var r=n(2552),o=n(346);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7167:function(e,t,n){var r=n(4901),o=n(7301),i=n(6009),s=i&&i.isTypedArray,l=s?o(s):r;e.exports=l},2216:function(e){e.exports=function(e){return void 0===e}},5950:function(e,t,n){var r=n(695),o=n(8984),i=n(4894);e.exports=function(e){return i(e)?r(e):o(e)}},7241:function(e,t,n){var r=n(695),o=n(2903),i=n(4894);e.exports=function(e){return i(e)?r(e,!0):o(e)}},8090:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5378:function(e,t,n){var r=n(4932),o=n(5389),i=n(5128),s=n(6449);e.exports=function(e,t){return(s(e)?r:i)(e,o(t,3))}},104:function(e,t,n){var r=n(3661);function o(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 s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},179:function(e,t,n){var r=n(4932),o=n(9999),i=n(9931),s=n(1769),l=n(1791),a=n(3138),u=n(8816),d=n(3349),c=u((function(e,t){var n={};if(null==e)return n;var u=!1;t=r(t,(function(t){return t=s(t,e),u||(u=t.length>1),t})),l(e,d(e),n),u&&(n=o(n,7,a));for(var c=t.length;c--;)i(n,t[c]);return n}));e.exports=c},2877:function(e,t,n){var r=n(6155),o=n(6449);e.exports=function(e,t,n,i){return null==e?[]:(o(t)||(t=null==t?[]:[t]),o(n=i?void 0:n)||(n=null==n?[]:[n]),r(e,t,n))}},4383:function(e,t,n){var r=n(6001),o=n(8816)((function(e,t){return null==e?{}:r(e,t)}));e.exports=o},583:function(e,t,n){var r=n(7237),o=n(7255),i=n(8586),s=n(7797);e.exports=function(e){return i(e)?r(s(e)):o(e)}},2426:function(e,t,n){var r=n(4248),o=n(5389),i=n(916),s=n(6449),l=n(6800);e.exports=function(e,t,n){var a=s(e)?r:i;return n&&l(e,t,n)&&(t=void 0),a(e,o(t,3))}},3031:function(e,t,n){var r=n(3120),o=n(6155),i=n(9302),s=n(6800),l=i((function(e,t){if(null==e)return[];var n=t.length;return n>1&&s(e,t[0],t[1])?t=[]:n>2&&s(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])}));e.exports=l},3345:function(e){e.exports=function(){return[]}},9935:function(e){e.exports=function(){return!1}},4921:function(e,t,n){var r=n(5160),o=n(1489);e.exports=function(e,t,n){return e&&e.length?(t=n||void 0===t?1:o(t),r(e,0,t<0?0:t)):[]}},7400:function(e,t,n){var r=n(9374),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489:function(e,t,n){var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374:function(e,t,n){var r=n(4128),o=n(3805),i=n(4394),s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,a=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||a.test(e)?u(e.slice(2),n?2:8):s.test(e)?NaN:+e}},8938:function(e,t,n){var r=n(2963)(n(5950));e.exports=r},2072:function(e,t,n){var r=n(4932),o=n(3007),i=n(6449),s=n(4394),l=n(1802),a=n(7797),u=n(3222);e.exports=function(e){return i(e)?r(e,a):s(e)?[e]:o(l(u(e)))}},3222:function(e,t,n){var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},7200:function(e,t,n){var r=n(3222),o=0;e.exports=function(e){var t=++o;return r(e)+t}},5880:function(e,t,n){var r=n(514),o=n(5950);e.exports=function(e){return null==e?[]:r(e,o(e))}},1648:function(e,t,n){var r=n(3915),o=n(9302),i=n(3693),s=o((function(e,t){return i(e)?r(e,t):[]}));e.exports=s},7248:function(e,t,n){var r=n(6547),o=n(1234);e.exports=function(e,t){return o(e||[],t||[],r)}},5228:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var i,s,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),a=1;a1)for(var n=1;n1?t-1:0),r=1;r2?n-2:0),i=2;i1&&void 0!==arguments[1]&&arguments[1],n=this.props,r=n.tolerance,o=n.onSelection,i=n.onEndSelection,s=[],l=(0,d.findDOMNode)(this.refs.selectbox);l&&(this._registry.forEach((function(e){e.domNode&&(0,g.default)(l,e.domNode,r)&&!s.includes(e.key)&&s.push(e.key)})),t?"function"==typeof i&&i(s,e):"function"==typeof o&&o(s,e))}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.enabled,r=e.fixedPosition,o=e.className,i=e.selectingClassName,s=this.state,l=s.isBoxSelecting,a=s.boxLeft,d=s.boxTop,c=s.boxWidth,h=s.boxHeight,f=this.props.component;if(!n)return u.default.createElement(f,{className:o},t);var m={left:a,top:d,width:c,height:h,zIndex:9e3,position:r?"fixed":"absolute",cursor:"default"},g={backgroundColor:"transparent",border:"1px dashed #999",width:"100%",height:"100%",float:"left"},y={position:"relative",overflow:"visible"};return u.default.createElement(f,{className:(0,p.default)(o,l?i:null),style:y},l?u.default.createElement("div",{style:m,ref:"selectbox"},u.default.createElement("span",{style:g})):null,t)}}]),t}(a.Component);v.propTypes={children:c.default.node,onBeginSelection:c.default.func,onEndSelection:c.default.func,onSelection:c.default.func,component:c.default.node,tolerance:c.default.number,fixedPosition:c.default.bool,preventDefault:c.default.bool,onNonItemClick:c.default.func,enabled:c.default.bool,className:c.default.string,selectingClassName:c.default.string},v.defaultProps={component:"div",tolerance:0,fixedPosition:!1,preventDefault:!0,enabled:!0},v.childContextTypes={selectable:c.default.object},t.default=v},function(e,t,n){"use strict";(function(t){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=n(1),i=n(2),s=n(8),l=n(15),a=n(3),u=n(16);e.exports=function(e,n){function d(e){var t=e&&(O&&e[O]||e[I]);if("function"==typeof t)return t}function c(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e){this.message=e,this.stack=""}function h(e){function r(r,u,d,c,h,f,m){if(c=c||D,f=f||d,m!==a)if(n)i(!1,"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");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var g=c+":"+d;!o[g]&&l<3&&(s(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",f,c),o[g]=!0,l++)}return null==u[d]?r?new p(null===u[d]?"The "+h+" `"+f+"` is marked as required in `"+c+"`, but its value is `null`.":"The "+h+" `"+f+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(u,d,c,h,f)}if("production"!==t.env.NODE_ENV)var o={},l=0;var u=r.bind(null,!1);return u.isRequired=r.bind(null,!0),u}function f(e){function t(t,n,r,o,i,s){var l=t[n];return w(l)!==e?new p("Invalid "+o+" `"+i+"` of type `"+x(l)+"` supplied to `"+r+"`, expected `"+e+"`."):null}return h(t)}function m(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new p("Invalid "+o+" `"+i+"` of type `"+w(s)+"` supplied to `"+r+"`, expected an array.");for(var l=0;ln+l||t+o-ar+s)};t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=e instanceof HTMLElement?(0,r.default)(e):e,s=t instanceof HTMLElement?(0,r.default)(t):t;return o(i.top,i.left,s.top,s.left,i.offsetWidth,i.offsetHeight,s.offsetWidth,s.offsetHeight,n)}},function(e,t,n){"use strict";(function(t){function n(e,t,n){function r(t){var n=m,r=g;return m=g=void 0,w=t,v=e.apply(r,n)}function i(e){return w=e,b=setTimeout(d,t),x?r(e):v}function s(e){var n=t-(e-C);return F?E(n,y-(e-w)):n}function a(e){var n=e-C;return void 0===C||n>=t||n<0||F&&e-w>=y}function d(){var e=_();if(a(e))return c(e);b=setTimeout(d,s(e))}function c(e){return b=void 0,A&&m?r(e):(m=g=void 0,v)}function p(){void 0!==b&&clearTimeout(b),w=0,m=C=g=b=void 0}function h(){return void 0===b?v:c(_())}function f(){var e=_(),n=a(e);if(m=arguments,g=this,C=e,n){if(void 0===b)return i(C);if(F)return b=setTimeout(d,t),r(C)}return void 0===b&&(b=setTimeout(d,t)),v}var m,g,y,v,b,C,w=0,x=!1,F=!1,A=!0;if("function"!=typeof e)throw new TypeError(u);return t=l(t)||0,o(n)&&(x=!!n.leading,y=(F="maxWait"in n)?S(l(n.maxWait)||0,t):y,A="trailing"in n?!!n.trailing:A),f.cancel=p,f.flush=h,f}function r(e,t,r){var i=!0,s=!0;if("function"!=typeof e)throw new TypeError(u);return o(r)&&(i="leading"in r?!!r.leading:i,s="trailing"in r?!!r.trailing:s),n(e,t,{leading:i,maxWait:t,trailing:s})}function o(e){var t=void 0===e?"undefined":a(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==(void 0===e?"undefined":a(e))}function s(e){return"symbol"==(void 0===e?"undefined":a(e))||i(e)&&C.call(e)==c}function l(e){if("number"==typeof e)return e;if(s(e))return d;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(p,"");var n=f.test(e);return n||m.test(e)?g(e.slice(2),n?2:8):h.test(e)?d:+e}var 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},u="Expected a function",d=NaN,c="[object Symbol]",p=/^\s+|\s+$/g,h=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,m=/^0o[0-7]+$/i,g=parseInt,y="object"==(void 0===t?"undefined":a(t))&&t&&t.Object===Object&&t,v="object"==("undefined"==typeof self?"undefined":a(self))&&self&&self.Object===Object&&self,b=y||v||Function("return this")(),C=Object.prototype.toString,S=Math.max,E=Math.min,_=function(){return b.Date.now()};e.exports=r}).call(t,n(21))},function(e,t,n){"use strict";var r,o="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};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":o(window))&&(r=window)}e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function s(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)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n
'),this.element.appendChild(e));let t=e.getElementsByTagName("span")[0];return t&&(null!=t.textContent?t.textContent=this.options.dictFallbackMessage:null!=t.innerText&&(t.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize(e,t,n,r){let o={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},i=e.width/e.height;null==t&&null==n?(t=o.srcWidth,n=o.srcHeight):null==t?t=n*i:null==n&&(n=t/i);let s=(t=Math.min(t,o.srcWidth))/(n=Math.min(n,o.srcHeight));if(o.srcWidth>t||o.srcHeight>n)if("crop"===r)i>s?(o.srcHeight=e.height,o.srcWidth=o.srcHeight*s):(o.srcWidth=e.width,o.srcHeight=o.srcWidth/s);else{if("contain"!==r)throw new Error(`Unknown resizeMethod '${r}'`);i>s?n=t/i:t=n*i}return o.srcX=(e.width-o.srcWidth)/2,o.srcY=(e.height-o.srcHeight)/2,o.trgWidth=t,o.trgHeight=n,o},transformFile(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:r('
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n'),drop(e){return this.element.classList.remove("dz-drag-hover")},dragstart(e){},dragend(e){return this.element.classList.remove("dz-drag-hover")},dragenter(e){return this.element.classList.add("dz-drag-hover")},dragover(e){return this.element.classList.add("dz-drag-hover")},dragleave(e){return this.element.classList.remove("dz-drag-hover")},paste(e){},reset(){return this.element.classList.remove("dz-started")},addedfile(e){if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){for(var t of(e.previewElement=s.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),e.previewElement.querySelectorAll("[data-dz-name]")))t.textContent=e.name;for(t of e.previewElement.querySelectorAll("[data-dz-size]"))t.innerHTML=this.filesize(e.size);this.options.addRemoveLinks&&(e._removeLink=s.createElement(`${this.options.dictRemoveFile}`),e.previewElement.appendChild(e._removeLink));let n=t=>(t.preventDefault(),t.stopPropagation(),e.status===s.UPLOADING?s.confirm(this.options.dictCancelUploadConfirmation,(()=>this.removeFile(e))):this.options.dictRemoveFileConfirmation?s.confirm(this.options.dictRemoveFileConfirmation,(()=>this.removeFile(e))):this.removeFile(e));for(let t of e.previewElement.querySelectorAll("[data-dz-remove]"))t.addEventListener("click",n)}},removedfile(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");for(let n of e.previewElement.querySelectorAll("[data-dz-thumbnail]"))n.alt=e.name,n.src=t;return setTimeout((()=>e.previewElement.classList.add("dz-image-preview")),1)}},error(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"string"!=typeof t&&t.error&&(t=t.error);for(let n of e.previewElement.querySelectorAll("[data-dz-errormessage]"))n.textContent=t}},errormultiple(){},processing(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple(){},uploadprogress(e,t,n){if(e.previewElement)for(let n of e.previewElement.querySelectorAll("[data-dz-uploadprogress]"))"PROGRESS"===n.nodeName?n.value=t:n.style.width=`${t}%`},totaluploadprogress(){},sending(){},sendingmultiple(){},success(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple(){},canceled(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple(){},complete(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple(){},maxfilesexceeded(){},maxfilesreached(){},queuecomplete(){},addedfiles(){}};class s extends o{static initClass(){this.prototype.Emitter=o,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}constructor(e,t){let n,r;if(super(),this.element=e,this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),null===this.element||!this.element instanceof HTMLElement)throw new Error("Invalid dropzone element: not an instance of HTMLElement.");if(this.element.dropzone)throw new Error("Dropzone already attached.");s.instances.push(this),this.element.dropzone=this;let o=null!=(r=s.optionsForElement(this.element))?r:{};if(this.options=Object.assign({},i,o,null!=t?t:{}),this.options.previewTemplate=this.options.previewTemplate.replace(/\n*/g,""),this.options.forceFallback||!s.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.uploadMultiple&&this.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");if(this.options.binaryBody&&this.options.uploadMultiple)throw new Error("You cannot set both: binaryBody and uploadMultiple.");"string"==typeof this.options.method&&(this.options.method=this.options.method.toUpperCase()),(n=this.getExistingFallback())&&n.parentNode&&n.parentNode.removeChild(n),!1!==this.options.previewsContainer&&(this.options.previewsContainer?this.previewsContainer=s.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(!0===this.options.clickable?this.clickableElements=[this.element]:this.clickableElements=s.getElements(this.options.clickable,"clickable")),this.init()}getAcceptedFiles(){return this.files.filter((e=>e.accepted)).map((e=>e))}getRejectedFiles(){return this.files.filter((e=>!e.accepted)).map((e=>e))}getFilesWithStatus(e){return this.files.filter((t=>t.status===e)).map((e=>e))}getQueuedFiles(){return this.getFilesWithStatus(s.QUEUED)}getUploadingFiles(){return this.getFilesWithStatus(s.UPLOADING)}getAddedFiles(){return this.getFilesWithStatus(s.ADDED)}getActiveFiles(){return this.files.filter((e=>e.status===s.UPLOADING||e.status===s.QUEUED)).map((e=>e))}init(){if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(s.createElement(`
`)),this.clickableElements.length){let e=()=>{this.hiddenFileInput&&this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=document.createElement("input"),this.hiddenFileInput.setAttribute("type","file"),this.hiddenFileInput.setAttribute("form",this.element.id),(null===this.options.maxFiles||this.options.maxFiles>1)&&this.hiddenFileInput.setAttribute("multiple","multiple"),this.hiddenFileInput.className="dz-hidden-input",null!==this.options.acceptedFiles&&this.hiddenFileInput.setAttribute("accept",this.options.acceptedFiles),null!==this.options.capture&&this.hiddenFileInput.setAttribute("capture",this.options.capture),this.hiddenFileInput.setAttribute("tabindex","-1"),this.hiddenFileInput.setAttribute("aria-label","dropzone hidden input"),this.hiddenFileInput.style.visibility="hidden",this.hiddenFileInput.style.position="absolute",this.hiddenFileInput.style.top="0",this.hiddenFileInput.style.left="0",this.hiddenFileInput.style.height="0",this.hiddenFileInput.style.width="0",s.getElement(this.options.hiddenInputContainer,"hiddenInputContainer").appendChild(this.hiddenFileInput),this.hiddenFileInput.addEventListener("change",(()=>{let{files:t}=this.hiddenFileInput;if(t.length)for(let e of t)this.addFile(e);this.emit("addedfiles",t),e()}))};e()}this.URL=null!==window.URL?window.URL:window.webkitURL;for(let e of this.events)this.on(e,this.options[e]);this.on("uploadprogress",(()=>this.updateTotalUploadProgress())),this.on("removedfile",(()=>this.updateTotalUploadProgress())),this.on("canceled",(e=>this.emit("complete",e))),this.on("complete",(e=>{if(0===this.getAddedFiles().length&&0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length)return setTimeout((()=>this.emit("queuecomplete")),0)}));let e=function(e){if(function(e){return e.dataTransfer.types&&e.dataTransfer.types.includes("Files")}(e))return e.stopPropagation(),e.preventDefault()};return this.listeners=[{element:this.element,events:{dragstart:e=>this.emit("dragstart",e),dragenter:t=>(e(t),this.emit("dragenter",t)),dragover:t=>{const n=t.dataTransfer.effectAllowed;return t.dataTransfer.dropEffect="move"===n||"linkMove"===n?"move":"copy",e(t),this.emit("dragover",t)},dragleave:e=>this.emit("dragleave",e),drop:t=>(e(t),this.drop(t)),dragend:e=>this.emit("dragend",e)}}],this.clickableElements.forEach((e=>this.listeners.push({element:e,events:{click:t=>((e!==this.element||t.target===this.element||s.elementInside(t.target,this.element.querySelector(".dz-message")))&&this.hiddenFileInput.click(),!0)}}))),this.enable(),this.options.init.call(this)}destroy(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,s.instances.splice(s.instances.indexOf(this),1)}updateTotalUploadProgress(){let e,t=0,n=0;if(this.getActiveFiles().length){for(let e of this.getActiveFiles())t+=e.upload.bytesSent,n+=e.upload.total;e=100*t/n}else e=100;return this.emit("totaluploadprogress",e,n,t)}_getParamName(e){return"function"==typeof this.options.paramName?this.options.paramName(e):`${this.options.paramName}${this.options.uploadMultiple?`[${e}]`:""}`}_renameFile(e){const t={...e,name:e.name.replace(/\u202F/g," ")};return"function"!=typeof this.options.renameFile?t.name:this.options.renameFile(t)}getFallbackForm(){let e,t;if(e=this.getExistingFallback())return e;let n='
';this.options.dictFallbackText&&(n+=`

${this.options.dictFallbackText}

`),n+=`
`;let r=s.createElement(n);return"FORM"!==this.element.tagName?(t=s.createElement(`
`),t.appendChild(r)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:r}getExistingFallback(){let e=function(e){for(let t of e)if(/(^| )fallback($| )/.test(t.className))return t};for(let n of["div","form"]){var t;if(t=e(this.element.getElementsByTagName(n)))return t}}setupEventListeners(){return this.listeners.map((e=>(()=>{let t=[];for(let n in e.events){let r=e.events[n];t.push(e.element.addEventListener(n,r,!1))}return t})()))}removeEventListeners(){return this.listeners.map((e=>(()=>{let t=[];for(let n in e.events){let r=e.events[n];t.push(e.element.removeEventListener(n,r,!1))}return t})()))}disable(){return this.clickableElements.forEach((e=>e.classList.remove("dz-clickable"))),this.removeEventListeners(),this.disabled=!0,this.files.map((e=>this.cancelUpload(e)))}enable(){return delete this.disabled,this.clickableElements.forEach((e=>e.classList.add("dz-clickable"))),this.setupEventListeners()}filesize(e){let t=0,n="b";if(e>0){let r=["tb","gb","mb","kb","b"];for(let o=0;o=Math.pow(this.options.filesizeBase,4-o)/10){t=e/Math.pow(this.options.filesizeBase,4-o),n=i;break}}t=Math.round(10*t)/10}return`${t} ${this.options.dictFileSizeUnits[n]}`}_updateMaxFilesReachedClass(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}drop(e){if(!e.dataTransfer)return;this.emit("drop",e);let t=[];for(let n=0;ne.items,null!=t?n(t):void 0))return;var t,n;this.emit("paste",e);let{items:r}=e.clipboardData;return r.length?this._addFilesFromItems(r):void 0}handleFiles(e){for(let t of e)this.addFile(t)}_addFilesFromItems(e){return(()=>{let t=[];for(let r of e){var n;null!=r.webkitGetAsEntry&&(n=r.webkitGetAsEntry())?n.isFile?t.push(this.addFile(r.getAsFile())):n.isDirectory?t.push(this._addFilesFromDirectory(n,n.name)):t.push(void 0):null!=r.getAsFile&&(null==r.kind||"file"===r.kind)?t.push(this.addFile(r.getAsFile())):t.push(void 0)}return t})()}_addFilesFromDirectory(e,t){let n=e.createReader(),r=e=>{return t=console,n="log",r=t=>t.log(e),null!=t&&"function"==typeof t[n]?r(t,n):void 0;var t,n,r};var o=()=>n.readEntries((e=>{if(e.length>0){for(let n of e)n.isFile?n.file((e=>{if(!this.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath=`${t}/${e.name}`,this.addFile(e)})):n.isDirectory&&this._addFilesFromDirectory(n,`${t}/${n.name}`);o()}return null}),r);return o()}accept(e,t){this.options.maxFilesize&&e.size>1048576*this.options.maxFilesize?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):s.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)}addFile(e){e.upload={uuid:window.isSecureContext?self.crypto.randomUUID():s.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e)},this.files.push(e),e.status=s.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,(t=>{t?(e.accepted=!1,this._errorProcessing([e],t)):(e.accepted=!0,this.options.autoQueue&&this.enqueueFile(e)),this._updateMaxFilesReachedClass()}))}enqueueFiles(e){for(let t of e)this.enqueueFile(t);return null}enqueueFile(e){if(e.status!==s.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=s.QUEUED,this.options.autoProcessQueue)return setTimeout((()=>this.processQueue()),0)}_enqueueThumbnail(e){if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1048576*this.options.maxThumbnailFilesize)return this._thumbnailQueue.push(e),setTimeout((()=>this._processThumbnailQueue()),0)}_processThumbnailQueue(){if(this._processingThumbnail||0===this._thumbnailQueue.length)return;this._processingThumbnail=!0;let e=this._thumbnailQueue.shift();return this.createThumbnail(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,(t=>(this.emit("thumbnail",e,t),this._processingThumbnail=!1,this._processThumbnailQueue())))}removeFile(e){if(e.status===s.UPLOADING&&this.cancelUpload(e),this.files=l(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}removeAllFiles(e){null==e&&(e=!1);for(let t of this.files.slice())(t.status!==s.UPLOADING||e)&&this.removeFile(t);return null}resizeImage(e,t,n,r,o){return this.createThumbnail(e,t,n,r,!0,((t,n)=>{if(null==n)return o(e);{let{resizeMimeType:t}=this.options;null==t&&(t=e.type);let r=n.toDataURL(t,this.options.resizeQuality);return"image/jpeg"!==t&&"image/jpg"!==t||(r=function(e,t){var n="data:image/jpeg;base64,";if(!e.startsWith(n)||!t.startsWith(n))return t;var r=window.atob(e.slice(n.length));if(!r.startsWith("ÿØÿ"))return t;var o=0,i="";for(;o{e.dataURL=l.result,"image/svg+xml"!==e.type?this.createThumbnailFromUrl(e,t,n,r,o,i,void 0,s):null!=i&&i(l.result)},l.readAsDataURL(e)}displayExistingFile(e,t,n,r,o=!0){if(this.emit("addedfile",e),this.emit("complete",e),o){let o=t=>{this.emit("thumbnail",e,t),n&&n()};e.dataURL=t,this.createThumbnailFromUrl(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,o,r)}else this.emit("thumbnail",e,t),n&&n()}createThumbnailFromUrl(e,t,n,r,o,i,s,l=!1){let a=document.createElement("img");s&&(a.crossOrigin=s),o="from-image"!=getComputedStyle(document.body).imageOrientation&&o,a.onload=()=>{let s=e=>e(1);return"undefined"!=typeof EXIF&&null!==EXIF&&o&&(s=e=>EXIF.getData(a,(function(){return e(EXIF.getTag(this,"Orientation"))}))),s((o=>{e.width=a.width,e.height=a.height;let s=this.options.resize.call(this,e,t,n,r),l=document.createElement("canvas"),d=l.getContext("2d");switch(l.width=s.trgWidth,l.height=s.trgHeight,o>4&&(l.width=s.trgHeight,l.height=s.trgWidth),o){case 2:d.translate(l.width,0),d.scale(-1,1);break;case 3:d.translate(l.width,l.height),d.rotate(Math.PI);break;case 4:d.translate(0,l.height),d.scale(1,-1);break;case 5:d.rotate(.5*Math.PI),d.scale(1,-1);break;case 6:d.rotate(.5*Math.PI),d.translate(0,-l.width);break;case 7:d.rotate(.5*Math.PI),d.translate(l.height,-l.width),d.scale(-1,1);break;case 8:d.rotate(-.5*Math.PI),d.translate(-l.height,0)}u(d,a,null!=s.srcX?s.srcX:0,null!=s.srcY?s.srcY:0,s.srcWidth,s.srcHeight,null!=s.trgX?s.trgX:0,null!=s.trgY?s.trgY:0,s.trgWidth,s.trgHeight);let c=l.toDataURL("image/png");if(null!=i)return i(c,l)}))},null!=i&&(a.onerror=i);var d=e.dataURL;return l&&(d=function(e){var t="data:image/jpeg;base64,";if(!e.startsWith(t))return e;var n=window.atob(e.slice(t.length));if(!n.startsWith("ÿØÿ"))return e;var r=0,o="";for(;r=e)return;let r=this.getQueuedFiles();if(r.length>0){if(this.options.uploadMultiple)return this.processFiles(r.slice(0,e-t));for(;nt.xhr===e)).map((e=>e))}cancelUpload(e){if(e.status===s.UPLOADING){let t=this._getFilesWithXhr(e.xhr);for(let e of t)e.status=s.CANCELED;void 0!==e.xhr&&e.xhr.abort();for(let e of t)this.emit("canceled",e);this.options.uploadMultiple&&this.emit("canceledmultiple",t)}else e.status!==s.ADDED&&e.status!==s.QUEUED||(e.status=s.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}resolveOption(e,...t){return"function"==typeof e?e.apply(this,t):e}uploadFile(e){return this.uploadFiles([e])}uploadFiles(e){this._transformFiles(e,(t=>{if(this.options.chunking){let n=t[0];e[0].upload.chunked=this.options.chunking&&(this.options.forceChunking||n.size>this.options.chunkSize),e[0].upload.totalChunkCount=Math.ceil(n.size/this.options.chunkSize),0===n.size&&(e[0].upload.totalChunkCount=1)}if(e[0].upload.chunked){let n=e[0],r=t[0];n.upload.chunks=[];let o=()=>{let t=0;for(;void 0!==n.upload.chunks[t];)t++;if(t>=n.upload.totalChunkCount)return;let o=t*this.options.chunkSize,i=Math.min(o+this.options.chunkSize,r.size),l={name:this._getParamName(0),data:r.webkitSlice?r.webkitSlice(o,i):r.slice(o,i),filename:n.upload.filename,chunkIndex:t};n.upload.chunks[t]={file:n,index:t,dataBlock:l,status:s.UPLOADING,progress:0,retries:0},this._uploadData(e,[l])};if(n.upload.finishedChunkUpload=(t,r)=>{let i=!0;t.status=s.SUCCESS,t.dataBlock=null,t.response=t.xhr.responseText,t.responseHeaders=t.xhr.getAllResponseHeaders(),t.xhr=null;for(let e=0;e{this._finished(e,r,null)}))},this.options.parallelChunkUploads){const e=Math.min(!0===this.options.parallelChunkUploads?this.options.parallelUploads:this.options.parallelChunkUploads,n.upload.totalChunkCount);for(let t=0;t{this._finishedUploading(e,n,t)},n.ontimeout=()=>{this._handleUploadError(e,n,`Request timedout after ${this.options.timeout/1e3} seconds`)},n.onerror=()=>{this._handleUploadError(e,n)},(null!=n.upload?n.upload:n).onprogress=t=>this._updateFilesUploadProgress(e,n,t);let i=this.options.defaultHeaders?{Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"}:{};this.options.binaryBody&&(i["Content-Type"]=e[0].type),this.options.headers&&Object.assign(i,this.options.headers);for(let e in i){let t=i[e];t&&n.setRequestHeader(e,t)}if(this.options.binaryBody){for(let t of e)this.emit("sending",t,n);this.options.uploadMultiple&&this.emit("sendingmultiple",e,n),this.submitRequest(n,null,e)}else{let r=new FormData;if(this.options.params){let t=this.options.params;"function"==typeof t&&(t=t.call(this,e,n,e[0].upload.chunked?this._getChunk(e[0],n):null));for(let e in t){let n=t[e];if(Array.isArray(n))for(let t=0;t{n[o]=i,++r===e.length&&t(n)}))}_addFormElementData(e){if("FORM"===this.element.tagName)for(let t of this.element.querySelectorAll("input, textarea, select, button")){let n=t.getAttribute("name"),r=t.getAttribute("type");if(r&&(r=r.toLowerCase()),null!=n)if("SELECT"===t.tagName&&t.hasAttribute("multiple"))for(let r of t.options)r.selected&&e.append(n,r.value);else(!r||"checkbox"!==r&&"radio"!==r||t.checked)&&e.append(n,t.value)}}_updateFilesUploadProgress(e,t,n){if(e[0].upload.chunked){let r=e[0],o=this._getChunk(r,t);n?(o.progress=100*n.loaded/n.total,o.total=n.total,o.bytesSent=n.loaded):(o.progress=100,o.bytesSent=o.total),r.upload.progress=0,r.upload.total=0,r.upload.bytesSent=0;for(let e=0;e(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16)))}}s.initClass(),s.options={},s.optionsForElement=function(e){return e.getAttribute("id")&&void 0!==s.options?s.options[a(e.getAttribute("id"))]:void 0},s.instances=[],s.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},s.discover=function(){let e;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else{e=[];let t=t=>(()=>{let n=[];for(let r of t)/(^| )dropzone($| )/.test(r.className)?n.push(e.push(r)):n.push(void 0);return n})();t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))}return(()=>{let t=[];for(let n of e)!1!==s.optionsForElement(n)?t.push(new s(n)):t.push(void 0);return t})()},s.isBrowserSupported=function(){return"undefined"!=typeof Promise},s.dataURItoBlob=function(e){let t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),o=new Uint8Array(r);for(let e=0,n=t.length,r=0<=n;r?e<=n:e>=n;r?e++:e--)o[e]=t.charCodeAt(e);return new Blob([r],{type:n})};const l=(e,t)=>e.filter((e=>e!==t)).map((e=>e)),a=e=>e.replace(/[\-_](\w)/g,(e=>e.charAt(1).toUpperCase()));s.createElement=function(e){let t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},s.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},s.getElement=function(e,t){let n;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector or a plain HTML element.`);return n},s.getElements=function(e,t){let n,r;if(e instanceof Array){r=[];try{for(n of e)r.push(this.getElement(n,t))}catch(e){r=null}}else if("string"==typeof e)for(n of(r=[],document.querySelectorAll(e)))r.push(n);else null!=e.nodeType&&(r=[e]);if(null==r||!r.length)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`);return r},s.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},s.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");let n=e.type,r=n.replace(/\/.*$/,"");for(let o of t)if(o=o.trim(),"."===o.charAt(0)){if(-1!==e.name.toLowerCase().indexOf(o.toLowerCase(),e.name.length-o.length))return!0}else if(/\/\*$/.test(o)){if(r===o.replace(/\/.*$/,""))return!0}else if(n===o)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each((function(){return new s(this,e)}))}),s.ADDED="added",s.QUEUED="queued",s.ACCEPTED=s.QUEUED,s.UPLOADING="uploading",s.PROCESSING=s.UPLOADING,s.CANCELED="canceled",s.ERROR="error",s.SUCCESS="success";var u=function(e,t,n,r,o,i,s,l,a,u){let d=function(e){let t=e.naturalHeight,n=document.createElement("canvas");n.width=1,n.height=t;let r=n.getContext("2d");r.drawImage(e,0,0);let{data:o}=r.getImageData(1,0,1,t),i=0,s=t,l=t;for(;l>i;)0===o[4*(l-1)+3]?s=l:i=l,l=s+i>>1;let a=l/t;return 0===a?1:a}(t);return e.drawImage(t,n,r,o,i,s,l,a,u/d)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){"use strict";var e=p(n(1669)),t=p(n(5815)),r=p(n(1594)),o=n(5145),i=c(n(5207)),s=p(n(6931)),l=c(n(2121)),a=c(n(1021)),u=n(2499);function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function p(e){return e&&e.__esModule?e:{default:e}}const h=(0,i.loadComponent)(s.default),f='img[data-shortcode="image"]';(()=>{const n={init(n){const r=t.default._t("AssetAdmin.INSERT_FROM_FILES","Insert from Files"),o=t.default._t("AssetAdmin.EDIT_IMAGE","Edit image"),i=t.default._t("AssetAdmin.DELETE_IMAGE","Delete image"),s=t.default._t("AssetAdmin.FILE","File");n.addCommand("ssmedia",(()=>{(0,e.default)(`#${n.id}`).entwine("ss").openMediaDialog()})),n.addCommand("ssmedia-delete",(()=>{const e=n.selection.getNode();n.dom.is(e,f)?e.remove():console.error({error:"Unexpected selection - expected image",selectedNode:e})})),n.ui.registry.addButton("ssmedia",{tooltip:r,icon:"image",onAction:()=>n.execCommand("ssmedia"),stateSelector:f}),n.ui.registry.addMenuItem("ssmedia",{text:s,icon:"image",onAction:()=>n.execCommand("ssmedia")}),n.ui.registry.addButton("ssmediaedit",{tooltip:o,icon:"edit-block",onAction:()=>n.execCommand("ssmedia")}),n.ui.registry.addButton("ssmediadelete",{tooltip:i,icon:"remove",onAction:()=>n.execCommand("ssmedia-delete")});const a=n.getParam("image_size_presets");let d=[];return a&&(d=(0,u.imageSizePresetButtons)(n,a)),n.ui.registry.addContextToolbar("ssmedia",{predicate:e=>n.dom.is(e,f),position:"node",scope:"node",items:`${d.join(" ")} | ssmediaedit ssmediadelete`}),n.on("BeforeExecCommand",(e=>{const t=e.command,r=e.ui,o=e.value;"mceEditImage"!==t&&"mceImage"!==t||(e.preventDefault(),n.execCommand("ssmedia",r,o))})),n.on("GetContent",(t=>{const n=(0,e.default)(`
${t.content}
`);n.find(f).add(n.filter(f)).each((function(){const t=(0,e.default)(this),n={src:t.attr("src"),id:t.data("id"),width:t.attr("width"),height:t.attr("height"),class:t.attr("class"),title:t.attr("title"),alt:t.attr("alt"),loading:t.data("loading")},r=l.default.serialise({name:"image",properties:(0,l.sanitiseShortCodeProperties)(n),wrapped:!1});t.replaceWith(r)})),t.content="",n.each((function(){void 0!==this.innerHTML&&(t.content+=this.innerHTML)}))})),n.on("BeforeSetContent",(t=>{let n=t.content,r=l.default.match("image",!1,n);for(;r;){const t=r.properties,o=(0,e.default)("").attr(Object.assign({},t,{id:void 0,"data-id":t.id,"data-shortcode":"image","data-loading":t.loading})).addClass("ss-htmleditorfield-file image");n=n.replace(r.original,(0,e.default)("
").append(o).html()),r=l.default.match("image",!1,n)}t.content=n})),{getMetadata(){return{name:"Silverstripe Media",url:"https://docs.silverstripe.org/en/4/developer_guides/forms/field_types/htmleditorfield"}}}}};tinymce.PluginManager.add("ssmedia",(e=>n.init(e)))})(),e.default.entwine("ss",(t=>{t(".js-injector-boot #insert-media-react__dialog-wrapper").entwine({Element:null,Data:{},ReactRoot:null,onunmatch(){this._clearModal()},_clearModal(){const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))},open(){const{dispatch:e}=i.default.reducer.store;e(a.initFormStack("insert-media","admin"));const t=tinymce.activeEditor.getParam("image_size_presets");e(a.defineImageSizePresets(t)),this._renderModal(!0)},close(){const{dispatch:e}=i.default.reducer.store;e(a.reset()),this._renderModal(!1)},_renderModal(e){var t=this;const{url:n,...i}=this.getOriginalAttributes(),s=i.hasOwnProperty("ID")&&null!==i.ID,l=this.getFolderId(),a=this.getElement().getEditor(),u=a.getInstance().selection,d=a.getSelection(),c=u.getNode().tagName,p="A"!==c&&("IMG"===c||""===d.trim());let f=this.getReactRoot();f||(f=(0,o.createRoot)(this[0])),f.render(r.default.createElement(h,{title:!1,isOpen:e,folderId:l,onInsert:function(){return t._handleInsert(...arguments)},onClosed:()=>this.close(),bodyClassName:"modal__dialog",className:"insert-media-react__dialog-wrapper",requireLinkText:p,fileAttributes:i,fileSelected:s})),this.setReactRoot(f)},_handleInsert(e,t){let n=!1;this.setData(Object.assign({},e,t));try{let e=null;if(e=t?t.category:"image","image"===e)n=this.insertImage();else n=this.insertFile()}catch(e){this.statusMessage(e,"bad")}return n&&this.close(),Promise.resolve()},getFolderId(){const e=this.getElement();if(!e)return null;const t=Number(e.data("config").upload_folder_id);return isNaN(t)?null:t},getOriginalAttributes(){const e=this.getElement();if(!e)return{};const n=e.getEditor().getSelectedNode();if(!n)return{};const r=t(n),o=(r.attr("href")||"").split("#");if(o[0]){const e=l.default.match("file_link",!1,o[0]);if(e)return{ID:e.properties.id?parseInt(e.properties.id,10):0,Anchor:o[1]||"",Description:r.attr("title"),TargetBlank:!!r.attr("target")}}const i=r.parent(".captionImage").find(".caption"),s={url:r.attr("src"),AltText:r.attr("alt"),Width:r.attr("width"),Height:r.attr("height"),Loading:r.attr("data-loading"),TitleTooltip:r.attr("title"),Alignment:this.findPosition(r.attr("class")),Caption:i.text(),ID:r.attr("data-id")};return["Width","Height","ID"].forEach((e=>{s[e]="string"==typeof s[e]?parseInt(s[e],10):null})),s},findPosition(e){if("string"!=typeof e)return"";const t=e.split(" ");return["leftAlone","center","rightAlone","left","right"].find((e=>t.indexOf(e)>-1))},getAttributes(){const e=this.getData();return{src:e.url,alt:e.AltText,width:e.Width,height:e.Height,title:e.TitleTooltip,class:e.Alignment,"data-id":e.ID,"data-shortcode":"image","data-loading":e.Loading}},getExtraData(){const e=this.getData();return{CaptionText:e&&e.Caption}},insertFile(){const e=this.getData(),n=this.getElement().getEditor(),r=t(n.getSelectedNode()),o=l.default.serialise({name:"file_link",properties:{id:e.ID}},!0);let i=n.getSelection()||e.Text||e.filename;r.is("a")&&r.html()&&(i="");const s={href:o,target:e.TargetBlank?"_blank":"",title:e.Description};if(r.is("img")){i=e.Text||e.filename;const o=t("").attr(s).text(i);r.replaceWith(o),n.addUndo(),n.repaint()}else this.insertLinkInEditor(s,i);return!0},insertImage(){const e=this.getElement();if(!e)return!1;const n=e.getEditor();if(!n)return!1;const r=t(n.getSelectedNode()),o=this.getAttributes(),i=this.getExtraData();let s=r&&r.is("img,a")?r:null;s&&s.parent().is(".captionImage")&&(s=s.parent());const l=r&&r.is("img")?r:t("");l.attr(o).addClass("ss-htmleditorfield-file image");let a=l.parent(".captionImage"),u=a.find(".caption");i.CaptionText?(a.length||(a=t("
")),a.attr("class",`captionImage ${o.class}`).removeAttr("data-mce-style").width(o.width),u.length||(u=t('

').appendTo(a)),u.attr("class",`caption ${o.class}`).text(i.CaptionText)):(a=null,u=null);const d=a||l;return s&&s.not(d).length&&s.replaceWith(d),a&&a.prepend(l),s||(n.repaint(),n.insertContent(t("
").append(d).html(),{skip_undo:1})),n.addUndo(),n.repaint(),!0},statusMessage(n,r){const o=t("
").text(n).html();e.default.noticeAdd({text:o,type:r,stayTime:5e3,inEffect:{left:"0",opacity:"show"}})}})}))}()}(); \ No newline at end of file +/******/ (function() { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ HiddenText: function() { return /* binding */ HiddenText; }, +/* harmony export */ LiveRegion: function() { return /* binding */ LiveRegion; }, +/* harmony export */ useAnnouncement: function() { return /* binding */ useAnnouncement; } +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); + + +const hiddenStyles = { + display: 'none' +}; +function HiddenText(_ref) { + let { + id, + value + } = _ref; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { + id: id, + style: hiddenStyles + }, value); +} + +function LiveRegion(_ref) { + let { + id, + announcement, + ariaLiveType = "assertive" + } = _ref; + // Hide element visually but keep it readable by screen readers + const visuallyHidden = { + position: 'fixed', + top: 0, + left: 0, + width: 1, + height: 1, + margin: -1, + border: 0, + padding: 0, + overflow: 'hidden', + clip: 'rect(0 0 0 0)', + clipPath: 'inset(100%)', + whiteSpace: 'nowrap' + }; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { + id: id, + style: visuallyHidden, + role: "status", + "aria-live": ariaLiveType, + "aria-atomic": true + }, announcement); +} + +function useAnnouncement() { + const [announcement, setAnnouncement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''); + const announce = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(value => { + if (value != null) { + setAnnouncement(value); + } + }, []); + return { + announce, + announcement + }; +} + + +//# sourceMappingURL=accessibility.esm.js.map + + +/***/ }), + +/***/ "./node_modules/@dnd-kit/core/dist/core.esm.js": +/*!*****************************************************!*\ + !*** ./node_modules/@dnd-kit/core/dist/core.esm.js ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ AutoScrollActivator: function() { return /* binding */ AutoScrollActivator; }, +/* harmony export */ DndContext: function() { return /* binding */ DndContext; }, +/* harmony export */ DragOverlay: function() { return /* binding */ DragOverlay; }, +/* harmony export */ KeyboardCode: function() { return /* binding */ KeyboardCode; }, +/* harmony export */ KeyboardSensor: function() { return /* binding */ KeyboardSensor; }, +/* harmony export */ MeasuringFrequency: function() { return /* binding */ MeasuringFrequency; }, +/* harmony export */ MeasuringStrategy: function() { return /* binding */ MeasuringStrategy; }, +/* harmony export */ MouseSensor: function() { return /* binding */ MouseSensor; }, +/* harmony export */ PointerSensor: function() { return /* binding */ PointerSensor; }, +/* harmony export */ TouchSensor: function() { return /* binding */ TouchSensor; }, +/* harmony export */ TraversalOrder: function() { return /* binding */ TraversalOrder; }, +/* harmony export */ applyModifiers: function() { return /* binding */ applyModifiers; }, +/* harmony export */ closestCenter: function() { return /* binding */ closestCenter; }, +/* harmony export */ closestCorners: function() { return /* binding */ closestCorners; }, +/* harmony export */ defaultAnnouncements: function() { return /* binding */ defaultAnnouncements; }, +/* harmony export */ defaultCoordinates: function() { return /* binding */ defaultCoordinates; }, +/* harmony export */ defaultDropAnimation: function() { return /* binding */ defaultDropAnimationConfiguration; }, +/* harmony export */ defaultDropAnimationSideEffects: function() { return /* binding */ defaultDropAnimationSideEffects; }, +/* harmony export */ defaultKeyboardCoordinateGetter: function() { return /* binding */ defaultKeyboardCoordinateGetter; }, +/* harmony export */ defaultScreenReaderInstructions: function() { return /* binding */ defaultScreenReaderInstructions; }, +/* harmony export */ getClientRect: function() { return /* binding */ getClientRect; }, +/* harmony export */ getFirstCollision: function() { return /* binding */ getFirstCollision; }, +/* harmony export */ getScrollableAncestors: function() { return /* binding */ getScrollableAncestors; }, +/* harmony export */ pointerWithin: function() { return /* binding */ pointerWithin; }, +/* harmony export */ rectIntersection: function() { return /* binding */ rectIntersection; }, +/* harmony export */ useDndContext: function() { return /* binding */ useDndContext; }, +/* harmony export */ useDndMonitor: function() { return /* binding */ useDndMonitor; }, +/* harmony export */ useDraggable: function() { return /* binding */ useDraggable; }, +/* harmony export */ useDroppable: function() { return /* binding */ useDroppable; }, +/* harmony export */ useSensor: function() { return /* binding */ useSensor; }, +/* harmony export */ useSensors: function() { return /* binding */ useSensors; } +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "react-dom"); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dnd-kit/utilities */ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js"); +/* harmony import */ var _dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @dnd-kit/accessibility */ "./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js"); + + + + + +const DndMonitorContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null); + +function useDndMonitor(listener) { + const registerListener = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(DndMonitorContext); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!registerListener) { + throw new Error('useDndMonitor must be used within a children of '); + } + + const unsubscribe = registerListener(listener); + return unsubscribe; + }, [listener, registerListener]); +} + +function useDndMonitorProvider() { + const [listeners] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => new Set()); + const registerListener = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(listener => { + listeners.add(listener); + return () => listeners.delete(listener); + }, [listeners]); + const dispatch = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(_ref => { + let { + type, + event + } = _ref; + listeners.forEach(listener => { + var _listener$type; + + return (_listener$type = listener[type]) == null ? void 0 : _listener$type.call(listener, event); + }); + }, [listeners]); + return [dispatch, registerListener]; +} + +const defaultScreenReaderInstructions = { + draggable: "\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n " +}; +const defaultAnnouncements = { + onDragStart(_ref) { + let { + active + } = _ref; + return "Picked up draggable item " + active.id + "."; + }, + + onDragOver(_ref2) { + let { + active, + over + } = _ref2; + + if (over) { + return "Draggable item " + active.id + " was moved over droppable area " + over.id + "."; + } + + return "Draggable item " + active.id + " is no longer over a droppable area."; + }, + + onDragEnd(_ref3) { + let { + active, + over + } = _ref3; + + if (over) { + return "Draggable item " + active.id + " was dropped over droppable area " + over.id; + } + + return "Draggable item " + active.id + " was dropped."; + }, + + onDragCancel(_ref4) { + let { + active + } = _ref4; + return "Dragging was cancelled. Draggable item " + active.id + " was dropped."; + } + +}; + +function Accessibility(_ref) { + let { + announcements = defaultAnnouncements, + container, + hiddenTextDescribedById, + screenReaderInstructions = defaultScreenReaderInstructions + } = _ref; + const { + announce, + announcement + } = (0,_dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__.useAnnouncement)(); + const liveRegionId = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)("DndLiveRegion"); + const [mounted, setMounted] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + setMounted(true); + }, []); + useDndMonitor((0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + onDragStart(_ref2) { + let { + active + } = _ref2; + announce(announcements.onDragStart({ + active + })); + }, + + onDragMove(_ref3) { + let { + active, + over + } = _ref3; + + if (announcements.onDragMove) { + announce(announcements.onDragMove({ + active, + over + })); + } + }, + + onDragOver(_ref4) { + let { + active, + over + } = _ref4; + announce(announcements.onDragOver({ + active, + over + })); + }, + + onDragEnd(_ref5) { + let { + active, + over + } = _ref5; + announce(announcements.onDragEnd({ + active, + over + })); + }, + + onDragCancel(_ref6) { + let { + active, + over + } = _ref6; + announce(announcements.onDragCancel({ + active, + over + })); + } + + }), [announce, announcements])); + + if (!mounted) { + return null; + } + + const markup = react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__.HiddenText, { + id: hiddenTextDescribedById, + value: screenReaderInstructions.draggable + }), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__.LiveRegion, { + id: liveRegionId, + announcement: announcement + })); + return container ? (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(markup, container) : markup; +} + +var Action; + +(function (Action) { + Action["DragStart"] = "dragStart"; + Action["DragMove"] = "dragMove"; + Action["DragEnd"] = "dragEnd"; + Action["DragCancel"] = "dragCancel"; + Action["DragOver"] = "dragOver"; + Action["RegisterDroppable"] = "registerDroppable"; + Action["SetDroppableDisabled"] = "setDroppableDisabled"; + Action["UnregisterDroppable"] = "unregisterDroppable"; +})(Action || (Action = {})); + +function noop() {} + +function useSensor(sensor, options) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + sensor, + options: options != null ? options : {} + }), // eslint-disable-next-line react-hooks/exhaustive-deps + [sensor, options]); +} + +function useSensors() { + for (var _len = arguments.length, sensors = new Array(_len), _key = 0; _key < _len; _key++) { + sensors[_key] = arguments[_key]; + } + + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => [...sensors].filter(sensor => sensor != null), // eslint-disable-next-line react-hooks/exhaustive-deps + [...sensors]); +} + +const defaultCoordinates = /*#__PURE__*/Object.freeze({ + x: 0, + y: 0 +}); + +/** + * Returns the distance between two points + */ +function distanceBetween(p1, p2) { + return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2)); +} + +function getRelativeTransformOrigin(event, rect) { + const eventCoordinates = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(event); + + if (!eventCoordinates) { + return '0 0'; + } + + const transformOrigin = { + x: (eventCoordinates.x - rect.left) / rect.width * 100, + y: (eventCoordinates.y - rect.top) / rect.height * 100 + }; + return transformOrigin.x + "% " + transformOrigin.y + "%"; +} + +/** + * Sort collisions from smallest to greatest value + */ +function sortCollisionsAsc(_ref, _ref2) { + let { + data: { + value: a + } + } = _ref; + let { + data: { + value: b + } + } = _ref2; + return a - b; +} +/** + * Sort collisions from greatest to smallest value + */ + +function sortCollisionsDesc(_ref3, _ref4) { + let { + data: { + value: a + } + } = _ref3; + let { + data: { + value: b + } + } = _ref4; + return b - a; +} +/** + * Returns the coordinates of the corners of a given rectangle: + * [TopLeft {x, y}, TopRight {x, y}, BottomLeft {x, y}, BottomRight {x, y}] + */ + +function cornersOfRectangle(_ref5) { + let { + left, + top, + height, + width + } = _ref5; + return [{ + x: left, + y: top + }, { + x: left + width, + y: top + }, { + x: left, + y: top + height + }, { + x: left + width, + y: top + height + }]; +} +function getFirstCollision(collisions, property) { + if (!collisions || collisions.length === 0) { + return null; + } + + const [firstCollision] = collisions; + return property ? firstCollision[property] : firstCollision; +} + +/** + * Returns the coordinates of the center of a given ClientRect + */ + +function centerOfRectangle(rect, left, top) { + if (left === void 0) { + left = rect.left; + } + + if (top === void 0) { + top = rect.top; + } + + return { + x: left + rect.width * 0.5, + y: top + rect.height * 0.5 + }; +} +/** + * Returns the closest rectangles from an array of rectangles to the center of a given + * rectangle. + */ + + +const closestCenter = _ref => { + let { + collisionRect, + droppableRects, + droppableContainers + } = _ref; + const centerRect = centerOfRectangle(collisionRect, collisionRect.left, collisionRect.top); + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect) { + const distBetween = distanceBetween(centerOfRectangle(rect), centerRect); + collisions.push({ + id, + data: { + droppableContainer, + value: distBetween + } + }); + } + } + + return collisions.sort(sortCollisionsAsc); +}; + +/** + * Returns the closest rectangles from an array of rectangles to the corners of + * another rectangle. + */ + +const closestCorners = _ref => { + let { + collisionRect, + droppableRects, + droppableContainers + } = _ref; + const corners = cornersOfRectangle(collisionRect); + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect) { + const rectCorners = cornersOfRectangle(rect); + const distances = corners.reduce((accumulator, corner, index) => { + return accumulator + distanceBetween(rectCorners[index], corner); + }, 0); + const effectiveDistance = Number((distances / 4).toFixed(4)); + collisions.push({ + id, + data: { + droppableContainer, + value: effectiveDistance + } + }); + } + } + + return collisions.sort(sortCollisionsAsc); +}; + +/** + * Returns the intersecting rectangle area between two rectangles + */ + +function getIntersectionRatio(entry, target) { + const top = Math.max(target.top, entry.top); + const left = Math.max(target.left, entry.left); + const right = Math.min(target.left + target.width, entry.left + entry.width); + const bottom = Math.min(target.top + target.height, entry.top + entry.height); + const width = right - left; + const height = bottom - top; + + if (left < right && top < bottom) { + const targetArea = target.width * target.height; + const entryArea = entry.width * entry.height; + const intersectionArea = width * height; + const intersectionRatio = intersectionArea / (targetArea + entryArea - intersectionArea); + return Number(intersectionRatio.toFixed(4)); + } // Rectangles do not overlap, or overlap has an area of zero (edge/corner overlap) + + + return 0; +} +/** + * Returns the rectangles that has the greatest intersection area with a given + * rectangle in an array of rectangles. + */ + +const rectIntersection = _ref => { + let { + collisionRect, + droppableRects, + droppableContainers + } = _ref; + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect) { + const intersectionRatio = getIntersectionRatio(rect, collisionRect); + + if (intersectionRatio > 0) { + collisions.push({ + id, + data: { + droppableContainer, + value: intersectionRatio + } + }); + } + } + } + + return collisions.sort(sortCollisionsDesc); +}; + +/** + * Check if a given point is contained within a bounding rectangle + */ + +function isPointWithinRect(point, rect) { + const { + top, + left, + bottom, + right + } = rect; + return top <= point.y && point.y <= bottom && left <= point.x && point.x <= right; +} +/** + * Returns the rectangles that the pointer is hovering over + */ + + +const pointerWithin = _ref => { + let { + droppableContainers, + droppableRects, + pointerCoordinates + } = _ref; + + if (!pointerCoordinates) { + return []; + } + + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect && isPointWithinRect(pointerCoordinates, rect)) { + /* There may be more than a single rectangle intersecting + * with the pointer coordinates. In order to sort the + * colliding rectangles, we measure the distance between + * the pointer and the corners of the intersecting rectangle + */ + const corners = cornersOfRectangle(rect); + const distances = corners.reduce((accumulator, corner) => { + return accumulator + distanceBetween(pointerCoordinates, corner); + }, 0); + const effectiveDistance = Number((distances / 4).toFixed(4)); + collisions.push({ + id, + data: { + droppableContainer, + value: effectiveDistance + } + }); + } + } + + return collisions.sort(sortCollisionsAsc); +}; + +function adjustScale(transform, rect1, rect2) { + return { ...transform, + scaleX: rect1 && rect2 ? rect1.width / rect2.width : 1, + scaleY: rect1 && rect2 ? rect1.height / rect2.height : 1 + }; +} + +function getRectDelta(rect1, rect2) { + return rect1 && rect2 ? { + x: rect1.left - rect2.left, + y: rect1.top - rect2.top + } : defaultCoordinates; +} + +function createRectAdjustmentFn(modifier) { + return function adjustClientRect(rect) { + for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + adjustments[_key - 1] = arguments[_key]; + } + + return adjustments.reduce((acc, adjustment) => ({ ...acc, + top: acc.top + modifier * adjustment.y, + bottom: acc.bottom + modifier * adjustment.y, + left: acc.left + modifier * adjustment.x, + right: acc.right + modifier * adjustment.x + }), { ...rect + }); + }; +} +const getAdjustedRect = /*#__PURE__*/createRectAdjustmentFn(1); + +function parseTransform(transform) { + if (transform.startsWith('matrix3d(')) { + const transformArray = transform.slice(9, -1).split(/, /); + return { + x: +transformArray[12], + y: +transformArray[13], + scaleX: +transformArray[0], + scaleY: +transformArray[5] + }; + } else if (transform.startsWith('matrix(')) { + const transformArray = transform.slice(7, -1).split(/, /); + return { + x: +transformArray[4], + y: +transformArray[5], + scaleX: +transformArray[0], + scaleY: +transformArray[3] + }; + } + + return null; +} + +function inverseTransform(rect, transform, transformOrigin) { + const parsedTransform = parseTransform(transform); + + if (!parsedTransform) { + return rect; + } + + const { + scaleX, + scaleY, + x: translateX, + y: translateY + } = parsedTransform; + const x = rect.left - translateX - (1 - scaleX) * parseFloat(transformOrigin); + const y = rect.top - translateY - (1 - scaleY) * parseFloat(transformOrigin.slice(transformOrigin.indexOf(' ') + 1)); + const w = scaleX ? rect.width / scaleX : rect.width; + const h = scaleY ? rect.height / scaleY : rect.height; + return { + width: w, + height: h, + top: y, + right: x + w, + bottom: y + h, + left: x + }; +} + +const defaultOptions = { + ignoreTransform: false +}; +/** + * Returns the bounding client rect of an element relative to the viewport. + */ + +function getClientRect(element, options) { + if (options === void 0) { + options = defaultOptions; + } + + let rect = element.getBoundingClientRect(); + + if (options.ignoreTransform) { + const { + transform, + transformOrigin + } = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element).getComputedStyle(element); + + if (transform) { + rect = inverseTransform(rect, transform, transformOrigin); + } + } + + const { + top, + left, + width, + height, + bottom, + right + } = rect; + return { + top, + left, + width, + height, + bottom, + right + }; +} +/** + * Returns the bounding client rect of an element relative to the viewport. + * + * @remarks + * The ClientRect returned by this method does not take into account transforms + * applied to the element it measures. + * + */ + +function getTransformAgnosticClientRect(element) { + return getClientRect(element, { + ignoreTransform: true + }); +} + +function getWindowClientRect(element) { + const width = element.innerWidth; + const height = element.innerHeight; + return { + top: 0, + left: 0, + right: width, + bottom: height, + width, + height + }; +} + +function isFixed(node, computedStyle) { + if (computedStyle === void 0) { + computedStyle = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(node).getComputedStyle(node); + } + + return computedStyle.position === 'fixed'; +} + +function isScrollable(element, computedStyle) { + if (computedStyle === void 0) { + computedStyle = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element).getComputedStyle(element); + } + + const overflowRegex = /(auto|scroll|overlay)/; + const properties = ['overflow', 'overflowX', 'overflowY']; + return properties.some(property => { + const value = computedStyle[property]; + return typeof value === 'string' ? overflowRegex.test(value) : false; + }); +} + +function getScrollableAncestors(element, limit) { + const scrollParents = []; + + function findScrollableAncestors(node) { + if (limit != null && scrollParents.length >= limit) { + return scrollParents; + } + + if (!node) { + return scrollParents; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isDocument)(node) && node.scrollingElement != null && !scrollParents.includes(node.scrollingElement)) { + scrollParents.push(node.scrollingElement); + return scrollParents; + } + + if (!(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(node) || (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isSVGElement)(node)) { + return scrollParents; + } + + if (scrollParents.includes(node)) { + return scrollParents; + } + + const computedStyle = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element).getComputedStyle(node); + + if (node !== element) { + if (isScrollable(node, computedStyle)) { + scrollParents.push(node); + } + } + + if (isFixed(node, computedStyle)) { + return scrollParents; + } + + return findScrollableAncestors(node.parentNode); + } + + if (!element) { + return scrollParents; + } + + return findScrollableAncestors(element); +} +function getFirstScrollableAncestor(node) { + const [firstScrollableAncestor] = getScrollableAncestors(node, 1); + return firstScrollableAncestor != null ? firstScrollableAncestor : null; +} + +function getScrollableElement(element) { + if (!_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.canUseDOM || !element) { + return null; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isWindow)(element)) { + return element; + } + + if (!(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isNode)(element)) { + return null; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isDocument)(element) || element === (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(element).scrollingElement) { + return window; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(element)) { + return element; + } + + return null; +} + +function getScrollXCoordinate(element) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isWindow)(element)) { + return element.scrollX; + } + + return element.scrollLeft; +} +function getScrollYCoordinate(element) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isWindow)(element)) { + return element.scrollY; + } + + return element.scrollTop; +} +function getScrollCoordinates(element) { + return { + x: getScrollXCoordinate(element), + y: getScrollYCoordinate(element) + }; +} + +var Direction; + +(function (Direction) { + Direction[Direction["Forward"] = 1] = "Forward"; + Direction[Direction["Backward"] = -1] = "Backward"; +})(Direction || (Direction = {})); + +function isDocumentScrollingElement(element) { + if (!_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.canUseDOM || !element) { + return false; + } + + return element === document.scrollingElement; +} + +function getScrollPosition(scrollingContainer) { + const minScroll = { + x: 0, + y: 0 + }; + const dimensions = isDocumentScrollingElement(scrollingContainer) ? { + height: window.innerHeight, + width: window.innerWidth + } : { + height: scrollingContainer.clientHeight, + width: scrollingContainer.clientWidth + }; + const maxScroll = { + x: scrollingContainer.scrollWidth - dimensions.width, + y: scrollingContainer.scrollHeight - dimensions.height + }; + const isTop = scrollingContainer.scrollTop <= minScroll.y; + const isLeft = scrollingContainer.scrollLeft <= minScroll.x; + const isBottom = scrollingContainer.scrollTop >= maxScroll.y; + const isRight = scrollingContainer.scrollLeft >= maxScroll.x; + return { + isTop, + isLeft, + isBottom, + isRight, + maxScroll, + minScroll + }; +} + +const defaultThreshold = { + x: 0.2, + y: 0.2 +}; +function getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, _ref, acceleration, thresholdPercentage) { + let { + top, + left, + right, + bottom + } = _ref; + + if (acceleration === void 0) { + acceleration = 10; + } + + if (thresholdPercentage === void 0) { + thresholdPercentage = defaultThreshold; + } + + const { + isTop, + isBottom, + isLeft, + isRight + } = getScrollPosition(scrollContainer); + const direction = { + x: 0, + y: 0 + }; + const speed = { + x: 0, + y: 0 + }; + const threshold = { + height: scrollContainerRect.height * thresholdPercentage.y, + width: scrollContainerRect.width * thresholdPercentage.x + }; + + if (!isTop && top <= scrollContainerRect.top + threshold.height) { + // Scroll Up + direction.y = Direction.Backward; + speed.y = acceleration * Math.abs((scrollContainerRect.top + threshold.height - top) / threshold.height); + } else if (!isBottom && bottom >= scrollContainerRect.bottom - threshold.height) { + // Scroll Down + direction.y = Direction.Forward; + speed.y = acceleration * Math.abs((scrollContainerRect.bottom - threshold.height - bottom) / threshold.height); + } + + if (!isRight && right >= scrollContainerRect.right - threshold.width) { + // Scroll Right + direction.x = Direction.Forward; + speed.x = acceleration * Math.abs((scrollContainerRect.right - threshold.width - right) / threshold.width); + } else if (!isLeft && left <= scrollContainerRect.left + threshold.width) { + // Scroll Left + direction.x = Direction.Backward; + speed.x = acceleration * Math.abs((scrollContainerRect.left + threshold.width - left) / threshold.width); + } + + return { + direction, + speed + }; +} + +function getScrollElementRect(element) { + if (element === document.scrollingElement) { + const { + innerWidth, + innerHeight + } = window; + return { + top: 0, + left: 0, + right: innerWidth, + bottom: innerHeight, + width: innerWidth, + height: innerHeight + }; + } + + const { + top, + left, + right, + bottom + } = element.getBoundingClientRect(); + return { + top, + left, + right, + bottom, + width: element.clientWidth, + height: element.clientHeight + }; +} + +function getScrollOffsets(scrollableAncestors) { + return scrollableAncestors.reduce((acc, node) => { + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(acc, getScrollCoordinates(node)); + }, defaultCoordinates); +} +function getScrollXOffset(scrollableAncestors) { + return scrollableAncestors.reduce((acc, node) => { + return acc + getScrollXCoordinate(node); + }, 0); +} +function getScrollYOffset(scrollableAncestors) { + return scrollableAncestors.reduce((acc, node) => { + return acc + getScrollYCoordinate(node); + }, 0); +} + +function scrollIntoViewIfNeeded(element, measure) { + if (measure === void 0) { + measure = getClientRect; + } + + if (!element) { + return; + } + + const { + top, + left, + bottom, + right + } = measure(element); + const firstScrollableAncestor = getFirstScrollableAncestor(element); + + if (!firstScrollableAncestor) { + return; + } + + if (bottom <= 0 || right <= 0 || top >= window.innerHeight || left >= window.innerWidth) { + element.scrollIntoView({ + block: 'center', + inline: 'center' + }); + } +} + +const properties = [['x', ['left', 'right'], getScrollXOffset], ['y', ['top', 'bottom'], getScrollYOffset]]; +class Rect { + constructor(rect, element) { + this.rect = void 0; + this.width = void 0; + this.height = void 0; + this.top = void 0; + this.bottom = void 0; + this.right = void 0; + this.left = void 0; + const scrollableAncestors = getScrollableAncestors(element); + const scrollOffsets = getScrollOffsets(scrollableAncestors); + this.rect = { ...rect + }; + this.width = rect.width; + this.height = rect.height; + + for (const [axis, keys, getScrollOffset] of properties) { + for (const key of keys) { + Object.defineProperty(this, key, { + get: () => { + const currentOffsets = getScrollOffset(scrollableAncestors); + const scrollOffsetsDeltla = scrollOffsets[axis] - currentOffsets; + return this.rect[key] + scrollOffsetsDeltla; + }, + enumerable: true + }); + } + } + + Object.defineProperty(this, 'rect', { + enumerable: false + }); + } + +} + +class Listeners { + constructor(target) { + this.target = void 0; + this.listeners = []; + + this.removeAll = () => { + this.listeners.forEach(listener => { + var _this$target; + + return (_this$target = this.target) == null ? void 0 : _this$target.removeEventListener(...listener); + }); + }; + + this.target = target; + } + + add(eventName, handler, options) { + var _this$target2; + + (_this$target2 = this.target) == null ? void 0 : _this$target2.addEventListener(eventName, handler, options); + this.listeners.push([eventName, handler, options]); + } + +} + +function getEventListenerTarget(target) { + // If the `event.target` element is removed from the document events will still be targeted + // at it, and hence won't always bubble up to the window or document anymore. + // If there is any risk of an element being removed while it is being dragged, + // the best practice is to attach the event listeners directly to the target. + // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget + const { + EventTarget + } = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(target); + return target instanceof EventTarget ? target : (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(target); +} + +function hasExceededDistance(delta, measurement) { + const dx = Math.abs(delta.x); + const dy = Math.abs(delta.y); + + if (typeof measurement === 'number') { + return Math.sqrt(dx ** 2 + dy ** 2) > measurement; + } + + if ('x' in measurement && 'y' in measurement) { + return dx > measurement.x && dy > measurement.y; + } + + if ('x' in measurement) { + return dx > measurement.x; + } + + if ('y' in measurement) { + return dy > measurement.y; + } + + return false; +} + +var EventName; + +(function (EventName) { + EventName["Click"] = "click"; + EventName["DragStart"] = "dragstart"; + EventName["Keydown"] = "keydown"; + EventName["ContextMenu"] = "contextmenu"; + EventName["Resize"] = "resize"; + EventName["SelectionChange"] = "selectionchange"; + EventName["VisibilityChange"] = "visibilitychange"; +})(EventName || (EventName = {})); + +function preventDefault(event) { + event.preventDefault(); +} +function stopPropagation(event) { + event.stopPropagation(); +} + +var KeyboardCode; + +(function (KeyboardCode) { + KeyboardCode["Space"] = "Space"; + KeyboardCode["Down"] = "ArrowDown"; + KeyboardCode["Right"] = "ArrowRight"; + KeyboardCode["Left"] = "ArrowLeft"; + KeyboardCode["Up"] = "ArrowUp"; + KeyboardCode["Esc"] = "Escape"; + KeyboardCode["Enter"] = "Enter"; + KeyboardCode["Tab"] = "Tab"; +})(KeyboardCode || (KeyboardCode = {})); + +const defaultKeyboardCodes = { + start: [KeyboardCode.Space, KeyboardCode.Enter], + cancel: [KeyboardCode.Esc], + end: [KeyboardCode.Space, KeyboardCode.Enter, KeyboardCode.Tab] +}; +const defaultKeyboardCoordinateGetter = (event, _ref) => { + let { + currentCoordinates + } = _ref; + + switch (event.code) { + case KeyboardCode.Right: + return { ...currentCoordinates, + x: currentCoordinates.x + 25 + }; + + case KeyboardCode.Left: + return { ...currentCoordinates, + x: currentCoordinates.x - 25 + }; + + case KeyboardCode.Down: + return { ...currentCoordinates, + y: currentCoordinates.y + 25 + }; + + case KeyboardCode.Up: + return { ...currentCoordinates, + y: currentCoordinates.y - 25 + }; + } + + return undefined; +}; + +class KeyboardSensor { + constructor(props) { + this.props = void 0; + this.autoScrollEnabled = false; + this.referenceCoordinates = void 0; + this.listeners = void 0; + this.windowListeners = void 0; + this.props = props; + const { + event: { + target + } + } = props; + this.props = props; + this.listeners = new Listeners((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(target)); + this.windowListeners = new Listeners((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(target)); + this.handleKeyDown = this.handleKeyDown.bind(this); + this.handleCancel = this.handleCancel.bind(this); + this.attach(); + } + + attach() { + this.handleStart(); + this.windowListeners.add(EventName.Resize, this.handleCancel); + this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); + setTimeout(() => this.listeners.add(EventName.Keydown, this.handleKeyDown)); + } + + handleStart() { + const { + activeNode, + onStart + } = this.props; + const node = activeNode.node.current; + + if (node) { + scrollIntoViewIfNeeded(node); + } + + onStart(defaultCoordinates); + } + + handleKeyDown(event) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(event)) { + const { + active, + context, + options + } = this.props; + const { + keyboardCodes = defaultKeyboardCodes, + coordinateGetter = defaultKeyboardCoordinateGetter, + scrollBehavior = 'smooth' + } = options; + const { + code + } = event; + + if (keyboardCodes.end.includes(code)) { + this.handleEnd(event); + return; + } + + if (keyboardCodes.cancel.includes(code)) { + this.handleCancel(event); + return; + } + + const { + collisionRect + } = context.current; + const currentCoordinates = collisionRect ? { + x: collisionRect.left, + y: collisionRect.top + } : defaultCoordinates; + + if (!this.referenceCoordinates) { + this.referenceCoordinates = currentCoordinates; + } + + const newCoordinates = coordinateGetter(event, { + active, + context: context.current, + currentCoordinates + }); + + if (newCoordinates) { + const coordinatesDelta = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(newCoordinates, currentCoordinates); + const scrollDelta = { + x: 0, + y: 0 + }; + const { + scrollableAncestors + } = context.current; + + for (const scrollContainer of scrollableAncestors) { + const direction = event.code; + const { + isTop, + isRight, + isLeft, + isBottom, + maxScroll, + minScroll + } = getScrollPosition(scrollContainer); + const scrollElementRect = getScrollElementRect(scrollContainer); + const clampedCoordinates = { + x: Math.min(direction === KeyboardCode.Right ? scrollElementRect.right - scrollElementRect.width / 2 : scrollElementRect.right, Math.max(direction === KeyboardCode.Right ? scrollElementRect.left : scrollElementRect.left + scrollElementRect.width / 2, newCoordinates.x)), + y: Math.min(direction === KeyboardCode.Down ? scrollElementRect.bottom - scrollElementRect.height / 2 : scrollElementRect.bottom, Math.max(direction === KeyboardCode.Down ? scrollElementRect.top : scrollElementRect.top + scrollElementRect.height / 2, newCoordinates.y)) + }; + const canScrollX = direction === KeyboardCode.Right && !isRight || direction === KeyboardCode.Left && !isLeft; + const canScrollY = direction === KeyboardCode.Down && !isBottom || direction === KeyboardCode.Up && !isTop; + + if (canScrollX && clampedCoordinates.x !== newCoordinates.x) { + const newScrollCoordinates = scrollContainer.scrollLeft + coordinatesDelta.x; + const canScrollToNewCoordinates = direction === KeyboardCode.Right && newScrollCoordinates <= maxScroll.x || direction === KeyboardCode.Left && newScrollCoordinates >= minScroll.x; + + if (canScrollToNewCoordinates && !coordinatesDelta.y) { + // We don't need to update coordinates, the scroll adjustment alone will trigger + // logic to auto-detect the new container we are over + scrollContainer.scrollTo({ + left: newScrollCoordinates, + behavior: scrollBehavior + }); + return; + } + + if (canScrollToNewCoordinates) { + scrollDelta.x = scrollContainer.scrollLeft - newScrollCoordinates; + } else { + scrollDelta.x = direction === KeyboardCode.Right ? scrollContainer.scrollLeft - maxScroll.x : scrollContainer.scrollLeft - minScroll.x; + } + + if (scrollDelta.x) { + scrollContainer.scrollBy({ + left: -scrollDelta.x, + behavior: scrollBehavior + }); + } + + break; + } else if (canScrollY && clampedCoordinates.y !== newCoordinates.y) { + const newScrollCoordinates = scrollContainer.scrollTop + coordinatesDelta.y; + const canScrollToNewCoordinates = direction === KeyboardCode.Down && newScrollCoordinates <= maxScroll.y || direction === KeyboardCode.Up && newScrollCoordinates >= minScroll.y; + + if (canScrollToNewCoordinates && !coordinatesDelta.x) { + // We don't need to update coordinates, the scroll adjustment alone will trigger + // logic to auto-detect the new container we are over + scrollContainer.scrollTo({ + top: newScrollCoordinates, + behavior: scrollBehavior + }); + return; + } + + if (canScrollToNewCoordinates) { + scrollDelta.y = scrollContainer.scrollTop - newScrollCoordinates; + } else { + scrollDelta.y = direction === KeyboardCode.Down ? scrollContainer.scrollTop - maxScroll.y : scrollContainer.scrollTop - minScroll.y; + } + + if (scrollDelta.y) { + scrollContainer.scrollBy({ + top: -scrollDelta.y, + behavior: scrollBehavior + }); + } + + break; + } + } + + this.handleMove(event, (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(newCoordinates, this.referenceCoordinates), scrollDelta)); + } + } + } + + handleMove(event, coordinates) { + const { + onMove + } = this.props; + event.preventDefault(); + onMove(coordinates); + } + + handleEnd(event) { + const { + onEnd + } = this.props; + event.preventDefault(); + this.detach(); + onEnd(); + } + + handleCancel(event) { + const { + onCancel + } = this.props; + event.preventDefault(); + this.detach(); + onCancel(); + } + + detach() { + this.listeners.removeAll(); + this.windowListeners.removeAll(); + } + +} +KeyboardSensor.activators = [{ + eventName: 'onKeyDown', + handler: (event, _ref, _ref2) => { + let { + keyboardCodes = defaultKeyboardCodes, + onActivation + } = _ref; + let { + active + } = _ref2; + const { + code + } = event.nativeEvent; + + if (keyboardCodes.start.includes(code)) { + const activator = active.activatorNode.current; + + if (activator && event.target !== activator) { + return false; + } + + event.preventDefault(); + onActivation == null ? void 0 : onActivation({ + event: event.nativeEvent + }); + return true; + } + + return false; + } +}]; + +function isDistanceConstraint(constraint) { + return Boolean(constraint && 'distance' in constraint); +} + +function isDelayConstraint(constraint) { + return Boolean(constraint && 'delay' in constraint); +} + +class AbstractPointerSensor { + constructor(props, events, listenerTarget) { + var _getEventCoordinates; + + if (listenerTarget === void 0) { + listenerTarget = getEventListenerTarget(props.event.target); + } + + this.props = void 0; + this.events = void 0; + this.autoScrollEnabled = true; + this.document = void 0; + this.activated = false; + this.initialCoordinates = void 0; + this.timeoutId = null; + this.listeners = void 0; + this.documentListeners = void 0; + this.windowListeners = void 0; + this.props = props; + this.events = events; + const { + event + } = props; + const { + target + } = event; + this.props = props; + this.events = events; + this.document = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(target); + this.documentListeners = new Listeners(this.document); + this.listeners = new Listeners(listenerTarget); + this.windowListeners = new Listeners((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(target)); + this.initialCoordinates = (_getEventCoordinates = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(event)) != null ? _getEventCoordinates : defaultCoordinates; + this.handleStart = this.handleStart.bind(this); + this.handleMove = this.handleMove.bind(this); + this.handleEnd = this.handleEnd.bind(this); + this.handleCancel = this.handleCancel.bind(this); + this.handleKeydown = this.handleKeydown.bind(this); + this.removeTextSelection = this.removeTextSelection.bind(this); + this.attach(); + } + + attach() { + const { + events, + props: { + options: { + activationConstraint, + bypassActivationConstraint + } + } + } = this; + this.listeners.add(events.move.name, this.handleMove, { + passive: false + }); + this.listeners.add(events.end.name, this.handleEnd); + + if (events.cancel) { + this.listeners.add(events.cancel.name, this.handleCancel); + } + + this.windowListeners.add(EventName.Resize, this.handleCancel); + this.windowListeners.add(EventName.DragStart, preventDefault); + this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); + this.windowListeners.add(EventName.ContextMenu, preventDefault); + this.documentListeners.add(EventName.Keydown, this.handleKeydown); + + if (activationConstraint) { + if (bypassActivationConstraint != null && bypassActivationConstraint({ + event: this.props.event, + activeNode: this.props.activeNode, + options: this.props.options + })) { + return this.handleStart(); + } + + if (isDelayConstraint(activationConstraint)) { + this.timeoutId = setTimeout(this.handleStart, activationConstraint.delay); + this.handlePending(activationConstraint); + return; + } + + if (isDistanceConstraint(activationConstraint)) { + this.handlePending(activationConstraint); + return; + } + } + + this.handleStart(); + } + + detach() { + this.listeners.removeAll(); + this.windowListeners.removeAll(); // Wait until the next event loop before removing document listeners + // This is necessary because we listen for `click` and `selection` events on the document + + setTimeout(this.documentListeners.removeAll, 50); + + if (this.timeoutId !== null) { + clearTimeout(this.timeoutId); + this.timeoutId = null; + } + } + + handlePending(constraint, offset) { + const { + active, + onPending + } = this.props; + onPending(active, constraint, this.initialCoordinates, offset); + } + + handleStart() { + const { + initialCoordinates + } = this; + const { + onStart + } = this.props; + + if (initialCoordinates) { + this.activated = true; // Stop propagation of click events once activation constraints are met + + this.documentListeners.add(EventName.Click, stopPropagation, { + capture: true + }); // Remove any text selection from the document + + this.removeTextSelection(); // Prevent further text selection while dragging + + this.documentListeners.add(EventName.SelectionChange, this.removeTextSelection); + onStart(initialCoordinates); + } + } + + handleMove(event) { + var _getEventCoordinates2; + + const { + activated, + initialCoordinates, + props + } = this; + const { + onMove, + options: { + activationConstraint + } + } = props; + + if (!initialCoordinates) { + return; + } + + const coordinates = (_getEventCoordinates2 = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(event)) != null ? _getEventCoordinates2 : defaultCoordinates; + const delta = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(initialCoordinates, coordinates); // Constraint validation + + if (!activated && activationConstraint) { + if (isDistanceConstraint(activationConstraint)) { + if (activationConstraint.tolerance != null && hasExceededDistance(delta, activationConstraint.tolerance)) { + return this.handleCancel(); + } + + if (hasExceededDistance(delta, activationConstraint.distance)) { + return this.handleStart(); + } + } + + if (isDelayConstraint(activationConstraint)) { + if (hasExceededDistance(delta, activationConstraint.tolerance)) { + return this.handleCancel(); + } + } + + this.handlePending(activationConstraint, delta); + return; + } + + if (event.cancelable) { + event.preventDefault(); + } + + onMove(coordinates); + } + + handleEnd() { + const { + onAbort, + onEnd + } = this.props; + this.detach(); + + if (!this.activated) { + onAbort(this.props.active); + } + + onEnd(); + } + + handleCancel() { + const { + onAbort, + onCancel + } = this.props; + this.detach(); + + if (!this.activated) { + onAbort(this.props.active); + } + + onCancel(); + } + + handleKeydown(event) { + if (event.code === KeyboardCode.Esc) { + this.handleCancel(); + } + } + + removeTextSelection() { + var _this$document$getSel; + + (_this$document$getSel = this.document.getSelection()) == null ? void 0 : _this$document$getSel.removeAllRanges(); + } + +} + +const events = { + cancel: { + name: 'pointercancel' + }, + move: { + name: 'pointermove' + }, + end: { + name: 'pointerup' + } +}; +class PointerSensor extends AbstractPointerSensor { + constructor(props) { + const { + event + } = props; // Pointer events stop firing if the target is unmounted while dragging + // Therefore we attach listeners to the owner document instead + + const listenerTarget = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(event.target); + super(props, events, listenerTarget); + } + +} +PointerSensor.activators = [{ + eventName: 'onPointerDown', + handler: (_ref, _ref2) => { + let { + nativeEvent: event + } = _ref; + let { + onActivation + } = _ref2; + + if (!event.isPrimary || event.button !== 0) { + return false; + } + + onActivation == null ? void 0 : onActivation({ + event + }); + return true; + } +}]; + +const events$1 = { + move: { + name: 'mousemove' + }, + end: { + name: 'mouseup' + } +}; +var MouseButton; + +(function (MouseButton) { + MouseButton[MouseButton["RightClick"] = 2] = "RightClick"; +})(MouseButton || (MouseButton = {})); + +class MouseSensor extends AbstractPointerSensor { + constructor(props) { + super(props, events$1, (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(props.event.target)); + } + +} +MouseSensor.activators = [{ + eventName: 'onMouseDown', + handler: (_ref, _ref2) => { + let { + nativeEvent: event + } = _ref; + let { + onActivation + } = _ref2; + + if (event.button === MouseButton.RightClick) { + return false; + } + + onActivation == null ? void 0 : onActivation({ + event + }); + return true; + } +}]; + +const events$2 = { + cancel: { + name: 'touchcancel' + }, + move: { + name: 'touchmove' + }, + end: { + name: 'touchend' + } +}; +class TouchSensor extends AbstractPointerSensor { + constructor(props) { + super(props, events$2); + } + + static setup() { + // Adding a non-capture and non-passive `touchmove` listener in order + // to force `event.preventDefault()` calls to work in dynamically added + // touchmove event handlers. This is required for iOS Safari. + window.addEventListener(events$2.move.name, noop, { + capture: false, + passive: false + }); + return function teardown() { + window.removeEventListener(events$2.move.name, noop); + }; // We create a new handler because the teardown function of another sensor + // could remove our event listener if we use a referentially equal listener. + + function noop() {} + } + +} +TouchSensor.activators = [{ + eventName: 'onTouchStart', + handler: (_ref, _ref2) => { + let { + nativeEvent: event + } = _ref; + let { + onActivation + } = _ref2; + const { + touches + } = event; + + if (touches.length > 1) { + return false; + } + + onActivation == null ? void 0 : onActivation({ + event + }); + return true; + } +}]; + +var AutoScrollActivator; + +(function (AutoScrollActivator) { + AutoScrollActivator[AutoScrollActivator["Pointer"] = 0] = "Pointer"; + AutoScrollActivator[AutoScrollActivator["DraggableRect"] = 1] = "DraggableRect"; +})(AutoScrollActivator || (AutoScrollActivator = {})); + +var TraversalOrder; + +(function (TraversalOrder) { + TraversalOrder[TraversalOrder["TreeOrder"] = 0] = "TreeOrder"; + TraversalOrder[TraversalOrder["ReversedTreeOrder"] = 1] = "ReversedTreeOrder"; +})(TraversalOrder || (TraversalOrder = {})); + +function useAutoScroller(_ref) { + let { + acceleration, + activator = AutoScrollActivator.Pointer, + canScroll, + draggingRect, + enabled, + interval = 5, + order = TraversalOrder.TreeOrder, + pointerCoordinates, + scrollableAncestors, + scrollableAncestorRects, + delta, + threshold + } = _ref; + const scrollIntent = useScrollIntent({ + delta, + disabled: !enabled + }); + const [setAutoScrollInterval, clearAutoScrollInterval] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useInterval)(); + const scrollSpeed = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + x: 0, + y: 0 + }); + const scrollDirection = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + x: 0, + y: 0 + }); + const rect = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + switch (activator) { + case AutoScrollActivator.Pointer: + return pointerCoordinates ? { + top: pointerCoordinates.y, + bottom: pointerCoordinates.y, + left: pointerCoordinates.x, + right: pointerCoordinates.x + } : null; + + case AutoScrollActivator.DraggableRect: + return draggingRect; + } + }, [activator, draggingRect, pointerCoordinates]); + const scrollContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const autoScroll = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => { + const scrollContainer = scrollContainerRef.current; + + if (!scrollContainer) { + return; + } + + const scrollLeft = scrollSpeed.current.x * scrollDirection.current.x; + const scrollTop = scrollSpeed.current.y * scrollDirection.current.y; + scrollContainer.scrollBy(scrollLeft, scrollTop); + }, []); + const sortedScrollableAncestors = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => order === TraversalOrder.TreeOrder ? [...scrollableAncestors].reverse() : scrollableAncestors, [order, scrollableAncestors]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!enabled || !scrollableAncestors.length || !rect) { + clearAutoScrollInterval(); + return; + } + + for (const scrollContainer of sortedScrollableAncestors) { + if ((canScroll == null ? void 0 : canScroll(scrollContainer)) === false) { + continue; + } + + const index = scrollableAncestors.indexOf(scrollContainer); + const scrollContainerRect = scrollableAncestorRects[index]; + + if (!scrollContainerRect) { + continue; + } + + const { + direction, + speed + } = getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, rect, acceleration, threshold); + + for (const axis of ['x', 'y']) { + if (!scrollIntent[axis][direction[axis]]) { + speed[axis] = 0; + direction[axis] = 0; + } + } + + if (speed.x > 0 || speed.y > 0) { + clearAutoScrollInterval(); + scrollContainerRef.current = scrollContainer; + setAutoScrollInterval(autoScroll, interval); + scrollSpeed.current = speed; + scrollDirection.current = direction; + return; + } + } + + scrollSpeed.current = { + x: 0, + y: 0 + }; + scrollDirection.current = { + x: 0, + y: 0 + }; + clearAutoScrollInterval(); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [acceleration, autoScroll, canScroll, clearAutoScrollInterval, enabled, interval, // eslint-disable-next-line react-hooks/exhaustive-deps + JSON.stringify(rect), // eslint-disable-next-line react-hooks/exhaustive-deps + JSON.stringify(scrollIntent), setAutoScrollInterval, scrollableAncestors, sortedScrollableAncestors, scrollableAncestorRects, // eslint-disable-next-line react-hooks/exhaustive-deps + JSON.stringify(threshold)]); +} +const defaultScrollIntent = { + x: { + [Direction.Backward]: false, + [Direction.Forward]: false + }, + y: { + [Direction.Backward]: false, + [Direction.Forward]: false + } +}; + +function useScrollIntent(_ref2) { + let { + delta, + disabled + } = _ref2; + const previousDelta = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(delta); + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousIntent => { + if (disabled || !previousDelta || !previousIntent) { + // Reset scroll intent tracking when auto-scrolling is disabled + return defaultScrollIntent; + } + + const direction = { + x: Math.sign(delta.x - previousDelta.x), + y: Math.sign(delta.y - previousDelta.y) + }; // Keep track of the user intent to scroll in each direction for both axis + + return { + x: { + [Direction.Backward]: previousIntent.x[Direction.Backward] || direction.x === -1, + [Direction.Forward]: previousIntent.x[Direction.Forward] || direction.x === 1 + }, + y: { + [Direction.Backward]: previousIntent.y[Direction.Backward] || direction.y === -1, + [Direction.Forward]: previousIntent.y[Direction.Forward] || direction.y === 1 + } + }; + }, [disabled, delta, previousDelta]); +} + +function useCachedNode(draggableNodes, id) { + const draggableNode = id != null ? draggableNodes.get(id) : undefined; + const node = draggableNode ? draggableNode.node.current : null; + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(cachedNode => { + var _ref; + + if (id == null) { + return null; + } // In some cases, the draggable node can unmount while dragging + // This is the case for virtualized lists. In those situations, + // we fall back to the last known value for that node. + + + return (_ref = node != null ? node : cachedNode) != null ? _ref : null; + }, [node, id]); +} + +function useCombineActivators(sensors, getSyntheticHandler) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => sensors.reduce((accumulator, sensor) => { + const { + sensor: Sensor + } = sensor; + const sensorActivators = Sensor.activators.map(activator => ({ + eventName: activator.eventName, + handler: getSyntheticHandler(activator.handler, sensor) + })); + return [...accumulator, ...sensorActivators]; + }, []), [sensors, getSyntheticHandler]); +} + +var MeasuringStrategy; + +(function (MeasuringStrategy) { + MeasuringStrategy[MeasuringStrategy["Always"] = 0] = "Always"; + MeasuringStrategy[MeasuringStrategy["BeforeDragging"] = 1] = "BeforeDragging"; + MeasuringStrategy[MeasuringStrategy["WhileDragging"] = 2] = "WhileDragging"; +})(MeasuringStrategy || (MeasuringStrategy = {})); + +var MeasuringFrequency; + +(function (MeasuringFrequency) { + MeasuringFrequency["Optimized"] = "optimized"; +})(MeasuringFrequency || (MeasuringFrequency = {})); + +const defaultValue = /*#__PURE__*/new Map(); +function useDroppableMeasuring(containers, _ref) { + let { + dragging, + dependencies, + config + } = _ref; + const [queue, setQueue] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const { + frequency, + measure, + strategy + } = config; + const containersRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(containers); + const disabled = isDisabled(); + const disabledRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(disabled); + const measureDroppableContainers = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (ids) { + if (ids === void 0) { + ids = []; + } + + if (disabledRef.current) { + return; + } + + setQueue(value => { + if (value === null) { + return ids; + } + + return value.concat(ids.filter(id => !value.includes(id))); + }); + }, [disabledRef]); + const timeoutId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const droppableRects = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousValue => { + if (disabled && !dragging) { + return defaultValue; + } + + if (!previousValue || previousValue === defaultValue || containersRef.current !== containers || queue != null) { + const map = new Map(); + + for (let container of containers) { + if (!container) { + continue; + } + + if (queue && queue.length > 0 && !queue.includes(container.id) && container.rect.current) { + // This container does not need to be re-measured + map.set(container.id, container.rect.current); + continue; + } + + const node = container.node.current; + const rect = node ? new Rect(measure(node), node) : null; + container.rect.current = rect; + + if (rect) { + map.set(container.id, rect); + } + } + + return map; + } + + return previousValue; + }, [containers, queue, dragging, disabled, measure]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + containersRef.current = containers; + }, [containers]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled) { + return; + } + + measureDroppableContainers(); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [dragging, disabled]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (queue && queue.length > 0) { + setQueue(null); + } + }, //eslint-disable-next-line react-hooks/exhaustive-deps + [JSON.stringify(queue)]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled || typeof frequency !== 'number' || timeoutId.current !== null) { + return; + } + + timeoutId.current = setTimeout(() => { + measureDroppableContainers(); + timeoutId.current = null; + }, frequency); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [frequency, disabled, measureDroppableContainers, ...dependencies]); + return { + droppableRects, + measureDroppableContainers, + measuringScheduled: queue != null + }; + + function isDisabled() { + switch (strategy) { + case MeasuringStrategy.Always: + return false; + + case MeasuringStrategy.BeforeDragging: + return dragging; + + default: + return !dragging; + } + } +} + +function useInitialValue(value, computeFn) { + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousValue => { + if (!value) { + return null; + } + + if (previousValue) { + return previousValue; + } + + return typeof computeFn === 'function' ? computeFn(value) : value; + }, [computeFn, value]); +} + +function useInitialRect(node, measure) { + return useInitialValue(node, measure); +} + +/** + * Returns a new MutationObserver instance. + * If `MutationObserver` is undefined in the execution environment, returns `undefined`. + */ + +function useMutationObserver(_ref) { + let { + callback, + disabled + } = _ref; + const handleMutations = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useEvent)(callback); + const mutationObserver = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (disabled || typeof window === 'undefined' || typeof window.MutationObserver === 'undefined') { + return undefined; + } + + const { + MutationObserver + } = window; + return new MutationObserver(handleMutations); + }, [handleMutations, disabled]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + return () => mutationObserver == null ? void 0 : mutationObserver.disconnect(); + }, [mutationObserver]); + return mutationObserver; +} + +/** + * Returns a new ResizeObserver instance bound to the `onResize` callback. + * If `ResizeObserver` is undefined in the execution environment, returns `undefined`. + */ + +function useResizeObserver(_ref) { + let { + callback, + disabled + } = _ref; + const handleResize = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useEvent)(callback); + const resizeObserver = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (disabled || typeof window === 'undefined' || typeof window.ResizeObserver === 'undefined') { + return undefined; + } + + const { + ResizeObserver + } = window; + return new ResizeObserver(handleResize); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [disabled]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + return () => resizeObserver == null ? void 0 : resizeObserver.disconnect(); + }, [resizeObserver]); + return resizeObserver; +} + +function defaultMeasure(element) { + return new Rect(getClientRect(element), element); +} + +function useRect(element, measure, fallbackRect) { + if (measure === void 0) { + measure = defaultMeasure; + } + + const [rect, setRect] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + + function measureRect() { + setRect(currentRect => { + if (!element) { + return null; + } + + if (element.isConnected === false) { + var _ref; + + // Fall back to last rect we measured if the element is + // no longer connected to the DOM. + return (_ref = currentRect != null ? currentRect : fallbackRect) != null ? _ref : null; + } + + const newRect = measure(element); + + if (JSON.stringify(currentRect) === JSON.stringify(newRect)) { + return currentRect; + } + + return newRect; + }); + } + + const mutationObserver = useMutationObserver({ + callback(records) { + if (!element) { + return; + } + + for (const record of records) { + const { + type, + target + } = record; + + if (type === 'childList' && target instanceof HTMLElement && target.contains(element)) { + measureRect(); + break; + } + } + } + + }); + const resizeObserver = useResizeObserver({ + callback: measureRect + }); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + measureRect(); + + if (element) { + resizeObserver == null ? void 0 : resizeObserver.observe(element); + mutationObserver == null ? void 0 : mutationObserver.observe(document.body, { + childList: true, + subtree: true + }); + } else { + resizeObserver == null ? void 0 : resizeObserver.disconnect(); + mutationObserver == null ? void 0 : mutationObserver.disconnect(); + } + }, [element]); + return rect; +} + +function useRectDelta(rect) { + const initialRect = useInitialValue(rect); + return getRectDelta(rect, initialRect); +} + +const defaultValue$1 = []; +function useScrollableAncestors(node) { + const previousNode = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(node); + const ancestors = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousValue => { + if (!node) { + return defaultValue$1; + } + + if (previousValue && previousValue !== defaultValue$1 && node && previousNode.current && node.parentNode === previousNode.current.parentNode) { + return previousValue; + } + + return getScrollableAncestors(node); + }, [node]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + previousNode.current = node; + }, [node]); + return ancestors; +} + +function useScrollOffsets(elements) { + const [scrollCoordinates, setScrollCoordinates] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const prevElements = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(elements); // To-do: Throttle the handleScroll callback + + const handleScroll = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(event => { + const scrollingElement = getScrollableElement(event.target); + + if (!scrollingElement) { + return; + } + + setScrollCoordinates(scrollCoordinates => { + if (!scrollCoordinates) { + return null; + } + + scrollCoordinates.set(scrollingElement, getScrollCoordinates(scrollingElement)); + return new Map(scrollCoordinates); + }); + }, []); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const previousElements = prevElements.current; + + if (elements !== previousElements) { + cleanup(previousElements); + const entries = elements.map(element => { + const scrollableElement = getScrollableElement(element); + + if (scrollableElement) { + scrollableElement.addEventListener('scroll', handleScroll, { + passive: true + }); + return [scrollableElement, getScrollCoordinates(scrollableElement)]; + } + + return null; + }).filter(entry => entry != null); + setScrollCoordinates(entries.length ? new Map(entries) : null); + prevElements.current = elements; + } + + return () => { + cleanup(elements); + cleanup(previousElements); + }; + + function cleanup(elements) { + elements.forEach(element => { + const scrollableElement = getScrollableElement(element); + scrollableElement == null ? void 0 : scrollableElement.removeEventListener('scroll', handleScroll); + }); + } + }, [handleScroll, elements]); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (elements.length) { + return scrollCoordinates ? Array.from(scrollCoordinates.values()).reduce((acc, coordinates) => (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(acc, coordinates), defaultCoordinates) : getScrollOffsets(elements); + } + + return defaultCoordinates; + }, [elements, scrollCoordinates]); +} + +function useScrollOffsetsDelta(scrollOffsets, dependencies) { + if (dependencies === void 0) { + dependencies = []; + } + + const initialScrollOffsets = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + initialScrollOffsets.current = null; + }, // eslint-disable-next-line react-hooks/exhaustive-deps + dependencies); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const hasScrollOffsets = scrollOffsets !== defaultCoordinates; + + if (hasScrollOffsets && !initialScrollOffsets.current) { + initialScrollOffsets.current = scrollOffsets; + } + + if (!hasScrollOffsets && initialScrollOffsets.current) { + initialScrollOffsets.current = null; + } + }, [scrollOffsets]); + return initialScrollOffsets.current ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(scrollOffsets, initialScrollOffsets.current) : defaultCoordinates; +} + +function useSensorSetup(sensors) { + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.canUseDOM) { + return; + } + + const teardownFns = sensors.map(_ref => { + let { + sensor + } = _ref; + return sensor.setup == null ? void 0 : sensor.setup(); + }); + return () => { + for (const teardown of teardownFns) { + teardown == null ? void 0 : teardown(); + } + }; + }, // TO-DO: Sensors length could theoretically change which would not be a valid dependency + // eslint-disable-next-line react-hooks/exhaustive-deps + sensors.map(_ref2 => { + let { + sensor + } = _ref2; + return sensor; + })); +} + +function useSyntheticListeners(listeners, id) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + return listeners.reduce((acc, _ref) => { + let { + eventName, + handler + } = _ref; + + acc[eventName] = event => { + handler(event, id); + }; + + return acc; + }, {}); + }, [listeners, id]); +} + +function useWindowRect(element) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => element ? getWindowClientRect(element) : null, [element]); +} + +const defaultValue$2 = []; +function useRects(elements, measure) { + if (measure === void 0) { + measure = getClientRect; + } + + const [firstElement] = elements; + const windowRect = useWindowRect(firstElement ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(firstElement) : null); + const [rects, setRects] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(defaultValue$2); + + function measureRects() { + setRects(() => { + if (!elements.length) { + return defaultValue$2; + } + + return elements.map(element => isDocumentScrollingElement(element) ? windowRect : new Rect(measure(element), element)); + }); + } + + const resizeObserver = useResizeObserver({ + callback: measureRects + }); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + resizeObserver == null ? void 0 : resizeObserver.disconnect(); + measureRects(); + elements.forEach(element => resizeObserver == null ? void 0 : resizeObserver.observe(element)); + }, [elements]); + return rects; +} + +function getMeasurableNode(node) { + if (!node) { + return null; + } + + if (node.children.length > 1) { + return node; + } + + const firstChild = node.children[0]; + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(firstChild) ? firstChild : node; +} + +function useDragOverlayMeasuring(_ref) { + let { + measure + } = _ref; + const [rect, setRect] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const handleResize = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(entries => { + for (const { + target + } of entries) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(target)) { + setRect(rect => { + const newRect = measure(target); + return rect ? { ...rect, + width: newRect.width, + height: newRect.height + } : newRect; + }); + break; + } + } + }, [measure]); + const resizeObserver = useResizeObserver({ + callback: handleResize + }); + const handleNodeChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(element => { + const node = getMeasurableNode(element); + resizeObserver == null ? void 0 : resizeObserver.disconnect(); + + if (node) { + resizeObserver == null ? void 0 : resizeObserver.observe(node); + } + + setRect(node ? measure(node) : null); + }, [measure, resizeObserver]); + const [nodeRef, setRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(handleNodeChange); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + nodeRef, + rect, + setRef + }), [rect, nodeRef, setRef]); +} + +const defaultSensors = [{ + sensor: PointerSensor, + options: {} +}, { + sensor: KeyboardSensor, + options: {} +}]; +const defaultData = { + current: {} +}; +const defaultMeasuringConfiguration = { + draggable: { + measure: getTransformAgnosticClientRect + }, + droppable: { + measure: getTransformAgnosticClientRect, + strategy: MeasuringStrategy.WhileDragging, + frequency: MeasuringFrequency.Optimized + }, + dragOverlay: { + measure: getClientRect + } +}; + +class DroppableContainersMap extends Map { + get(id) { + var _super$get; + + return id != null ? (_super$get = super.get(id)) != null ? _super$get : undefined : undefined; + } + + toArray() { + return Array.from(this.values()); + } + + getEnabled() { + return this.toArray().filter(_ref => { + let { + disabled + } = _ref; + return !disabled; + }); + } + + getNodeFor(id) { + var _this$get$node$curren, _this$get; + + return (_this$get$node$curren = (_this$get = this.get(id)) == null ? void 0 : _this$get.node.current) != null ? _this$get$node$curren : undefined; + } + +} + +const defaultPublicContext = { + activatorEvent: null, + active: null, + activeNode: null, + activeNodeRect: null, + collisions: null, + containerNodeRect: null, + draggableNodes: /*#__PURE__*/new Map(), + droppableRects: /*#__PURE__*/new Map(), + droppableContainers: /*#__PURE__*/new DroppableContainersMap(), + over: null, + dragOverlay: { + nodeRef: { + current: null + }, + rect: null, + setRef: noop + }, + scrollableAncestors: [], + scrollableAncestorRects: [], + measuringConfiguration: defaultMeasuringConfiguration, + measureDroppableContainers: noop, + windowRect: null, + measuringScheduled: false +}; +const defaultInternalContext = { + activatorEvent: null, + activators: [], + active: null, + activeNodeRect: null, + ariaDescribedById: { + draggable: '' + }, + dispatch: noop, + draggableNodes: /*#__PURE__*/new Map(), + over: null, + measureDroppableContainers: noop +}; +const InternalContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(defaultInternalContext); +const PublicContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(defaultPublicContext); + +function getInitialState() { + return { + draggable: { + active: null, + initialCoordinates: { + x: 0, + y: 0 + }, + nodes: new Map(), + translate: { + x: 0, + y: 0 + } + }, + droppable: { + containers: new DroppableContainersMap() + } + }; +} +function reducer(state, action) { + switch (action.type) { + case Action.DragStart: + return { ...state, + draggable: { ...state.draggable, + initialCoordinates: action.initialCoordinates, + active: action.active + } + }; + + case Action.DragMove: + if (state.draggable.active == null) { + return state; + } + + return { ...state, + draggable: { ...state.draggable, + translate: { + x: action.coordinates.x - state.draggable.initialCoordinates.x, + y: action.coordinates.y - state.draggable.initialCoordinates.y + } + } + }; + + case Action.DragEnd: + case Action.DragCancel: + return { ...state, + draggable: { ...state.draggable, + active: null, + initialCoordinates: { + x: 0, + y: 0 + }, + translate: { + x: 0, + y: 0 + } + } + }; + + case Action.RegisterDroppable: + { + const { + element + } = action; + const { + id + } = element; + const containers = new DroppableContainersMap(state.droppable.containers); + containers.set(id, element); + return { ...state, + droppable: { ...state.droppable, + containers + } + }; + } + + case Action.SetDroppableDisabled: + { + const { + id, + key, + disabled + } = action; + const element = state.droppable.containers.get(id); + + if (!element || key !== element.key) { + return state; + } + + const containers = new DroppableContainersMap(state.droppable.containers); + containers.set(id, { ...element, + disabled + }); + return { ...state, + droppable: { ...state.droppable, + containers + } + }; + } + + case Action.UnregisterDroppable: + { + const { + id, + key + } = action; + const element = state.droppable.containers.get(id); + + if (!element || key !== element.key) { + return state; + } + + const containers = new DroppableContainersMap(state.droppable.containers); + containers.delete(id); + return { ...state, + droppable: { ...state.droppable, + containers + } + }; + } + + default: + { + return state; + } + } +} + +function RestoreFocus(_ref) { + let { + disabled + } = _ref; + const { + active, + activatorEvent, + draggableNodes + } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(InternalContext); + const previousActivatorEvent = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(activatorEvent); + const previousActiveId = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(active == null ? void 0 : active.id); // Restore keyboard focus on the activator node + + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled) { + return; + } + + if (!activatorEvent && previousActivatorEvent && previousActiveId != null) { + if (!(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(previousActivatorEvent)) { + return; + } + + if (document.activeElement === previousActivatorEvent.target) { + // No need to restore focus + return; + } + + const draggableNode = draggableNodes.get(previousActiveId); + + if (!draggableNode) { + return; + } + + const { + activatorNode, + node + } = draggableNode; + + if (!activatorNode.current && !node.current) { + return; + } + + requestAnimationFrame(() => { + for (const element of [activatorNode.current, node.current]) { + if (!element) { + continue; + } + + const focusableNode = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.findFirstFocusableNode)(element); + + if (focusableNode) { + focusableNode.focus(); + break; + } + } + }); + } + }, [activatorEvent, disabled, draggableNodes, previousActiveId, previousActivatorEvent]); + return null; +} + +function applyModifiers(modifiers, _ref) { + let { + transform, + ...args + } = _ref; + return modifiers != null && modifiers.length ? modifiers.reduce((accumulator, modifier) => { + return modifier({ + transform: accumulator, + ...args + }); + }, transform) : transform; +} + +function useMeasuringConfiguration(config) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + draggable: { ...defaultMeasuringConfiguration.draggable, + ...(config == null ? void 0 : config.draggable) + }, + droppable: { ...defaultMeasuringConfiguration.droppable, + ...(config == null ? void 0 : config.droppable) + }, + dragOverlay: { ...defaultMeasuringConfiguration.dragOverlay, + ...(config == null ? void 0 : config.dragOverlay) + } + }), // eslint-disable-next-line react-hooks/exhaustive-deps + [config == null ? void 0 : config.draggable, config == null ? void 0 : config.droppable, config == null ? void 0 : config.dragOverlay]); +} + +function useLayoutShiftScrollCompensation(_ref) { + let { + activeNode, + measure, + initialRect, + config = true + } = _ref; + const initialized = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false); + const { + x, + y + } = typeof config === 'boolean' ? { + x: config, + y: config + } : config; + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + const disabled = !x && !y; + + if (disabled || !activeNode) { + initialized.current = false; + return; + } + + if (initialized.current || !initialRect) { + // Return early if layout shift scroll compensation was already attempted + // or if there is no initialRect to compare to. + return; + } // Get the most up to date node ref for the active draggable + + + const node = activeNode == null ? void 0 : activeNode.node.current; + + if (!node || node.isConnected === false) { + // Return early if there is no attached node ref or if the node is + // disconnected from the document. + return; + } + + const rect = measure(node); + const rectDelta = getRectDelta(rect, initialRect); + + if (!x) { + rectDelta.x = 0; + } + + if (!y) { + rectDelta.y = 0; + } // Only perform layout shift scroll compensation once + + + initialized.current = true; + + if (Math.abs(rectDelta.x) > 0 || Math.abs(rectDelta.y) > 0) { + const firstScrollableAncestor = getFirstScrollableAncestor(node); + + if (firstScrollableAncestor) { + firstScrollableAncestor.scrollBy({ + top: rectDelta.y, + left: rectDelta.x + }); + } + } + }, [activeNode, x, y, initialRect, measure]); +} + +const ActiveDraggableContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({ ...defaultCoordinates, + scaleX: 1, + scaleY: 1 +}); +var Status; + +(function (Status) { + Status[Status["Uninitialized"] = 0] = "Uninitialized"; + Status[Status["Initializing"] = 1] = "Initializing"; + Status[Status["Initialized"] = 2] = "Initialized"; +})(Status || (Status = {})); + +const DndContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(function DndContext(_ref) { + var _sensorContext$curren, _dragOverlay$nodeRef$, _dragOverlay$rect, _over$rect; + + let { + id, + accessibility, + autoScroll = true, + children, + sensors = defaultSensors, + collisionDetection = rectIntersection, + measuring, + modifiers, + ...props + } = _ref; + const store = (0,react__WEBPACK_IMPORTED_MODULE_0__.useReducer)(reducer, undefined, getInitialState); + const [state, dispatch] = store; + const [dispatchMonitorEvent, registerMonitorListener] = useDndMonitorProvider(); + const [status, setStatus] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(Status.Uninitialized); + const isInitialized = status === Status.Initialized; + const { + draggable: { + active: activeId, + nodes: draggableNodes, + translate + }, + droppable: { + containers: droppableContainers + } + } = state; + const node = activeId != null ? draggableNodes.get(activeId) : null; + const activeRects = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + initial: null, + translated: null + }); + const active = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + var _node$data; + + return activeId != null ? { + id: activeId, + // It's possible for the active node to unmount while dragging + data: (_node$data = node == null ? void 0 : node.data) != null ? _node$data : defaultData, + rect: activeRects + } : null; + }, [activeId, node]); + const activeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const [activeSensor, setActiveSensor] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const [activatorEvent, setActivatorEvent] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const latestProps = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(props, Object.values(props)); + const draggableDescribedById = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)("DndDescribedBy", id); + const enabledDroppableContainers = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => droppableContainers.getEnabled(), [droppableContainers]); + const measuringConfiguration = useMeasuringConfiguration(measuring); + const { + droppableRects, + measureDroppableContainers, + measuringScheduled + } = useDroppableMeasuring(enabledDroppableContainers, { + dragging: isInitialized, + dependencies: [translate.x, translate.y], + config: measuringConfiguration.droppable + }); + const activeNode = useCachedNode(draggableNodes, activeId); + const activationCoordinates = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => activatorEvent ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(activatorEvent) : null, [activatorEvent]); + const autoScrollOptions = getAutoScrollerOptions(); + const initialActiveNodeRect = useInitialRect(activeNode, measuringConfiguration.draggable.measure); + useLayoutShiftScrollCompensation({ + activeNode: activeId != null ? draggableNodes.get(activeId) : null, + config: autoScrollOptions.layoutShiftCompensation, + initialRect: initialActiveNodeRect, + measure: measuringConfiguration.draggable.measure + }); + const activeNodeRect = useRect(activeNode, measuringConfiguration.draggable.measure, initialActiveNodeRect); + const containerNodeRect = useRect(activeNode ? activeNode.parentElement : null); + const sensorContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + activatorEvent: null, + active: null, + activeNode, + collisionRect: null, + collisions: null, + droppableRects, + draggableNodes, + draggingNode: null, + draggingNodeRect: null, + droppableContainers, + over: null, + scrollableAncestors: [], + scrollAdjustedTranslate: null + }); + const overNode = droppableContainers.getNodeFor((_sensorContext$curren = sensorContext.current.over) == null ? void 0 : _sensorContext$curren.id); + const dragOverlay = useDragOverlayMeasuring({ + measure: measuringConfiguration.dragOverlay.measure + }); // Use the rect of the drag overlay if it is mounted + + const draggingNode = (_dragOverlay$nodeRef$ = dragOverlay.nodeRef.current) != null ? _dragOverlay$nodeRef$ : activeNode; + const draggingNodeRect = isInitialized ? (_dragOverlay$rect = dragOverlay.rect) != null ? _dragOverlay$rect : activeNodeRect : null; + const usesDragOverlay = Boolean(dragOverlay.nodeRef.current && dragOverlay.rect); // The delta between the previous and new position of the draggable node + // is only relevant when there is no drag overlay + + const nodeRectDelta = useRectDelta(usesDragOverlay ? null : activeNodeRect); // Get the window rect of the dragging node + + const windowRect = useWindowRect(draggingNode ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(draggingNode) : null); // Get scrollable ancestors of the dragging node + + const scrollableAncestors = useScrollableAncestors(isInitialized ? overNode != null ? overNode : activeNode : null); + const scrollableAncestorRects = useRects(scrollableAncestors); // Apply modifiers + + const modifiedTranslate = applyModifiers(modifiers, { + transform: { + x: translate.x - nodeRectDelta.x, + y: translate.y - nodeRectDelta.y, + scaleX: 1, + scaleY: 1 + }, + activatorEvent, + active, + activeNodeRect, + containerNodeRect, + draggingNodeRect, + over: sensorContext.current.over, + overlayNodeRect: dragOverlay.rect, + scrollableAncestors, + scrollableAncestorRects, + windowRect + }); + const pointerCoordinates = activationCoordinates ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(activationCoordinates, translate) : null; + const scrollOffsets = useScrollOffsets(scrollableAncestors); // Represents the scroll delta since dragging was initiated + + const scrollAdjustment = useScrollOffsetsDelta(scrollOffsets); // Represents the scroll delta since the last time the active node rect was measured + + const activeNodeScrollDelta = useScrollOffsetsDelta(scrollOffsets, [activeNodeRect]); + const scrollAdjustedTranslate = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(modifiedTranslate, scrollAdjustment); + const collisionRect = draggingNodeRect ? getAdjustedRect(draggingNodeRect, modifiedTranslate) : null; + const collisions = active && collisionRect ? collisionDetection({ + active, + collisionRect, + droppableRects, + droppableContainers: enabledDroppableContainers, + pointerCoordinates + }) : null; + const overId = getFirstCollision(collisions, 'id'); + const [over, setOver] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); // When there is no drag overlay used, we need to account for the + // window scroll delta + + const appliedTranslate = usesDragOverlay ? modifiedTranslate : (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(modifiedTranslate, activeNodeScrollDelta); + const transform = adjustScale(appliedTranslate, (_over$rect = over == null ? void 0 : over.rect) != null ? _over$rect : null, activeNodeRect); + const activeSensorRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const instantiateSensor = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((event, _ref2) => { + let { + sensor: Sensor, + options + } = _ref2; + + if (activeRef.current == null) { + return; + } + + const activeNode = draggableNodes.get(activeRef.current); + + if (!activeNode) { + return; + } + + const activatorEvent = event.nativeEvent; + const sensorInstance = new Sensor({ + active: activeRef.current, + activeNode, + event: activatorEvent, + options, + // Sensors need to be instantiated with refs for arguments that change over time + // otherwise they are frozen in time with the stale arguments + context: sensorContext, + + onAbort(id) { + const draggableNode = draggableNodes.get(id); + + if (!draggableNode) { + return; + } + + const { + onDragAbort + } = latestProps.current; + const event = { + id + }; + onDragAbort == null ? void 0 : onDragAbort(event); + dispatchMonitorEvent({ + type: 'onDragAbort', + event + }); + }, + + onPending(id, constraint, initialCoordinates, offset) { + const draggableNode = draggableNodes.get(id); + + if (!draggableNode) { + return; + } + + const { + onDragPending + } = latestProps.current; + const event = { + id, + constraint, + initialCoordinates, + offset + }; + onDragPending == null ? void 0 : onDragPending(event); + dispatchMonitorEvent({ + type: 'onDragPending', + event + }); + }, + + onStart(initialCoordinates) { + const id = activeRef.current; + + if (id == null) { + return; + } + + const draggableNode = draggableNodes.get(id); + + if (!draggableNode) { + return; + } + + const { + onDragStart + } = latestProps.current; + const event = { + activatorEvent, + active: { + id, + data: draggableNode.data, + rect: activeRects + } + }; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + onDragStart == null ? void 0 : onDragStart(event); + setStatus(Status.Initializing); + dispatch({ + type: Action.DragStart, + initialCoordinates, + active: id + }); + dispatchMonitorEvent({ + type: 'onDragStart', + event + }); + setActiveSensor(activeSensorRef.current); + setActivatorEvent(activatorEvent); + }); + }, + + onMove(coordinates) { + dispatch({ + type: Action.DragMove, + coordinates + }); + }, + + onEnd: createHandler(Action.DragEnd), + onCancel: createHandler(Action.DragCancel) + }); + activeSensorRef.current = sensorInstance; + + function createHandler(type) { + return async function handler() { + const { + active, + collisions, + over, + scrollAdjustedTranslate + } = sensorContext.current; + let event = null; + + if (active && scrollAdjustedTranslate) { + const { + cancelDrop + } = latestProps.current; + event = { + activatorEvent, + active: active, + collisions, + delta: scrollAdjustedTranslate, + over + }; + + if (type === Action.DragEnd && typeof cancelDrop === 'function') { + const shouldCancel = await Promise.resolve(cancelDrop(event)); + + if (shouldCancel) { + type = Action.DragCancel; + } + } + } + + activeRef.current = null; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + dispatch({ + type + }); + setStatus(Status.Uninitialized); + setOver(null); + setActiveSensor(null); + setActivatorEvent(null); + activeSensorRef.current = null; + const eventName = type === Action.DragEnd ? 'onDragEnd' : 'onDragCancel'; + + if (event) { + const handler = latestProps.current[eventName]; + handler == null ? void 0 : handler(event); + dispatchMonitorEvent({ + type: eventName, + event + }); + } + }); + }; + } + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [draggableNodes]); + const bindActivatorToSensorInstantiator = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((handler, sensor) => { + return (event, active) => { + const nativeEvent = event.nativeEvent; + const activeDraggableNode = draggableNodes.get(active); + + if ( // Another sensor is already instantiating + activeRef.current !== null || // No active draggable + !activeDraggableNode || // Event has already been captured + nativeEvent.dndKit || nativeEvent.defaultPrevented) { + return; + } + + const activationContext = { + active: activeDraggableNode + }; + const shouldActivate = handler(event, sensor.options, activationContext); + + if (shouldActivate === true) { + nativeEvent.dndKit = { + capturedBy: sensor.sensor + }; + activeRef.current = active; + instantiateSensor(event, sensor); + } + }; + }, [draggableNodes, instantiateSensor]); + const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator); + useSensorSetup(sensors); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + if (activeNodeRect && status === Status.Initializing) { + setStatus(Status.Initialized); + } + }, [activeNodeRect, status]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const { + onDragMove + } = latestProps.current; + const { + active, + activatorEvent, + collisions, + over + } = sensorContext.current; + + if (!active || !activatorEvent) { + return; + } + + const event = { + active, + activatorEvent, + collisions, + delta: { + x: scrollAdjustedTranslate.x, + y: scrollAdjustedTranslate.y + }, + over + }; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + onDragMove == null ? void 0 : onDragMove(event); + dispatchMonitorEvent({ + type: 'onDragMove', + event + }); + }); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [scrollAdjustedTranslate.x, scrollAdjustedTranslate.y]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const { + active, + activatorEvent, + collisions, + droppableContainers, + scrollAdjustedTranslate + } = sensorContext.current; + + if (!active || activeRef.current == null || !activatorEvent || !scrollAdjustedTranslate) { + return; + } + + const { + onDragOver + } = latestProps.current; + const overContainer = droppableContainers.get(overId); + const over = overContainer && overContainer.rect.current ? { + id: overContainer.id, + rect: overContainer.rect.current, + data: overContainer.data, + disabled: overContainer.disabled + } : null; + const event = { + active, + activatorEvent, + collisions, + delta: { + x: scrollAdjustedTranslate.x, + y: scrollAdjustedTranslate.y + }, + over + }; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + setOver(over); + onDragOver == null ? void 0 : onDragOver(event); + dispatchMonitorEvent({ + type: 'onDragOver', + event + }); + }); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [overId]); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + sensorContext.current = { + activatorEvent, + active, + activeNode, + collisionRect, + collisions, + droppableRects, + draggableNodes, + draggingNode, + draggingNodeRect, + droppableContainers, + over, + scrollableAncestors, + scrollAdjustedTranslate + }; + activeRects.current = { + initial: draggingNodeRect, + translated: collisionRect + }; + }, [active, activeNode, collisions, collisionRect, draggableNodes, draggingNode, draggingNodeRect, droppableRects, droppableContainers, over, scrollableAncestors, scrollAdjustedTranslate]); + useAutoScroller({ ...autoScrollOptions, + delta: translate, + draggingRect: collisionRect, + pointerCoordinates, + scrollableAncestors, + scrollableAncestorRects + }); + const publicContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + const context = { + active, + activeNode, + activeNodeRect, + activatorEvent, + collisions, + containerNodeRect, + dragOverlay, + draggableNodes, + droppableContainers, + droppableRects, + over, + measureDroppableContainers, + scrollableAncestors, + scrollableAncestorRects, + measuringConfiguration, + measuringScheduled, + windowRect + }; + return context; + }, [active, activeNode, activeNodeRect, activatorEvent, collisions, containerNodeRect, dragOverlay, draggableNodes, droppableContainers, droppableRects, over, measureDroppableContainers, scrollableAncestors, scrollableAncestorRects, measuringConfiguration, measuringScheduled, windowRect]); + const internalContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + const context = { + activatorEvent, + activators, + active, + activeNodeRect, + ariaDescribedById: { + draggable: draggableDescribedById + }, + dispatch, + draggableNodes, + over, + measureDroppableContainers + }; + return context; + }, [activatorEvent, activators, active, activeNodeRect, dispatch, draggableDescribedById, draggableNodes, over, measureDroppableContainers]); + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(DndMonitorContext.Provider, { + value: registerMonitorListener + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(InternalContext.Provider, { + value: internalContext + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PublicContext.Provider, { + value: publicContext + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ActiveDraggableContext.Provider, { + value: transform + }, children)), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RestoreFocus, { + disabled: (accessibility == null ? void 0 : accessibility.restoreFocus) === false + })), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Accessibility, { ...accessibility, + hiddenTextDescribedById: draggableDescribedById + })); + + function getAutoScrollerOptions() { + const activeSensorDisablesAutoscroll = (activeSensor == null ? void 0 : activeSensor.autoScrollEnabled) === false; + const autoScrollGloballyDisabled = typeof autoScroll === 'object' ? autoScroll.enabled === false : autoScroll === false; + const enabled = isInitialized && !activeSensorDisablesAutoscroll && !autoScrollGloballyDisabled; + + if (typeof autoScroll === 'object') { + return { ...autoScroll, + enabled + }; + } + + return { + enabled + }; + } +}); + +const NullContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null); +const defaultRole = 'button'; +const ID_PREFIX = 'Draggable'; +function useDraggable(_ref) { + let { + id, + data, + disabled = false, + attributes + } = _ref; + const key = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)(ID_PREFIX); + const { + activators, + activatorEvent, + active, + activeNodeRect, + ariaDescribedById, + draggableNodes, + over + } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(InternalContext); + const { + role = defaultRole, + roleDescription = 'draggable', + tabIndex = 0 + } = attributes != null ? attributes : {}; + const isDragging = (active == null ? void 0 : active.id) === id; + const transform = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(isDragging ? ActiveDraggableContext : NullContext); + const [node, setNodeRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(); + const [activatorNode, setActivatorNodeRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(); + const listeners = useSyntheticListeners(activators, id); + const dataRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(data); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + draggableNodes.set(id, { + id, + key, + node, + activatorNode, + data: dataRef + }); + return () => { + const node = draggableNodes.get(id); + + if (node && node.key === key) { + draggableNodes.delete(id); + } + }; + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [draggableNodes, id]); + const memoizedAttributes = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + role, + tabIndex, + 'aria-disabled': disabled, + 'aria-pressed': isDragging && role === defaultRole ? true : undefined, + 'aria-roledescription': roleDescription, + 'aria-describedby': ariaDescribedById.draggable + }), [disabled, role, tabIndex, isDragging, roleDescription, ariaDescribedById.draggable]); + return { + active, + activatorEvent, + activeNodeRect, + attributes: memoizedAttributes, + isDragging, + listeners: disabled ? undefined : listeners, + node, + over, + setNodeRef, + setActivatorNodeRef, + transform + }; +} + +function useDndContext() { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(PublicContext); +} + +const ID_PREFIX$1 = 'Droppable'; +const defaultResizeObserverConfig = { + timeout: 25 +}; +function useDroppable(_ref) { + let { + data, + disabled = false, + id, + resizeObserverConfig + } = _ref; + const key = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)(ID_PREFIX$1); + const { + active, + dispatch, + over, + measureDroppableContainers + } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(InternalContext); + const previous = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + disabled + }); + const resizeObserverConnected = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false); + const rect = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const callbackId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const { + disabled: resizeObserverDisabled, + updateMeasurementsFor, + timeout: resizeObserverTimeout + } = { ...defaultResizeObserverConfig, + ...resizeObserverConfig + }; + const ids = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(updateMeasurementsFor != null ? updateMeasurementsFor : id); + const handleResize = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => { + if (!resizeObserverConnected.current) { + // ResizeObserver invokes the `handleResize` callback as soon as `observe` is called, + // assuming the element is rendered and displayed. + resizeObserverConnected.current = true; + return; + } + + if (callbackId.current != null) { + clearTimeout(callbackId.current); + } + + callbackId.current = setTimeout(() => { + measureDroppableContainers(Array.isArray(ids.current) ? ids.current : [ids.current]); + callbackId.current = null; + }, resizeObserverTimeout); + }, //eslint-disable-next-line react-hooks/exhaustive-deps + [resizeObserverTimeout]); + const resizeObserver = useResizeObserver({ + callback: handleResize, + disabled: resizeObserverDisabled || !active + }); + const handleNodeChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((newElement, previousElement) => { + if (!resizeObserver) { + return; + } + + if (previousElement) { + resizeObserver.unobserve(previousElement); + resizeObserverConnected.current = false; + } + + if (newElement) { + resizeObserver.observe(newElement); + } + }, [resizeObserver]); + const [nodeRef, setNodeRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(handleNodeChange); + const dataRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(data); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!resizeObserver || !nodeRef.current) { + return; + } + + resizeObserver.disconnect(); + resizeObserverConnected.current = false; + resizeObserver.observe(nodeRef.current); + }, [nodeRef, resizeObserver]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + dispatch({ + type: Action.RegisterDroppable, + element: { + id, + key, + disabled, + node: nodeRef, + rect, + data: dataRef + } + }); + return () => dispatch({ + type: Action.UnregisterDroppable, + key, + id + }); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [id]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled !== previous.current.disabled) { + dispatch({ + type: Action.SetDroppableDisabled, + id, + key, + disabled + }); + previous.current.disabled = disabled; + } + }, [id, key, disabled, dispatch]); + return { + active, + rect, + isOver: (over == null ? void 0 : over.id) === id, + node: nodeRef, + over, + setNodeRef + }; +} + +function AnimationManager(_ref) { + let { + animation, + children + } = _ref; + const [clonedChildren, setClonedChildren] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const [element, setElement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const previousChildren = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(children); + + if (!children && !clonedChildren && previousChildren) { + setClonedChildren(previousChildren); + } + + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + if (!element) { + return; + } + + const key = clonedChildren == null ? void 0 : clonedChildren.key; + const id = clonedChildren == null ? void 0 : clonedChildren.props.id; + + if (key == null || id == null) { + setClonedChildren(null); + return; + } + + Promise.resolve(animation(id, element)).then(() => { + setClonedChildren(null); + }); + }, [animation, clonedChildren, element]); + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, children, clonedChildren ? (0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(clonedChildren, { + ref: setElement + }) : null); +} + +const defaultTransform = { + x: 0, + y: 0, + scaleX: 1, + scaleY: 1 +}; +function NullifiedContextProvider(_ref) { + let { + children + } = _ref; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(InternalContext.Provider, { + value: defaultInternalContext + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ActiveDraggableContext.Provider, { + value: defaultTransform + }, children)); +} + +const baseStyles = { + position: 'fixed', + touchAction: 'none' +}; + +const defaultTransition = activatorEvent => { + const isKeyboardActivator = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(activatorEvent); + return isKeyboardActivator ? 'transform 250ms ease' : undefined; +}; + +const PositionedOverlay = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((_ref, ref) => { + let { + as, + activatorEvent, + adjustScale, + children, + className, + rect, + style, + transform, + transition = defaultTransition + } = _ref; + + if (!rect) { + return null; + } + + const scaleAdjustedTransform = adjustScale ? transform : { ...transform, + scaleX: 1, + scaleY: 1 + }; + const styles = { ...baseStyles, + width: rect.width, + height: rect.height, + top: rect.top, + left: rect.left, + transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(scaleAdjustedTransform), + transformOrigin: adjustScale && activatorEvent ? getRelativeTransformOrigin(activatorEvent, rect) : undefined, + transition: typeof transition === 'function' ? transition(activatorEvent) : transition, + ...style + }; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(as, { + className, + style: styles, + ref + }, children); +}); + +const defaultDropAnimationSideEffects = options => _ref => { + let { + active, + dragOverlay + } = _ref; + const originalStyles = {}; + const { + styles, + className + } = options; + + if (styles != null && styles.active) { + for (const [key, value] of Object.entries(styles.active)) { + if (value === undefined) { + continue; + } + + originalStyles[key] = active.node.style.getPropertyValue(key); + active.node.style.setProperty(key, value); + } + } + + if (styles != null && styles.dragOverlay) { + for (const [key, value] of Object.entries(styles.dragOverlay)) { + if (value === undefined) { + continue; + } + + dragOverlay.node.style.setProperty(key, value); + } + } + + if (className != null && className.active) { + active.node.classList.add(className.active); + } + + if (className != null && className.dragOverlay) { + dragOverlay.node.classList.add(className.dragOverlay); + } + + return function cleanup() { + for (const [key, value] of Object.entries(originalStyles)) { + active.node.style.setProperty(key, value); + } + + if (className != null && className.active) { + active.node.classList.remove(className.active); + } + }; +}; + +const defaultKeyframeResolver = _ref2 => { + let { + transform: { + initial, + final + } + } = _ref2; + return [{ + transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(initial) + }, { + transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(final) + }]; +}; + +const defaultDropAnimationConfiguration = { + duration: 250, + easing: 'ease', + keyframes: defaultKeyframeResolver, + sideEffects: /*#__PURE__*/defaultDropAnimationSideEffects({ + styles: { + active: { + opacity: '0' + } + } + }) +}; +function useDropAnimation(_ref3) { + let { + config, + draggableNodes, + droppableContainers, + measuringConfiguration + } = _ref3; + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useEvent)((id, node) => { + if (config === null) { + return; + } + + const activeDraggable = draggableNodes.get(id); + + if (!activeDraggable) { + return; + } + + const activeNode = activeDraggable.node.current; + + if (!activeNode) { + return; + } + + const measurableNode = getMeasurableNode(node); + + if (!measurableNode) { + return; + } + + const { + transform + } = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(node).getComputedStyle(node); + const parsedTransform = parseTransform(transform); + + if (!parsedTransform) { + return; + } + + const animation = typeof config === 'function' ? config : createDefaultDropAnimation(config); + scrollIntoViewIfNeeded(activeNode, measuringConfiguration.draggable.measure); + return animation({ + active: { + id, + data: activeDraggable.data, + node: activeNode, + rect: measuringConfiguration.draggable.measure(activeNode) + }, + draggableNodes, + dragOverlay: { + node, + rect: measuringConfiguration.dragOverlay.measure(measurableNode) + }, + droppableContainers, + measuringConfiguration, + transform: parsedTransform + }); + }); +} + +function createDefaultDropAnimation(options) { + const { + duration, + easing, + sideEffects, + keyframes + } = { ...defaultDropAnimationConfiguration, + ...options + }; + return _ref4 => { + let { + active, + dragOverlay, + transform, + ...rest + } = _ref4; + + if (!duration) { + // Do not animate if animation duration is zero. + return; + } + + const delta = { + x: dragOverlay.rect.left - active.rect.left, + y: dragOverlay.rect.top - active.rect.top + }; + const scale = { + scaleX: transform.scaleX !== 1 ? active.rect.width * transform.scaleX / dragOverlay.rect.width : 1, + scaleY: transform.scaleY !== 1 ? active.rect.height * transform.scaleY / dragOverlay.rect.height : 1 + }; + const finalTransform = { + x: transform.x - delta.x, + y: transform.y - delta.y, + ...scale + }; + const animationKeyframes = keyframes({ ...rest, + active, + dragOverlay, + transform: { + initial: transform, + final: finalTransform + } + }); + const [firstKeyframe] = animationKeyframes; + const lastKeyframe = animationKeyframes[animationKeyframes.length - 1]; + + if (JSON.stringify(firstKeyframe) === JSON.stringify(lastKeyframe)) { + // The start and end keyframes are the same, infer that there is no animation needed. + return; + } + + const cleanup = sideEffects == null ? void 0 : sideEffects({ + active, + dragOverlay, + ...rest + }); + const animation = dragOverlay.node.animate(animationKeyframes, { + duration, + easing, + fill: 'forwards' + }); + return new Promise(resolve => { + animation.onfinish = () => { + cleanup == null ? void 0 : cleanup(); + resolve(); + }; + }); + }; +} + +let key = 0; +function useKey(id) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (id == null) { + return; + } + + key++; + return key; + }, [id]); +} + +const DragOverlay = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(_ref => { + let { + adjustScale = false, + children, + dropAnimation: dropAnimationConfig, + style, + transition, + modifiers, + wrapperElement = 'div', + className, + zIndex = 999 + } = _ref; + const { + activatorEvent, + active, + activeNodeRect, + containerNodeRect, + draggableNodes, + droppableContainers, + dragOverlay, + over, + measuringConfiguration, + scrollableAncestors, + scrollableAncestorRects, + windowRect + } = useDndContext(); + const transform = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(ActiveDraggableContext); + const key = useKey(active == null ? void 0 : active.id); + const modifiedTransform = applyModifiers(modifiers, { + activatorEvent, + active, + activeNodeRect, + containerNodeRect, + draggingNodeRect: dragOverlay.rect, + over, + overlayNodeRect: dragOverlay.rect, + scrollableAncestors, + scrollableAncestorRects, + transform, + windowRect + }); + const initialRect = useInitialValue(activeNodeRect); + const dropAnimation = useDropAnimation({ + config: dropAnimationConfig, + draggableNodes, + droppableContainers, + measuringConfiguration + }); // We need to wait for the active node to be measured before connecting the drag overlay ref + // otherwise collisions can be computed against a mispositioned drag overlay + + const ref = initialRect ? dragOverlay.setRef : undefined; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(NullifiedContextProvider, null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AnimationManager, { + animation: dropAnimation + }, active && key ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PositionedOverlay, { + key: key, + id: active.id, + ref: ref, + as: wrapperElement, + activatorEvent: activatorEvent, + adjustScale: adjustScale, + className: className, + transition: transition, + rect: initialRect, + style: { + zIndex, + ...style + }, + transform: modifiedTransform + }, children) : null)); +}); + + +//# sourceMappingURL=core.esm.js.map + + +/***/ }), + +/***/ "./node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js": +/*!***************************************************************!*\ + !*** ./node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createSnapModifier: function() { return /* binding */ createSnapModifier; }, +/* harmony export */ restrictToFirstScrollableAncestor: function() { return /* binding */ restrictToFirstScrollableAncestor; }, +/* harmony export */ restrictToHorizontalAxis: function() { return /* binding */ restrictToHorizontalAxis; }, +/* harmony export */ restrictToParentElement: function() { return /* binding */ restrictToParentElement; }, +/* harmony export */ restrictToVerticalAxis: function() { return /* binding */ restrictToVerticalAxis; }, +/* harmony export */ restrictToWindowEdges: function() { return /* binding */ restrictToWindowEdges; }, +/* harmony export */ snapCenterToCursor: function() { return /* binding */ snapCenterToCursor; } +/* harmony export */ }); +/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dnd-kit/utilities */ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js"); + + +function createSnapModifier(gridSize) { + return _ref => { + let { + transform + } = _ref; + return { ...transform, + x: Math.ceil(transform.x / gridSize) * gridSize, + y: Math.ceil(transform.y / gridSize) * gridSize + }; + }; +} + +const restrictToHorizontalAxis = _ref => { + let { + transform + } = _ref; + return { ...transform, + y: 0 + }; +}; + +function restrictToBoundingRect(transform, rect, boundingRect) { + const value = { ...transform + }; + + if (rect.top + transform.y <= boundingRect.top) { + value.y = boundingRect.top - rect.top; + } else if (rect.bottom + transform.y >= boundingRect.top + boundingRect.height) { + value.y = boundingRect.top + boundingRect.height - rect.bottom; + } + + if (rect.left + transform.x <= boundingRect.left) { + value.x = boundingRect.left - rect.left; + } else if (rect.right + transform.x >= boundingRect.left + boundingRect.width) { + value.x = boundingRect.left + boundingRect.width - rect.right; + } + + return value; +} + +const restrictToParentElement = _ref => { + let { + containerNodeRect, + draggingNodeRect, + transform + } = _ref; + + if (!draggingNodeRect || !containerNodeRect) { + return transform; + } + + return restrictToBoundingRect(transform, draggingNodeRect, containerNodeRect); +}; + +const restrictToFirstScrollableAncestor = _ref => { + let { + draggingNodeRect, + transform, + scrollableAncestorRects + } = _ref; + const firstScrollableAncestorRect = scrollableAncestorRects[0]; + + if (!draggingNodeRect || !firstScrollableAncestorRect) { + return transform; + } + + return restrictToBoundingRect(transform, draggingNodeRect, firstScrollableAncestorRect); +}; + +const restrictToVerticalAxis = _ref => { + let { + transform + } = _ref; + return { ...transform, + x: 0 + }; +}; + +const restrictToWindowEdges = _ref => { + let { + transform, + draggingNodeRect, + windowRect + } = _ref; + + if (!draggingNodeRect || !windowRect) { + return transform; + } + + return restrictToBoundingRect(transform, draggingNodeRect, windowRect); +}; + +const snapCenterToCursor = _ref => { + let { + activatorEvent, + draggingNodeRect, + transform + } = _ref; + + if (draggingNodeRect && activatorEvent) { + const activatorCoordinates = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_0__.getEventCoordinates)(activatorEvent); + + if (!activatorCoordinates) { + return transform; + } + + const offsetX = activatorCoordinates.x - draggingNodeRect.left; + const offsetY = activatorCoordinates.y - draggingNodeRect.top; + return { ...transform, + x: transform.x + offsetX - draggingNodeRect.width / 2, + y: transform.y + offsetY - draggingNodeRect.height / 2 + }; + } + + return transform; +}; + + +//# sourceMappingURL=modifiers.esm.js.map + + +/***/ }), + +/***/ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js": +/*!***************************************************************!*\ + !*** ./node_modules/@dnd-kit/utilities/dist/utilities.esm.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ CSS: function() { return /* binding */ CSS; }, +/* harmony export */ add: function() { return /* binding */ add; }, +/* harmony export */ canUseDOM: function() { return /* binding */ canUseDOM; }, +/* harmony export */ findFirstFocusableNode: function() { return /* binding */ findFirstFocusableNode; }, +/* harmony export */ getEventCoordinates: function() { return /* binding */ getEventCoordinates; }, +/* harmony export */ getOwnerDocument: function() { return /* binding */ getOwnerDocument; }, +/* harmony export */ getWindow: function() { return /* binding */ getWindow; }, +/* harmony export */ hasViewportRelativeCoordinates: function() { return /* binding */ hasViewportRelativeCoordinates; }, +/* harmony export */ isDocument: function() { return /* binding */ isDocument; }, +/* harmony export */ isHTMLElement: function() { return /* binding */ isHTMLElement; }, +/* harmony export */ isKeyboardEvent: function() { return /* binding */ isKeyboardEvent; }, +/* harmony export */ isNode: function() { return /* binding */ isNode; }, +/* harmony export */ isSVGElement: function() { return /* binding */ isSVGElement; }, +/* harmony export */ isTouchEvent: function() { return /* binding */ isTouchEvent; }, +/* harmony export */ isWindow: function() { return /* binding */ isWindow; }, +/* harmony export */ subtract: function() { return /* binding */ subtract; }, +/* harmony export */ useCombinedRefs: function() { return /* binding */ useCombinedRefs; }, +/* harmony export */ useEvent: function() { return /* binding */ useEvent; }, +/* harmony export */ useInterval: function() { return /* binding */ useInterval; }, +/* harmony export */ useIsomorphicLayoutEffect: function() { return /* binding */ useIsomorphicLayoutEffect; }, +/* harmony export */ useLatestValue: function() { return /* binding */ useLatestValue; }, +/* harmony export */ useLazyMemo: function() { return /* binding */ useLazyMemo; }, +/* harmony export */ useNodeRef: function() { return /* binding */ useNodeRef; }, +/* harmony export */ usePrevious: function() { return /* binding */ usePrevious; }, +/* harmony export */ useUniqueId: function() { return /* binding */ useUniqueId; } +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); + + +function useCombinedRefs() { + for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { + refs[_key] = arguments[_key]; + } + + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => node => { + refs.forEach(ref => ref(node)); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + refs); +} + +// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js +const canUseDOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'; + +function isWindow(element) { + const elementString = Object.prototype.toString.call(element); + return elementString === '[object Window]' || // In Electron context the Window object serializes to [object global] + elementString === '[object global]'; +} + +function isNode(node) { + return 'nodeType' in node; +} + +function getWindow(target) { + var _target$ownerDocument, _target$ownerDocument2; + + if (!target) { + return window; + } + + if (isWindow(target)) { + return target; + } + + if (!isNode(target)) { + return window; + } + + return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window; +} + +function isDocument(node) { + const { + Document + } = getWindow(node); + return node instanceof Document; +} + +function isHTMLElement(node) { + if (isWindow(node)) { + return false; + } + + return node instanceof getWindow(node).HTMLElement; +} + +function isSVGElement(node) { + return node instanceof getWindow(node).SVGElement; +} + +function getOwnerDocument(target) { + if (!target) { + return document; + } + + if (isWindow(target)) { + return target.document; + } + + if (!isNode(target)) { + return document; + } + + if (isDocument(target)) { + return target; + } + + if (isHTMLElement(target) || isSVGElement(target)) { + return target.ownerDocument; + } + + return document; +} + +/** + * A hook that resolves to useEffect on the server and useLayoutEffect on the client + * @param callback {function} Callback function that is invoked when the dependencies of the hook change + */ + +const useIsomorphicLayoutEffect = canUseDOM ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect; + +function useEvent(handler) { + const handlerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(handler); + useIsomorphicLayoutEffect(() => { + handlerRef.current = handler; + }); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return handlerRef.current == null ? void 0 : handlerRef.current(...args); + }, []); +} + +function useInterval() { + const intervalRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const set = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((listener, duration) => { + intervalRef.current = setInterval(listener, duration); + }, []); + const clear = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => { + if (intervalRef.current !== null) { + clearInterval(intervalRef.current); + intervalRef.current = null; + } + }, []); + return [set, clear]; +} + +function useLatestValue(value, dependencies) { + if (dependencies === void 0) { + dependencies = [value]; + } + + const valueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(value); + useIsomorphicLayoutEffect(() => { + if (valueRef.current !== value) { + valueRef.current = value; + } + }, dependencies); + return valueRef; +} + +function useLazyMemo(callback, dependencies) { + const valueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + const newValue = callback(valueRef.current); + valueRef.current = newValue; + return newValue; + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [...dependencies]); +} + +function useNodeRef(onChange) { + const onChangeHandler = useEvent(onChange); + const node = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const setNodeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(element => { + if (element !== node.current) { + onChangeHandler == null ? void 0 : onChangeHandler(element, node.current); + } + + node.current = element; + }, //eslint-disable-next-line + []); + return [node, setNodeRef]; +} + +function usePrevious(value) { + const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + ref.current = value; + }, [value]); + return ref.current; +} + +let ids = {}; +function useUniqueId(prefix, value) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (value) { + return value; + } + + const id = ids[prefix] == null ? 0 : ids[prefix] + 1; + ids[prefix] = id; + return prefix + "-" + id; + }, [prefix, value]); +} + +function createAdjustmentFn(modifier) { + return function (object) { + for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + adjustments[_key - 1] = arguments[_key]; + } + + return adjustments.reduce((accumulator, adjustment) => { + const entries = Object.entries(adjustment); + + for (const [key, valueAdjustment] of entries) { + const value = accumulator[key]; + + if (value != null) { + accumulator[key] = value + modifier * valueAdjustment; + } + } + + return accumulator; + }, { ...object + }); + }; +} + +const add = /*#__PURE__*/createAdjustmentFn(1); +const subtract = /*#__PURE__*/createAdjustmentFn(-1); + +function hasViewportRelativeCoordinates(event) { + return 'clientX' in event && 'clientY' in event; +} + +function isKeyboardEvent(event) { + if (!event) { + return false; + } + + const { + KeyboardEvent + } = getWindow(event.target); + return KeyboardEvent && event instanceof KeyboardEvent; +} + +function isTouchEvent(event) { + if (!event) { + return false; + } + + const { + TouchEvent + } = getWindow(event.target); + return TouchEvent && event instanceof TouchEvent; +} + +/** + * Returns the normalized x and y coordinates for mouse and touch events. + */ + +function getEventCoordinates(event) { + if (isTouchEvent(event)) { + if (event.touches && event.touches.length) { + const { + clientX: x, + clientY: y + } = event.touches[0]; + return { + x, + y + }; + } else if (event.changedTouches && event.changedTouches.length) { + const { + clientX: x, + clientY: y + } = event.changedTouches[0]; + return { + x, + y + }; + } + } + + if (hasViewportRelativeCoordinates(event)) { + return { + x: event.clientX, + y: event.clientY + }; + } + + return null; +} + +const CSS = /*#__PURE__*/Object.freeze({ + Translate: { + toString(transform) { + if (!transform) { + return; + } + + const { + x, + y + } = transform; + return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)"; + } + + }, + Scale: { + toString(transform) { + if (!transform) { + return; + } + + const { + scaleX, + scaleY + } = transform; + return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")"; + } + + }, + Transform: { + toString(transform) { + if (!transform) { + return; + } + + return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(' '); + } + + }, + Transition: { + toString(_ref) { + let { + property, + duration, + easing + } = _ref; + return property + " " + duration + "ms " + easing; + } + + } +}); + +const SELECTOR = 'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]'; +function findFirstFocusableNode(element) { + if (element.matches(SELECTOR)) { + return element; + } + + return element.querySelector(SELECTOR); +} + + +//# sourceMappingURL=utilities.esm.js.map + + +/***/ }), + +/***/ "./client/src/components/AssetDropzone/AssetDropzone.js": +/*!**************************************************************!*\ + !*** ./client/src/components/AssetDropzone/AssetDropzone.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _dropzone = _interopRequireDefault(__webpack_require__(/*! @deltablot/dropzone */ "./node_modules/@deltablot/dropzone/dist/dropzone.mjs")); +var _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ "jquery")); +var _DataFormat = __webpack_require__(/*! lib/DataFormat */ "lib/DataFormat"); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +let idCounter = 0; +class AssetDropzone extends _react.Component { + constructor(props) { + super(props); + this.dropzone = null; + this.dragging = false; + this.handleAccept = this.handleAccept.bind(this); + this.handleAddedFile = this.handleAddedFile.bind(this); + this.handleDragEnter = this.handleDragEnter.bind(this); + this.handleDragLeave = this.handleDragLeave.bind(this); + this.handleDrop = this.handleDrop.bind(this); + this.handleUploadProgress = this.handleUploadProgress.bind(this); + this.handleUploadComplete = this.handleUploadComplete.bind(this); + this.handleError = this.handleError.bind(this); + this.handleSending = this.handleSending.bind(this); + this.handleSuccess = this.handleSuccess.bind(this); + this.handleQueueComplete = this.handleQueueComplete.bind(this); + this.loadImage = this.loadImage.bind(this); + this.handleMaxFilesExceeded = this.handleMaxFilesExceeded.bind(this); + } + componentDidMount() { + this.dropzone = new _dropzone.default(this.dropzoneRef, Object.assign({}, this.getDefaultOptions(), this.props.options)); + const { + name + } = this.props; + if (name && this.dropzone.hiddenFileInput) { + this.dropzone.hiddenFileInput.classList.add(`dz-input-${name}`); + } + if (typeof this.props.promptOnRemove !== 'undefined') { + this.setPromptOnRemove(this.props.promptOnRemove); + } + } + componentDidUpdate(prevProps) { + const { + name + } = this.props; + if (name && this.dropzone.hiddenFileInput) { + this.dropzone.hiddenFileInput.classList.add(`dz-input-${name}`); + } + if (this.props.canUpload && prevProps.options !== this.props.options) { + if (this.dropzone) { + this.dropzone.enable(); + this.dropzone.options = Object.assign({}, this.getDefaultOptions(), this.dropzone.options, this.props.options); + } + } + } + componentWillUnmount() { + this.dropzone.files = []; + this.dropzone.destroy(); + } + getDefaultOptions() { + let clickable = null; + let uploadSelector = this.props.uploadSelector; + if (!uploadSelector && this.props.uploadButton) { + uploadSelector = '.asset-dropzone__upload-button'; + } + if (uploadSelector) { + const found = (0, _jquery.default)(this.dropzoneRef).find(uploadSelector); + if (found && found.length) { + clickable = found.toArray(); + } + } + return { + accept: this.handleAccept, + addedfile: this.handleAddedFile, + dragenter: this.handleDragEnter, + dragleave: this.handleDragLeave, + drop: this.handleDrop, + maxfilesexceeded: this.handleMaxFilesExceeded, + uploadprogress: this.handleUploadProgress, + complete: this.handleUploadComplete, + dictDefaultMessage: _i18n.default._t('AssetAdmin.DROPZONE_DEFAULT_MESSAGE', 'Drop files here to upload'), + dictFallbackMessage: _i18n.default._t('AssetAdmin.DROPZONE_FALLBACK_MESSAGE', 'Your browser does not support drag\'n\'drop file uploads.'), + dictFallbackText: _i18n.default._t('AssetAdmin.DROPZONE_FALLBACK_TEXT', 'Please use the fallback form below to upload your files like in the olden days.'), + dictInvalidFileType: _i18n.default._t('AssetAdmin.DROPZONE_INVALID_FILE_TYPE', 'You can\'t upload files of this type.'), + dictResponseError: _i18n.default._t('AssetAdmin.DROPZONE_RESPONSE_ERROR', 'Server responded with an error.'), + dictCancelUpload: _i18n.default._t('AssetAdmin.DROPZONE_CANCEL_UPLOAD', 'Cancel upload'), + dictCancelUploadConfirmation: _i18n.default._t('AssetAdmin.DROPZONE_CANCEL_UPLOAD_CONFIRMATION', 'Are you sure you want to cancel this upload?'), + dictRemoveFile: _i18n.default._t('AssetAdmin.DROPZONE_REMOVE_FILE', 'Remove file'), + dictMaxFilesExceeded: _i18n.default._t('AssetAdmin.DROPZONE_MAX_FILES_EXCEEDED', 'You can not upload any more files.'), + error: this.handleError, + sending: this.handleSending, + success: this.handleSuccess, + queuecomplete: this.handleQueueComplete, + thumbnailHeight: 150, + thumbnailWidth: 200, + timeout: 0, + clickable + }; + } + getFileCategory(fileType) { + return fileType.split('/')[0]; + } + getLoadPreview(file) { + return new Promise(resolve => { + const reader = new FileReader(); + reader.onload = event => { + if (this.getFileCategory(file.type) === 'image') { + const img = new Image(); + resolve(this.loadImage(img, event.target.result)); + } else { + resolve({}); + } + }; + reader.readAsDataURL(file); + }); + } + getFileTitle(filename) { + return filename.replace(/[.][^.]+$/, '').replace(/-_/, ' '); + } + setPromptOnRemove(userPrompt) { + this.dropzone.options.dictRemoveFileConfirmation = userPrompt; + } + handleDragEnter(event) { + if (!this.props.canUpload) { + return; + } + this.dragging = true; + this.forceUpdate(); + if (typeof this.props.onDragEnter === 'function') { + this.props.onDragEnter(event); + } + } + handleDragLeave(event) { + const componentNode = this.dropzoneRef; + if (!this.props.canUpload) { + return; + } + if (event.target !== componentNode) { + return; + } + this.dragging = false; + this.forceUpdate(); + if (typeof this.props.onDragLeave === 'function') { + this.props.onDragLeave(event, componentNode); + } + } + handleUploadProgress(file, progress, bytesSent) { + if (typeof this.props.onUploadProgress === 'function') { + this.props.onUploadProgress(file, progress, bytesSent); + } + } + handleUploadComplete(file) { + if (typeof this.props.onUploadComplete === 'function') { + this.props.onUploadComplete(file.status); + } + } + handleDrop(event) { + this.dragging = false; + this.forceUpdate(); + if (typeof this.props.onDrop === 'function') { + this.props.onDrop(event); + } + } + handleSending(file, xhr, formData) { + if (typeof this.props.updateFormData === 'function') { + this.props.updateFormData(formData); + } + formData.append('SecurityID', this.props.securityID); + formData.append('ParentID', this.props.folderId); + const newXhr = Object.assign({}, xhr, { + abort: () => { + this.dropzone.cancelUpload(file); + xhr.abort(); + } + }); + if (typeof this.props.onSending === 'function') { + this.props.onSending(file, newXhr, formData); + } + } + handleMaxFilesExceeded(file) { + if (typeof this.props.onMaxFilesExceeded === 'function') { + return this.props.onMaxFilesExceeded(file); + } + return true; + } + generateQueuedId() { + idCounter += 1; + return idCounter; + } + handleAccept(file, done) { + if (typeof this.props.canFileUpload === 'function' && !this.props.canFileUpload(file)) { + return done(_i18n.default._t('AssetAdmin.DROPZONE_CANNOT_UPLOAD', 'Uploading not permitted.')); + } + if (!this.props.canUpload) { + return done(_i18n.default._t('AssetAdmin.DROPZONE_CANNOT_UPLOAD', 'Uploading not permitted.')); + } + return done(); + } + handleAddedFile(file) { + file._queuedId = this.generateQueuedId(); + const details = { + category: this.getFileCategory(file.type), + filename: file.name, + queuedId: file._queuedId, + size: file.size, + title: this.getFileTitle(file.name), + extension: (0, _DataFormat.getFileExtension)(file.name), + type: file.type, + uploadedToFolderId: this.props.folderId + }; + this.props.onAddedFile(details); + const loadPreview = this.getLoadPreview(file); + return loadPreview.then(preview => { + const previewDetails = { + height: preview.height, + width: preview.width, + url: preview.thumbnailURL, + thumbnail: preview.thumbnailURL, + smallThumbnail: preview.thumbnailURL + }; + if (typeof this.props.onPreviewLoaded === 'function') { + this.props.onPreviewLoaded(details, previewDetails); + } + return { + ...details, + ...previewDetails + }; + }); + } + loadImage(img, newSource) { + return new Promise(resolve => { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + img.onload = () => { + const previewWidth = this.props.preview.width * 2; + const previewHeight = this.props.preview.height * 2; + const ratio = img.naturalWidth / img.naturalHeight; + if (img.naturalWidth < previewWidth || img.naturalHeight < previewHeight) { + canvas.width = img.naturalWidth; + canvas.height = img.naturalHeight; + } else if (ratio < 1) { + canvas.width = previewWidth; + canvas.height = previewWidth / ratio; + } else { + canvas.width = previewHeight * ratio; + canvas.height = previewHeight; + } + ctx.drawImage(img, 0, 0, canvas.width, canvas.height); + const thumbnailURL = canvas.toDataURL('image/png'); + resolve({ + width: img.naturalWidth, + height: img.naturalHeight, + thumbnailURL + }); + }; + img.src = newSource; + }); + } + handleError(file, message) { + this.dropzone.removeFile(file); + this.props.onError(file, message); + } + handleSuccess(file) { + this.dropzone.removeFile(file); + this.props.onSuccess(file); + } + handleQueueComplete() { + if (this.props.onQueueComplete) { + this.props.onQueueComplete(); + } + } + render() { + const className = ['asset-dropzone']; + if (this.props.className) { + className.push(this.props.className); + } + const buttonProps = { + className: 'asset-dropzone__upload-button ss-ui-button font-icon-upload', + type: 'button' + }; + if (!this.props.canUpload) { + buttonProps.disabled = true; + } + if (this.dragging === true) { + className.push('dragging'); + } + return _react.default.createElement("div", { + className: className.join(' '), + ref: node => { + this.dropzoneRef = node; + } + }, this.props.uploadButton && _react.default.createElement("button", buttonProps, _i18n.default._t('AssetAdmin.DROPZONE_UPLOAD')), this.props.children); + } +} +AssetDropzone.propTypes = { + folderId: _propTypes.default.number.isRequired, + onAccept: _propTypes.default.func, + onAddedFile: _propTypes.default.func.isRequired, + onDragEnter: _propTypes.default.func, + onDragLeave: _propTypes.default.func, + onDrop: _propTypes.default.func, + onError: _propTypes.default.func.isRequired, + onPreviewLoaded: _propTypes.default.func, + onSending: _propTypes.default.func, + onSuccess: _propTypes.default.func.isRequired, + onMaxFilesExceeded: _propTypes.default.func, + updateFormData: _propTypes.default.func, + canFileUpload: _propTypes.default.func, + onQueueComplete: _propTypes.default.func, + options: _propTypes.default.shape({ + url: _propTypes.default.string.isRequired + }), + promptOnRemove: _propTypes.default.string, + securityID: _propTypes.default.string.isRequired, + uploadButton: _propTypes.default.bool, + uploadSelector: _propTypes.default.string, + canUpload: _propTypes.default.bool.isRequired, + preview: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }), + className: _propTypes.default.string +}; +AssetDropzone.defaultProps = { + uploadButton: true +}; +var _default = exports["default"] = AssetDropzone; + +/***/ }), + +/***/ "./client/src/components/BulkActions/BulkActions.js": +/*!**********************************************************!*\ + !*** ./client/src/components/BulkActions/BulkActions.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _reactstrap = __webpack_require__(/*! reactstrap */ "reactstrap"); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +class BulkActions extends _react.Component { + constructor(props) { + super(props); + this.handleChangeValue = this.handleChangeValue.bind(this); + this.renderChild = this.renderChild.bind(this); + } + getOptionByValue(value) { + return this.props.actions.find(action => action.value === value); + } + handleChangeValue(event) { + let promise = null; + const option = this.getOptionByValue(event.target.value); + if (option === null) { + return null; + } + if (typeof option.confirm === 'function') { + promise = option.confirm(this.props.items).then(() => option.callback(event, this.props.items)).catch(reason => { + if (reason !== 'cancelled') { + throw reason; + } + }); + } else { + promise = option.callback(event, this.props.items) || Promise.resolve(); + } + return promise; + } + renderChild(action, i) { + const className = (0, _classnames.default)('bulk-actions__action', action.className || 'font-icon-info-circled', { + btn: i < 2, + 'bulk-actions__action--more': i > 2 + }); + if (i < 2) { + return _react.default.createElement(_reactstrap.Button, { + className: className, + key: action.value, + onClick: this.handleChangeValue, + value: action.value, + color: action.color + }, action.label); + } + return _react.default.createElement(_reactstrap.DropdownItem, { + type: "button", + className: className, + key: action.value, + onClick: this.handleChangeValue, + value: action.value + }, action.label); + } + render() { + if (!this.props.items.length) { + return null; + } + let children = this.props.actions.filter(action => !action.canApply || action.canApply(this.props.items)); + children = children.map(this.renderChild); + if (!children.length) { + return null; + } + const { + ActionMenu, + showCount + } = this.props; + const selectAll = _i18n.default._t('AssetAdmin.BULK_ACTIONS_SELECT_ALL', 'Select all'); + const selected = _i18n.default.sprintf(_i18n.default._t('AssetAdmin.BULK_ACTIONS_SELECTED', '%s selected'), this.props.items.length); + const title = _i18n.default._t('AssetAdmin.BULK_ACTIONS_CLEAR_SELECTION', 'Clear selection'); + return _react.default.createElement("div", { + className: "bulk-actions fieldholder-small" + }, showCount && _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_reactstrap.Button, { + className: "bulk-actions-counter font-icon-cross-mark", + onClick: this.props.onClearSelection, + title: title + }, selected), _react.default.createElement("div", { + className: "bulk-actions-select-all" + }, _react.default.createElement(_reactstrap.Button, { + onClick: this.props.onSelectAll + }, selectAll))), children.slice(0, 2), children.length > 2 && ActionMenu ? _react.default.createElement(ActionMenu, { + id: "BulkActions", + className: "bulk-actions__more-actions-menu" + }, children.slice(2)) : children.slice(2)); + } +} +exports.Component = BulkActions; +BulkActions.propTypes = { + items: _propTypes.default.array, + actions: _propTypes.default.arrayOf(_propTypes.default.shape({ + value: _propTypes.default.string.isRequired, + label: _propTypes.default.string.isRequired, + className: _propTypes.default.string, + destructive: _propTypes.default.bool, + callback: _propTypes.default.func, + canApply: _propTypes.default.func, + confirm: _propTypes.default.func + })), + ActionMenu: _propTypes.default.elementType, + showCount: _propTypes.default.bool, + onClearSelection: _propTypes.default.func.isRequired, + onSelectAll: _propTypes.default.func.isRequired +}; +BulkActions.defaultProps = { + items: [], + actions: [], + ActionMenu: null, + total: null, + showCount: true, + totalReachedMessage: _i18n.default._t('') +}; +function mapStateToProps(state) { + return { + gallery: state.assetAdmin.gallery + }; +} +const BulkActionsWithState = (0, _reactRedux.connect)(mapStateToProps)(BulkActions); +var _default = exports["default"] = (0, _Injector.inject)(['ActionMenu'], ActionMenu => ({ + ActionMenu +}), () => 'BulkActions')(BulkActionsWithState); + +/***/ }), + +/***/ "./client/src/components/GalleryItem/GalleryItem.js": +/*!**********************************************************!*\ + !*** ./client/src/components/GalleryItem/GalleryItem.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Folder = exports.File = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _fileShape = _interopRequireDefault(__webpack_require__(/*! lib/fileShape */ "./client/src/lib/fileShape.js")); +var _draggable = _interopRequireDefault(__webpack_require__(/*! components/GalleryItem/draggable */ "./client/src/components/GalleryItem/draggable.js")); +var _droppable = _interopRequireDefault(__webpack_require__(/*! components/GalleryItem/droppable */ "./client/src/components/GalleryItem/droppable.js")); +var _Badge = _interopRequireDefault(__webpack_require__(/*! components/Badge/Badge */ "components/Badge/Badge")); +var _FileStatusIcon = _interopRequireDefault(__webpack_require__(/*! components/FileStatusIcon/FileStatusIcon */ "components/FileStatusIcon/FileStatusIcon")); +var _configShape = _interopRequireDefault(__webpack_require__(/*! lib/configShape */ "./client/src/lib/configShape.js")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _reactSelectable = __webpack_require__(/*! react-selectable */ "./node_modules/react-selectable/dist/react-selectable.js"); +var imageLoadActions = _interopRequireWildcard(__webpack_require__(/*! state/imageLoad/ImageLoadActions */ "./client/src/state/imageLoad/ImageLoadActions.js")); +var _ImageLoadStatus = _interopRequireDefault(__webpack_require__(/*! state/imageLoad/ImageLoadStatus */ "./client/src/state/imageLoad/ImageLoadStatus.js")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +function shouldLoadImage(props) { + return props.item.thumbnail && props.item.category === 'image' && props.item.exists && !props.item.queuedId && props.sectionConfig.imageRetry.minRetry && props.sectionConfig.imageRetry.maxRetry; +} +const preventFocus = event => { + event.preventDefault(); +}; +class GalleryItem extends _react.Component { + constructor(props) { + super(props); + this.handleSelect = this.handleSelect.bind(this); + this.handleActivate = this.handleActivate.bind(this); + this.handleKeyDown = this.handleKeyDown.bind(this); + this.handleCancelUpload = this.handleCancelUpload.bind(this); + } + componentDidUpdate() { + if (shouldLoadImage(this.props)) { + this.props.actions.imageLoad.loadImage(this.props.item.thumbnail, this.props.sectionConfig.imageRetry); + } + } + getThumbnailStyles() { + const { + item: { + thumbnail, + version + }, + bustCache + } = this.props; + if (!this.isImage() || !thumbnail || this.missing()) { + return {}; + } + const url = bustCache === false || !version || thumbnail.startsWith('data:image/') ? thumbnail : `${thumbnail}?vid=${version}`; + switch (this.props.loadState) { + case _ImageLoadStatus.default.SUCCESS: + case _ImageLoadStatus.default.DISABLED: + return { + backgroundImage: `url(${url})` + }; + default: + return {}; + } + } + getErrorMessage() { + let message = null; + const { + item, + loadState + } = this.props; + if (this.hasError()) { + message = item.message.value; + } else if (this.missing()) { + message = _i18n.default._t('AssetAdmin.FILE_MISSING', 'File cannot be found'); + } else if (loadState === _ImageLoadStatus.default.FAILED) { + message = _i18n.default._t('AssetAdmin.FILE_LOAD_ERROR', 'Thumbnail not available'); + } + if (message !== null) { + const updateErrorMessage = this.getItemFunction('updateErrorMessage'); + message = updateErrorMessage(message, this.props); + return _react.default.createElement("span", { + className: "gallery-item__error-message" + }, message); + } + return null; + } + getThumbnailClassNames() { + const thumbnailClassNames = ['gallery-item__thumbnail']; + if (this.isImageSmallerThanThumbnail()) { + thumbnailClassNames.push('gallery-item__thumbnail--small'); + } + if (!this.props.item.thumbnail && this.isImage()) { + thumbnailClassNames.push('gallery-item__thumbnail--no-preview'); + } + switch (this.props.loadState) { + case _ImageLoadStatus.default.LOADING: + case _ImageLoadStatus.default.WAITING: + thumbnailClassNames.push('gallery-item__thumbnail--loading'); + break; + case _ImageLoadStatus.default.FAILED: + thumbnailClassNames.push('gallery-item__thumbnail--error'); + break; + default: + break; + } + return thumbnailClassNames.join(' '); + } + getItemClassNames() { + const category = this.props.item.category || 'false'; + const selected = this.props.selectable && (this.props.item.selected || this.props.isDragging); + return (0, _classnames.default)({ + 'gallery-item': true, + [`gallery-item--${category}`]: true, + 'gallery-item--max-selected': this.props.maxSelected && !selected, + 'gallery-item--missing': this.missing(), + 'gallery-item--selectable': this.props.selectable, + 'gallery-item--selected': selected, + 'gallery-item--dropping': this.props.isDropping, + 'gallery-item--highlighted': this.props.item.highlighted, + 'gallery-item--error': this.hasError(), + 'gallery-item--dragging': this.props.isDragging + }); + } + getItemFunction(functionName) { + const { + item + } = this.props; + return typeof item[functionName] === 'function' ? item[functionName] : this.props[functionName]; + } + getStatusFlags() { + let flags = []; + const { + item + } = this.props; + if (item.type !== 'folder') { + if (item.draft) { + flags.push({ + key: 'status-draft', + title: _i18n.default._t('File.DRAFT', 'Draft'), + className: 'gallery-item--draft' + }); + } else if (item.modified) { + flags.push({ + key: 'status-modified', + title: _i18n.default._t('File.MODIFIED', 'Modified'), + className: 'gallery-item--modified' + }); + } + } + const updateStatusFlags = this.getItemFunction('updateStatusFlags'); + flags = updateStatusFlags(flags, this.props); + return _react.default.createElement("div", { + className: "gallery-item__status-flags" + }, flags.map(attrs => _react.default.createElement("span", attrs))); + } + getStatusIcons() { + const { + item + } = this.props; + const icons = []; + if (item.hasRestrictedAccess) { + icons.push({ + key: 'status-restricted', + fileID: item.id, + hasRestrictedAccess: true, + placement: 'top', + disableTooltip: item.type === 'folder', + includeBackground: item.type !== 'folder' + }); + } + if (item.isTrackedFormUpload && item.type !== 'folder') { + icons.push({ + key: 'status-tracked-form-upload', + fileID: item.id, + isTrackedFormUpload: true, + hasRestrictedAccess: item.hasRestrictedAccess, + placement: 'top', + includeBackground: true + }); + } + return _react.default.createElement("div", { + className: "gallery-item__status-icons" + }, icons.map(attrs => _react.default.createElement(_FileStatusIcon.default, attrs))); + } + getProgressBar() { + let progressBar = null; + const { + item + } = this.props; + const progressBarProps = { + className: 'gallery-item__progress-bar', + style: { + width: `${item.progress}%` + } + }; + if (!this.hasError() && this.uploading() && !this.complete()) { + progressBar = _react.default.createElement("div", { + className: "gallery-item__upload-progress" + }, _react.default.createElement("div", progressBarProps)); + } + const updateProgressBar = this.getItemFunction('updateProgressBar'); + progressBar = updateProgressBar(progressBar, this.props); + return progressBar; + } + isImageSmallerThanThumbnail() { + if (!this.isImage() || this.missing()) { + return false; + } + const width = this.props.item.width; + const height = this.props.item.height; + return height && width && height < _index.default.THUMBNAIL_HEIGHT && width < _index.default.THUMBNAIL_WIDTH; + } + complete() { + return this.props.item.queuedId && this.saved(); + } + saved() { + return this.props.item.id > 0; + } + missing() { + return !this.exists() && this.saved(); + } + uploading() { + return this.props.item.queuedId && !this.saved(); + } + exists() { + return this.props.item.exists; + } + isImage() { + return this.props.item.category === 'image'; + } + canBatchSelect() { + return this.props.selectable && this.props.item.canEdit; + } + hasError() { + let hasError = false; + if (this.props.item.message) { + hasError = this.props.item.message.type === 'error'; + } + return hasError; + } + handleActivate(event) { + event.stopPropagation(); + if (typeof this.props.onActivate === 'function' && this.saved()) { + this.props.onActivate(event, this.props.item); + } + } + handleSelect(event) { + event.stopPropagation(); + event.preventDefault(); + if (typeof this.props.onSelect === 'function') { + this.props.onSelect(event, this.props.item); + } + } + handleKeyDown(event) { + if (_index.default.SPACE_KEY_CODE === event.keyCode) { + event.preventDefault(); + if (this.canBatchSelect()) { + this.handleSelect(event); + } + } + if (_index.default.RETURN_KEY_CODE === event.keyCode) { + this.handleActivate(event); + } + } + handleCancelUpload(event) { + event.stopPropagation(); + event.preventDefault(); + if (this.hasError()) { + this.props.onRemoveErroredUpload(this.props.item); + } else if (this.props.onCancelUpload) { + this.props.onCancelUpload(this.props.item); + } + } + render() { + let action = null; + let actionIcon = null; + let overlay = null; + const { + id, + queuedId + } = this.props.item; + const htmlID = id ? `item-${id}` : `queued-${queuedId}`; + if (this.props.selectable) { + if (this.canBatchSelect()) { + action = this.handleSelect; + } + actionIcon = 'font-icon-tick'; + } + if (this.uploading()) { + action = this.handleCancelUpload; + actionIcon = 'font-icon-cancel'; + } else if (this.exists()) { + const label = _i18n.default._t('AssetAdmin.VIEW', 'View'); + overlay = _react.default.createElement("div", { + className: "gallery-item--overlay font-icon-eye" + }, label); + } + const badge = this.props.badge; + const inputProps = { + className: 'gallery-item__checkbox', + type: 'checkbox', + title: _i18n.default._t('AssetAdmin.SELECT', 'Select'), + tabIndex: -1, + onMouseDown: preventFocus, + id: htmlID + }; + const inputLabelClasses = ['gallery-item__checkbox-label', actionIcon]; + if (!this.canBatchSelect()) { + inputProps.disabled = true; + inputLabelClasses.push('gallery-item__checkbox-label--disabled'); + } + const inputLabelProps = { + className: inputLabelClasses.join(' '), + onClick: action + }; + return _react.default.createElement("div", { + className: this.getItemClassNames(), + "data-id": this.props.item.id, + tabIndex: 0, + role: "button", + onKeyDown: this.handleKeyDown, + onClick: this.handleActivate + }, !!badge && _react.default.createElement(_Badge.default, { + className: "gallery-item__badge", + status: badge.status, + message: badge.message + }), _react.default.createElement("div", { + ref: thumbnail => { + this.thumbnail = thumbnail; + }, + className: this.getThumbnailClassNames(), + style: this.getThumbnailStyles() + }, overlay, this.getStatusFlags(), this.getStatusIcons()), this.getProgressBar(), this.getErrorMessage(), this.props.children, _react.default.createElement("div", { + className: "gallery-item__title", + ref: title => { + this.title = title; + } + }, _react.default.createElement("label", _extends({}, inputLabelProps, { + htmlFor: htmlID + }), _react.default.createElement("input", inputProps)), this.props.item.title)); + } +} +exports.Component = GalleryItem; +GalleryItem.propTypes = { + sectionConfig: _configShape.default, + item: _fileShape.default, + loadState: _propTypes.default.oneOf(Object.values(_ImageLoadStatus.default)), + bustCache: _propTypes.default.bool, + highlighted: _propTypes.default.bool, + selected: _propTypes.default.bool, + isDropping: _propTypes.default.bool, + isDragging: _propTypes.default.bool, + message: _propTypes.default.shape({ + value: _propTypes.default.string, + type: _propTypes.default.string + }), + selectable: _propTypes.default.bool, + onActivate: _propTypes.default.func, + onSelect: _propTypes.default.func, + onCancelUpload: _propTypes.default.func, + onRemoveErroredUpload: _propTypes.default.func, + badge: _propTypes.default.shape({ + status: _propTypes.default.string, + message: _propTypes.default.string + }), + updateStatusFlags: _propTypes.default.func, + updateProgressBar: _propTypes.default.func, + updateErrorMessage: _propTypes.default.func +}; +GalleryItem.defaultProps = { + item: {}, + sectionConfig: { + imageRetry: {} + }, + updateStatusFlags: flags => flags, + updateProgressBar: progressBar => progressBar, + updateErrorMessage: message => message, + bustCache: true +}; +function mapStateToProps(state, ownprops) { + const sectionConfigKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; + const { + bustCache + } = state.config.sections.find(section => section.name === sectionConfigKey); + let loadState = _ImageLoadStatus.default.DISABLED; + if (shouldLoadImage(ownprops)) { + const imageLoad = state.assetAdmin.imageLoad; + const file = imageLoad.files.find(next => ownprops.item.thumbnail === next.url); + loadState = file && file.status || _ImageLoadStatus.default.NONE; + } + return { + bustCache, + loadState + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + imageLoad: (0, _redux.bindActionCreators)(imageLoadActions, dispatch) + } + }; +} +const ConnectedGalleryItem = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(GalleryItem); +const File = exports.File = (0, _reactSelectable.createSelectable)((0, _draggable.default)(ConnectedGalleryItem)); +const Folder = exports.Folder = (0, _reactSelectable.createSelectable)((0, _droppable.default)(File)); +var _default = exports["default"] = ConnectedGalleryItem; + +/***/ }), + +/***/ "./client/src/components/GalleryItem/GalleryItemDragLayer.js": +/*!*******************************************************************!*\ + !*** ./client/src/components/GalleryItem/GalleryItemDragLayer.js ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _Badge = _interopRequireDefault(__webpack_require__(/*! components/Badge/Badge */ "components/Badge/Badge")); +var _GalleryItem = _interopRequireDefault(__webpack_require__(/*! ./GalleryItem */ "./client/src/components/GalleryItem/GalleryItem.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +function GalleryItemDragLayer(props) { + const { + draggingItems, + draggingItemProps + } = props; + const selectionCount = draggingItems.length; + const shadows = [selectionCount > 1 ? _react.default.createElement("div", { + key: "1", + className: "gallery-item__drag-shadow" + }) : null, selectionCount > 2 ? _react.default.createElement("div", { + key: "2", + className: "gallery-item__drag-shadow gallery-item__drag-shadow--second" + }) : null]; + const isFolder = draggingItemProps.item.type === 'folder'; + let badge = null; + if (selectionCount > 1) { + badge = _react.default.createElement(_Badge.default, { + className: "gallery-item__drag-layer-count", + status: "info", + message: `${selectionCount}` + }); + } + return _react.default.createElement("div", { + className: "gallery-item__drag-layer" + }, _react.default.createElement("div", { + className: "gallery-item__drag-layer-item" + }, _react.default.createElement("div", { + className: "gallery-item__drag-layer-preview" + }, shadows, _react.default.createElement(_GalleryItem.default, _extends({}, draggingItemProps, { + isDragging: true + })), isFolder && badge), !isFolder && badge)); +} +GalleryItemDragLayer.propTypes = { + draggingItems: _propTypes.default.arrayOf(_propTypes.default.number), + draggingItemProps: _propTypes.default.object +}; +var _default = exports["default"] = GalleryItemDragLayer; + +/***/ }), + +/***/ "./client/src/components/GalleryItem/draggable.js": +/*!********************************************************!*\ + !*** ./client/src/components/GalleryItem/draggable.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = draggable; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _core = __webpack_require__(/*! @dnd-kit/core */ "./node_modules/@dnd-kit/core/dist/core.esm.js"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +function draggable(Item) { + let uniqueID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + function DraggableItem(props) { + let id = uniqueID; + if (id === null) { + id = props.item.id; + } + const canDrag = typeof props.canDrag === 'boolean' ? props.canDrag : true; + const { + attributes, + listeners, + setNodeRef + } = (0, _core.useDraggable)({ + disabled: !canDrag, + id, + data: { + props + } + }); + const item = _react.default.createElement(Item, props); + return _react.default.createElement("div", _extends({ + className: "gallery-item__draggable", + draggable: true, + ref: setNodeRef + }, listeners, attributes), item); + } + DraggableItem.propTypes = { + item: _propTypes.default.shape({ + id: _propTypes.default.number.isRequired + }).isRequired, + onDrag: _propTypes.default.func, + canDrag: _propTypes.default.bool, + selectedFiles: _propTypes.default.arrayOf(_propTypes.default.number) + }; + return DraggableItem; +} + +/***/ }), + +/***/ "./client/src/components/GalleryItem/droppable.js": +/*!********************************************************!*\ + !*** ./client/src/components/GalleryItem/droppable.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = droppable; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _core = __webpack_require__(/*! @dnd-kit/core */ "./node_modules/@dnd-kit/core/dist/core.esm.js"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +function droppable(Item) { + let uniqueID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + function DroppableItem(props) { + let id = uniqueID; + if (id === null) { + id = props.item.id; + } + const { + setNodeRef, + isOver + } = (0, _core.useDroppable)({ + id + }); + const item = _react.default.createElement(Item, _extends({ + isDropping: isOver + }, props)); + return _react.default.createElement("div", { + ref: setNodeRef, + className: "gallery-item__droppable" + }, item); + } + DroppableItem.propTypes = { + connectDropTarget: _propTypes.default.func.isRequired, + item: _propTypes.default.shape({ + id: _propTypes.default.number.isRequired + }).isRequired + }; + return DroppableItem; +} + +/***/ }), + +/***/ "./client/src/constants/index.js": +/*!***************************************!*\ + !*** ./client/src/constants/index.js ***! + \***************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +var _default = exports["default"] = { + ACTIONS: { + CREATE_FOLDER: 'create-folder', + EDIT_FILE: 'edit' + }, + MOVE_SUCCESS_DURATION: 3000, + CSS_TRANSITION_TIME: 300, + SMALL_THUMBNAIL_HEIGHT: 60, + SMALL_THUMBNAIL_WIDTH: 60, + THUMBNAIL_HEIGHT: 150, + THUMBNAIL_WIDTH: 200, + BULK_ACTIONS: [{ + value: 'delete', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_DELETE', 'Delete'), + className: 'font-icon-trash', + destructive: true, + callback: null, + canApply: items => items.every(item => item && item.canDelete) + }, { + value: 'archive', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_ARCHIVE', 'Archive'), + className: 'font-icon-box', + destructive: true, + callback: null, + canApply: items => items.every(item => item && item.canDelete) + }, { + value: 'edit', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_EDIT', 'Edit'), + className: 'font-icon-edit', + destructive: false, + canApply: items => items.length === 1, + callback: null + }, { + value: 'move', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_MOVE', 'Move'), + className: 'font-icon-folder-move', + canApply: items => items.every(item => item && item.canEdit), + destructive: false, + callback: null + }, { + value: 'publish', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_PUBLISH', 'Publish'), + className: 'font-icon-rocket', + destructive: false, + callback: null, + canApply: items => items.some(item => item && item.modified) && items.every(item => item.canEdit && item.type !== 'folder'), + confirm: null + }, { + value: 'unpublish', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_UNPUBLISH', 'Unpublish'), + className: 'font-icon-cancel-circled', + destructive: false, + callback: null, + canApply: items => items.some(item => item.published) && items.every(item => item.canEdit && item.type !== 'folder'), + confirm: null + }, { + value: 'insert', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_INSERT', 'Insert'), + className: 'font-icon-plus-circled btn-primary', + destructive: false, + callback: null, + canApply: items => items.length, + confirm: null + }], + BULK_ACTIONS_PLACEHOLDER: _i18n.default._t('AssetAdmin.BULK_ACTIONS_PLACEHOLDER'), + SPACE_KEY_CODE: 32, + RETURN_KEY_CODE: 13, + DEFAULT_PREVIEW: 'framework/client/dist/images/app_icons/generic_92.png', + MODAL_MOVE: 'MODAL_MOVE' +}; + +/***/ }), + +/***/ "./client/src/containers/AssetAdmin/AssetAdmin.js": +/*!********************************************************!*\ + !*** ./client/src/containers/AssetAdmin/AssetAdmin.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var galleryActions = _interopRequireWildcard(__webpack_require__(/*! state/gallery/GalleryActions */ "./client/src/state/gallery/GalleryActions.js")); +var toastsActions = _interopRequireWildcard(__webpack_require__(/*! state/toasts/ToastsActions */ "state/toasts/ToastsActions")); +var queuedFilesActions = _interopRequireWildcard(__webpack_require__(/*! state/queuedFiles/QueuedFilesActions */ "./client/src/state/queuedFiles/QueuedFilesActions.js")); +var displaySearchActions = _interopRequireWildcard(__webpack_require__(/*! state/displaySearch/DisplaySearchActions */ "./client/src/state/displaySearch/DisplaySearchActions.js")); +var _Editor = _interopRequireDefault(__webpack_require__(/*! containers/Editor/Editor */ "./client/src/containers/Editor/Editor.js")); +var _Gallery = _interopRequireDefault(__webpack_require__(/*! containers/Gallery/Gallery */ "./client/src/containers/Gallery/Gallery.js")); +var _Toolbar = _interopRequireDefault(__webpack_require__(/*! components/Toolbar/Toolbar */ "components/Toolbar/Toolbar")); +var _Search = _interopRequireWildcard(__webpack_require__(/*! components/Search/Search */ "components/Search/Search")); +var _SearchToggle = _interopRequireDefault(__webpack_require__(/*! components/Search/SearchToggle */ "components/Search/SearchToggle")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _configShape = _interopRequireDefault(__webpack_require__(/*! lib/configShape */ "./client/src/lib/configShape.js")); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var confirmDeletionActions = _interopRequireWildcard(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionActions */ "./client/src/state/confirmDeletion/ConfirmDeletionActions.js")); +var _getFormSchema = _interopRequireDefault(__webpack_require__(/*! lib/getFormSchema */ "./client/src/lib/getFormSchema.js")); +var _getJsonErrorMessage = _interopRequireDefault(__webpack_require__(/*! lib/getJsonErrorMessage */ "lib/getJsonErrorMessage")); +var _BulkDeleteConfirmation = _interopRequireDefault(__webpack_require__(/*! ../BulkDeleteConfirmation/BulkDeleteConfirmation */ "./client/src/containers/BulkDeleteConfirmation/BulkDeleteConfirmation.js")); +var _AssetAdminBreadcrumb = _interopRequireDefault(__webpack_require__(/*! ./AssetAdminBreadcrumb */ "./client/src/containers/AssetAdmin/AssetAdminBreadcrumb.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +class AssetAdmin extends _react.Component { + constructor(props) { + super(props); + this.handleOpenFile = this.handleOpenFile.bind(this); + this.handleCloseFile = this.handleCloseFile.bind(this); + this.handleDelete = this.handleDelete.bind(this); + this.doPublish = this.doPublish.bind(this); + this.doUnpublish = this.doUnpublish.bind(this); + this.handleUnpublish = this.handleUnpublish.bind(this); + this.handleDoSearch = this.handleDoSearch.bind(this); + this.handleClearSearch = this.handleClearSearch.bind(this); + this.handleSubmitEditor = this.handleSubmitEditor.bind(this); + this.handleOpenFolder = this.handleOpenFolder.bind(this); + this.handleSort = this.handleSort.bind(this); + this.handleSetPage = this.handleSetPage.bind(this); + this.createEndpoint = this.createEndpoint.bind(this); + this.handleBackButtonClick = this.handleBackButtonClick.bind(this); + this.handleFolderIcon = this.handleFolderIcon.bind(this); + this.handleBrowse = this.handleBrowse.bind(this); + this.handleViewChange = this.handleViewChange.bind(this); + this.handleUpload = this.handleUpload.bind(this); + this.handleUploadQueue = this.handleUploadQueue.bind(this); + this.handleCreateFolder = this.handleCreateFolder.bind(this); + this.handleMoveFilesSuccess = this.handleMoveFilesSuccess.bind(this); + this.refetchFolder = this.refetchFolder.bind(this); + this.state = { + loading: false, + folder: null, + files: [], + totalCount: 0, + forceRefetch: false + }; + } + componentDidMount() { + this.refetchFolder(); + } + componentDidUpdate(prevProps) { + if (this.props.folderId !== prevProps.folderId || this.props.fileId !== prevProps.fileId && this.props.fileId !== 0 || this.state.forceRefetch) { + this.refetchFolder(); + } + if (this.state.forceRefetch) { + this.setState({ + forceRefetch: false + }); + } + } + getFolderId() { + if (this.props.folderId !== null) { + return this.props.folderId; + } + if (this.state.folder) { + return this.state.folder.id; + } + return 0; + } + refetchFolder() { + const folderId = this.getFolderId(); + const urlParams = new URLSearchParams(window.location.search); + const qsParams = []; + urlParams.forEach((value, key) => { + if (key === 'page' || key.substring(0, 6) === 'filter' || key.substring(0, 4) === 'sort') { + qsParams.push(`${key}=${value}`); + } + }); + let qs = ''; + if (qsParams.length) { + qs = `?${qsParams.join('&')}`; + } + const sectionConfig = _Config.default.getSection('SilverStripe\\AssetAdmin\\Controller\\AssetAdminOpen'); + const url = `${sectionConfig.endpoints.read.url}/${folderId}${qs}`; + _Backend.default.get(url).then(async response => { + const responseJson = await response.json(); + this.setState({ + loading: false, + folder: responseJson, + files: responseJson.children.nodes, + totalCount: responseJson.children.pageInfo.totalCount + }); + }).catch(async err => { + this.setState({ + loading: false, + folder: null, + files: [], + totalCount: 0 + }); + const message = await (0, _getJsonErrorMessage.default)(err); + this.props.actions.toasts.error(message); + }); + } + getFiles() { + const { + queuedFiles, + folderId + } = this.props; + const files = this.state.files; + const combinedFilesList = [...queuedFiles.items.filter(item => (!item.id || !files.find(file => file.id === item.id)) && (!item.hasOwnProperty('uploadedToFolderId') || item.uploadedToFolderId === folderId)), ...files]; + const foldersList = combinedFilesList.filter(file => file.type === 'folder'); + const filesList = combinedFilesList.filter(file => file.type !== 'folder'); + return foldersList.concat(filesList); + } + handleBrowse(folderId, fileId, query) { + if (typeof this.props.onBrowse === 'function') { + this.props.onBrowse(folderId, fileId, query); + this.setState({ + forceRefetch: true + }); + } + if (folderId !== this.getFolderId()) { + this.props.actions.gallery.deselectFiles(); + } + } + handleSetPage(page) { + this.handleBrowse(this.getFolderId(), this.props.fileId, Object.assign({}, this.props.query, { + page + })); + this.setState({ + forceRefetch: true + }); + } + handleDoSearch(data) { + this.props.actions.gallery.deselectFiles(); + this.props.actions.queuedFiles.purgeUploadQueue(); + this.handleBrowse(data.currentFolderOnly ? this.getFolderId() : 0, null, { + filter: data, + view: this.props.query.view + }); + } + handleClearSearch(event) { + this.props.actions.displaySearch.closeSearch(); + this.props.actions.gallery.deselectFiles(); + this.props.actions.queuedFiles.purgeUploadQueue(); + this.refetchFolder(); + const folder = this.state.folder; + this.handleOpenFolder(event, folder); + } + handleSort(sort) { + this.handleBrowse(this.getFolderId(), this.props.fileId, { + ...this.props.query, + sort, + limit: undefined, + page: undefined + }); + this.setState({ + forceRefetch: true + }); + } + handleViewChange(view) { + this.handleBrowse(this.getFolderId(), this.props.fileId, Object.assign({}, this.props.query, { + view + })); + } + createEndpoint(endpointConfig) { + let includeToken = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + return _Backend.default.createEndpointFetcher(Object.assign({}, endpointConfig, includeToken ? { + defaultData: { + SecurityID: this.props.securityId + } + } : {})); + } + handleBackButtonClick(event) { + event.preventDefault(); + this.props.actions.gallery.deselectFiles(); + const folder = this.state.folder; + if (folder) { + this.handleOpenFolder(folder.parentId || 0); + } else { + this.handleOpenFolder(0); + } + } + resetFile(file) { + if (file.queuedId) { + this.props.actions.queuedFiles.removeQueuedFile(file.queuedId); + } + if (this.props.fileId === file.id) { + this.props.resetFileDetails(this.getFolderId(), file.id, this.props.query); + } + } + handleFolderIcon() { + this.handleOpenFile(this.getFolderId()); + } + handleOpenFile(fileId) { + this.handleBrowse(this.getFolderId(), fileId, this.props.query); + } + handleSubmitEditor(data, action, submitFn) { + let promise = null; + if (action === 'action_insert' && this.props.type === 'select') { + const files = this.getFiles(); + const file = files.find(item => item.id === parseInt(data.ID, 10)); + this.props.onInsertMany(null, [file]); + this.setState({ + forceRefetch: true + }); + return Promise.resolve(); + } + if (typeof this.props.onSubmitEditor === 'function') { + const file = this.findFile(this.props.fileId); + promise = this.props.onSubmitEditor(data, action, submitFn, file); + } else { + promise = submitFn(); + } + if (!promise) { + throw new Error('Promise was not returned for submitting'); + } + this.setState({ + forceRefetch: true + }); + return promise.then(response => { + if (action === 'action_createfolder') { + if (this.props.type === 'admin') { + this.handleOpenFile(response.record.id); + } else { + this.handleOpenFolder(this.getFolderId()); + } + } else if ((action === 'action_save' || action === 'action_publish') && this.getFolderId() !== response.record.parent.id) { + this.handleBrowse(response.record.parent.id, response.record.id, null); + } + return response; + }); + } + handleCloseFile() { + this.handleBrowse(this.getFolderId(), null, this.props.query); + } + handleOpenFolder(folderId) { + const { + page, + filter, + ...query + } = this.props.query; + this.handleBrowse(folderId, null, query); + } + handleDelete(ids) { + this.props.actions.confirmDeletion.deleting(); + const files = ids.map(id => { + const result = this.findFile(id); + if (!result) { + throw new Error(`File selected for deletion cannot be found: ${id}`); + } + if (result.queuedId) { + this.props.actions.queuedFiles.removeQueuedFile(result.queuedId); + } + return result; + }); + const fileIDs = files.map(file => file.id); + const folder = this.state.folder; + const parentId = folder ? folder.id : 0; + const url = this.props.sectionConfig.endpoints.delete.url; + return _Backend.default.post(url, { + ids: fileIDs + }, { + 'X-SecurityID': _Config.default.get('SecurityID') + }).then(() => { + this.handleBrowse(parentId, null, this.props.query); + const queuedFiles = this.props.queuedFiles.items.filter(file => fileIDs.includes(file.id)); + queuedFiles.forEach(file => { + if (file.queuedId) { + this.props.actions.queuedFiles.removeQueuedFile(file.queuedId); + } + }); + let transKey = 'AssetAdmin.BULK_ACTIONS_DELETE_SUCCESS_02'; + let transDefault = '%s folders/files were successfully deleted.'; + if (this.props.sectionConfig.filesAreVersioned && this.props.sectionConfig.archiveFiles) { + transKey = 'AssetAdmin.BULK_ACTIONS_ARCHIVE_SUCCESS_02'; + transDefault = '%s folders/files were successfully archived.'; + } + this.props.actions.toasts.success(_i18n.default.sprintf(_i18n.default._t(transKey, transDefault), fileIDs.length)); + this.props.actions.gallery.deselectFiles(); + this.refetchFolder(); + }).catch(async err => { + const message = await (0, _getJsonErrorMessage.default)(err); + this.props.actions.toasts.error(message); + }).finally(() => this.props.actions.confirmDeletion.reset()); + } + doUnpublish(ids) { + const files = ids.map(id => { + const result = this.findFile(id); + if (!result) { + throw new Error(`File selected for unpublishing cannot be found: ${id}`); + } else if (result.type === 'folder') { + throw new Error('Cannot unpublish folders'); + } + return result; + }); + const fileIDs = files.map(file => file.id); + const qs = fileIDs.map(id => `ids[]=${id}`).join('&'); + let url = `${this.props.sectionConfig.endpoints.readLiveOwnerCounts.url}?${qs}`; + return _Backend.default.get(url).then(async response => { + const responseJson = await response.json(); + const filesWithLiveUsage = responseJson.filter(fileObj => fileObj.count > 0); + const displayedMessages = filesWithLiveUsage.slice(0, 4).map(fileObj => fileObj.message); + const theRestLength = filesWithLiveUsage.slice(5).length; + let theRestMessage = ''; + if (theRestLength > 0) { + theRestMessage = _i18n.default.inject(_i18n.default._t('AssetAdmin.BULK_OWNED_WARNING_REMAINING', 'And {count} other file(s)'), { + count: theRestLength + }); + } + if (displayedMessages.length) { + const confirmationMessage = [_i18n.default.inject(_i18n.default._t('AssetAdmin.BULK_OWNED_WARNING_HEADING', '{count} file(s) are being used by other published content.'), { + count: displayedMessages.length + }), ...displayedMessages, theRestMessage, _i18n.default._t('AssetAdmin.BULK_OWNED_WARNING_FOOTER', 'Unpublishing will only remove files from the published version of the content. They will remain on the draft version. Unpublish anyway?')].filter(s => s).join('\n\n'); + if (!confirm(confirmationMessage)) { + return Promise.reject(); + } + } + return Promise.resolve(); + }).then(() => { + url = this.props.sectionConfig.endpoints.unpublish.url; + return _Backend.default.post(url, { + ids: fileIDs + }, { + 'X-SecurityID': _Config.default.get('SecurityID') + }).catch(async err => { + const message = await (0, _getJsonErrorMessage.default)(err); + this.props.actions.toasts.error(message); + }); + }).then(() => { + this.refetchFolder(); + return files; + }).catch(async err => { + const message = await (0, _getJsonErrorMessage.default)(err); + this.props.actions.toasts.error(message); + return []; + }); + } + handleUnpublish(fileIds) { + return this.doUnpublish(fileIds).then(files => { + const { + fileId + } = this.props; + this.refetchFolder().then(() => { + if (fileId && files.find(file => file.id === fileId)) { + this.props.resetFileDetails(this.getFolderId(), fileId, this.props.query); + } + }); + }); + } + doPublish(ids) { + const files = ids.map(id => { + const result = this.findFile(id); + if (!result) { + throw new Error(`File selected for publishing cannot be found: ${id}`); + } else if (result.type === 'folder') { + throw new Error('Cannot publish folders'); + } + return result; + }); + const fileIDs = files.map(file => file.id); + const url = this.props.sectionConfig.endpoints.publish.url; + return _Backend.default.post(url, { + ids: fileIDs + }, { + 'X-SecurityID': _Config.default.get('SecurityID') + }).then(() => { + files.forEach(file => this.resetFile(file)); + this.refetchFolder(); + return files; + }).catch(async err => { + const message = await (0, _getJsonErrorMessage.default)(err); + this.props.actions.toasts.error(message); + }); + } + findFile(fileId) { + const allFiles = this.getFiles(); + return allFiles.find(item => item.id === parseInt(fileId, 10)); + } + handleUpload() {} + handleUploadQueue() { + if (this.props.fileId) { + this.refetchFolder(); + } + } + handleCreateFolder() { + this.props.onBrowse(this.getFolderId(), null, this.props.query, _index.default.ACTIONS.CREATE_FOLDER); + } + handleMoveFilesSuccess(folderId, fileIds) { + const files = this.props.queuedFiles.items.filter(file => fileIds.includes(file.id)); + files.forEach(file => { + if (file.queuedId) { + this.props.actions.queuedFiles.removeQueuedFile(file.queuedId); + } + }); + this.props.actions.gallery.deselectFiles(); + this.refetchFolder(); + } + renderGallery() { + const { + GalleryComponent + } = this.props; + const config = this.props.sectionConfig; + const createFileApiUrl = config.endpoints.createFile.url; + const createFileApiMethod = config.endpoints.createFile.method; + const limit = this.props.query && parseInt(this.props.query.limit || config.limit, 10); + const page = this.props.query && parseInt(this.props.query.page || 1, 10); + const sort = this.props.query && this.props.query.sort; + const view = this.props.query && this.props.query.view; + const filters = this.props.query.filter || {}; + const folder = this.state.folder; + const loading = this.state.loading; + return _react.default.createElement(GalleryComponent, { + files: this.getFiles(), + fileId: this.props.fileId, + folderId: this.getFolderId(), + folder: folder, + type: this.props.type, + limit: limit, + page: page, + totalCount: this.state.totalCount, + view: view, + filters: filters, + createFileApiUrl: createFileApiUrl, + createFileApiMethod: createFileApiMethod, + onInsertMany: this.props.onInsertMany, + onPublish: this.doPublish, + onUnpublish: this.doUnpublish, + onOpenFile: this.handleOpenFile, + onOpenFolder: this.handleOpenFolder, + onSuccessfulUpload: this.handleUpload, + onSuccessfulUploadQueue: this.handleUploadQueue, + onCreateFolder: this.handleCreateFolder, + onMoveFilesSuccess: this.handleMoveFilesSuccess, + onClearSearch: this.handleClearSearch, + onSort: this.handleSort, + onSetPage: this.handleSetPage, + onViewChange: this.handleViewChange, + sort: sort, + sectionConfig: config, + loading: loading, + maxFilesSelect: this.props.maxFiles, + dialog: this.props.dialog + }); + } + renderEditor() { + const { + sectionConfig: config, + viewAction, + type, + fileId, + dialog, + requireLinkText, + fileSelected, + EditorComponent + } = this.props; + const { + schemaUrl, + targetId + } = (0, _getFormSchema.default)({ + config, + viewAction, + folderId: this.getFolderId(), + type, + fileId + }); + if (!schemaUrl) { + return null; + } + const schemaUrlQueries = []; + if (requireLinkText) { + schemaUrlQueries.push({ + name: 'requireLinkText', + value: true + }); + } + if (fileSelected) { + schemaUrlQueries.push({ + name: 'fileSelected', + value: true + }); + } + const editorProps = { + dialog, + fileId: targetId, + schemaUrl, + schemaUrlQueries, + onClose: this.handleCloseFile, + onSubmit: this.handleSubmitEditor, + onUnpublish: this.handleUnpublish + }; + return _react.default.createElement(EditorComponent, editorProps); + } + render() { + const { + folderId, + query, + getUrl, + type, + maxFiles, + toolbarChildren, + SearchComponent, + BulkDeleteConfirmationComponent + } = this.props; + if (this.state.folder === null) { + return null; + } + const showBackButton = Boolean(folderId || (0, _Search.hasFilters)(query.filter)); + const searchFormSchemaUrl = this.props.sectionConfig.form.fileSearchForm.schemaUrl; + const filters = query.filter || {}; + const classNames = (0, _classnames.default)('fill-height asset-admin', type === 'select' && { + 'asset-admin--single-select': maxFiles === 1, + 'asset-admin--multi-select': maxFiles !== 1 + }); + const showSearch = (0, _Search.hasFilters)(query.filter) || this.props.showSearch; + const onSearchToggle = this.props.actions.displaySearch ? this.props.actions.displaySearch.toggleSearch : undefined; + const folder = this.state.folder; + const breadcrumbProps = { + folder, + query, + getUrl, + onBrowse: this.handleBrowse, + onFolderIcon: this.handleFolderIcon + }; + return _react.default.createElement("div", { + className: classNames + }, _react.default.createElement(_Toolbar.default, { + showBackButton: showBackButton, + onBackButtonClick: this.handleBackButtonClick + }, folder && _react.default.createElement(_AssetAdminBreadcrumb.default, breadcrumbProps), _react.default.createElement("div", { + className: "asset-admin__toolbar-extra pull-xs-right fill-width vertical-align-items" + }, _react.default.createElement(_SearchToggle.default, { + toggled: showSearch, + onToggle: onSearchToggle + }), toolbarChildren)), showSearch && _react.default.createElement(SearchComponent, { + onSearch: this.handleDoSearch, + id: "AssetSearchForm", + formSchemaUrl: searchFormSchemaUrl, + onHide: this.handleClearSearch, + displayBehavior: "HIDEABLE", + filters: filters, + name: "name" + }), _react.default.createElement("div", { + className: "flexbox-area-grow fill-width fill-height gallery" + }, this.renderGallery(), this.renderEditor()), _react.default.createElement(BulkDeleteConfirmationComponent, { + onConfirm: this.handleDelete, + filesAreVersioned: this.props.sectionConfig.filesAreVersioned, + archiveFiles: this.props.sectionConfig.archiveFiles + })); + } +} +exports.Component = AssetAdmin; +AssetAdmin.propTypes = { + dialog: _propTypes.default.bool, + sectionConfig: _configShape.default, + fileId: _propTypes.default.number, + folderId: _propTypes.default.number, + resetFileDetails: _propTypes.default.func, + onBrowse: _propTypes.default.func, + onReplaceUrl: _propTypes.default.func, + onInsertMany: _propTypes.default.func, + getUrl: _propTypes.default.func, + query: _propTypes.default.shape({ + sort: _propTypes.default.string, + limit: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), + page: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), + filter: _propTypes.default.object + }), + onSubmitEditor: _propTypes.default.func, + type: _propTypes.default.oneOf(['insert-media', 'insert-link', 'select', 'admin']), + queuedFiles: _propTypes.default.shape({ + items: _propTypes.default.array.isRequired + }), + filesTotalCount: _propTypes.default.number, + loading: _propTypes.default.bool, + actions: _propTypes.default.object, + maxFiles: _propTypes.default.number, + fileSelected: _propTypes.default.bool, + EditorComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]), + GalleryComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]), + SearchComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]), + BulkDeleteConfirmationComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +AssetAdmin.defaultProps = { + type: 'admin', + query: { + sort: '', + limit: null, + page: 0, + filter: {} + }, + maxFiles: null, + EditorComponent: _Editor.default, + GalleryComponent: _Gallery.default, + SearchComponent: _Search.default, + BulkDeleteConfirmationComponent: _BulkDeleteConfirmation.default +}; +function mapStateToProps(state, ownProps) { + const { + formSchema + } = state.assetAdmin.modal; + return { + securityId: state.config.SecurityID, + queuedFiles: state.assetAdmin.queuedFiles, + showSearch: state.assetAdmin.displaySearch.isOpen, + type: formSchema && formSchema.type || ownProps.type + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + gallery: (0, _redux.bindActionCreators)(galleryActions, dispatch), + toasts: (0, _redux.bindActionCreators)(toastsActions, dispatch), + displaySearch: (0, _redux.bindActionCreators)(displaySearchActions, dispatch), + queuedFiles: (0, _redux.bindActionCreators)(queuedFilesActions, dispatch), + confirmDeletion: (0, _redux.bindActionCreators)(confirmDeletionActions, dispatch) + } + }; +} +var _default = exports["default"] = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(AssetAdmin); + +/***/ }), + +/***/ "./client/src/containers/AssetAdmin/AssetAdminBreadcrumb.js": +/*!******************************************************************!*\ + !*** ./client/src/containers/AssetAdmin/AssetAdminBreadcrumb.js ***! + \******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _Breadcrumb = __webpack_require__(/*! components/Breadcrumb/Breadcrumb */ "components/Breadcrumb/Breadcrumb"); +var _Search = __webpack_require__(/*! components/Search/Search */ "components/Search/Search"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const AssetAdminBreadcrumb = _ref => { + let { + folder, + query, + getUrl, + onBrowse, + onFolderIcon, + PlainBreadcrumbComponent + } = _ref; + const handleClick = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return event => { + event.preventDefault(); + onBrowse(...args); + }; + }; + const hrefBuilder = function () { + return getUrl && getUrl(...arguments); + }; + const breadcrumbs = [{ + text: _i18n.default._t('AssetAdmin.FILES', 'Files'), + href: hrefBuilder(0, null, query), + onClick: handleClick(0, null, query) + }]; + if (folder && folder.id) { + if (folder.ancestors) { + folder.ancestors.forEach(parent => { + breadcrumbs.push({ + text: parent.title, + href: hrefBuilder(parent.id, null, query), + onClick: handleClick(parent.id, null, query) + }); + }); + } + const icons = [{ + className: 'icon font-icon-edit-list', + onClick: e => { + e.preventDefault(); + onFolderIcon(); + } + }]; + if (folder.hasRestrictedAccess) { + icons.push({ + nodeName: 'FileStatusIcon', + hasRestrictedAccess: true + }); + } + breadcrumbs.push({ + text: folder.title, + href: hrefBuilder(folder.id, null, query), + onClick: handleClick(folder.id, null, query), + icons + }); + } + if ((0, _Search.hasFilters)(query.filter)) { + breadcrumbs.push({ + text: _i18n.default._t('LeftAndMain.SEARCHRESULTS', 'Search results') + }); + } + return _react.default.createElement(PlainBreadcrumbComponent, { + multiline: true, + crumbs: breadcrumbs + }); +}; +AssetAdminBreadcrumb.propTypes = { + onBrowse: _propTypes.default.func, + onFolderIcon: _propTypes.default.func, + getUrl: _propTypes.default.func, + query: _propTypes.default.shape({ + sort: _propTypes.default.string, + limit: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), + page: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), + filter: _propTypes.default.object, + view: _propTypes.default.string + }), + folder: _propTypes.default.shape({ + id: _propTypes.default.number, + title: _propTypes.default.string, + ancestors: _propTypes.default.array, + parentId: _propTypes.default.number, + canView: _propTypes.default.bool, + canEdit: _propTypes.default.bool + }), + PlainBreadcrumbComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +AssetAdminBreadcrumb.defaultProps = { + PlainBreadcrumbComponent: _Breadcrumb.Component +}; +var _default = exports["default"] = AssetAdminBreadcrumb; + +/***/ }), + +/***/ "./client/src/containers/AssetAdmin/AssetAdminRouter.js": +/*!**************************************************************!*\ + !*** ./client/src/containers/AssetAdmin/AssetAdminRouter.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Component = void 0; +exports.buildUrl = buildUrl; +exports["default"] = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _reactRouterDom = __webpack_require__(/*! react-router-dom */ "react-router-dom"); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _withRouter = _interopRequireWildcard(__webpack_require__(/*! lib/withRouter */ "lib/withRouter")); +var _AssetAdmin = _interopRequireDefault(__webpack_require__(/*! containers/AssetAdmin/AssetAdmin */ "./client/src/containers/AssetAdmin/AssetAdmin.js")); +var _DataFormat = __webpack_require__(/*! lib/DataFormat */ "lib/DataFormat"); +var _qs = _interopRequireDefault(__webpack_require__(/*! qs */ "qs")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _configShape = _interopRequireDefault(__webpack_require__(/*! lib/configShape */ "./client/src/lib/configShape.js")); +var _urls = __webpack_require__(/*! lib/urls */ "lib/urls"); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const sectionConfigKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; +const actions = Object.keys(_index.default.ACTIONS).map(key => _index.default.ACTIONS[key]); +function buildUrl(_ref) { + let { + base, + folderId, + fileId, + query, + action + } = _ref; + if (action && actions.indexOf(action) === -1) { + throw new Error(`Invalid action provided: ${action}`); + } + let url = null; + if (fileId) { + url = (0, _urls.joinUrlPaths)(base, `show/${folderId}/${_index.default.ACTIONS.EDIT_FILE}/${fileId}`); + } else if (folderId) { + url = (0, _urls.joinUrlPaths)(base, `show/${folderId}`); + } else { + url = base; + } + if (action === _index.default.ACTIONS.CREATE_FOLDER) { + url = (0, _urls.joinUrlPaths)(base, `show/${folderId || 0}/${action}`); + } + const hasQuery = query && Object.keys(query).length > 0; + if (hasQuery) { + url = `${url}?${_qs.default.stringify(query)}`; + } + return url; +} +class AssetAdminRouter extends _react.Component { + constructor(props) { + super(props); + this.handleBrowse = this.handleBrowse.bind(this); + this.handleReplaceUrl = this.handleReplaceUrl.bind(this); + this.handleResetDetails = this.handleResetDetails.bind(this); + this.getUrl = this.getUrl.bind(this); + } + getUrl() { + let folderId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + let fileId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + let action = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _index.default.ACTIONS.EDIT_FILE; + const newFolderId = parseInt(folderId || 0, 10); + const newFileId = parseInt(fileId || 0, 10); + const hasFolderChanged = newFolderId !== this.getFolderId(); + const newQuery = Object.assign({}, query); + if (hasFolderChanged || newQuery.page <= 1) { + delete newQuery.page; + } + return buildUrl({ + base: `/${this.props.sectionConfig.reactRoutePath}`, + folderId: newFolderId, + fileId: newFileId, + query: newQuery, + action + }); + } + getFolderId() { + if (this.props.router.params && this.props.router.params.folderId) { + return parseInt(this.props.router.params.folderId, 10); + } + return 0; + } + getFileId() { + if (this.props.router.params && this.props.router.params.fileId) { + return parseInt(this.props.router.params.fileId, 10); + } + return 0; + } + getViewAction() { + if (this.props.router.params && this.props.router.params.viewAction) { + return this.props.router.params.viewAction; + } + return _index.default.ACTIONS.EDIT_FILE; + } + getSectionProps() { + return { + sectionConfig: this.props.sectionConfig, + type: 'admin', + folderId: this.getFolderId(), + viewAction: this.getViewAction(), + fileId: this.getFileId(), + query: this.getQuery(), + getUrl: this.getUrl, + onBrowse: this.handleBrowse, + onReplaceUrl: this.handleReplaceUrl, + resetFileDetails: this.handleResetDetails + }; + } + getQuery() { + return (0, _DataFormat.decodeQuery)(this.props.router.location.search); + } + handleBrowse(folderId, fileId, query, action) { + const pathname = this.getUrl(folderId, fileId, query, action); + this.props.router.navigate(pathname); + } + handleReplaceUrl(folderId, fileId, query, action) { + const pathname = this.getUrl(folderId, fileId, query, action); + this.props.router.navigate(pathname, { + replace: true + }); + } + handleResetDetails(folderId, fileId, query) { + const currentPathname = this.getUrl(folderId, fileId, query); + const clearPathname = this.getUrl(folderId, null, query); + this.props.router.navigate(clearPathname, { + replace: true, + state: { + reset: true, + resetPath: currentPathname + } + }); + } + render() { + const { + AssetAdminComponent + } = this.props; + const locationState = this.props.router.location.state; + if (locationState && locationState && locationState.reset) { + return _react.default.createElement(_reactRouterDom.Navigate, { + to: locationState.resetPath, + replace: true + }); + } + if (!this.props.sectionConfig) { + return null; + } + return _react.default.createElement(AssetAdminComponent, this.getSectionProps()); + } +} +exports.Component = AssetAdminRouter; +AssetAdminRouter.propTypes = { + sectionConfig: _configShape.default, + router: _withRouter.routerPropTypes, + AssetAdminComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +AssetAdminRouter.defaultProps = { + AssetAdminComponent: _AssetAdmin.default +}; +function mapStateToProps(state) { + const sectionConfig = state.config.sections.find(section => section.name === sectionConfigKey); + return { + sectionConfig + }; +} +var _default = exports["default"] = (0, _withRouter.default)((0, _reactRedux.connect)(mapStateToProps)(AssetAdminRouter)); + +/***/ }), + +/***/ "./client/src/containers/AssetAdmin/stateRouter.js": +/*!*********************************************************!*\ + !*** ./client/src/containers/AssetAdmin/stateRouter.js ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.AssetAdminStateRouter = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _AssetAdminRouter = __webpack_require__(/*! containers/AssetAdmin/AssetAdminRouter */ "./client/src/containers/AssetAdmin/AssetAdminRouter.js"); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _ModalActions = __webpack_require__(/*! state/modal/ModalActions */ "./client/src/state/modal/ModalActions.js"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const sectionConfigKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; +const initialState = { + folderId: null, + fileId: null, + query: {}, + action: _index.default.ACTIONS.EDIT_FILE +}; +class AssetAdminStateRouter extends _react.Component { + constructor(props) { + super(props); + this.handleBrowse = this.handleBrowse.bind(this); + this.getUrl = this.getUrl.bind(this); + this.state = Object.assign({}, initialState, { + folderId: props.folderId + }); + } + getUrl() { + let folderId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + let fileId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + let action = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _index.default.ACTIONS.EDIT_FILE; + const newFolderId = parseInt(folderId || 0, 10); + const newFileId = parseInt(fileId || 0, 10); + const oldFolderId = this.getFolderId(); + const hasFolderChanged = newFolderId !== oldFolderId && oldFolderId !== null; + const newQuery = Object.assign({}, query); + if (hasFolderChanged || newQuery.page <= 1) { + delete newQuery.page; + } + return (0, _AssetAdminRouter.buildUrl)({ + base: this.props.sectionConfig.reactRoutePath, + folderId: newFolderId, + fileId: newFileId, + query: newQuery, + action + }); + } + getFolderId() { + if (this.state.folderId === null) { + return null; + } + return parseInt(this.state.folderId || 0, 10); + } + getFileId() { + return parseInt(this.state.fileId || this.props.fileId || 0, 10); + } + getViewAction() { + return this.state.action || _index.default.ACTIONS.EDIT_FILE; + } + getSectionProps() { + const props = Object.assign({}, this.props, { + folderId: this.getFolderId(), + fileId: this.getFileId(), + viewAction: this.getViewAction(), + query: this.state.query, + getUrl: this.getUrl, + onBrowse: this.handleBrowse + }); + delete props.Component; + return props; + } + handleBrowse(folderId, fileId) { + let query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + let action = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _index.default.ACTIONS.EDIT_FILE; + if (action && Object.values(_index.default.ACTIONS).indexOf(action) === -1) { + throw new Error(`Invalid action provided: ${action}`); + } + if (this.state.fileId !== fileId) { + this.props.actions.resetFormStack(); + } + this.setState({ + folderId, + fileId, + query, + action + }); + } + render() { + const sectionProps = this.getSectionProps(); + const AssetAdmin = this.props.Component; + return _react.default.createElement(AssetAdmin, sectionProps); + } +} +exports.AssetAdminStateRouter = AssetAdminStateRouter; +AssetAdminStateRouter.propTypes = { + Component: _propTypes.default.elementType, + sectionConfig: _propTypes.default.shape({ + url: _propTypes.default.string.isRequired + }).isRequired, + fileId: _propTypes.default.number +}; +function mapDispatchToProps(dispatch) { + return { + actions: { + resetFormStack: () => dispatch((0, _ModalActions.resetFormStack)()) + } + }; +} +function stateRouter(AssetAdmin) { + function mapStateToProps(state) { + const sectionConfig = state.config.sections.find(section => section.name === sectionConfigKey); + return { + Component: AssetAdmin, + sectionConfig + }; + } + return (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(AssetAdminStateRouter); +} +var _default = exports["default"] = stateRouter; + +/***/ }), + +/***/ "./client/src/containers/BulkDeleteConfirmation/BulkDeleteConfirmation.js": +/*!********************************************************************************!*\ + !*** ./client/src/containers/BulkDeleteConfirmation/BulkDeleteConfirmation.js ***! + \********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var confirmDeletionActions = _interopRequireWildcard(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionActions */ "./client/src/state/confirmDeletion/ConfirmDeletionActions.js")); +var TRANSITIONS = _interopRequireWildcard(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionTransitions */ "./client/src/state/confirmDeletion/ConfirmDeletionTransitions.js")); +var toastsActions = _interopRequireWildcard(__webpack_require__(/*! state/toasts/ToastsActions */ "state/toasts/ToastsActions")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _fileShape = _interopRequireDefault(__webpack_require__(/*! lib/fileShape */ "./client/src/lib/fileShape.js")); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var _getJsonErrorMessage = _interopRequireDefault(__webpack_require__(/*! lib/getJsonErrorMessage */ "lib/getJsonErrorMessage")); +var _DeletionModal = _interopRequireDefault(__webpack_require__(/*! ./DeletionModal */ "./client/src/containers/BulkDeleteConfirmation/DeletionModal.js")); +var _BulkDeleteMessage = _interopRequireDefault(__webpack_require__(/*! ./BulkDeleteMessage */ "./client/src/containers/BulkDeleteConfirmation/BulkDeleteMessage.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +const BulkDeleteConfirmation = _ref => { + let { + LoadingComponent, + transition, + files, + onModalClose, + onCancel, + onConfirm, + filesAreVersioned, + archiveFiles, + actions + } = _ref; + const [isLoading, setIsLoading] = (0, _react.useState)(true); + const [fileCounts, setFileCounts] = (0, _react.useState)({}); + (0, _react.useEffect)(() => { + const sectionKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; + const config = _Config.default.getSection(sectionKey); + const fileIDs = files.map(fild => fild.id); + const qs = fileIDs.map(id => `ids[]=${id}`).join('&'); + const url = `${config.endpoints.readDescendantCounts.url}?${qs}`; + setIsLoading(true); + _Backend.default.get(url).then(async response => { + const responseJson = await response.json(); + setIsLoading(false); + setFileCounts(responseJson); + }).catch(async err => { + const message = await (0, _getJsonErrorMessage.default)(err); + actions.toasts.error(message); + }); + }, [files]); + let body = null; + const transKey = filesAreVersioned && archiveFiles ? 'AssetAdmin.ARCHIVE' : 'AssetAdmin.DELETE'; + const transDefault = filesAreVersioned && archiveFiles ? 'Archive' : 'Delete'; + let deleteModalActions = [{ + label: _i18n.default._t(transKey, transDefault), + handler: () => onConfirm(files.map(_ref2 => { + let { + id + } = _ref2; + return id; + })), + color: 'danger' + }, { + label: _i18n.default._t('AssetAdmin.CANCEL', 'Cancel'), + handler: onCancel + }]; + if (isLoading) { + body = _react.default.createElement(LoadingComponent, null); + } else { + const topLevelFolderCount = fileCounts.filter(r => r.type === 'folder').length; + const topLevelFileCount = fileCounts.filter(r => r.type === 'file').length; + const descendantFileCount = fileCounts.reduce((t, r) => t + r.count, 0); + const bodyProps = { + topLevelFolderCount, + topLevelFileCount, + descendantFileCount, + filesAreVersioned, + archiveFiles + }; + body = _react.default.createElement(_BulkDeleteMessage.default, bodyProps); + if (topLevelFileCount + descendantFileCount > 0) { + deleteModalActions = [{ + label: _i18n.default._t('AssetAdmin.CANCEL', 'Cancel'), + handler: onCancel, + color: 'primary' + }, { + label: _i18n.default._t(transKey, transDefault), + handler: () => onConfirm(files.map(_ref3 => { + let { + id + } = _ref3; + return id; + })), + color: 'danger' + }]; + } + } + const isOpen = ![TRANSITIONS.CANCELING, TRANSITIONS.DELETING].includes(transition); + return _react.default.createElement(_DeletionModal.default, { + body: body, + isOpen: isOpen, + actions: deleteModalActions, + onCancel: onCancel, + onClosed: onModalClose, + filesAreVersioned: filesAreVersioned, + archiveFiles: archiveFiles + }); +}; +exports.Component = BulkDeleteConfirmation; +BulkDeleteConfirmation.propTypes = { + LoadingComponent: _propTypes.default.elementType, + transition: _propTypes.default.oneOf(['canceling', 'deleting', false]), + files: _propTypes.default.arrayOf(_fileShape.default), + descendantFileCounts: _propTypes.default.object, + onCancel: _propTypes.default.func.isRequired, + onModalClose: _propTypes.default.func.isRequired, + onConfirm: _propTypes.default.func.isRequired, + filesAreVersioned: _propTypes.default.bool.isRequired, + archiveFiles: _propTypes.default.bool.isRequired, + actions: _propTypes.default.object.isRequired +}; +const ConnectedModal = (0, _redux.compose)((0, _Injector.inject)(['Loading'], Loading => ({ + LoadingComponent: Loading +})))(BulkDeleteConfirmation); +const ConditionalModal = _ref4 => { + let { + showConfirmation, + files, + ...props + } = _ref4; + return showConfirmation && files.length > 0 ? _react.default.createElement(ConnectedModal, _extends({}, props, { + files: files + })) : null; +}; +const mapStateToProps = _ref5 => { + let { + assetAdmin: { + confirmDeletion + } + } = _ref5; + return confirmDeletion; +}; +const mapDispatchToProps = dispatch => ({ + onCancel: () => dispatch(confirmDeletionActions.cancel()), + onModalClose: () => dispatch(confirmDeletionActions.modalClose()), + actions: { + toasts: (0, _redux.bindActionCreators)(toastsActions, dispatch), + confirmation: (0, _redux.bindActionCreators)(confirmDeletionActions, dispatch) + } +}); +var _default = exports["default"] = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(ConditionalModal); + +/***/ }), + +/***/ "./client/src/containers/BulkDeleteConfirmation/BulkDeleteMessage.js": +/*!***************************************************************************!*\ + !*** ./client/src/containers/BulkDeleteConfirmation/BulkDeleteMessage.js ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const confirmationMessage = (topLevelFolderCount, topLevelFileCount, descendantFileCount, filesAreVersioned, archiveFiles) => { + const fileCount = topLevelFileCount + descendantFileCount; + if (fileCount > 0) { + let transKey = 'AssetAdmin.BULK_ACTIONS_DELETE_ITEMS_CONFIRM'; + let transDefault = ["You're about to delete %s file(s) which may be used in your site's content.", 'Carefully check the file usage on the files before deleting the file(s).'].join(' '); + if (filesAreVersioned && archiveFiles) { + transKey = 'AssetAdmin.BULK_ACTIONS_ARCHIVE_ITEMS_CONFIRM'; + transDefault = ["You're about to archive %s file(s) which may be used in your site's content.", 'Carefully check the file usage on the files before archiving the file(s).'].join(' '); + } + return _i18n.default.sprintf(_i18n.default._t(transKey, transDefault), fileCount); + } else if (topLevelFolderCount === 1) { + let transKey = 'AssetAdmin.BULK_ACTIONS_DELETE_FOLDER_CONFIRM'; + let transDefault = 'Are you sure you want to delete this folder?'; + if (filesAreVersioned && archiveFiles) { + transKey = 'AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDER_CONFIRM'; + transDefault = 'Are you sure you want to archive this folder?'; + } + return _i18n.default._t(transKey, transDefault); + } + let transKey = 'AssetAdmin.BULK_ACTIONS_DELETE_FOLDERS_CONFIRM'; + let transDefault = 'Are you sure you want to delete these folders?'; + if (filesAreVersioned && archiveFiles) { + transKey = 'AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDERS_CONFIRM'; + transDefault = 'Are you sure you want to archive these folders?'; + } + return _i18n.default._t(transKey, transDefault); +}; +const BulkDeleteMessage = _ref => { + let { + topLevelFolderCount, + topLevelFileCount, + descendantFileCount, + filesAreVersioned, + archiveFiles + } = _ref; + let transKey = 'AssetAdmin.BULK_ACTIONS_DELETE_WARNING'; + let transDefault = 'Ensure files are removed from content areas prior to deleting them, otherwise they will ' + 'appear as broken links.'; + if (filesAreVersioned && archiveFiles) { + transKey = 'AssetAdmin.BULK_ACTIONS_ARCHIVE_WARNING'; + transDefault = 'Ensure files are removed from content areas prior to archiving them, otherwise they will ' + 'appear as broken links.'; + } + const message = confirmationMessage(topLevelFolderCount, topLevelFileCount, descendantFileCount, filesAreVersioned, archiveFiles); + return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("p", null, message), topLevelFileCount + descendantFileCount > 0 && _react.default.createElement("p", null, _i18n.default._t(transKey, transDefault))); +}; +BulkDeleteMessage.propTypes = { + topLevelFolderCount: _propTypes.default.number, + topLevelFileCount: _propTypes.default.number, + descendantFileCount: _propTypes.default.number +}; +BulkDeleteMessage.defaultProps = { + topLevelFolderCount: 0, + topLevelFileCount: 0, + descendantFileCount: 0 +}; +var _default = exports["default"] = BulkDeleteMessage; + +/***/ }), + +/***/ "./client/src/containers/BulkDeleteConfirmation/DeletionModal.js": +/*!***********************************************************************!*\ + !*** ./client/src/containers/BulkDeleteConfirmation/DeletionModal.js ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _reactstrap = __webpack_require__(/*! reactstrap */ "reactstrap"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const DeletionModal = _ref => { + let { + isOpen, + body, + onCancel, + actions, + filesAreVersioned, + archiveFiles + } = _ref; + let transKey = 'AssetAdmin.CONFIRM_FILE_DELETION'; + let transDefault = 'Confirm deletion'; + if (filesAreVersioned && archiveFiles) { + transKey = 'AssetAdmin.CONFIRM_FILE_ARCHIVE'; + transDefault = 'Confirm archive'; + } + return _react.default.createElement(_reactstrap.Modal, { + isOpen: isOpen, + toggle: onCancel + }, _react.default.createElement(_reactstrap.ModalHeader, { + toggle: onCancel + }, _i18n.default._t(transKey, transDefault)), _react.default.createElement(_reactstrap.ModalBody, null, body), _react.default.createElement(_reactstrap.ModalFooter, null, actions.map(_ref2 => { + let { + label, + handler, + color + } = _ref2; + return _react.default.createElement(_reactstrap.Button, { + key: label, + color: color, + onClick: handler + }, label); + }))); +}; +DeletionModal.propTypes = { + isOpen: _propTypes.default.bool.isRequired, + body: _propTypes.default.node.isRequired, + onCancel: _propTypes.default.func.isRequired, + actions: _propTypes.default.arrayOf(_propTypes.default.shape({ + label: _propTypes.default.string.isRequired, + handler: _propTypes.default.func, + color: _propTypes.default.string + })), + filesAreVersioned: _propTypes.default.bool.isRequired, + archiveFiles: _propTypes.default.bool.isRequired +}; +var _default = exports["default"] = DeletionModal; + +/***/ }), + +/***/ "./client/src/containers/Editor/Editor.js": +/*!************************************************!*\ + !*** ./client/src/containers/Editor/Editor.js ***! + \************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _FormBuilderLoader = _interopRequireDefault(__webpack_require__(/*! containers/FormBuilderLoader/FormBuilderLoader */ "containers/FormBuilderLoader/FormBuilderLoader")); +var UnsavedFormsActions = _interopRequireWildcard(__webpack_require__(/*! state/unsavedForms/UnsavedFormsActions */ "state/unsavedForms/UnsavedFormsActions")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +var confirmDeletionActions = _interopRequireWildcard(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionActions */ "./client/src/state/confirmDeletion/ConfirmDeletionActions.js")); +var modalActions = _interopRequireWildcard(__webpack_require__(/*! state/modal/ModalActions */ "./client/src/state/modal/ModalActions.js")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _url = _interopRequireDefault(__webpack_require__(/*! url */ "url")); +var _qs = _interopRequireDefault(__webpack_require__(/*! qs */ "qs")); +var _EditorHeader = _interopRequireWildcard(__webpack_require__(/*! ./EditorHeader */ "./client/src/containers/Editor/EditorHeader.js")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +const formIdentifier = 'AssetAdmin.EditForm'; +class Editor extends _react.Component { + constructor(props) { + super(props); + this.getFormSchemaUrl = this.getFormSchemaUrl.bind(this); + this.handleCancelKeyDown = this.handleCancelKeyDown.bind(this); + this.handleClose = this.handleClose.bind(this); + this.handleSubmit = this.handleSubmit.bind(this); + this.handleAction = this.handleAction.bind(this); + this.handleLoadingSuccess = this.handleLoadingSuccess.bind(this); + this.handleLoadingError = this.handleLoadingError.bind(this); + this.handleFetchingSchema = this.handleFetchingSchema.bind(this); + this.createFn = this.createFn.bind(this); + this.editorHeader = this.editorHeader.bind(this); + this.state = { + loadingForm: false, + loadingError: null, + file: null + }; + } + componentDidMount() { + this.refetchFile(); + } + componentDidUpdate(prevProps) { + if (prevProps.fileId !== this.props.fileId && prevProps.fileId !== null) { + this.refetchFile(); + } + } + refetchFile() { + const sectionConfig = _Config.default.getSection('SilverStripe\\AssetAdmin\\Controller\\AssetAdminOpen'); + const endpointUrl = `${sectionConfig.endpoints.read.url}/${this.props.fileId}`; + _Backend.default.get(endpointUrl).then(response => response.json()).then(responseJson => { + this.setState({ + file: responseJson + }); + }); + } + getFormSchemaUrl() { + const { + schemaUrlQueries, + schemaUrl, + fileId + } = this.props; + const parsedURL = _url.default.parse(schemaUrl); + const parsedQs = schemaUrlQueries.reduce((accumulator, _ref) => { + let { + name, + value + } = _ref; + return { + ...accumulator, + [name]: value + }; + }, {}); + return _url.default.format({ + ...parsedURL, + pathname: `${parsedURL.path}/${fileId}`, + search: _qs.default.stringify(parsedQs) + }); + } + handleAction(event) { + const file = this.state.file; + switch (event.currentTarget.name) { + case 'action_replacefile': + this.replaceFile(); + event.preventDefault(); + break; + case 'action_downloadfile': + this.downloadFile(); + event.preventDefault(); + break; + case 'action_delete': + this.props.actions.confirmDeletion.confirm([file]); + event.preventDefault(); + break; + default: + break; + } + } + handleCancelKeyDown(event) { + if (event.keyCode === _index.default.SPACE_KEY_CODE || event.keyCode === _index.default.RETURN_KEY_CODE) { + this.handleClose(event); + } + } + handleSubmit(data, action, submitFn) { + const { + showingSubForm, + actions + } = this.props; + if (typeof this.props.onSubmit === 'function') { + return this.props.onSubmit(data, action, submitFn).finally(() => { + if (showingSubForm && ['action_save', 'action_publish'].indexOf(action) !== -1) { + actions.modal.popFormStackEntry(); + } + }); + } + return submitFn(); + } + handleClose(event) { + const { + showingSubForm, + onClose, + actions + } = this.props; + if (showingSubForm) { + actions.modal.popFormStackEntry(); + } else { + onClose(); + } + if (event) { + event.preventDefault(); + } + } + replaceFile() { + const hiddenFileInput = document.querySelector('.dz-input-PreviewImage'); + if (hiddenFileInput) { + hiddenFileInput.click(); + } + } + downloadFile() { + function downloadURI(uri, name) { + const link = document.createElement('a'); + link.download = name; + link.href = uri; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } + const file = this.state.file; + downloadURI(file.url, file.name); + document.getElementById('Form_fileEditForm_PopoverActions').focus(); + } + handleLoadingError(exception) { + this.setState({ + loadingForm: false, + loadingError: exception.errors[0] + }); + } + handleLoadingSuccess() { + this.setState({ + loadingForm: false, + loadingError: null + }); + } + handleFetchingSchema() { + this.setState({ + loadingForm: true + }); + } + editorHeader(_ref2) { + let { + SchemaComponent, + ...fieldProps + } = _ref2; + const { + dialog, + nextType, + showingSubForm, + actions, + EditorHeaderComponent + } = this.props; + const schemaUrl = this.getFormSchemaUrl(); + const file = this.state.file; + let showButton = _EditorHeader.buttonStates.SWITCH; + if (dialog && file && file.type !== 'folder') { + showButton = showingSubForm ? _EditorHeader.buttonStates.ALWAYS_BACK : _EditorHeader.buttonStates.ONLY_BACK; + } + const { + formid + } = fieldProps; + const onDetails = nextType && file && file.type !== 'folder' ? () => { + actions.modal.stashFormValues(formid, schemaUrl); + actions.modal.pushFormStackEntry(nextType); + } : undefined; + const props = { + onCancel: this.handleClose, + showButton, + onDetails + }; + return _react.default.createElement(EditorHeaderComponent, props, _react.default.createElement(SchemaComponent, fieldProps)); + } + createFn(SchemaComponent, componentProps) { + if (componentProps.name === 'AssetEditorHeaderFieldGroup') { + const CreatedEditorHeader = this.editorHeader; + const editorHeaderProps = { + key: componentProps.id, + SchemaComponent, + ...componentProps + }; + return _react.default.createElement(CreatedEditorHeader, editorHeaderProps); + } + return _react.default.createElement(SchemaComponent, _extends({ + key: componentProps.id + }, componentProps)); + } + render() { + if (!this.state.file) { + return null; + } + const { + FormBuilderLoaderComponent + } = this.props; + const formSchemaUrl = this.getFormSchemaUrl(); + const editorClasses = (0, _classnames.default)('panel', 'form--no-dividers', 'editor', { + 'editor--asset-dropzone--disable': !this.props.enableDropzone + }, this.props.className); + let error = null; + if (this.state.loadingError) { + let message = this.state.loadingError.value; + if (this.state.loadingError.code === 404) { + message = _i18n.default._t('AssetAdmin.FILE_MISSING', 'File cannot be found'); + } + if (!message) { + message = _i18n.default._t('Admin.UNKNOWN_ERROR', 'An unknown error has occurred'); + } + error = _react.default.createElement("div", { + className: "editor__file-preview-message--file-missing" + }, message); + } + const Loading = this.props.loadingComponent; + return _react.default.createElement("div", { + className: editorClasses + }, _react.default.createElement("div", { + className: "editor__details fill-height" + }, _react.default.createElement(FormBuilderLoaderComponent, { + identifier: formIdentifier, + schemaUrl: formSchemaUrl, + onSubmit: this.handleSubmit, + onAction: this.handleAction, + onLoadingSuccess: this.handleLoadingSuccess, + onLoadingError: this.handleLoadingError, + onFetchingSchema: this.handleFetchingSchema, + createFn: this.createFn, + file: this.state.file + }), error, this.state.loadingForm && _react.default.createElement(Loading, null))); + } +} +exports.Component = Editor; +Editor.propTypes = { + className: _propTypes.default.string, + fileId: _propTypes.default.number.isRequired, + enableDropzone: _propTypes.default.bool, + dialog: _propTypes.default.bool, + onClose: _propTypes.default.func.isRequired, + onSubmit: _propTypes.default.func.isRequired, + schemaUrl: _propTypes.default.string.isRequired, + schemaUrlQueries: _propTypes.default.arrayOf(_propTypes.default.shape({ + name: _propTypes.default.string, + value: _propTypes.default.any + })), + actions: _propTypes.default.object, + showingSubForm: _propTypes.default.bool, + nextType: _propTypes.default.string, + EditorHeaderComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]), + FormBuilderLoaderComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +Editor.defaultProps = { + EditorHeaderComponent: _EditorHeader.default, + FormBuilderLoaderComponent: _FormBuilderLoader.default +}; +function mapDispatchToProps(dispatch) { + return { + actions: { + unsavedForms: (0, _redux.bindActionCreators)(UnsavedFormsActions, dispatch), + confirmDeletion: (0, _redux.bindActionCreators)(confirmDeletionActions, dispatch), + modal: (0, _redux.bindActionCreators)(modalActions, dispatch) + } + }; +} +function mapStateToProps(_ref3) { + let { + assetAdmin: { + gallery, + modal + } + } = _ref3; + return { + enableDropzone: gallery.enableDropzone, + nextType: modal.formSchema && modal.formSchema.nextType, + showingSubForm: modal.formSchemaStack && modal.formSchemaStack.length > 1 + }; +} +var _default = exports["default"] = (0, _redux.compose)((0, _Injector.inject)(['Loading'], Loading => ({ + loadingComponent: Loading +}), () => 'AssetAdmin.Editor'), (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(Editor); + +/***/ }), + +/***/ "./client/src/containers/Editor/EditorHeader.js": +/*!******************************************************!*\ + !*** ./client/src/containers/Editor/EditorHeader.js ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.buttonStates = void 0; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _Button = _interopRequireDefault(__webpack_require__(/*! components/Button/Button */ "components/Button/Button")); +var _BackButton = _interopRequireDefault(__webpack_require__(/*! components/Button/BackButton */ "components/Button/BackButton")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const handle = handler => e => { + e.preventDefault(); + if (handler) { + handler(); + } +}; +const ALWAYS_BACK = 'ALWAYS_BACK'; +const ALWAYS_CANCEL = 'ALWAYS_CANCEL'; +const SWITCH = 'SWITCH'; +const ONLY_BACK = 'ONLY_BACK'; +const ONLY_CANCEL = 'ONLY_CANCEL'; +const NONE = 'NONE'; +const buttonStates = exports.buttonStates = { + ALWAYS_BACK, + ALWAYS_CANCEL, + SWITCH, + ONLY_BACK, + ONLY_CANCEL, + NONE +}; +const EditorHeader = _ref => { + let { + onCancel, + onDetails, + showButton, + children + } = _ref; + const cancelHandler = handle(onCancel); + const showBack = [ALWAYS_BACK, SWITCH, ONLY_BACK].indexOf(showButton) >= 0; + const showCancel = [ALWAYS_CANCEL, SWITCH, ONLY_CANCEL].indexOf(showButton) >= 0; + const backClassName = (0, _classnames.default)('editor-header__back-button', 'btn--icon-xl', { + 'editor-header__back-button--md-below': [SWITCH, ONLY_BACK].indexOf(showButton) >= 0 + }); + const cancelClassName = (0, _classnames.default)('editor-header__cancel-button', 'btn--icon-xl', { + 'editor-header__cancel-button--lg-above': [SWITCH, ONLY_CANCEL].indexOf(showButton) >= 0 + }); + return _react.default.createElement("div", { + className: "editor-header" + }, showBack && _react.default.createElement(_BackButton.default, { + className: backClassName, + onClick: cancelHandler + }), _react.default.createElement("div", { + className: "editor-header__field" + }, children), onDetails && _react.default.createElement(_Button.default, { + onClick: handle(onDetails), + icon: "edit-list", + className: "editor-header__edit", + outline: true + }, _i18n.default._t('AssetAdmin.DETAILS', 'Details')), showCancel && _react.default.createElement("div", null, _react.default.createElement(_Button.default, { + icon: "cancel", + className: cancelClassName, + noText: true, + onClick: cancelHandler + }, _i18n.default._t('AssetAdmin.CANCEL')))); +}; +EditorHeader.propTypes = { + onCancel: _propTypes.default.func, + onDetails: _propTypes.default.func, + showButton: _propTypes.default.oneOf(Object.keys(buttonStates).map(state => buttonStates[state])), + children: _propTypes.default.node +}; +var _default = exports["default"] = EditorHeader; + +/***/ }), + +/***/ "./client/src/containers/Gallery/Gallery.js": +/*!**************************************************!*\ + !*** ./client/src/containers/Gallery/Gallery.js ***! + \**************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.galleryViewPropTypes = exports.galleryViewDefaultProps = exports["default"] = exports.Component = void 0; +var _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ "jquery")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _AssetDropzone = _interopRequireDefault(__webpack_require__(/*! components/AssetDropzone/AssetDropzone */ "./client/src/components/AssetDropzone/AssetDropzone.js")); +var _BulkActions = _interopRequireDefault(__webpack_require__(/*! components/BulkActions/BulkActions */ "./client/src/components/BulkActions/BulkActions.js")); +var _ThumbnailView = _interopRequireDefault(__webpack_require__(/*! containers/ThumbnailView/ThumbnailView */ "./client/src/containers/ThumbnailView/ThumbnailView.js")); +var _TableView = _interopRequireDefault(__webpack_require__(/*! containers/TableView/TableView */ "./client/src/containers/TableView/TableView.js")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _FormAlert = _interopRequireDefault(__webpack_require__(/*! components/FormAlert/FormAlert */ "components/FormAlert/FormAlert")); +var galleryActions = _interopRequireWildcard(__webpack_require__(/*! state/gallery/GalleryActions */ "./client/src/state/gallery/GalleryActions.js")); +var toastsActions = _interopRequireWildcard(__webpack_require__(/*! state/toasts/ToastsActions */ "state/toasts/ToastsActions")); +var queuedFilesActions = _interopRequireWildcard(__webpack_require__(/*! state/queuedFiles/QueuedFilesActions */ "./client/src/state/queuedFiles/QueuedFilesActions.js")); +var confirmDeletionActions = _interopRequireWildcard(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionActions */ "./client/src/state/confirmDeletion/ConfirmDeletionActions.js")); +var _reactSelectable = __webpack_require__(/*! react-selectable */ "./node_modules/react-selectable/dist/react-selectable.js"); +var _configShape = _interopRequireDefault(__webpack_require__(/*! lib/configShape */ "./client/src/lib/configShape.js")); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var _getStatusCodeMessage = _interopRequireDefault(__webpack_require__(/*! lib/getStatusCodeMessage */ "./client/src/lib/getStatusCodeMessage.js")); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +var _MoveModal = _interopRequireDefault(__webpack_require__(/*! ../MoveModal/MoveModal */ "./client/src/containers/MoveModal/MoveModal.js")); +var _GalleryDND = _interopRequireDefault(__webpack_require__(/*! ./GalleryDND */ "./client/src/containers/Gallery/GalleryDND.js")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const ACTION_TYPES = { + DELETE: 'delete', + ARCHIVE: 'archive', + EDIT: 'edit', + MOVE: 'move', + PUBLISH: 'publish', + UNPUBLISH: 'unpublish', + INSERT: 'insert', + ADMIN: 'admin', + SELECT: 'select' +}; +class Gallery extends _react.Component { + constructor(props) { + super(props); + this.handleOpenFolder = this.handleOpenFolder.bind(this); + this.handleOpenFile = this.handleOpenFile.bind(this); + this.handleSelect = this.handleSelect.bind(this); + this.handleAddedFile = this.handleAddedFile.bind(this); + this.handlePreviewLoaded = this.handlePreviewLoaded.bind(this); + this.handleCancelUpload = this.handleCancelUpload.bind(this); + this.handleRemoveErroredUpload = this.handleRemoveErroredUpload.bind(this); + this.handleUploadProgress = this.handleUploadProgress.bind(this); + this.handleSending = this.handleSending.bind(this); + this.handleSort = this.handleSort.bind(this); + this.handleSetPage = this.handleSetPage.bind(this); + this.handleSuccessfulUpload = this.handleSuccessfulUpload.bind(this); + this.handleQueueComplete = this.handleQueueComplete.bind(this); + this.handleFailedUpload = this.handleFailedUpload.bind(this); + this.handleClearSearch = this.handleClearSearch.bind(this); + this.handleEnableDropzone = this.handleEnableDropzone.bind(this); + this.handleMoveFiles = this.handleMoveFiles.bind(this); + this.handleBulkEdit = this.handleBulkEdit.bind(this); + this.handleBulkPublish = this.handleBulkPublish.bind(this); + this.handleBulkUnpublish = this.handleBulkUnpublish.bind(this); + this.handleBulkMove = this.handleBulkMove.bind(this); + this.handleBulkInsert = this.handleBulkInsert.bind(this); + this.handleBeginSelection = this.handleBeginSelection.bind(this); + this.handleGroupSelect = this.handleGroupSelect.bind(this); + this.handleClearSelection = this.handleClearSelection.bind(this); + this.handleSelectAll = this.handleSelectAll.bind(this); + this.toggleSelectConcat = this.toggleSelectConcat.bind(this); + this.getSelectableFiles = this.getSelectableFiles.bind(this); + } + componentDidMount() { + this.initSortDropdown(); + window.addEventListener('keydown', this.toggleSelectConcat); + window.addEventListener('keyup', this.toggleSelectConcat); + } + componentDidUpdate(prevProps) { + this.initSortDropdown(); + this.initFlushUploadFiles(prevProps); + } + componentWillUnmount() { + window.removeEventListener('keydown', this.toggleSelectConcat); + window.removeEventListener('keyup', this.toggleSelectConcat); + } + initFlushUploadFiles(prevProps) { + if (this.props.view !== 'tile') { + const $select = this.getSortElement(); + $select.off('change'); + } + if (prevProps.folderId !== this.props.folderId) { + this.props.actions.queuedFiles.purgeUploadQueue(); + } + } + getSortElement() { + return (0, _jquery.default)(this.gallery).find('.gallery__sort .dropdown'); + } + getSearchMessage(filters) { + const messages = []; + if (filters.name) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGEKEYWORDS', 'with keywords \'{name}\'')); + } + if (filters.lastEditedFrom && filters.lastEditedTo) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGEEDITEDBETWEEN', 'last edited between \'{lastEditedFrom}\' and \'{lastEditedTo}\'')); + } else if (filters.lastEditedFrom) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGEEDITEDFROM', 'last edited after \'{lastEditedFrom}\'')); + } else if (filters.lastEditedTo) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGEEDITEDTO', 'last edited before \'{lastEditedTo}\'')); + } + if (filters.appCategory) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGECATEGORY', 'categorised as \'{appCategory}\'')); + } + if (filters.currentFolderOnly && this.props.folder.title) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGELIMIT', 'limited to the folder \'{folder}\'')); + } + const parts = [messages.slice(0, -1).join(`${_i18n.default._t('AssetAdmin.JOIN', ',')} `), messages.slice(-1)].filter(part => part).join(` ${_i18n.default._t('AssetAdmin.JOINLAST', 'and')} `); + if (parts === '') { + return ''; + } + const searchResults = { + parts: _i18n.default.inject(parts, Object.assign({ + folder: this.props.folder.title + }, filters, { + appCategory: filters.appCategory ? filters.appCategory.toLowerCase() : undefined + })) + }; + return _i18n.default.inject(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGE', 'Search results {parts}'), searchResults); + } + getSelection(firstId, lastId) { + const selectable = this.getSelectableFiles(); + const indexes = [firstId, lastId].map(id => selectable.findIndex(file => file.id === id)).filter(index => index !== -1).sort((a, b) => a - b); + if (indexes.length !== 2) { + return indexes.map(index => selectable[index].id); + } + const [firstIndex, lastIndex] = indexes; + return selectable.filter((file, index) => index >= firstIndex && index <= lastIndex).map(file => file.id); + } + getSelectableFiles() { + const selectable = this.props.files.filter(file => file.id); + if (this.props.type === ACTION_TYPES.SELECT) { + return selectable.filter(item => item.type !== 'folder'); + } + return selectable; + } + handleBulkInsert(event, items) { + this.props.onInsertMany(event, items); + } + handleBulkPublish(event, items) { + const publishItems = items.map(item => item.id); + if (!publishItems.length) { + this.props.actions.gallery.deselectFiles(); + return Promise.resolve(true); + } + this.props.actions.gallery.setLoading(true); + return this.props.onPublish(publishItems).then(resultItems => { + this.props.actions.gallery.setLoading(false); + this.props.actions.toasts.success(_i18n.default.sprintf(_i18n.default._t('AssetAdmin.BULK_ACTIONS_PUBLISH_SUCCESS', '%s folders/files were successfully published.'), resultItems.length)); + this.props.actions.gallery.deselectFiles(); + }); + } + handleBulkUnpublish(event, items) { + const unpublishItems = items.filter(item => item.published).map(item => item.id); + if (!unpublishItems.length) { + this.props.actions.gallery.deselectFiles(); + return Promise.resolve(true); + } + this.props.actions.gallery.setLoading(true); + return this.props.onUnpublish(unpublishItems).then(resultItems => { + this.props.actions.gallery.setLoading(false); + this.props.actions.toasts.success(_i18n.default.sprintf(_i18n.default._t('AssetAdmin.BULK_ACTIONS_UNPUBLISH_SUCCESS', '%s folders/files were successfully unpublished.'), resultItems.length)); + this.props.actions.gallery.deselectFiles(); + }); + } + initSortDropdown() { + if (this.props.view === 'tile') { + const $select = this.getSortElement(); + $select.chosen({ + allow_single_deselect: true, + disable_search_threshold: 20 + }); + $select.off('change'); + $select.on('change', () => $select.find(':selected')[0].click()); + } + } + handleSort(value) { + this.props.actions.queuedFiles.purgeUploadQueue(); + this.props.onSort(value); + } + handleSetPage(page) { + this.props.onSetPage(page); + } + handleCancelUpload(fileData) { + fileData.xhr.abort(); + this.props.actions.queuedFiles.removeQueuedFile(fileData.queuedId); + } + handleRemoveErroredUpload(fileData) { + this.props.actions.queuedFiles.removeQueuedFile(fileData.queuedId); + } + handleAddedFile(fileData) { + this.props.actions.queuedFiles.addQueuedFile(fileData); + } + handlePreviewLoaded(fileData, previewData) { + this.props.actions.queuedFiles.updateQueuedFile(fileData.queuedId, previewData); + } + handleSending(file, xhr) { + this.props.actions.queuedFiles.updateQueuedFile(file._queuedId, { + xhr + }); + } + handleUploadProgress(file, progress) { + this.props.actions.queuedFiles.updateQueuedFile(file._queuedId, { + progress + }); + } + handleSuccessfulUpload(fileXhr) { + const json = JSON.parse(fileXhr.xhr.response); + if (typeof json[0].error !== 'undefined') { + this.handleFailedUpload(fileXhr); + return; + } + this.props.actions.queuedFiles.succeedUpload(fileXhr._queuedId, json[0]); + if (this.props.onSuccessfulUpload) { + this.props.onSuccessfulUpload(json); + } + const filesInProgress = this.props.queuedFiles.items.reduce((inProgress, file) => { + if (file.progress !== 100) { + return inProgress + 1; + } + return inProgress; + }, 0); + if (!this.props.fileId && !this.props.selectedFiles.length && filesInProgress === 0) { + const lastFile = json.pop(); + this.props.onOpenFile(lastFile.id); + } + } + handleQueueComplete() { + if (this.props.onSuccessfulUploadQueue) { + this.props.onSuccessfulUploadQueue(); + } + } + handleFailedUpload(fileXhr, response) { + const statusCodeMessage = fileXhr.xhr && fileXhr.xhr.status ? (0, _getStatusCodeMessage.default)(fileXhr.xhr.status, fileXhr.xhr) : ''; + this.props.actions.queuedFiles.failUpload(fileXhr._queuedId, response, statusCodeMessage); + } + itemIsSelected(id) { + return this.props.selectedFiles.indexOf(id) > -1; + } + toggleSelectConcat(event) { + this.props.actions.gallery.setConcatenateSelect(this.isConcat(event)); + } + isConcat(event) { + return event.metaKey || event.ctrlKey || event.shiftKey; + } + itemIsHighlighted(id) { + return this.props.fileId === id; + } + hasOpenedItem() { + return !!this.props.fileId; + } + handleClearSearch(event) { + this.props.onClearSearch(event); + } + handleGroupSelect(items, event) { + const { + setSelectedFiles, + selectFiles + } = this.props.actions.gallery; + const selectableFiles = this.getSelectableFiles(); + const selectItems = items.filter((id, index) => { + if (items.indexOf(id) !== index) { + return false; + } + return selectableFiles.find(file => file.id === id); + }); + const concat = this.props.concatenateSelect || this.isConcat(event); + if (this.props.maxFilesSelect !== null) { + let totalFiles = selectItems.length; + if (concat) { + const totalSelected = this.props.selectedFiles.filter(id => !this.props.selectedFiles.includes(id)).concat(this.props.selectedFiles); + totalFiles = totalSelected.length; + } + if (totalFiles >= this.props.maxFilesSelect) { + return; + } + } + if (!concat) { + setSelectedFiles(selectItems); + } else { + selectFiles(selectItems); + } + } + handleClearSelection() { + this.props.actions.gallery.deselectFiles(); + } + handleSelectAll() { + const ids = this.props.files.map(file => file.id); + this.handleGroupSelect(ids, new Event('na')); + } + handleBeginSelection(e) { + let node = e.target; + while (node) { + if (node.classList.contains('griddle-footer')) { + return false; + } + if (node.classList.contains('gallery__main--selectable')) { + break; + } + node = node.parentNode; + } + return true; + } + handleOpenFolder(event, folder) { + event.preventDefault(); + this.props.onOpenFolder(folder.id); + } + handleOpenFile(event, file) { + event.preventDefault(); + if (file.created === null) { + return; + } + if ((!this.props.selectedFiles.length || this.props.maxFilesSelect === 1) && this.props.type === ACTION_TYPES.SELECT) { + this.handleSelect(event, file); + } + this.props.onOpenFile(file.id, file); + } + handleSelect(event, item) { + const maxFiles = this.props.maxFilesSelect; + const selectable = this.getSelectableFiles(); + let selectedItemIDs = selectable.filter(file => file.id === item.id).map(file => file.id); + if (maxFiles === 1) { + this.props.actions.gallery.setSelectedFiles(selectedItemIDs); + return; + } + if (this.props.selectedFiles.indexOf(item.id) === -1) { + if (event.shiftKey) { + selectedItemIDs = this.getSelection(this.props.lastSelected, item.id); + } + const totalSelected = this.props.selectedFiles.filter(id => !selectedItemIDs.includes(id)).concat(selectedItemIDs); + if (totalSelected.length > maxFiles && maxFiles !== null) { + return; + } + this.props.actions.gallery.selectFiles(selectedItemIDs); + this.props.actions.gallery.setLastSelected(item.id); + } else { + this.props.actions.gallery.deselectFiles([item.id]); + if (event.shiftKey) { + this.props.actions.gallery.setLastSelected(null); + } + } + } + handleEnableDropzone(enabled) { + this.props.actions.gallery.setEnableDropzone(enabled); + } + handleMoveFiles(folderId, fileIds) { + const url = this.props.sectionConfig.endpoints.move.url; + return _Backend.default.post(url, { + ids: fileIds, + folderID: folderId + }, { + 'X-SecurityID': _Config.default.get('SecurityID') + }).then(() => { + const duration = _index.default.MOVE_SUCCESS_DURATION; + const message = `+${fileIds.length}`; + this.props.actions.gallery.setFileBadge(folderId, message, 'success', duration); + if (typeof this.props.onMoveFilesSuccess === 'function') { + this.props.onMoveFilesSuccess(folderId, fileIds); + } + }).catch(() => { + this.props.actions.toasts.error(_i18n.default._t('AssetAdmin.FAILED_MOVE', 'There was an error moving the selected items.')); + }); + } + handleBulkEdit(event, items) { + this.handleOpenFile(event, items[0]); + } + handleBulkMove() { + this.props.actions.gallery.activateModal(_index.default.MODAL_MOVE); + } + renderTransitionBulkActions() { + return this.renderBulkActions(); + } + renderBulkActions() { + const { + type, + dialog, + maxFilesSelect, + files, + selectedFiles, + BulkActionsComponent, + sectionConfig + } = this.props; + const actionFilter = type === ACTION_TYPES.SELECT || dialog ? action => action.value === ACTION_TYPES.INSERT : action => action.value !== ACTION_TYPES.INSERT; + const deleteButtonFilter = sectionConfig.filesAreVersioned && sectionConfig.archiveFiles ? action => action.value !== ACTION_TYPES.DELETE : action => action.value !== ACTION_TYPES.ARCHIVE; + const actions = _index.default.BULK_ACTIONS.filter(actionFilter).filter(deleteButtonFilter).map(action => { + if (action.callback) { + return action; + } + switch (action.value) { + case ACTION_TYPES.DELETE: + case ACTION_TYPES.ARCHIVE: + { + return { + ...action, + callback: (event, items) => { + this.props.actions.confirmDeletion.confirm(items); + }, + confirm: undefined + }; + } + case ACTION_TYPES.EDIT: + { + return { + ...action, + callback: this.handleBulkEdit + }; + } + case ACTION_TYPES.MOVE: + { + return { + ...action, + callback: this.handleBulkMove + }; + } + case ACTION_TYPES.PUBLISH: + { + return { + ...action, + callback: this.handleBulkPublish + }; + } + case ACTION_TYPES.UNPUBLISH: + { + return { + ...action, + callback: this.handleBulkUnpublish + }; + } + case ACTION_TYPES.INSERT: + { + return { + ...action, + callback: this.handleBulkInsert, + color: 'primary' + }; + } + default: + { + return action; + } + } + }); + const selected = selectedFiles.map(id => files.find(file => file && id === file.id)).filter(item => item); + if (selected.length > 0 && [ACTION_TYPES.ADMIN, ACTION_TYPES.SELECT].includes(type)) { + return _react.default.createElement(BulkActionsComponent, { + actions: actions, + items: selected, + total: maxFilesSelect, + key: selected.length > 0, + container: this.gallery, + showCount: maxFilesSelect !== 1, + onClearSelection: this.handleClearSelection, + onSelectAll: this.handleSelectAll + }); + } + return null; + } + renderGalleryView() { + const GalleryView = this.props.view === 'table' ? _TableView.default : _ThumbnailView.default; + const files = this.props.files.map(file => { + const selected = this.itemIsSelected(file.id); + const highlighted = this.itemIsHighlighted(file.id); + const key = (file.queuedId ? `queueId${file.queuedId}` : `id${file.id}`) + (selected ? '--selected' : ''); + return { + ...file, + selected, + highlighted, + key + }; + }); + const { + type, + loading, + dialog, + page, + totalCount, + limit, + sort, + selectedFiles, + badges, + maxFilesSelect, + sectionConfig + } = this.props; + const selectableItems = type === ACTION_TYPES.SELECT || type === ACTION_TYPES.ADMIN && (!maxFilesSelect || maxFilesSelect > 1); + const props = { + selectableItems, + selectableFolders: type !== ACTION_TYPES.SELECT && !dialog, + files, + loading, + page, + totalCount, + limit, + sort, + selectedFiles, + badges, + onSort: this.handleSort, + onSetPage: this.handleSetPage, + onOpenFile: this.handleOpenFile, + onOpenFolder: this.handleOpenFolder, + onSelect: this.handleSelect, + onCancelUpload: this.handleCancelUpload, + onDropFiles: this.handleMoveFiles, + onRemoveErroredUpload: this.handleRemoveErroredUpload, + onEnableDropzone: this.handleEnableDropzone, + sectionConfig, + canDrag: type === ACTION_TYPES.ADMIN, + maxFilesSelect + }; + return _react.default.createElement(GalleryView, props); + } + renderToolbar() { + const { + GalleryToolbar, + sort, + view, + folder, + onCreateFolder, + onOpenFolder, + onViewChange + } = this.props; + const props = { + onMoveFiles: this.handleMoveFiles, + onSort: this.handleSort, + onCreateFolder, + onOpenFolder, + onViewChange, + view, + sort, + folder + }; + return _react.default.createElement(GalleryToolbar, props); + } + render() { + const { + folder, + loading, + errorMessage, + noticeMessage + } = this.props; + const Loading = this.props.LoadingComponent; + if (!folder) { + if (errorMessage) { + return _react.default.createElement("div", { + className: "gallery__error flexbox-area-grow" + }, _react.default.createElement("div", { + className: "gallery__error-message" + }, _react.default.createElement("h3", null, _i18n.default._t('AssetAdmin.DROPZONE_RESPONSE_ERROR', 'Server responded with an error.')), errorMessage && _react.default.createElement("p", null, errorMessage))); + } + if (loading) { + return _react.default.createElement("div", { + className: "flexbox-area-grow" + }, _react.default.createElement(Loading, null)); + } + return _react.default.createElement("div", { + className: "flexbox-area-grow" + }, _react.default.createElement("div", { + className: "editor__file-preview-message--file-missing m-t-3" + }, _i18n.default._t('Admin.UNKNOWN_ERROR', 'An unknown error has occurred'))); + } + const messages = _react.default.createElement("div", { + className: "gallery_messages" + }, errorMessage && _react.default.createElement(_FormAlert.default, { + value: errorMessage, + type: "danger" + }), noticeMessage && _react.default.createElement(_FormAlert.default, { + value: noticeMessage, + type: "success" + })); + const dimensions = { + height: _index.default.THUMBNAIL_HEIGHT, + width: _index.default.THUMBNAIL_WIDTH + }; + const dropzoneOptions = { + url: this.props.createFileApiUrl, + method: this.props.createFileApiMethod, + paramName: 'Upload', + clickable: '#upload-button', + ...this.props.sectionConfig.dropzoneOptions + }; + const securityID = this.props.securityId; + const canEdit = this.props.folder.canEdit && this.props.enableDropzone; + const galleryClasses = ['panel', 'panel--padded', 'panel--scrollable', 'gallery__main', 'fill-height']; + if (this.props.type === ACTION_TYPES.INSERT) { + galleryClasses.push('insert-media-modal__main'); + } + const cssClasses = galleryClasses; + if (this.hasOpenedItem()) { + cssClasses.push('gallery__main--has-opened-item'); + } + return _react.default.createElement("div", { + className: "flexbox-area-grow gallery__outer", + ref: gallery => { + this.gallery = gallery; + } + }, this.renderTransitionBulkActions(), _react.default.createElement(_GalleryDND.default, { + selectedFiles: this.props.selectedFiles, + className: galleryClasses.join(' ') + }, this.renderToolbar(), _react.default.createElement(_reactSelectable.SelectableGroup, { + enabled: this.props.view === 'tile' && this.props.type === ACTION_TYPES.ADMIN, + className: "flexbox-area-grow fill-height gallery__main--selectable", + onSelection: this.handleGroupSelect, + onNonItemClick: this.handleClearSelection, + onBeginSelection: this.handleBeginSelection, + preventDefault: false, + fixedPosition: true + }, _react.default.createElement(_AssetDropzone.default, { + name: "gallery-container", + className: "flexbox-area-grow", + canUpload: canEdit, + onAddedFile: this.handleAddedFile, + onPreviewLoaded: this.handlePreviewLoaded, + onError: this.handleFailedUpload, + onSuccess: this.handleSuccessfulUpload, + onQueueComplete: this.handleQueueComplete, + onSending: this.handleSending, + onUploadProgress: this.handleUploadProgress, + preview: dimensions, + folderId: this.props.folderId, + options: dropzoneOptions, + securityID: securityID, + uploadButton: false + }, messages, this.renderGalleryView()))), this.props.loading && _react.default.createElement(Loading, null), _react.default.createElement(_MoveModal.default, { + sectionConfig: this.props.sectionConfig, + folderId: this.props.folderId, + onSuccess: this.props.onMoveFilesSuccess, + onOpenFolder: this.props.onOpenFolder + })); + } +} +exports.Component = Gallery; +const sharedDefaultProps = { + page: 1, + limit: 15 +}; +const sharedPropTypes = { + sectionConfig: _configShape.default, + loading: _propTypes.default.bool, + sort: _propTypes.default.string, + files: _propTypes.default.arrayOf(_propTypes.default.shape({ + id: _propTypes.default.number, + parent: _propTypes.default.shape({ + id: _propTypes.default.number + }) + })).isRequired, + selectedFiles: _propTypes.default.arrayOf(_propTypes.default.number), + totalCount: _propTypes.default.number, + page: _propTypes.default.number, + limit: _propTypes.default.number, + badges: _propTypes.default.arrayOf(_propTypes.default.shape({ + id: _propTypes.default.number, + message: _propTypes.default.node, + status: _propTypes.default.string + })), + onOpenFile: _propTypes.default.func.isRequired, + onOpenFolder: _propTypes.default.func.isRequired, + onSort: _propTypes.default.func.isRequired, + onSetPage: _propTypes.default.func.isRequired, + maxFilesSelect: _propTypes.default.number +}; +const galleryViewDefaultProps = exports.galleryViewDefaultProps = Object.assign({}, sharedDefaultProps, { + selectableItems: false +}); +const galleryViewPropTypes = exports.galleryViewPropTypes = Object.assign({}, sharedPropTypes, { + selectableItems: _propTypes.default.bool, + selectableFolders: _propTypes.default.bool, + onSelect: _propTypes.default.func, + onCancelUpload: _propTypes.default.func, + onRemoveErroredUpload: _propTypes.default.func, + onEnableDropzone: _propTypes.default.func +}); +Gallery.defaultProps = Object.assign({}, sharedDefaultProps, { + type: ACTION_TYPES.ADMIN, + view: 'tile', + enableDropzone: true, + dialog: false, + BulkActionsComponent: _BulkActions.default +}); +Gallery.propTypes = Object.assign({}, sharedPropTypes, { + onSuccessfulUpload: _propTypes.default.func, + onSuccessfulUploadQueue: _propTypes.default.func, + onCreateFolder: _propTypes.default.func, + onMoveFilesSuccess: _propTypes.default.func, + onPublish: _propTypes.default.func, + onUnpublish: _propTypes.default.func, + type: _propTypes.default.oneOf(['insert-media', 'insert-link', ACTION_TYPES.SELECT, ACTION_TYPES.ADMIN]), + view: _propTypes.default.oneOf(['tile', 'table']), + lastSelected: _propTypes.default.number, + dialog: _propTypes.default.bool, + fileId: _propTypes.default.number, + folderId: _propTypes.default.number.isRequired, + folder: _propTypes.default.shape({ + id: _propTypes.default.number, + title: _propTypes.default.string, + parentId: _propTypes.default.number, + canView: _propTypes.default.bool, + canEdit: _propTypes.default.bool + }), + files: _propTypes.default.array, + errorMessage: _propTypes.default.string, + actions: _propTypes.default.object, + securityId: _propTypes.default.string, + onViewChange: _propTypes.default.func.isRequired, + createFileApiUrl: _propTypes.default.string, + createFileApiMethod: _propTypes.default.string, + search: _propTypes.default.object, + enableDropzone: _propTypes.default.bool, + concatenateSelect: _propTypes.default.bool, + GalleryToolbar: _propTypes.default.elementType, + sorters: _propTypes.default.arrayOf(_propTypes.default.shape({ + field: _propTypes.default.string.isRequired, + direction: _propTypes.default.oneOf(['asc', 'desc']).isRequired, + label: _propTypes.default.string.isRequired + })).isRequired, + BulkActionsComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}); +function mapStateToProps(state, ownProps) { + let { + sort + } = ownProps; + const { + selectedFiles, + errorMessage, + noticeMessage, + enableDropzone, + badges, + concatenateSelect, + loading, + sorters, + lastSelected + } = state.assetAdmin.gallery; + if (!sort && sorters && sorters[0]) { + sort = `${sorters[0].field},${sorters[0].direction}`; + } + return { + lastSelected, + selectedFiles, + errorMessage, + noticeMessage, + enableDropzone, + badges, + concatenateSelect, + loading: ownProps.loading || loading, + queuedFiles: state.assetAdmin.queuedFiles, + securityId: state.config.SecurityID, + sorters, + sort + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + gallery: (0, _redux.bindActionCreators)(galleryActions, dispatch), + toasts: (0, _redux.bindActionCreators)(toastsActions, dispatch), + queuedFiles: (0, _redux.bindActionCreators)(queuedFilesActions, dispatch), + confirmDeletion: (0, _redux.bindActionCreators)(confirmDeletionActions, dispatch) + } + }; +} +var _default = exports["default"] = (0, _redux.compose)((0, _Injector.inject)(['GalleryToolbar', 'Loading'], (GalleryToolbar, Loading) => ({ + GalleryToolbar, + LoadingComponent: Loading +}), () => 'AssetAdmin.Gallery'), (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(Gallery); + +/***/ }), + +/***/ "./client/src/containers/Gallery/GalleryDND.js": +/*!*****************************************************!*\ + !*** ./client/src/containers/Gallery/GalleryDND.js ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _GalleryItemDragLayer = _interopRequireDefault(__webpack_require__(/*! components/GalleryItem/GalleryItemDragLayer */ "./client/src/components/GalleryItem/GalleryItemDragLayer.js")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _core = __webpack_require__(/*! @dnd-kit/core */ "./node_modules/@dnd-kit/core/dist/core.esm.js"); +var _modifiers = __webpack_require__(/*! @dnd-kit/modifiers */ "./node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function GalleryDND(_ref) { + let { + className, + selectedFiles, + children, + ...props + } = _ref; + const [dragging, setDragging] = (0, _react.useState)(false); + const [draggingItemID, setDraggingItemID] = (0, _react.useState)(null); + const [draggingItemProps, setDraggingItemProps] = (0, _react.useState)(null); + const handleDragStart = (0, _react.useCallback)(event => { + setDragging(true); + setDraggingItemID(event.active.id); + setDraggingItemProps(event.active.data.current.props); + }); + const handleDragEnd = (0, _react.useCallback)(event => { + setDragging(false); + setDraggingItemID(null); + setDraggingItemProps(null); + }); + const sensors = (0, _core.useSensors)((0, _core.useSensor)(_core.PointerSensor, { + activationConstraint: { + distance: 10 + } + })); + const draggingItems = [...selectedFiles]; + if (!draggingItems.includes(draggingItemID)) { + draggingItems.push(draggingItemID); + } + return _react.default.createElement("div", { + className: (0, _classnames.default)(className, { + 'gallery__main--dragging': dragging + }) + }, _react.default.createElement(_core.DndContext, { + sensors: sensors, + onDragStart: handleDragStart, + onDragEnd: handleDragEnd, + modifiers: [_modifiers.restrictToWindowEdges] + }, children, _react.default.createElement(_core.DragOverlay, null, dragging && _react.default.createElement(_GalleryItemDragLayer.default, { + draggingItemProps: draggingItemProps, + draggingItems: draggingItems + })))); +} +GalleryDND.contextTypes = { + dragDropManager: _propTypes.default.object +}; +GalleryDND.propTypes = { + selectedFiles: _propTypes.default.arrayOf(_propTypes.default.number), + className: _propTypes.default.string, + children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]) +}; +var _default = exports["default"] = GalleryDND; + +/***/ }), + +/***/ "./client/src/containers/InsertMediaModal/InsertMediaModal.js": +/*!********************************************************************!*\ + !*** ./client/src/containers/InsertMediaModal/InsertMediaModal.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _AssetAdmin = _interopRequireDefault(__webpack_require__(/*! containers/AssetAdmin/AssetAdmin */ "./client/src/containers/AssetAdmin/AssetAdmin.js")); +var _stateRouter = _interopRequireDefault(__webpack_require__(/*! containers/AssetAdmin/stateRouter */ "./client/src/containers/AssetAdmin/stateRouter.js")); +var _fileSchemaModalHandler = _interopRequireDefault(__webpack_require__(/*! containers/InsertLinkModal/fileSchemaModalHandler */ "containers/InsertLinkModal/fileSchemaModalHandler")); +var galleryActions = _interopRequireWildcard(__webpack_require__(/*! state/gallery/GalleryActions */ "./client/src/state/gallery/GalleryActions.js")); +var modalActions = _interopRequireWildcard(__webpack_require__(/*! state/modal/ModalActions */ "./client/src/state/modal/ModalActions.js")); +var _FormBuilderModal = _interopRequireDefault(__webpack_require__(/*! components/FormBuilderModal/FormBuilderModal */ "components/FormBuilderModal/FormBuilderModal")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _getFormSchema = _interopRequireDefault(__webpack_require__(/*! lib/getFormSchema */ "./client/src/lib/getFormSchema.js")); +var _qs = _interopRequireDefault(__webpack_require__(/*! qs */ "qs")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +class InsertMediaModal extends _react.Component { + constructor(props) { + super(props); + this.handleSubmit = this.handleSubmit.bind(this); + } + componentDidMount() { + const { + isOpen, + onBrowse, + setOverrides, + fileAttributes, + folderId + } = this.props; + if (!isOpen) { + onBrowse(folderId || 0); + } else if (typeof setOverrides === 'function' && fileAttributes.ID) { + setOverrides(this.props); + onBrowse(folderId, fileAttributes.ID); + } + } + componentDidUpdate(prevProps) { + if (!this.props.isOpen && prevProps.isOpen) { + this.props.onBrowse(this.props.folderId); + this.props.actions.gallery.deselectFiles(); + } + if (typeof prevProps.setOverrides === 'function' && this.props.isOpen && !prevProps.isOpen) { + prevProps.setOverrides(this.props); + this.props.onBrowse(this.props.folderId, this.props.fileAttributes ? this.props.fileAttributes.ID : null); + } + } + getSectionProps() { + return { + ...this.props, + dialog: true, + toolbarChildren: this.renderToolbarChildren(), + onSubmitEditor: this.handleSubmit, + onReplaceUrl: this.props.onBrowse + }; + } + getModalProps() { + const { + onHide, + onInsert, + sectionConfig, + schemaUrl, + className, + ...props + } = this.props; + return { + ...props, + className: (0, _classnames.default)('insert-media-modal', className), + size: 'lg', + showCloseButton: false + }; + } + handleSubmit(data, action, submitFn, file) { + if (action === 'action_insert') { + return this.props.onInsert(data, file); + } + return submitFn(); + } + renderToolbarChildren() { + return _react.default.createElement("button", { + type: "button", + className: "close modal__close-button insert-media-modal__close-button", + onClick: this.props.onClosed, + "aria-label": _i18n.default._t('FormBuilderModal.CLOSE', 'Close') + }, _react.default.createElement("span", { + "aria-hidden": "true" + }, "\xD7")); + } + render() { + const modalProps = this.getModalProps(); + const sectionProps = this.getSectionProps(); + const assetAdmin = this.props.isOpen ? _react.default.createElement(_AssetAdmin.default, sectionProps) : null; + return _react.default.createElement(_FormBuilderModal.default, modalProps, assetAdmin); + } +} +exports.Component = InsertMediaModal; +InsertMediaModal.propTypes = { + sectionConfig: _propTypes.default.shape({ + url: _propTypes.default.string, + form: _propTypes.default.object + }), + type: _propTypes.default.oneOf(['insert-media', 'insert-link', 'select', 'admin']), + schemaUrl: _propTypes.default.string, + isOpen: _propTypes.default.bool, + setOverrides: _propTypes.default.func, + onInsert: _propTypes.default.func.isRequired, + fileAttributes: _propTypes.default.shape({ + ID: _propTypes.default.number, + AltText: _propTypes.default.string, + Width: _propTypes.default.number, + Height: _propTypes.default.number, + Loading: _propTypes.default.string, + TitleTooltip: _propTypes.default.string, + Alignment: _propTypes.default.string, + Description: _propTypes.default.string, + TargetBlank: _propTypes.default.bool + }), + requireLinkText: _propTypes.default.bool, + folderId: _propTypes.default.number, + fileId: _propTypes.default.number, + viewAction: _propTypes.default.string, + query: _propTypes.default.object, + getUrl: _propTypes.default.func, + onBrowse: _propTypes.default.func.isRequired, + onClosed: _propTypes.default.func, + className: _propTypes.default.string, + actions: _propTypes.default.object, + maxFiles: _propTypes.default.number, + fileSelected: _propTypes.default.bool +}; +InsertMediaModal.defaultProps = { + className: '', + fileAttributes: {}, + type: 'insert-media', + folderId: 0, + maxFiles: 1 +}; +function mapStateToProps(state, ownProps) { + const config = ownProps.sectionConfig; + if (!config) { + return {}; + } + let folderId = 0; + if (ownProps.folderId !== null) { + folderId = ownProps.folderId; + } else if (ownProps.folder) { + folderId = ownProps.folder.id; + } + const fileId = ownProps.fileAttributes ? ownProps.fileAttributes.ID : ownProps.fileId; + const formSchema = state.assetAdmin.modal.formSchema; + const props = { + config, + viewAction: ownProps.viewAction, + folderId, + type: formSchema && formSchema.type, + fileId + }; + const { + schemaUrl, + targetId + } = (0, _getFormSchema.default)(props); + if (!schemaUrl) { + return {}; + } + const queryMap = {}; + if (ownProps.requireLinkText) { + queryMap.requireLinkText = true; + } + if (ownProps.fileSelected) { + queryMap.fileSelected = true; + } + let query = _qs.default.stringify(queryMap); + query = query ? `?${query}` : ''; + return { + schemaUrl: `${schemaUrl}/${targetId}${query}`, + type: formSchema && formSchema.type + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + gallery: (0, _redux.bindActionCreators)(galleryActions, dispatch), + modal: (0, _redux.bindActionCreators)(modalActions, dispatch) + } + }; +} +var _default = exports["default"] = (0, _redux.compose)(_stateRouter.default, (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), _fileSchemaModalHandler.default)(InsertMediaModal); + +/***/ }), + +/***/ "./client/src/containers/MoveModal/MoveModal.js": +/*!******************************************************!*\ + !*** ./client/src/containers/MoveModal/MoveModal.js ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _GalleryActions = __webpack_require__(/*! state/gallery/GalleryActions */ "./client/src/state/gallery/GalleryActions.js"); +var _ToastsActions = __webpack_require__(/*! state/toasts/ToastsActions */ "state/toasts/ToastsActions"); +var _FormBuilderModal = _interopRequireDefault(__webpack_require__(/*! components/FormBuilderModal/FormBuilderModal */ "components/FormBuilderModal/FormBuilderModal")); +var _configShape = _interopRequireDefault(__webpack_require__(/*! lib/configShape */ "./client/src/lib/configShape.js")); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +class MoveModal extends _react.default.Component { + constructor(props) { + super(props); + this.handleSubmit = this.handleSubmit.bind(this); + this.timeout = null; + } + handleSubmit(_ref) { + let { + FolderID + } = _ref; + const { + selectedFiles, + onSuccess, + onClosed, + setNotice, + setError, + setBadge + } = this.props; + let url = this.props.sectionConfig.endpoints.move.url; + return _Backend.default.post(url, { + ids: selectedFiles, + folderID: FolderID + }, { + 'X-SecurityID': _Config.default.get('SecurityID') + }).then(() => { + url = `${this.props.sectionConfig.endpoints.read.url}/${FolderID}`; + return _Backend.default.get(url); + }).then(response => response.json()).then(responseJson => { + if (typeof onSuccess === 'function') { + onSuccess(responseJson.id, selectedFiles); + } + setBadge(responseJson.id, `${selectedFiles.length}`, 'success', _index.default.MOVE_SUCCESS_DURATION); + setNotice(_i18n.default.sprintf(_i18n.default._t('AssetAdmin.MOVED_ITEMS_TO', 'Moved %s item(s) to %s'), selectedFiles.length, responseJson.name), [{ + label: _i18n.default._t('AssetAdmin.GO_TO_FOLDER', 'Go to folder'), + onClick: () => this.props.onOpenFolder(responseJson.id) + }]); + onClosed(); + }).catch(() => { + setError(_i18n.default._t('AssetAdmin.FAILED_MOVE', 'There was an error moving the selected items.')); + }); + } + render() { + const { + isOpen, + onClosed, + title, + folderId, + sectionConfig + } = this.props; + const { + schemaUrl + } = sectionConfig.form.moveForm; + return _react.default.createElement(_FormBuilderModal.default, { + title: title, + isOpen: isOpen, + onClosed: onClosed, + onSubmit: this.handleSubmit, + identifier: "AssetAdmin.MoveForm", + schemaUrl: `${schemaUrl}/${folderId}` + }); + } +} +MoveModal.propTypes = { + sectionConfig: _configShape.default, + folderId: _propTypes.default.number.isRequired, + isOpen: _propTypes.default.bool, + onClosed: _propTypes.default.func, + setNotice: _propTypes.default.func, + setBadge: _propTypes.default.func, + setError: _propTypes.default.func, + title: _propTypes.default.string, + onSuccess: _propTypes.default.func, + onOpenFolder: _propTypes.default.func.isRequired, + selectedFiles: _propTypes.default.array.isRequired +}; +MoveModal.defaultProps = { + isOpen: false +}; +function mapStateToProps(state) { + const { + modal, + selectedFiles + } = state.assetAdmin.gallery; + return { + isOpen: modal === _index.default.MODAL_MOVE, + selectedFiles, + title: _i18n.default.sprintf(_i18n.default._t('AssetAdmin.MOVE_ITEMS_TO', 'Move %s item(s) to...'), selectedFiles.length) + }; +} +function mapDispatchToProps(dispatch) { + return { + onClosed() { + dispatch((0, _GalleryActions.deactivateModal)()); + }, + setNotice(msg) { + let actions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + dispatch((0, _ToastsActions.display)({ + text: msg, + type: 'success', + actions + })); + }, + setError(msg) { + dispatch((0, _ToastsActions.display)({ + text: msg, + type: 'error' + })); + }, + setBadge() { + dispatch((0, _GalleryActions.setFileBadge)(...arguments)); + } + }; +} +var _default = exports["default"] = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(MoveModal); + +/***/ }), + +/***/ "./client/src/containers/TableView/TableView.js": +/*!******************************************************!*\ + !*** ./client/src/containers/TableView/TableView.js ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _griddleReact = _interopRequireDefault(__webpack_require__(/*! griddle-react */ "./node_modules/griddle-react/modules/griddle.jsx.js")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _FileStatusIcon = _interopRequireDefault(__webpack_require__(/*! components/FileStatusIcon/FileStatusIcon */ "components/FileStatusIcon/FileStatusIcon")); +var _Gallery = __webpack_require__(/*! containers/Gallery/Gallery */ "./client/src/containers/Gallery/Gallery.js"); +var _DataFormat = __webpack_require__(/*! lib/DataFormat */ "lib/DataFormat"); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _redux = __webpack_require__(/*! redux */ "redux"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +class TableView extends _react.Component { + constructor(props) { + super(props); + this.getColumns = this.getColumns.bind(this); + this.handleSort = this.handleSort.bind(this); + this.handleSetPage = this.handleSetPage.bind(this); + this.handleRowClick = this.handleRowClick.bind(this); + this.renderSelect = this.renderSelect.bind(this); + this.renderTitle = this.renderTitle.bind(this); + this.renderStatus = this.renderStatus.bind(this); + this.renderNoItemsNotice = this.renderNoItemsNotice.bind(this); + } + getColumns() { + const columns = ['thumbnail', 'title', 'status', 'size', 'lastEdited']; + if (this.props.selectableItems) { + columns.unshift('selected'); + } + return columns; + } + getColumnConfig() { + return [{ + columnName: 'selected', + sortable: false, + displayName: '', + cssClassName: 'gallery__table-column--select', + customComponent: this.renderSelect + }, { + columnName: 'thumbnail', + sortable: false, + displayName: '', + cssClassName: 'gallery__table-column--image', + customComponent: this.renderThumbnail + }, { + columnName: 'title', + customCompareFn: () => 0, + displayName: _i18n.default._t('File.TITLE', 'Title'), + cssClassName: 'gallery__table-column--title', + customComponent: this.renderTitle + }, { + columnName: 'status', + sortable: false, + cssClassName: 'sort--disabled', + customComponent: this.renderStatus, + displayName: _i18n.default._t('File.STATUS', 'Status') + }, { + columnName: 'lastEdited', + displayName: _i18n.default._t('File.MODIFIED', 'Modified'), + customComponent: this.renderDate + }, { + columnName: 'size', + sortable: false, + displayName: _i18n.default._t('File.SIZE', 'Size'), + cssClassName: 'sort--disabled', + customComponent: this.renderSize + }]; + } + getRowMetadata(rowData) { + return `gallery__table-row ${rowData.highlighted ? 'gallery__table-row--highlighted' : ''}`; + } + getTableProps() { + const [sortColumn, sortDirection] = this.props.sort.split(','); + return { + tableClassName: 'gallery__table table table-hover', + gridClassName: 'gallery__main-view--table', + rowMetadata: { + bodyCssClassName: this.getRowMetadata, + key: 'key' + }, + sortAscendingComponent: '', + sortDescendingComponent: '', + useExternal: true, + externalSetPage: this.handleSetPage, + externalChangeSort: this.handleSort, + externalSetFilter: () => null, + externalSetPageSize: () => null, + externalCurrentPage: this.props.page - 1, + externalMaxPage: Math.ceil(this.props.totalCount / this.props.limit), + externalSortColumn: sortColumn, + externalSortAscending: sortDirection === 'asc', + initialSort: sortColumn, + columns: this.getColumns(), + columnMetadata: this.getColumnConfig(), + useGriddleStyles: false, + onRowClick: this.handleRowClick, + results: this.props.files, + customNoDataComponent: this.renderNoItemsNotice + }; + } + handleActivate(event, item) { + if (item.type === 'folder') { + this.props.onOpenFolder(event, item); + } else { + this.props.onOpenFile(event, item); + } + } + handleRowClick(row, event) { + const item = row.props.data; + if (event.currentTarget.classList.contains('gallery__table-column--select')) { + event.stopPropagation(); + event.preventDefault(); + if (typeof this.props.onSelect === 'function') { + this.props.onSelect(event, item); + return; + } + } + this.handleActivate(event, item); + } + handleSort(column, ascending) { + const direction = ascending ? 'asc' : 'desc'; + this.props.onSort(`${column},${direction}`); + } + handleSetPage(page) { + this.props.onSetPage(page + 1); + } + preventFocus(event) { + event.preventDefault(); + } + renderNoItemsNotice() { + if (this.props.files.length === 0 && !this.props.loading) { + return _react.default.createElement("p", { + className: "gallery__no-item-notice" + }, _i18n.default._t('AssetAdmin.NOITEMSFOUND')); + } + return null; + } + renderSize(props) { + if (props.rowData.type === 'folder') { + return null; + } + const description = (0, _DataFormat.fileSize)(props.data); + return _react.default.createElement("span", null, description); + } + renderStatus(props) { + let flags = []; + const item = props.rowData; + const { + VersionedBadge + } = this.props; + if (item.type !== 'folder') { + if (item.draft) { + flags.push({ + key: 'status-draft', + status: 'draft' + }); + } else if (item.modified) { + flags.push({ + key: 'status-modified', + status: 'modified' + }); + } + } + flags = flags.map(_ref => { + let { + ...attributes + } = _ref; + return _react.default.createElement(VersionedBadge, attributes); + }); + return flags ? _react.default.createElement("span", null, flags) : null; + } + renderProgressBar(rowData) { + if (!rowData.queuedId || rowData.message && rowData.message.type === 'error') { + return null; + } + if (rowData.id > 0) { + return _react.default.createElement("div", { + className: "gallery__progress-bar--complete" + }); + } + const progressBarProps = { + className: 'gallery__progress-bar-progress', + style: { + width: `${rowData.progress}%` + } + }; + return _react.default.createElement("div", { + className: "gallery__progress-bar" + }, _react.default.createElement("div", progressBarProps)); + } + renderRestrictedAccess(rowData) { + const { + hasRestrictedAccess + } = rowData; + const attrs = { + fileID: rowData.id, + placement: 'top', + hasRestrictedAccess + }; + return _react.default.createElement(_FileStatusIcon.default, attrs); + } + renderTrackedFormUpload(rowData) { + const { + isTrackedFormUpload, + hasRestrictedAccess + } = rowData; + const attrs = { + fileID: rowData.id, + placement: 'top', + isTrackedFormUpload, + hasRestrictedAccess + }; + return _react.default.createElement(_FileStatusIcon.default, attrs); + } + renderTitle(props) { + const progress = this.renderProgressBar(props.rowData); + return _react.default.createElement("div", { + className: "fill-width" + }, _react.default.createElement("div", { + className: "flexbox-area-grow" + }, _react.default.createElement("span", null, props.data), props.rowData.hasRestrictedAccess && this.renderRestrictedAccess(props.rowData), props.rowData.isTrackedFormUpload && this.renderTrackedFormUpload(props.rowData)), progress); + } + renderSelect(props) { + if (this.props.selectableItems && (this.props.selectableFolders || props.rowData.type !== 'folder')) { + const checkboxProps = { + type: 'checkbox', + title: _i18n.default._t('AssetAdmin.SELECT'), + defaultChecked: props.data, + tabIndex: -1, + onMouseDown: this.preventFocus + }; + const maxSelected = ![null, 1].includes(this.props.maxFilesSelect) && this.props.selectedFiles.length >= this.props.maxFilesSelect; + if (maxSelected && !props.data) { + checkboxProps.disabled = true; + } + return _react.default.createElement("input", checkboxProps); + } + return null; + } + renderDate(props) { + if (props.rowData.type === 'folder') { + return null; + } + moment.locale(_i18n.default.detectLocale()); + return _react.default.createElement("span", null, moment(props.data).format('L LT')); + } + renderThumbnail(props) { + const url = props.data || props.rowData.url; + const uploading = props.rowData.queuedId && !props.rowData.id; + const category = props.rowData.category || 'false'; + const baseClass = 'gallery__table-image'; + const classNames = [baseClass]; + const styles = {}; + classNames.push(`${baseClass}--${category}`); + if (category === 'image' && url) { + styles.backgroundImage = `url("${url}")`; + } + if (!uploading && !url && category !== 'folder') { + classNames.push(`${baseClass}--error`); + } + return _react.default.createElement("div", { + className: classNames.join(' '), + style: styles + }); + } + render() { + return _react.default.createElement(_griddleReact.default, this.getTableProps()); + } +} +exports.Component = TableView; +TableView.defaultProps = _Gallery.galleryViewDefaultProps; +TableView.propTypes = { + ..._Gallery.galleryViewPropTypes, + sort: _propTypes.default.string.isRequired, + VersionedBadge: _propTypes.default.elementType +}; +var _default = exports["default"] = (0, _redux.compose)((0, _Injector.inject)(['VersionedBadge'], VersionedBadge => ({ + VersionedBadge +})))(TableView); + +/***/ }), + +/***/ "./client/src/containers/ThumbnailView/ThumbnailView.js": +/*!**************************************************************!*\ + !*** ./client/src/containers/ThumbnailView/ThumbnailView.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _Gallery = __webpack_require__(/*! containers/Gallery/Gallery */ "./client/src/containers/Gallery/Gallery.js"); +var _griddleReact = _interopRequireDefault(__webpack_require__(/*! griddle-react */ "./node_modules/griddle-react/modules/griddle.jsx.js")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +class ThumbnailView extends _react.Component { + constructor(props) { + super(props); + this.renderItem = this.renderItem.bind(this); + this.handleSetPage = this.handleSetPage.bind(this); + this.handlePrevPage = this.handlePrevPage.bind(this); + this.handleNextPage = this.handleNextPage.bind(this); + this.handleDrag = this.handleDrag.bind(this); + } + handleDrag(dragging) { + this.props.onEnableDropzone(!dragging); + } + handleSetPage(page) { + this.props.onSetPage(page + 1); + } + handleNextPage() { + const currentPage = this.props.page - 1; + this.handleSetPage(currentPage + 1); + } + handlePrevPage() { + const currentPage = this.props.page - 1; + if (currentPage === 0) { + this.handleSetPage(currentPage); + return; + } + this.handleSetPage(currentPage - 1); + } + folderFilter(file) { + return file.type === 'folder'; + } + fileFilter(file) { + return file.type !== 'folder'; + } + renderPagination() { + if (this.props.totalCount <= this.props.limit) { + return null; + } + const props = { + setPage: this.handleSetPage, + maxPage: Math.ceil(this.props.totalCount / this.props.limit), + next: this.handleNextPage, + nextText: _i18n.default._t('AssetAdmin.NEXT', 'Next'), + previous: this.handlePrevPage, + previousText: _i18n.default._t('AssetAdmin.PREVIOUS', 'Previous'), + currentPage: this.props.page - 1, + useGriddleStyles: false + }; + return _react.default.createElement("div", { + className: "griddle-footer" + }, _react.default.createElement(_griddleReact.default.GridPagination, props)); + } + renderItem(item) { + const { + File, + Folder, + badges, + sectionConfig, + selectedFiles, + selectableItems, + selectableFolders + } = this.props; + const badge = badges.find(badgeItem => badgeItem.id === item.id); + let props = { + sectionConfig, + key: item.key, + selectableKey: item.id, + item, + selectedFiles, + onDrag: this.handleDrag, + badge, + canDrag: this.props.canDrag + }; + if (item.queuedId && !item.id) { + const { + onCancelUpload, + onRemoveErroredUpload + } = this.props; + props = { + ...props, + onCancelUpload, + onRemoveErroredUpload + }; + } else { + const { + onOpenFolder, + onOpenFile + } = this.props; + props = { + ...props, + onActivate: item.type === 'folder' ? onOpenFolder : onOpenFile + }; + } + if (selectableItems && (selectableFolders || item.type !== 'folder')) { + const maxSelected = ![null, 1].includes(this.props.maxFilesSelect) && this.props.selectedFiles.length >= this.props.maxFilesSelect; + const onSelect = this.props.maxFilesSelect === 1 ? props.onActivate : this.props.onSelect; + props = { + ...props, + selectable: true, + onSelect, + maxSelected + }; + } + if (item.type === 'folder') { + const { + onDropFiles + } = this.props; + props = { + ...props, + onDropFiles + }; + return _react.default.createElement(Folder, props); + } + return _react.default.createElement(File, props); + } + render() { + const className = 'gallery__main-view--tile'; + return _react.default.createElement("div", { + className: className + }, _react.default.createElement("div", { + className: "gallery__folders" + }, this.props.files.filter(this.folderFilter).map(this.renderItem)), _react.default.createElement("div", { + className: "gallery__files" + }, this.props.files.filter(this.fileFilter).map(this.renderItem)), this.props.files.length === 0 && !this.props.loading && _react.default.createElement("p", { + className: "gallery__no-item-notice" + }, _i18n.default._t('AssetAdmin.NOITEMSFOUND')), _react.default.createElement("div", { + className: "gallery__load" + }, this.renderPagination())); + } +} +exports.Component = ThumbnailView; +ThumbnailView.defaultProps = _Gallery.galleryViewDefaultProps; +ThumbnailView.propTypes = { + ..._Gallery.galleryViewPropTypes, + File: _propTypes.default.elementType.isRequired, + Folder: _propTypes.default.elementType.isRequired +}; +const injector = (0, _Injector.inject)(['GalleryItemFile', 'GalleryItemFolder'], (GalleryItemFile, GalleryItemFolder) => ({ + File: GalleryItemFile, + Folder: GalleryItemFolder +}), () => 'AssetAdmin.Gallery.ThumbnailView'); +var _default = exports["default"] = injector(ThumbnailView); + +/***/ }), + +/***/ "./client/src/entwine/TinyMCE_ssmedia_sizepressets.js": +/*!************************************************************!*\ + !*** ./client/src/entwine/TinyMCE_ssmedia_sizepressets.js ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.imageSizePresetButtons = imageSizePresetButtons; +function presetButton(editor, preset) { + const { + name, + width, + text + } = preset; + const formatName = `ssmedia${name}`; + editor.on('init', () => { + editor.formatter.register(formatName, { + selector: 'img', + attributes: { + width: width ? width.toString() : '' + } + }); + }); + const image = () => { + let img = editor.selection.getNode(); + if (img.tagName !== 'IMG' && img.children.item('img')) { + img = img.children.item('img'); + } + return img && img.tagName === 'IMG' ? img : undefined; + }; + const disableCheck = button => { + const img = image(); + button.disabled(img && width ? img.naturalWidth < width : false); + }; + const formatMatches = () => { + if (editor.formatter.match(formatName)) { + return true; + } + const img = image(); + if (!width && img) { + const imgWidth = img.getAttribute('width'); + return !imgWidth || imgWidth.toString() === img.naturalWidth.toString(); + } + return false; + }; + const onPostRender = event => { + const button = event.target; + const onFormatChanged = () => { + button.active(formatMatches()); + }; + editor.on('NodeChange', () => { + disableCheck(button); + onFormatChanged(); + }); + disableCheck(button); + if (editor.formatter) { + editor.formatter.formatChanged(formatName, onFormatChanged); + if (formatMatches()) { + editor.formatter.apply(formatName); + const img = image(); + if (img) { + img.setAttribute('width', width || img.naturalWidth); + } + } + } + }; + const onAction = () => { + const img = image(); + if (!img) { + return; + } + img.removeAttribute('height'); + img.removeAttribute('width'); + editor.formatter.apply(formatName); + if (width) { + img.setAttribute('height', img.clientHeight); + } else { + img.setAttribute('width', img.naturalWidth); + img.setAttribute('height', img.naturalHeight); + } + }; + editor.ui.registry.addButton(formatName, { + text, + onAction, + onPostRender + }); + return formatName; +} +function imageSizePresetButtons(editor, sizePresets) { + return sizePresets.map(preset => presetButton(editor, preset)); +} + +/***/ }), + +/***/ "./client/src/lib/configShape.js": +/*!***************************************!*\ + !*** ./client/src/lib/configShape.js ***! + \***************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const configShape = _propTypes.default.shape({ + url: _propTypes.default.string, + limit: _propTypes.default.number, + imageRetry: _propTypes.default.shape({ + minRetry: _propTypes.default.number, + maxRetry: _propTypes.default.number, + expiry: _propTypes.default.number + }), + form: _propTypes.default.object, + dropzoneOptions: _propTypes.default.object +}); +var _default = exports["default"] = configShape; + +/***/ }), + +/***/ "./client/src/lib/fileShape.js": +/*!*************************************!*\ + !*** ./client/src/lib/fileShape.js ***! + \*************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const fileShape = _propTypes.default.shape({ + canEdit: _propTypes.default.bool, + canDelete: _propTypes.default.bool, + canView: _propTypes.default.bool, + exists: _propTypes.default.bool, + type: _propTypes.default.string, + smallThumbnail: _propTypes.default.string, + thumbnail: _propTypes.default.string, + width: _propTypes.default.number, + height: _propTypes.default.number, + category: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string]), + id: _propTypes.default.number, + url: _propTypes.default.string, + title: _propTypes.default.string, + progress: _propTypes.default.number, + visibility: _propTypes.default.string, + hasRestrictedAccess: _propTypes.default.bool, + isTrackedFormUpload: _propTypes.default.bool +}); +var _default = exports["default"] = fileShape; + +/***/ }), + +/***/ "./client/src/lib/getFormSchema.js": +/*!*****************************************!*\ + !*** ./client/src/lib/getFormSchema.js ***! + \*****************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getFormSchema; +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const { + CREATE_FOLDER, + EDIT_FILE +} = _index.default.ACTIONS; +function getFormSchema(_ref) { + let { + config: { + form + }, + viewAction, + folderId, + fileId, + type + } = _ref; + let schemaUrl = null; + let targetId = null; + if (viewAction === CREATE_FOLDER) { + schemaUrl = form.folderCreateForm.schemaUrl; + targetId = folderId; + return { + schemaUrl, + targetId + }; + } + if (viewAction === EDIT_FILE && fileId) { + switch (type) { + case 'insert-media': + schemaUrl = form.fileInsertForm.schemaUrl; + break; + case 'insert-link': + schemaUrl = form.fileEditorLinkForm.schemaUrl; + break; + case 'select': + schemaUrl = form.fileSelectForm.schemaUrl; + break; + case 'admin': + default: + schemaUrl = form.fileEditForm.schemaUrl; + break; + } + targetId = fileId; + return { + schemaUrl, + targetId + }; + } + return {}; +} + +/***/ }), + +/***/ "./client/src/lib/getStatusCodeMessage.js": +/*!************************************************!*\ + !*** ./client/src/lib/getStatusCodeMessage.js ***! + \************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getStatusCodeMessage; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function getStatusCodeMessage(statusCode, xhr) { + if (statusCode === 413) { + return _i18n.default._t('AssetAdmin.ERROR_FILE_SIZE', 'File size limit exceeded'); + } + if (statusCode === 403) { + if (xhr && typeof xhr.response === 'string') { + return xhr.response; + } + } + return _i18n.default._t('AssetAdmin.ERROR_DEFAULT', 'Something went wrong, please try again'); +} + +/***/ }), + +/***/ "./client/src/state/confirmDeletion/ConfirmDeletionActionTypes.js": +/*!************************************************************************!*\ + !*** ./client/src/state/confirmDeletion/ConfirmDeletionActionTypes.js ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + CONFIRM_DELETION_ASK: 'CONFIRM_DELETION_ASK', + CONFIRM_DELETION_CONFIRM: 'CONFIRM_DELETION_CONFIRM', + CONFIRM_DELETION_CANCEL: 'CONFIRM_DELETION_CANCEL', + CONFIRM_DELETION_RESET: 'CONFIRM_DELETION_RESET', + CONFIRM_DELETION_MODAL_CLOSE: 'CONFIRM_DELETION_MODAL_CLOSE' +}; + +/***/ }), + +/***/ "./client/src/state/confirmDeletion/ConfirmDeletionActions.js": +/*!********************************************************************!*\ + !*** ./client/src/state/confirmDeletion/ConfirmDeletionActions.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.cancel = cancel; +exports.confirm = confirm; +exports.deleting = deleting; +exports.modalClose = modalClose; +exports.reset = reset; +var _ConfirmDeletionActionTypes = _interopRequireDefault(__webpack_require__(/*! ./ConfirmDeletionActionTypes */ "./client/src/state/confirmDeletion/ConfirmDeletionActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function confirm(files) { + return { + type: _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_ASK, + payload: { + files + } + }; +} +function deleting() { + return { + type: _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_CONFIRM, + payload: {} + }; +} +function cancel() { + return { + type: _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_CANCEL, + payload: {} + }; +} +function reset() { + return { + type: _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_RESET, + payload: {} + }; +} +function modalClose() { + return { + type: _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_MODAL_CLOSE, + payload: {} + }; +} + +/***/ }), + +/***/ "./client/src/state/confirmDeletion/ConfirmDeletionTransitions.js": +/*!************************************************************************!*\ + !*** ./client/src/state/confirmDeletion/ConfirmDeletionTransitions.js ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.NO_TRANSITION = exports.DELETING = exports.CANCELING = void 0; +const NO_TRANSITION = exports.NO_TRANSITION = false; +const CANCELING = exports.CANCELING = 'canceling'; +const DELETING = exports.DELETING = 'deleting'; + +/***/ }), + +/***/ "./client/src/state/displaySearch/DisplaySearchActionTypes.js": +/*!********************************************************************!*\ + !*** ./client/src/state/displaySearch/DisplaySearchActionTypes.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + TOGGLE_SEARCH: 'TOGGLE_SEARCH', + OPEN_SEARCH: 'OPEN_SEARCH', + CLOSE_SEARCH: 'CLOSE_SEARCH' +}; + +/***/ }), + +/***/ "./client/src/state/displaySearch/DisplaySearchActions.js": +/*!****************************************************************!*\ + !*** ./client/src/state/displaySearch/DisplaySearchActions.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.closeSearch = closeSearch; +exports.openSearch = openSearch; +exports.toggleSearch = toggleSearch; +var _DisplaySearchActionTypes = _interopRequireDefault(__webpack_require__(/*! ./DisplaySearchActionTypes */ "./client/src/state/displaySearch/DisplaySearchActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function toggleSearch() { + return { + type: _DisplaySearchActionTypes.default.TOGGLE_SEARCH, + payload: null + }; +} +function openSearch() { + return { + type: _DisplaySearchActionTypes.default.OPEN_SEARCH, + payload: null + }; +} +function closeSearch() { + return { + type: _DisplaySearchActionTypes.default.CLOSE_SEARCH, + payload: null + }; +} + +/***/ }), + +/***/ "./client/src/state/gallery/GalleryActionTypes.js": +/*!********************************************************!*\ + !*** ./client/src/state/gallery/GalleryActionTypes.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = ['SET_LAST_SELECTED', 'SET_SELECTED_FILES', 'DESELECT_FILES', 'SELECT_FILES', 'LOAD_FILE_REQUEST', 'LOAD_FILE_SUCCESS', 'HIGHLIGHT_FILES', 'UPDATE_BATCH_ACTIONS', 'SET_NOTICE_MESSAGE', 'SET_ERROR_MESSAGE', 'SET_ENABLE_DROPZONE', 'SET_FILE_BADGE', 'CLEAR_FILE_BADGE', 'ACTIVATE_MODAL', 'DEACTIVATE_MODAL', 'CONCATENATE_SELECT', 'SET_LOADING'].reduce((obj, item) => Object.assign(obj, { + [item]: `GALLERY.${item}` +}), {}); + +/***/ }), + +/***/ "./client/src/state/gallery/GalleryActions.js": +/*!****************************************************!*\ + !*** ./client/src/state/gallery/GalleryActions.js ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.activateModal = activateModal; +exports.clearFileBadge = clearFileBadge; +exports.deactivateModal = deactivateModal; +exports.deselectFiles = deselectFiles; +exports.loadFile = loadFile; +exports.selectFiles = selectFiles; +exports.setConcatenateSelect = setConcatenateSelect; +exports.setEnableDropzone = setEnableDropzone; +exports.setErrorMessage = setErrorMessage; +exports.setFileBadge = setFileBadge; +exports.setLastSelected = setLastSelected; +exports.setLoading = setLoading; +exports.setNoticeMessage = setNoticeMessage; +exports.setSelectedFiles = setSelectedFiles; +var _GalleryActionTypes = _interopRequireDefault(__webpack_require__(/*! ./GalleryActionTypes */ "./client/src/state/gallery/GalleryActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function setLastSelected(id) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.SET_LAST_SELECTED, + payload: { + id + } + }); + }; +} +function setSelectedFiles(files) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.SET_SELECTED_FILES, + payload: { + files + } + }); + }; +} +function loadFile(id, file) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.LOAD_FILE_SUCCESS, + payload: { + id, + file + } + }); + }; +} +function selectFiles() { + let ids = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + return dispatch => dispatch({ + type: _GalleryActionTypes.default.SELECT_FILES, + payload: { + ids + } + }); +} +function setConcatenateSelect(concat) { + return dispatch => dispatch({ + type: _GalleryActionTypes.default.CONCATENATE_SELECT, + payload: !!concat + }); +} +function deselectFiles() { + let ids = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + return dispatch => dispatch({ + type: _GalleryActionTypes.default.DESELECT_FILES, + payload: { + ids + } + }); +} +function setNoticeMessage(message) { + return dispatch => dispatch({ + type: _GalleryActionTypes.default.SET_NOTICE_MESSAGE, + payload: { + message + } + }); +} +function setErrorMessage(message) { + return dispatch => dispatch({ + type: _GalleryActionTypes.default.SET_ERROR_MESSAGE, + payload: { + message + } + }); +} +function setEnableDropzone(enableDropzone) { + return dispatch => dispatch({ + type: _GalleryActionTypes.default.SET_ENABLE_DROPZONE, + payload: { + enableDropzone + } + }); +} +function clearFileBadge(id) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.CLEAR_FILE_BADGE, + payload: { + id + } + }); + }; +} +function setFileBadge(id, message, status, duration) { + return (dispatch, getState) => { + const { + assetAdmin + } = getState(); + const badge = assetAdmin.gallery.badges.find(item => item.id === id); + if (badge && badge.timer) { + clearTimeout(badge.timer); + } + const timer = duration > 0 ? setTimeout(() => clearFileBadge(id)(dispatch), duration) : null; + dispatch({ + type: _GalleryActionTypes.default.SET_FILE_BADGE, + payload: { + id, + message, + status, + timer + } + }); + }; +} +function activateModal(name) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.ACTIVATE_MODAL, + payload: name + }); + }; +} +function deactivateModal() { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.DEACTIVATE_MODAL + }); + }; +} +function setLoading(active) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.SET_LOADING, + payload: !!active + }); + }; +} + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadActionHandler.js": +/*!**************************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadActionHandler.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.defaultImageFactory = exports["default"] = void 0; +var _ImageLoadStatus = _interopRequireDefault(__webpack_require__(/*! ./ImageLoadStatus */ "./client/src/state/imageLoad/ImageLoadStatus.js")); +var _ImageLoadLocker = _interopRequireDefault(__webpack_require__(/*! ./ImageLoadLocker */ "./client/src/state/imageLoad/ImageLoadLocker.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const defaultOptions = { + minRetry: 0, + maxRetry: 0, + expiry: 0, + onStatusChange: () => null, + onRetry: () => null, + onReset: () => null, + onTimeout: () => null +}; +const defaultImageFactory = (url, resolve, reject) => { + const img = new Image(); + img.onload = resolve; + img.onerror = reject; + img.src = url; +}; +exports.defaultImageFactory = defaultImageFactory; +class ImageLoadActionHandler { + constructor(options) { + let factory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultImageFactory; + this.options = { + ...defaultOptions, + ...options + }; + this.factory = factory; + } + loadImage(url) { + if (!this.options.minRetry) { + return null; + } + if (!_ImageLoadLocker.default.lock(url)) { + return null; + } + return this.loadImageLoop(url, this.options.minRetry); + } + loadImageLoop(url, retryAfter) { + this.options.onStatusChange(url, _ImageLoadStatus.default.LOADING); + return new Promise((resolve, reject) => this.factory(url, resolve, reject)).then(() => this.handleSuccess(url)).catch(() => this.handleError(url, retryAfter)); + } + handleReset(url, resolve) { + this.options.onReset(url); + resolve(); + } + handleTimeout(callback, delay) { + const id = setTimeout(callback, delay); + this.options.onTimeout(id, delay); + return id; + } + handleSuccess(url) { + _ImageLoadLocker.default.unlock(url); + this.options.onStatusChange(url, _ImageLoadStatus.default.SUCCESS); + } + handleFailure(url) { + _ImageLoadLocker.default.unlock(url); + this.options.onStatusChange(url, _ImageLoadStatus.default.FAILED); + if (this.options.expiry) { + return new Promise(resolve => { + this.handleTimeout(() => this.handleReset(url, resolve), this.options.expiry * 1000); + }); + } + return null; + } + handleError(url, retryAfter) { + if (retryAfter > this.options.maxRetry) { + return this.handleFailure(url); + } + this.options.onStatusChange(url, _ImageLoadStatus.default.WAITING); + return this.handleRetry(url, retryAfter); + } + handleRetry(url, retryAfter) { + const promise = new Promise(resolve => { + this.handleTimeout(() => resolve(this.loadImageLoop(url, retryAfter * 2)), retryAfter * 1000); + }); + this.options.onRetry(url, retryAfter, promise); + return promise; + } + setOnRetry(callback) { + this.options.onRetry = callback; + } + setOnReset(callback) { + this.options.onReset = callback; + } + setOnStatusChange(callback) { + this.options.onStatusChange = callback; + } + setOnTimeout(callback) { + this.options.onTimeout = callback; + } +} +var _default = exports["default"] = ImageLoadActionHandler; + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadActionTypes.js": +/*!************************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadActionTypes.js ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + SET_STATUS: 'IMAGE_LOAD_SET_STATUS', + RESET: 'IMAGE_LOAD_RESET' +}; + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadActions.js": +/*!********************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadActions.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.loadImage = loadImage; +var _ImageLoadActionTypes = _interopRequireDefault(__webpack_require__(/*! ./ImageLoadActionTypes */ "./client/src/state/imageLoad/ImageLoadActionTypes.js")); +var _ImageLoadActionHandler = _interopRequireDefault(__webpack_require__(/*! ./ImageLoadActionHandler */ "./client/src/state/imageLoad/ImageLoadActionHandler.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function loadImage(url, options) { + return (dispatch, getState) => { + if (!url) { + return null; + } + const state = getState(); + const currentFile = state.assetAdmin.imageLoad.files.find(file => file.url === url); + if (currentFile) { + return null; + } + const loadOptions = { + ...options, + onStatusChange: (statusURL, status) => dispatch({ + type: _ImageLoadActionTypes.default.SET_STATUS, + payload: { + status, + url: statusURL + } + }), + onReset: statusURL => dispatch({ + type: _ImageLoadActionTypes.default.RESET, + payload: { + url: statusURL + } + }) + }; + const handler = new _ImageLoadActionHandler.default(loadOptions); + return handler.loadImage(url); + }; +} + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadLocker.js": +/*!*******************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadLocker.js ***! + \*******************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +class ImageLoadLocker { + constructor() { + this.urls = []; + } + lock(url) { + const index = this.urls.indexOf(url); + if (index >= 0) { + return false; + } + this.urls = [...this.urls, url]; + return true; + } + unlock(url) { + this.urls = this.urls.filter(next => next !== url); + } +} +exports.Component = ImageLoadLocker; +window.ss = window.ss || {}; +window.ss.imagelocker = window.ss.imagelocker || new ImageLoadLocker(); +var _default = exports["default"] = window.ss.imagelocker; + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadStatus.js": +/*!*******************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadStatus.js ***! + \*******************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + DISABLED: 'DISABLED', + NONE: 'NONE', + SUCCESS: 'SUCCESS', + LOADING: 'LOADING', + WAITING: 'WAITING', + FAILED: 'FAILED' +}; + +/***/ }), + +/***/ "./client/src/state/modal/ModalActionTypes.js": +/*!****************************************************!*\ + !*** ./client/src/state/modal/ModalActionTypes.js ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + DEFINE_IMAGE_SIZE_PRESETS: 'DEFINE_IMAGE_SIZE_PRESETS', + INIT_FORM_SCHEMA_STACK: 'INIT_FORM_SCHEMA_STACK', + POP_FORM_SCHEMA: 'POP_FORM_SCHEMA', + PUSH_FORM_SCHEMA: 'PUSH_FORM_SCHEMA', + RESET: 'RESET', + RESET_FORM_STACK: 'RESET_FORM_STACK' +}; + +/***/ }), + +/***/ "./client/src/state/modal/ModalActions.js": +/*!************************************************!*\ + !*** ./client/src/state/modal/ModalActions.js ***! + \************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.defineImageSizePresets = defineImageSizePresets; +exports.initFormStack = initFormStack; +exports.popFormStackEntry = popFormStackEntry; +exports.pushFormStackEntry = pushFormStackEntry; +exports.reset = reset; +exports.resetFormStack = resetFormStack; +exports.stashFormValues = stashFormValues; +var _getIn = _interopRequireDefault(__webpack_require__(/*! redux-form/lib/structure/plain/getIn */ "./node_modules/redux-form/lib/structure/plain/getIn.js")); +var _SchemaActions = __webpack_require__(/*! state/schema/SchemaActions */ "state/schema/SchemaActions"); +var _ModalActionTypes = _interopRequireDefault(__webpack_require__(/*! ./ModalActionTypes */ "./client/src/state/modal/ModalActionTypes.js")); +var _helpers = _interopRequireDefault(__webpack_require__(/*! ./helpers */ "./client/src/state/modal/helpers.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function defineImageSizePresets(imageSizePresets) { + return { + type: _ModalActionTypes.default.DEFINE_IMAGE_SIZE_PRESETS, + payload: { + imageSizePresets + } + }; +} +function stashFormValues(formIdentifier, schemaUrl) { + return (dispatch, getState) => { + const state = getState(); + const values = (0, _getIn.default)(state.form.formState, `${formIdentifier}.values`); + const fieldSchema = (0, _getIn.default)(state.form.formSchemas, `${schemaUrl}.schema.fields`); + if (values) { + const fields = Object.keys(values).filter(name => values[name] !== null && (0, _helpers.default)(name, fieldSchema)).map(name => ({ + name, + value: values[name] + })); + dispatch((0, _SchemaActions.setSchemaStateOverrides)(schemaUrl, { + fields + })); + } + }; +} +function pushFormStackEntry(type) { + let nextType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + return { + type: _ModalActionTypes.default.PUSH_FORM_SCHEMA, + payload: { + formSchema: { + type, + nextType + } + } + }; +} +function initFormStack(type) { + let nextType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + return { + type: _ModalActionTypes.default.INIT_FORM_SCHEMA_STACK, + payload: { + formSchema: { + type, + nextType + } + } + }; +} +function popFormStackEntry() { + return { + type: _ModalActionTypes.default.POP_FORM_SCHEMA + }; +} +function reset() { + return { + type: _ModalActionTypes.default.RESET + }; +} +function resetFormStack() { + return { + type: _ModalActionTypes.default.RESET_FORM_STACK + }; +} + +/***/ }), + +/***/ "./client/src/state/modal/helpers.js": +/*!*******************************************!*\ + !*** ./client/src/state/modal/helpers.js ***! + \*******************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isStashableField; +exports.findField = findField; +function findField(fieldName, fieldTree) { + let i; + for (i = 0; i < fieldTree.length; i++) { + const field = fieldTree[i]; + if (field.name === fieldName) { + return field; + } + if (field.children) { + const child = findField(fieldName, field.children); + if (child) { + return child; + } + } + } + return false; +} +function isStashableField(fieldName, fieldTree) { + const field = findField(fieldName, fieldTree); + return field && field.type !== 'hidden' && field.schemaType !== 'Structural' && !field.readOnly && !field.disabled; +} + +/***/ }), + +/***/ "./client/src/state/queuedFiles/QueuedFilesActionTypes.js": +/*!****************************************************************!*\ + !*** ./client/src/state/queuedFiles/QueuedFilesActionTypes.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + ADD_QUEUED_FILE: 'ADD_QUEUED_FILE', + FAIL_UPLOAD: 'FAIL_UPLOAD', + PURGE_UPLOAD_QUEUE: 'PURGE_UPLOAD_QUEUE', + REMOVE_QUEUED_FILE: 'REMOVE_QUEUED_FILE', + SUCCEED_UPLOAD: 'SUCCEED_UPLOAD', + UPDATE_QUEUED_FILE: 'UPDATE_QUEUED_FILE' +}; + +/***/ }), + +/***/ "./client/src/state/queuedFiles/QueuedFilesActions.js": +/*!************************************************************!*\ + !*** ./client/src/state/queuedFiles/QueuedFilesActions.js ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.addQueuedFile = addQueuedFile; +exports.failUpload = failUpload; +exports.purgeUploadQueue = purgeUploadQueue; +exports.removeQueuedFile = removeQueuedFile; +exports.succeedUpload = succeedUpload; +exports.updateQueuedFile = updateQueuedFile; +var _QueuedFilesActionTypes = _interopRequireDefault(__webpack_require__(/*! ./QueuedFilesActionTypes */ "./client/src/state/queuedFiles/QueuedFilesActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function addQueuedFile(file) { + return dispatch => dispatch({ + type: _QueuedFilesActionTypes.default.ADD_QUEUED_FILE, + payload: { + file + } + }); +} +function failUpload(queuedId, response, statusCodeMessage) { + return dispatch => { + let message = response.message; + if (response.errors && response.errors.length) { + message = response.errors[0]; + } + if (typeof response === 'string') { + message = { + value: statusCodeMessage || response, + type: 'error' + }; + } + return dispatch({ + type: _QueuedFilesActionTypes.default.FAIL_UPLOAD, + payload: { + queuedId, + message + } + }); + }; +} +function purgeUploadQueue() { + return dispatch => dispatch({ + type: _QueuedFilesActionTypes.default.PURGE_UPLOAD_QUEUE, + payload: null + }); +} +function removeQueuedFile(queuedId) { + return dispatch => dispatch({ + type: _QueuedFilesActionTypes.default.REMOVE_QUEUED_FILE, + payload: { + queuedId + } + }); +} +function succeedUpload(queuedId, json) { + return dispatch => dispatch({ + type: _QueuedFilesActionTypes.default.SUCCEED_UPLOAD, + payload: { + queuedId, + json + } + }); +} +function updateQueuedFile(queuedId, updates) { + return dispatch => dispatch({ + type: _QueuedFilesActionTypes.default.UPDATE_QUEUED_FILE, + payload: { + queuedId, + updates + } + }); +} + +/***/ }), + +/***/ "./node_modules/create-react-class/factory.js": +/*!****************************************************!*\ + !*** ./node_modules/create-react-class/factory.js ***! + \****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + + +var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); + +// -- Inlined from fbjs -- + +var emptyObject = {}; + +if (true) { + Object.freeze(emptyObject); +} + +var validateFormat = function validateFormat(format) {}; + +if (true) { + validateFormat = function validateFormat(format) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + }; +} + +function _invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); + + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +} + +var warning = function(){}; + +if (true) { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } + + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +// /-- Inlined from fbjs -- + +var MIXINS_KEY = 'mixins'; + +// Helper function to allow the creation of anonymous functions which do not +// have .name set to the name of the variable being assigned to. +function identity(fn) { + return fn; +} + +var ReactPropTypeLocationNames; +if (true) { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; +} else {} + +function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { + /** + * Policies that describe methods in `ReactClassInterface`. + */ + + var injectedMixins = []; + + /** + * Composite components are higher-level components that compose other composite + * or host components. + * + * To create a new type of `ReactClass`, pass a specification of + * your new class to `React.createClass`. The only requirement of your class + * specification is that you implement a `render` method. + * + * var MyComponent = React.createClass({ + * render: function() { + * return
Hello World
; + * } + * }); + * + * The class specification supports a specific protocol of methods that have + * special meaning (e.g. `render`). See `ReactClassInterface` for + * more the comprehensive protocol. Any other properties and methods in the + * class specification will be available on the prototype. + * + * @interface ReactClassInterface + * @internal + */ + var ReactClassInterface = { + /** + * An array of Mixin objects to include when defining your component. + * + * @type {array} + * @optional + */ + mixins: 'DEFINE_MANY', + + /** + * An object containing properties and methods that should be defined on + * the component's constructor instead of its prototype (static methods). + * + * @type {object} + * @optional + */ + statics: 'DEFINE_MANY', + + /** + * Definition of prop types for this component. + * + * @type {object} + * @optional + */ + propTypes: 'DEFINE_MANY', + + /** + * Definition of context types for this component. + * + * @type {object} + * @optional + */ + contextTypes: 'DEFINE_MANY', + + /** + * Definition of context types this component sets for its children. + * + * @type {object} + * @optional + */ + childContextTypes: 'DEFINE_MANY', + + // ==== Definition methods ==== + + /** + * Invoked when the component is mounted. Values in the mapping will be set on + * `this.props` if that prop is not specified (i.e. using an `in` check). + * + * This method is invoked before `getInitialState` and therefore cannot rely + * on `this.state` or use `this.setState`. + * + * @return {object} + * @optional + */ + getDefaultProps: 'DEFINE_MANY_MERGED', + + /** + * Invoked once before the component is mounted. The return value will be used + * as the initial value of `this.state`. + * + * getInitialState: function() { + * return { + * isOn: false, + * fooBaz: new BazFoo() + * } + * } + * + * @return {object} + * @optional + */ + getInitialState: 'DEFINE_MANY_MERGED', + + /** + * @return {object} + * @optional + */ + getChildContext: 'DEFINE_MANY_MERGED', + + /** + * Uses props from `this.props` and state from `this.state` to render the + * structure of the component. + * + * No guarantees are made about when or how often this method is invoked, so + * it must not have side effects. + * + * render: function() { + * var name = this.props.name; + * return
Hello, {name}!
; + * } + * + * @return {ReactComponent} + * @required + */ + render: 'DEFINE_ONCE', + + // ==== Delegate methods ==== + + /** + * Invoked when the component is initially created and about to be mounted. + * This may have side effects, but any external subscriptions or data created + * by this method must be cleaned up in `componentWillUnmount`. + * + * @optional + */ + componentWillMount: 'DEFINE_MANY', + + /** + * Invoked when the component has been mounted and has a DOM representation. + * However, there is no guarantee that the DOM node is in the document. + * + * Use this as an opportunity to operate on the DOM when the component has + * been mounted (initialized and rendered) for the first time. + * + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidMount: 'DEFINE_MANY', + + /** + * Invoked before the component receives new props. + * + * Use this as an opportunity to react to a prop transition by updating the + * state using `this.setState`. Current props are accessed via `this.props`. + * + * componentWillReceiveProps: function(nextProps, nextContext) { + * this.setState({ + * likesIncreasing: nextProps.likeCount > this.props.likeCount + * }); + * } + * + * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop + * transition may cause a state change, but the opposite is not true. If you + * need it, you are probably looking for `componentWillUpdate`. + * + * @param {object} nextProps + * @optional + */ + componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Invoked while deciding if the component should be updated as a result of + * receiving new props, state and/or context. + * + * Use this as an opportunity to `return false` when you're certain that the + * transition to the new props/state/context will not require a component + * update. + * + * shouldComponentUpdate: function(nextProps, nextState, nextContext) { + * return !equal(nextProps, this.props) || + * !equal(nextState, this.state) || + * !equal(nextContext, this.context); + * } + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @return {boolean} True if the component should update. + * @optional + */ + shouldComponentUpdate: 'DEFINE_ONCE', + + /** + * Invoked when the component is about to update due to a transition from + * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` + * and `nextContext`. + * + * Use this as an opportunity to perform preparation before an update occurs. + * + * NOTE: You **cannot** use `this.setState()` in this method. + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @param {ReactReconcileTransaction} transaction + * @optional + */ + componentWillUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component's DOM representation has been updated. + * + * Use this as an opportunity to operate on the DOM when the component has + * been updated. + * + * @param {object} prevProps + * @param {?object} prevState + * @param {?object} prevContext + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component is about to be removed from its parent and have + * its DOM representation destroyed. + * + * Use this as an opportunity to deallocate any external resources. + * + * NOTE: There is no `componentDidUnmount` since your component will have been + * destroyed by that point. + * + * @optional + */ + componentWillUnmount: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillMount`. + * + * @optional + */ + UNSAFE_componentWillMount: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillReceiveProps`. + * + * @optional + */ + UNSAFE_componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillUpdate`. + * + * @optional + */ + UNSAFE_componentWillUpdate: 'DEFINE_MANY', + + // ==== Advanced methods ==== + + /** + * Updates the component's currently mounted DOM representation. + * + * By default, this implements React's rendering and reconciliation algorithm. + * Sophisticated clients may wish to override this. + * + * @param {ReactReconcileTransaction} transaction + * @internal + * @overridable + */ + updateComponent: 'OVERRIDE_BASE' + }; + + /** + * Similar to ReactClassInterface but for static methods. + */ + var ReactClassStaticInterface = { + /** + * This method is invoked after a component is instantiated and when it + * receives new props. Return an object to update state in response to + * prop changes. Return null to indicate no change to state. + * + * If an object is returned, its keys will be merged into the existing state. + * + * @return {object || null} + * @optional + */ + getDerivedStateFromProps: 'DEFINE_MANY_MERGED' + }; + + /** + * Mapping from class specification keys to special processing functions. + * + * Although these are declared like instance properties in the specification + * when defining classes using `React.createClass`, they are actually static + * and are accessible on the constructor instead of the prototype. Despite + * being static, they must be defined outside of the "statics" key under + * which all other static methods are defined. + */ + var RESERVED_SPEC_KEYS = { + displayName: function(Constructor, displayName) { + Constructor.displayName = displayName; + }, + mixins: function(Constructor, mixins) { + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + mixSpecIntoComponent(Constructor, mixins[i]); + } + } + }, + childContextTypes: function(Constructor, childContextTypes) { + if (true) { + validateTypeDef(Constructor, childContextTypes, 'childContext'); + } + Constructor.childContextTypes = _assign( + {}, + Constructor.childContextTypes, + childContextTypes + ); + }, + contextTypes: function(Constructor, contextTypes) { + if (true) { + validateTypeDef(Constructor, contextTypes, 'context'); + } + Constructor.contextTypes = _assign( + {}, + Constructor.contextTypes, + contextTypes + ); + }, + /** + * Special case getDefaultProps which should move into statics but requires + * automatic merging. + */ + getDefaultProps: function(Constructor, getDefaultProps) { + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps = createMergedResultFunction( + Constructor.getDefaultProps, + getDefaultProps + ); + } else { + Constructor.getDefaultProps = getDefaultProps; + } + }, + propTypes: function(Constructor, propTypes) { + if (true) { + validateTypeDef(Constructor, propTypes, 'prop'); + } + Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); + }, + statics: function(Constructor, statics) { + mixStaticSpecIntoComponent(Constructor, statics); + }, + autobind: function() {} + }; + + function validateTypeDef(Constructor, typeDef, location) { + for (var propName in typeDef) { + if (typeDef.hasOwnProperty(propName)) { + // use a warning instead of an _invariant so components + // don't show up in prod but only in __DEV__ + if (true) { + warning( + typeof typeDef[propName] === 'function', + '%s: %s type `%s` is invalid; it must be a function, usually from ' + + 'React.PropTypes.', + Constructor.displayName || 'ReactClass', + ReactPropTypeLocationNames[location], + propName + ); + } + } + } + } + + function validateMethodOverride(isAlreadyDefined, name) { + var specPolicy = ReactClassInterface.hasOwnProperty(name) + ? ReactClassInterface[name] + : null; + + // Disallow overriding of base class methods unless explicitly allowed. + if (ReactClassMixin.hasOwnProperty(name)) { + _invariant( + specPolicy === 'OVERRIDE_BASE', + 'ReactClassInterface: You are attempting to override ' + + '`%s` from your class specification. Ensure that your method names ' + + 'do not overlap with React methods.', + name + ); + } + + // Disallow defining methods more than once unless explicitly allowed. + if (isAlreadyDefined) { + _invariant( + specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', + 'ReactClassInterface: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be due ' + + 'to a mixin.', + name + ); + } + } + + /** + * Mixin helper which handles policy validation and reserved + * specification keys when building React classes. + */ + function mixSpecIntoComponent(Constructor, spec) { + if (!spec) { + if (true) { + var typeofSpec = typeof spec; + var isMixinValid = typeofSpec === 'object' && spec !== null; + + if (true) { + warning( + isMixinValid, + "%s: You're attempting to include a mixin that is either null " + + 'or not an object. Check the mixins included by the component, ' + + 'as well as any mixins they include themselves. ' + + 'Expected object but got %s.', + Constructor.displayName || 'ReactClass', + spec === null ? null : typeofSpec + ); + } + } + + return; + } + + _invariant( + typeof spec !== 'function', + "ReactClass: You're attempting to " + + 'use a component class or function as a mixin. Instead, just use a ' + + 'regular object.' + ); + _invariant( + !isValidElement(spec), + "ReactClass: You're attempting to " + + 'use a component as a mixin. Instead, just use a regular object.' + ); + + var proto = Constructor.prototype; + var autoBindPairs = proto.__reactAutoBindPairs; + + // By handling mixins before any other properties, we ensure the same + // chaining order is applied to methods with DEFINE_MANY policy, whether + // mixins are listed before or after these methods in the spec. + if (spec.hasOwnProperty(MIXINS_KEY)) { + RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); + } + + for (var name in spec) { + if (!spec.hasOwnProperty(name)) { + continue; + } + + if (name === MIXINS_KEY) { + // We have already handled mixins in a special case above. + continue; + } + + var property = spec[name]; + var isAlreadyDefined = proto.hasOwnProperty(name); + validateMethodOverride(isAlreadyDefined, name); + + if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { + RESERVED_SPEC_KEYS[name](Constructor, property); + } else { + // Setup methods on prototype: + // The following member methods should not be automatically bound: + // 1. Expected ReactClass methods (in the "interface"). + // 2. Overridden methods (that were mixed in). + var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); + var isFunction = typeof property === 'function'; + var shouldAutoBind = + isFunction && + !isReactClassMethod && + !isAlreadyDefined && + spec.autobind !== false; + + if (shouldAutoBind) { + autoBindPairs.push(name, property); + proto[name] = property; + } else { + if (isAlreadyDefined) { + var specPolicy = ReactClassInterface[name]; + + // These cases should already be caught by validateMethodOverride. + _invariant( + isReactClassMethod && + (specPolicy === 'DEFINE_MANY_MERGED' || + specPolicy === 'DEFINE_MANY'), + 'ReactClass: Unexpected spec policy %s for key %s ' + + 'when mixing in component specs.', + specPolicy, + name + ); + + // For methods which are defined more than once, call the existing + // methods before calling the new property, merging if appropriate. + if (specPolicy === 'DEFINE_MANY_MERGED') { + proto[name] = createMergedResultFunction(proto[name], property); + } else if (specPolicy === 'DEFINE_MANY') { + proto[name] = createChainedFunction(proto[name], property); + } + } else { + proto[name] = property; + if (true) { + // Add verbose displayName to the function, which helps when looking + // at profiling tools. + if (typeof property === 'function' && spec.displayName) { + proto[name].displayName = spec.displayName + '_' + name; + } + } + } + } + } + } + } + + function mixStaticSpecIntoComponent(Constructor, statics) { + if (!statics) { + return; + } + + for (var name in statics) { + var property = statics[name]; + if (!statics.hasOwnProperty(name)) { + continue; + } + + var isReserved = name in RESERVED_SPEC_KEYS; + _invariant( + !isReserved, + 'ReactClass: You are attempting to define a reserved ' + + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + + 'as an instance property instead; it will still be accessible on the ' + + 'constructor.', + name + ); + + var isAlreadyDefined = name in Constructor; + if (isAlreadyDefined) { + var specPolicy = ReactClassStaticInterface.hasOwnProperty(name) + ? ReactClassStaticInterface[name] + : null; + + _invariant( + specPolicy === 'DEFINE_MANY_MERGED', + 'ReactClass: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be ' + + 'due to a mixin.', + name + ); + + Constructor[name] = createMergedResultFunction(Constructor[name], property); + + return; + } + + Constructor[name] = property; + } + } + + /** + * Merge two objects, but throw if both contain the same key. + * + * @param {object} one The first object, which is mutated. + * @param {object} two The second object + * @return {object} one after it has been mutated to contain everything in two. + */ + function mergeIntoWithNoDuplicateKeys(one, two) { + _invariant( + one && two && typeof one === 'object' && typeof two === 'object', + 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' + ); + + for (var key in two) { + if (two.hasOwnProperty(key)) { + _invariant( + one[key] === undefined, + 'mergeIntoWithNoDuplicateKeys(): ' + + 'Tried to merge two objects with the same key: `%s`. This conflict ' + + 'may be due to a mixin; in particular, this may be caused by two ' + + 'getInitialState() or getDefaultProps() methods returning objects ' + + 'with clashing keys.', + key + ); + one[key] = two[key]; + } + } + return one; + } + + /** + * Creates a function that invokes two functions and merges their return values. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createMergedResultFunction(one, two) { + return function mergedResult() { + var a = one.apply(this, arguments); + var b = two.apply(this, arguments); + if (a == null) { + return b; + } else if (b == null) { + return a; + } + var c = {}; + mergeIntoWithNoDuplicateKeys(c, a); + mergeIntoWithNoDuplicateKeys(c, b); + return c; + }; + } + + /** + * Creates a function that invokes two functions and ignores their return vales. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createChainedFunction(one, two) { + return function chainedFunction() { + one.apply(this, arguments); + two.apply(this, arguments); + }; + } + + /** + * Binds a method to the component. + * + * @param {object} component Component whose method is going to be bound. + * @param {function} method Method to be bound. + * @return {function} The bound method. + */ + function bindAutoBindMethod(component, method) { + var boundMethod = method.bind(component); + if (true) { + boundMethod.__reactBoundContext = component; + boundMethod.__reactBoundMethod = method; + boundMethod.__reactBoundArguments = null; + var componentName = component.constructor.displayName; + var _bind = boundMethod.bind; + boundMethod.bind = function(newThis) { + for ( + var _len = arguments.length, + args = Array(_len > 1 ? _len - 1 : 0), + _key = 1; + _key < _len; + _key++ + ) { + args[_key - 1] = arguments[_key]; + } + + // User is trying to bind() an autobound method; we effectively will + // ignore the value of "this" that the user is trying to use, so + // let's warn. + if (newThis !== component && newThis !== null) { + if (true) { + warning( + false, + 'bind(): React component methods may only be bound to the ' + + 'component instance. See %s', + componentName + ); + } + } else if (!args.length) { + if (true) { + warning( + false, + 'bind(): You are binding a component method to the component. ' + + 'React does this for you automatically in a high-performance ' + + 'way, so you can safely remove this call. See %s', + componentName + ); + } + return boundMethod; + } + var reboundMethod = _bind.apply(boundMethod, arguments); + reboundMethod.__reactBoundContext = component; + reboundMethod.__reactBoundMethod = method; + reboundMethod.__reactBoundArguments = args; + return reboundMethod; + }; + } + return boundMethod; + } + + /** + * Binds all auto-bound methods in a component. + * + * @param {object} component Component whose method is going to be bound. + */ + function bindAutoBindMethods(component) { + var pairs = component.__reactAutoBindPairs; + for (var i = 0; i < pairs.length; i += 2) { + var autoBindKey = pairs[i]; + var method = pairs[i + 1]; + component[autoBindKey] = bindAutoBindMethod(component, method); + } + } + + var IsMountedPreMixin = { + componentDidMount: function() { + this.__isMounted = true; + } + }; + + var IsMountedPostMixin = { + componentWillUnmount: function() { + this.__isMounted = false; + } + }; + + /** + * Add more to the ReactClass base class. These are all legacy features and + * therefore not already part of the modern ReactComponent. + */ + var ReactClassMixin = { + /** + * TODO: This will be deprecated because state should always keep a consistent + * type signature and the only use case for this, is to avoid that. + */ + replaceState: function(newState, callback) { + this.updater.enqueueReplaceState(this, newState, callback); + }, + + /** + * Checks whether or not this composite component is mounted. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function() { + if (true) { + warning( + this.__didWarnIsMounted, + '%s: isMounted is deprecated. Instead, make sure to clean up ' + + 'subscriptions and pending requests in componentWillUnmount to ' + + 'prevent memory leaks.', + (this.constructor && this.constructor.displayName) || + this.name || + 'Component' + ); + this.__didWarnIsMounted = true; + } + return !!this.__isMounted; + } + }; + + var ReactClassComponent = function() {}; + _assign( + ReactClassComponent.prototype, + ReactComponent.prototype, + ReactClassMixin + ); + + /** + * Creates a composite component class given a class specification. + * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass + * + * @param {object} spec Class specification (which must define `render`). + * @return {function} Component constructor function. + * @public + */ + function createClass(spec) { + // To keep our warnings more understandable, we'll use a little hack here to + // ensure that Constructor.name !== 'Constructor'. This makes sure we don't + // unnecessarily identify a class without displayName as 'Constructor'. + var Constructor = identity(function(props, context, updater) { + // This constructor gets overridden by mocks. The argument is used + // by mocks to assert on what gets mounted. + + if (true) { + warning( + this instanceof Constructor, + 'Something is calling a React component directly. Use a factory or ' + + 'JSX instead. See: https://fb.me/react-legacyfactory' + ); + } + + // Wire up auto-binding + if (this.__reactAutoBindPairs.length) { + bindAutoBindMethods(this); + } + + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + + this.state = null; + + // ReactClasses doesn't have constructors. Instead, they use the + // getInitialState and componentWillMount methods for initialization. + + var initialState = this.getInitialState ? this.getInitialState() : null; + if (true) { + // We allow auto-mocks to proceed as if they're returning null. + if ( + initialState === undefined && + this.getInitialState._isMockFunction + ) { + // This is probably bad practice. Consider warning here and + // deprecating this convenience. + initialState = null; + } + } + _invariant( + typeof initialState === 'object' && !Array.isArray(initialState), + '%s.getInitialState(): must return an object or null', + Constructor.displayName || 'ReactCompositeComponent' + ); + + this.state = initialState; + }); + Constructor.prototype = new ReactClassComponent(); + Constructor.prototype.constructor = Constructor; + Constructor.prototype.__reactAutoBindPairs = []; + + injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); + + mixSpecIntoComponent(Constructor, IsMountedPreMixin); + mixSpecIntoComponent(Constructor, spec); + mixSpecIntoComponent(Constructor, IsMountedPostMixin); + + // Initialize the defaultProps property after all mixins have been merged. + if (Constructor.getDefaultProps) { + Constructor.defaultProps = Constructor.getDefaultProps(); + } + + if (true) { + // This is a tag to indicate that the use of these method names is ok, + // since it's used with createClass. If it's not, then it's likely a + // mistake so we'll warn you to use the static property, property + // initializer or constructor respectively. + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps.isReactClassApproved = {}; + } + if (Constructor.prototype.getInitialState) { + Constructor.prototype.getInitialState.isReactClassApproved = {}; + } + } + + _invariant( + Constructor.prototype.render, + 'createClass(...): Class specification must implement a `render` method.' + ); + + if (true) { + warning( + !Constructor.prototype.componentShouldUpdate, + '%s has a method called ' + + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + + 'The name is phrased as a question because the function is ' + + 'expected to return a value.', + spec.displayName || 'A component' + ); + warning( + !Constructor.prototype.componentWillRecieveProps, + '%s has a method called ' + + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', + spec.displayName || 'A component' + ); + warning( + !Constructor.prototype.UNSAFE_componentWillRecieveProps, + '%s has a method called UNSAFE_componentWillRecieveProps(). ' + + 'Did you mean UNSAFE_componentWillReceiveProps()?', + spec.displayName || 'A component' + ); + } + + // Reduce time spent doing lookups by setting these on the prototype. + for (var methodName in ReactClassInterface) { + if (!Constructor.prototype[methodName]) { + Constructor.prototype[methodName] = null; + } + } + + return Constructor; + } + + return createClass; +} + +module.exports = factory; + + +/***/ }), + +/***/ "./node_modules/create-react-class/index.js": +/*!**************************************************!*\ + !*** ./node_modules/create-react-class/index.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + + +var React = __webpack_require__(/*! react */ "react"); +var factory = __webpack_require__(/*! ./factory */ "./node_modules/create-react-class/factory.js"); + +if (typeof React === 'undefined') { + throw Error( + 'create-react-class could not find the React object. If you are using script tags, ' + + 'make sure that React is being loaded before create-react-class.' + ); +} + +// Hack to grab NoopUpdateQueue from isomorphic React +var ReactNoopUpdateQueue = new React.Component().updater; + +module.exports = factory( + React.Component, + React.isValidElement, + ReactNoopUpdateQueue +); + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/columnProperties.js": +/*!****************************************************************!*\ + !*** ./node_modules/griddle-react/modules/columnProperties.js ***! + \****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + +var map = __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js"); +var filter = __webpack_require__(/*! lodash/filter */ "./node_modules/lodash/filter.js"); +var find = __webpack_require__(/*! lodash/find */ "./node_modules/lodash/find.js"); +var sortBy = __webpack_require__(/*! lodash/sortBy */ "./node_modules/lodash/sortBy.js"); +var difference = __webpack_require__(/*! lodash/difference */ "./node_modules/lodash/difference.js"); + +var ColumnProperties = (function () { + function ColumnProperties() { + var allColumns = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + var filteredColumns = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1]; + var childrenColumnName = arguments.length <= 2 || arguments[2] === undefined ? "children" : arguments[2]; + var columnMetadata = arguments.length <= 3 || arguments[3] === undefined ? [] : arguments[3]; + var metadataColumns = arguments.length <= 4 || arguments[4] === undefined ? [] : arguments[4]; + + _classCallCheck(this, ColumnProperties); + + this.allColumns = allColumns; + this.filteredColumns = filteredColumns; + this.childrenColumnName = childrenColumnName; + this.columnMetadata = columnMetadata; + this.metadataColumns = metadataColumns; + } + + _createClass(ColumnProperties, [{ + key: 'getMetadataColumns', + value: function getMetadataColumns() { + var meta = map(filter(this.columnMetadata, { visible: false }), function (item) { + return item.columnName; + }); + if (meta.indexOf(this.childrenColumnName) < 0) { + meta.push(this.childrenColumnName); + } + return meta.concat(this.metadataColumns); + } + }, { + key: 'getVisibleColumnCount', + value: function getVisibleColumnCount() { + return this.getColumns().length; + } + }, { + key: 'getColumnMetadataByName', + value: function getColumnMetadataByName(name) { + return find(this.columnMetadata, { columnName: name }); + } + }, { + key: 'hasColumnMetadata', + value: function hasColumnMetadata() { + return this.columnMetadata !== null && this.columnMetadata.length > 0; + } + }, { + key: 'getMetadataColumnProperty', + value: function getMetadataColumnProperty(columnName, propertyName, defaultValue) { + var meta = this.getColumnMetadataByName(columnName); + + //send back the default value if meta isn't there + if (typeof meta === "undefined" || meta === null) return defaultValue; + + return meta.hasOwnProperty(propertyName) ? meta[propertyName] : defaultValue; + } + }, { + key: 'orderColumns', + value: function orderColumns(cols) { + var _this = this; + + var ORDER_MAX = 100; + + var orderedColumns = sortBy(cols, function (item) { + var metaItem = find(_this.columnMetadata, { columnName: item }); + + if (typeof metaItem === 'undefined' || metaItem === null || isNaN(metaItem.order)) { + return ORDER_MAX; + } + + return metaItem.order; + }); + + return orderedColumns; + } + }, { + key: 'getColumns', + value: function getColumns() { + //if we didn't set default or filter + var filteredColumns = this.filteredColumns.length === 0 ? this.allColumns : this.filteredColumns; + + filteredColumns = difference(filteredColumns, this.metadataColumns); + + filteredColumns = this.orderColumns(filteredColumns); + + return filteredColumns; + } + }]); + + return ColumnProperties; +})(); + +module.exports = ColumnProperties; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/customFilterContainer.jsx.js": +/*!*************************************************************************!*\ + !*** ./node_modules/griddle-react/modules/customFilterContainer.jsx.js ***! + \*************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); + +var CustomFilterContainer = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "placeholderText": "" + }; + }, + render: function render() { + var that = this; + + if (typeof that.props.customFilterComponent !== 'function') { + console.log("Couldn't find valid template."); + return React.createElement('div', null); + } + + return React.createElement(that.props.customFilterComponent, { + changeFilter: this.props.changeFilter, + results: this.props.results, + currentResults: this.props.currentResults, + placeholderText: this.props.placeholderText }); + } +}); + +module.exports = CustomFilterContainer; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/customPaginationContainer.jsx.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/griddle-react/modules/customPaginationContainer.jsx.js ***! + \*****************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + Griddle - Simple Grid Component for React + https://github.com/DynamicTyped/Griddle + Copyright (c) 2014 Ryan Lanciaux | DynamicTyped + + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i];for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + }return target; +}; + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); + +var CustomPaginationContainer = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "maxPage": 0, + "nextText": "", + "previousText": "", + "currentPage": 0, + "customPagerComponent": {}, + "customPagerComponentOptions": {} + }; + }, + render: function render() { + var that = this; + + if (typeof that.props.customPagerComponent !== 'function') { + console.log("Couldn't find valid template."); + return React.createElement('div', null); + } + + return React.createElement(that.props.customPagerComponent, _extends({}, this.props.customPagerComponentOptions, { maxPage: this.props.maxPage, nextText: this.props.nextText, previousText: this.props.previousText, currentPage: this.props.currentPage, setPage: this.props.setPage, previous: this.props.previous, next: this.props.next })); + } +}); + +module.exports = CustomPaginationContainer; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/customRowComponentContainer.jsx.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/griddle-react/modules/customRowComponentContainer.jsx.js ***! + \*******************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + Griddle - Simple Grid Component for React + https://github.com/DynamicTyped/Griddle + Copyright (c) 2014 Ryan Lanciaux | DynamicTyped + + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); + +var CustomRowComponentContainer = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "data": [], + "metadataColumns": [], + "className": "", + "customComponent": {}, + "globalData": {} + }; + }, + render: function render() { + var that = this; + + if (typeof that.props.customComponent !== 'function') { + console.log("Couldn't find valid template."); + return React.createElement('div', { className: this.props.className }); + } + + var nodes = this.props.data.map(function (row, index) { + return React.createElement(that.props.customComponent, { data: row, metadataColumns: that.props.metadataColumns, key: index, globalData: that.props.globalData }); + }); + + var footer = this.props.showPager && this.props.pagingContent; + return React.createElement('div', { className: this.props.className, style: this.props.style }, nodes); + } +}); + +module.exports = CustomRowComponentContainer; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/deep.js": +/*!****************************************************!*\ + !*** ./node_modules/griddle-react/modules/deep.js ***! + \****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var forEach = __webpack_require__(/*! lodash/forEach */ "./node_modules/lodash/forEach.js"); +var isObject = __webpack_require__(/*! lodash/isObject */ "./node_modules/lodash/isObject.js"); +var isArray = __webpack_require__(/*! lodash/isArray */ "./node_modules/lodash/isArray.js"); +var isFunction = __webpack_require__(/*! lodash/isFunction */ "./node_modules/lodash/isFunction.js"); +var isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ "./node_modules/lodash/isPlainObject.js"); +var forOwn = __webpack_require__(/*! lodash/forOwn */ "./node_modules/lodash/forOwn.js"); + +// Credits: https://github.com/documentcloud/underscore-contrib +// Sub module: underscore.object.selectors +// License: MIT (https://github.com/documentcloud/underscore-contrib/blob/master/LICENSE) +// https://github.com/documentcloud/underscore-contrib/blob/master/underscore.object.selectors.js + +// Will take a path like 'element[0][1].subElement["Hey!.What?"]["[hey]"]' +// and return ["element", "0", "1", "subElement", "Hey!.What?", "[hey]"] +function keysFromPath(path) { + // from http://codereview.stackexchange.com/a/63010/8176 + /** + * Repeatedly capture either: + * - a bracketed expression, discarding optional matching quotes inside, or + * - an unbracketed expression, delimited by a dot or a bracket. + */ + var re = /\[("|')(.+)\1\]|([^.\[\]]+)/g; + + var elements = []; + var result; + while ((result = re.exec(path)) !== null) { + elements.push(result[2] || result[3]); + } + return elements; +} + +// Gets the value at any depth in a nested object based on the +// path described by the keys given. Keys may be given as an array +// or as a dot-separated string. +function getPath(obj, ks) { + if (typeof ks == "string") { + if (obj[ks] !== undefined) { + return obj[ks]; + } + ks = keysFromPath(ks); + } + + var i = -1, + length = ks.length; + + // If the obj is null or undefined we have to break as + // a TypeError will result trying to access any property + // Otherwise keep incrementally access the next property in + // ks until complete + while (++i < length && obj != null) { + obj = obj[ks[i]]; + } + return i === length ? obj : void 0; +} + +// Based on the origin underscore _.pick function +// Credit: https://github.com/jashkenas/underscore/blob/master/underscore.js +function powerPick(object, keys) { + var result = {}, + obj = object, + iteratee; + iteratee = function (key, obj) { + return key in obj; + }; + + obj = Object(obj); + + for (var i = 0, length = keys.length; i < length; i++) { + var key = keys[i]; + if (iteratee(key, obj)) result[key] = getPath(obj, key); + } + + return result; +} + +// Gets all the keys for a flattened object structure. +// Doesn't flatten arrays. +// Input: +// { +// a: { +// x: 1, +// y: 2 +// }, +// b: [3, 4], +// c: 5 +// } +// Output: +// [ +// "a.x", +// "a.y", +// "b", +// "c" +// ] +function getKeys(obj, prefix) { + var keys = []; + + forEach(obj, function (value, key) { + var fullKey = prefix ? prefix + "." + key : key; + if (isObject(value) && !isArray(value) && !isFunction(value) && !(value instanceof Date)) { + keys = keys.concat(getKeys(value, fullKey)); + } else { + keys.push(fullKey); + } + }); + + return keys; +} + +// Recursivly traverse plain objects and arrays calling `fn` on each +// non-object/non-array leaf node. +function iterObject(thing, fn) { + if (isArray(thing)) { + forEach(thing, function (item) { + iterObject(item, fn); + }); + } else if (isPlainObject(thing)) { + forOwn(thing, function (item) { + iterObject(item, fn); + }); + } else { + fn(thing); + } +} + +// Recursivly traverse plain objects and arrays and build a list of all +// non-object/non-array leaf nodes. +// +// Input: +// { "array": [1, "two", {"tree": 3}], "string": "a string" } +// +// Output: +// [1, 'two', 3, 'a string'] +// +function getObjectValues(thing) { + var results = []; + iterObject(thing, function (value) { + results.push(value); + }); + return results; +} + +module.exports = { + pick: powerPick, + getAt: getPath, + keys: getKeys, + getObjectValues: getObjectValues +}; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridFilter.jsx.js": +/*!**************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridFilter.jsx.js ***! + \**************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); + +var GridFilter = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "placeholderText": "" + }; + }, + handleChange: function handleChange(event) { + this.props.changeFilter(event.target.value); + }, + render: function render() { + return React.createElement('div', { className: 'filter-container' }, React.createElement('input', { type: 'text', name: 'filter', placeholder: this.props.placeholderText, className: 'form-control', onChange: this.handleChange })); + } +}); + +module.exports = GridFilter; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridNoData.jsx.js": +/*!**************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridNoData.jsx.js ***! + \**************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); + +var GridNoData = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "noDataMessage": "No Data" + }; + }, + render: function render() { + var that = this; + + return React.createElement('div', null, this.props.noDataMessage); + } +}); + +module.exports = GridNoData; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridPagination.jsx.js": +/*!******************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridPagination.jsx.js ***! + \******************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var assign = __webpack_require__(/*! lodash/assign */ "./node_modules/lodash/assign.js"); + +//needs props maxPage, currentPage, nextFunction, prevFunction +var GridPagination = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "maxPage": 0, + "nextText": "", + "previousText": "", + "currentPage": 0, + "useGriddleStyles": true, + "nextClassName": "griddle-next", + "previousClassName": "griddle-previous", + "nextIconComponent": null, + "previousIconComponent": null + }; + }, + pageChange: function pageChange(event) { + this.props.setPage(parseInt(event.target.value, 10) - 1); + }, + render: function render() { + var previous = ""; + var next = ""; + + if (this.props.currentPage > 0) { + previous = React.createElement('button', { type: 'button', onClick: this.props.previous, style: this.props.useGriddleStyles ? { "color": "#222", border: "none", background: "none", margin: "0 0 0 10px" } : null }, this.props.previousIconComponent, this.props.previousText); + } + + if (this.props.currentPage !== this.props.maxPage - 1) { + next = React.createElement('button', { type: 'button', onClick: this.props.next, style: this.props.useGriddleStyles ? { "color": "#222", border: "none", background: "none", margin: "0 10px 0 0" } : null }, this.props.nextText, this.props.nextIconComponent); + } + + var leftStyle = null; + var middleStyle = null; + var rightStyle = null; + + if (this.props.useGriddleStyles === true) { + var baseStyle = { + "float": "left", + minHeight: "1px", + marginTop: "5px" + }; + + rightStyle = assign({ textAlign: "right", width: "34%" }, baseStyle); + middleStyle = assign({ textAlign: "center", width: "33%" }, baseStyle); + leftStyle = assign({ width: "33%" }, baseStyle); + } + + var options = []; + + for (var i = 1; i <= this.props.maxPage; i++) { + options.push(React.createElement('option', { value: i, key: i }, i)); + } + + return React.createElement('div', { style: this.props.useGriddleStyles ? { minHeight: "35px" } : null }, React.createElement('div', { className: this.props.previousClassName, style: leftStyle }, previous), React.createElement('div', { className: 'griddle-page', style: middleStyle }, React.createElement('select', { value: this.props.currentPage + 1, onChange: this.pageChange }, options), ' / ', this.props.maxPage), React.createElement('div', { className: this.props.nextClassName, style: rightStyle }, next)); + } +}); + +module.exports = GridPagination; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridRow.jsx.js": +/*!***********************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridRow.jsx.js ***! + \***********************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var ColumnProperties = __webpack_require__(/*! ./columnProperties.js */ "./node_modules/griddle-react/modules/columnProperties.js"); +var deep = __webpack_require__(/*! ./deep.js */ "./node_modules/griddle-react/modules/deep.js"); +var isFunction = __webpack_require__(/*! lodash/isFunction */ "./node_modules/lodash/isFunction.js"); +var zipObject = __webpack_require__(/*! lodash/zipObject */ "./node_modules/lodash/zipObject.js"); +var assign = __webpack_require__(/*! lodash/assign */ "./node_modules/lodash/assign.js"); +var defaults = __webpack_require__(/*! lodash/defaults */ "./node_modules/lodash/defaults.js"); +var toPairs = __webpack_require__(/*! lodash/toPairs */ "./node_modules/lodash/toPairs.js"); +var without = __webpack_require__(/*! lodash/without */ "./node_modules/lodash/without.js"); + +var GridRow = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "isChildRow": false, + "showChildren": false, + "data": {}, + "columnSettings": null, + "rowSettings": null, + "hasChildren": false, + "useGriddleStyles": true, + "useGriddleIcons": true, + "isSubGriddle": false, + "paddingHeight": null, + "rowHeight": null, + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "parentRowCollapsedComponent": "â–¶", + "parentRowExpandedComponent": "â–¼", + "onRowClick": null, + "multipleSelectionSettings": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null + }; + }, + componentWillMount: function componentWillMount() { + if (this.props.onRowWillMount !== null && isFunction(this.props.onRowWillMount)) { + this.props.onRowWillMount(this); + } + }, + componentWillUnmount: function componentWillUnmount() { + if (this.props.onRowWillUnmount !== null && isFunction(this.props.onRowWillUnmount)) { + this.props.onRowWillUnmount(this); + } + }, + handleClick: function handleClick(e) { + if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { + this.props.onRowClick(this, e); + } else if (this.props.hasChildren) { + this.props.toggleChildren(); + } + }, + handleMouseEnter: function handleMouseEnter(e) { + if (this.props.onRowMouseEnter !== null && isFunction(this.props.onRowMouseEnter)) { + this.props.onRowMouseEnter(this, e); + } + }, + handleMouseLeave: function handleMouseLeave(e) { + if (this.props.onRowMouseLeave !== null && isFunction(this.props.onRowMouseLeave)) { + this.props.onRowMouseLeave(this, e); + } + }, + handleSelectionChange: function handleSelectionChange(e) { + //hack to get around warning that's not super useful in this case + return; + }, + handleSelectClick: function handleSelectClick(e) { + if (this.props.multipleSelectionSettings.isMultipleSelection) { + if (e.target.type === "checkbox") { + this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, this.refs.selected.checked); + } else { + this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, !this.refs.selected.checked); + } + } + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridRow: The columnSettings prop is null and it shouldn't be"); + } + }, + formatData: function formatData(data) { + if (typeof data === 'boolean') { + return String(data); + } + return data; + }, + render: function render() { + var _this = this; + + this.verifyProps(); + var that = this; + var columnStyles = null; + + if (this.props.useGriddleStyles) { + columnStyles = { + margin: "0px", + padding: that.props.paddingHeight + "px 5px " + that.props.paddingHeight + "px 5px", + height: that.props.rowHeight ? this.props.rowHeight - that.props.paddingHeight * 2 + "px" : null, + backgroundColor: "#FFF", + borderTopColor: "#DDD", + color: "#222" + }; + } + + var columns = this.props.columnSettings.getColumns(); + + // make sure that all the columns we need have default empty values + // otherwise they will get clipped + var defaultValues = zipObject(columns, []); + + // creates a 'view' on top the data so we will not alter the original data but will allow us to add default values to missing columns + var dataView = assign({}, this.props.data); + + defaults(dataView, defaultValues); + var data = toPairs(deep.pick(dataView, without(columns, 'children'))); + var nodes = data.map(function (col, index) { + var returnValue = null; + var meta = _this.props.columnSettings.getColumnMetadataByName(col[0]); + + //todo: Make this not as ridiculous looking + var firstColAppend = index === 0 && _this.props.hasChildren && _this.props.showChildren === false && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px", marginRight: "5px" } : null }, _this.props.parentRowCollapsedComponent) : index === 0 && _this.props.hasChildren && _this.props.showChildren && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px" } : null }, _this.props.parentRowExpandedComponent) : ""; + + if (index === 0 && _this.props.isChildRow && _this.props.useGriddleStyles) { + columnStyles = assign(columnStyles, { paddingLeft: 10 }); + } + + if (_this.props.columnSettings.hasColumnMetadata() && typeof meta !== 'undefined' && meta !== null) { + if (typeof meta.customComponent !== 'undefined' && meta.customComponent !== null) { + var customComponent = React.createElement(meta.customComponent, { data: col[1], rowData: dataView, metadata: meta }); + returnValue = React.createElement('td', { onClick: _this.handleClick, onMouseEnter: _this.handleMouseEnter, onMouseLeave: _this.handleMouseLeave, className: meta.cssClassName, key: index, style: columnStyles }, customComponent); + } else { + returnValue = React.createElement('td', { onClick: _this.handleClick, onMouseEnter: _this.handleMouseEnter, onMouseLeave: _this.handleMouseLeave, className: meta.cssClassName, key: index, style: columnStyles }, firstColAppend, _this.formatData(col[1])); + } + } + + return returnValue || React.createElement('td', { onClick: _this.handleClick, onMouseEnter: _this.handleMouseEnter, onMouseLeave: _this.handleMouseLeave, key: index, style: columnStyles }, firstColAppend, col[1]); + }); + + // Don't compete with onRowClick, but if no onRowClick function then + // clicking on the row should trigger select + var trOnClick, tdOnClick; + if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { + trOnClick = null; + tdOnClick = this.handleSelectClick; + } else { + if (this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { + trOnClick = this.handleSelectClick; + tdOnClick = null; + } else { + trOnClick = null; + tdOnClick = null; + } + } + + if (nodes && this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { + var selectedRowIds = this.props.multipleSelectionSettings.getSelectedRowIds(); + + nodes.unshift(React.createElement('td', { + key: 'selection', + style: columnStyles, + className: 'griddle-select griddle-select-cell', + onClick: tdOnClick + }, React.createElement('input', { + type: 'checkbox', + checked: this.props.multipleSelectionSettings.getIsRowChecked(dataView), + onChange: this.handleSelectionChange, + ref: 'selected' + }))); + } + + //Get the row from the row settings. + var className = that.props.rowSettings && that.props.rowSettings.getBodyRowMetadataClass(that.props.data) || "standard-row"; + + if (that.props.isChildRow) { + className = "child-row"; + } else if (that.props.hasChildren) { + className = that.props.showChildren ? this.props.parentRowExpandedClassName : this.props.parentRowCollapsedClassName; + } + + return React.createElement('tr', { onClick: trOnClick, className: className }, nodes); + } +}); + +module.exports = GridRow; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridRowContainer.jsx.js": +/*!********************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridRowContainer.jsx.js ***! + \********************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var ColumnProperties = __webpack_require__(/*! ./columnProperties.js */ "./node_modules/griddle-react/modules/columnProperties.js"); +var pick = __webpack_require__(/*! lodash/pick */ "./node_modules/lodash/pick.js"); + +var GridRowContainer = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "useGriddleStyles": true, + "useGriddleIcons": true, + "isSubGriddle": false, + "columnSettings": null, + "rowSettings": null, + "paddingHeight": null, + "rowHeight": null, + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "parentRowCollapsedComponent": "â–¶", + "parentRowExpandedComponent": "â–¼", + "onRowClick": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null, + "multipleSelectionSettings": null + }; + }, + getInitialState: function getInitialState() { + return { + "data": {}, + "showChildren": false + }; + }, + componentWillReceiveProps: function componentWillReceiveProps() { + this.setShowChildren(false); + }, + toggleChildren: function toggleChildren() { + this.setShowChildren(this.state.showChildren === false); + }, + setShowChildren: function setShowChildren(visible) { + this.setState({ + showChildren: visible + }); + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be"); + } + }, + render: function render() { + this.verifyProps(); + var that = this; + if (typeof this.props.data === "undefined") { + return React.createElement('tbody', null); + } + var arr = []; + + var columns = this.props.columnSettings.getColumns(); + + arr.push(React.createElement(this.props.rowSettings.rowComponent, { + useGriddleStyles: this.props.useGriddleStyles, + isSubGriddle: this.props.isSubGriddle, + data: this.props.rowSettings.isCustom ? pick(this.props.data, columns) : this.props.data, + rowData: this.props.rowSettings.isCustom ? this.props.data : null, + columnSettings: this.props.columnSettings, + rowSettings: this.props.rowSettings, + hasChildren: that.props.hasChildren, + toggleChildren: that.toggleChildren, + showChildren: that.state.showChildren, + key: that.props.uniqueId + '_base_row', + useGriddleIcons: that.props.useGriddleIcons, + parentRowExpandedClassName: this.props.parentRowExpandedClassName, + parentRowCollapsedClassName: this.props.parentRowCollapsedClassName, + parentRowExpandedComponent: this.props.parentRowExpandedComponent, + parentRowCollapsedComponent: this.props.parentRowCollapsedComponent, + paddingHeight: that.props.paddingHeight, + rowHeight: that.props.rowHeight, + onRowClick: that.props.onRowClick, + onRowMouseEnter: that.props.onRowMouseEnter, + onRowMouseLeave: that.props.onRowMouseLeave, + multipleSelectionSettings: this.props.multipleSelectionSettings, + onRowWillMount: that.props.onRowWillMount, + onRowWillUnmount: that.props.onRowWillUnmount })); + + var children = null; + + if (that.state.showChildren) { + children = that.props.hasChildren && this.props.data["children"].map(function (row, index) { + var key = that.props.rowSettings.getRowKey(row, index); + + if (typeof row["children"] !== "undefined") { + var Griddle = that.constructor.Griddle; + return React.createElement('tr', { key: key, style: { paddingLeft: 5 } }, React.createElement('td', { colSpan: that.props.columnSettings.getVisibleColumnCount(), className: 'griddle-parent', style: that.props.useGriddleStyles ? { border: "none", "padding": "0 0 0 5px" } : null }, React.createElement(Griddle, { + rowMetadata: { key: 'id' }, + isSubGriddle: true, + results: [row], + columns: that.props.columnSettings.getColumns(), + tableClassName: that.props.tableClassName, + parentRowExpandedClassName: that.props.parentRowExpandedClassName, + parentRowCollapsedClassName: that.props.parentRowCollapsedClassName, + showTableHeading: false, + showPager: false, + columnMetadata: that.props.columnSettings.columnMetadata, + parentRowExpandedComponent: that.props.parentRowExpandedComponent, + parentRowCollapsedComponent: that.props.parentRowCollapsedComponent, + paddingHeight: that.props.paddingHeight, + rowHeight: that.props.rowHeight + }))); + } + + return React.createElement(that.props.rowSettings.rowComponent, { + useGriddleStyles: that.props.useGriddleStyles, + isSubGriddle: that.props.isSubGriddle, + data: row, + columnSettings: that.props.columnSettings, + isChildRow: true, + columnMetadata: that.props.columnSettings.columnMetadata, + key: key + }); + }); + } + + return that.props.hasChildren === false ? arr[0] : React.createElement('tbody', null, that.state.showChildren ? arr.concat(children) : arr); + } +}); + +module.exports = GridRowContainer; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridSettings.jsx.js": +/*!****************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridSettings.jsx.js ***! + \****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var includes = __webpack_require__(/*! lodash/includes */ "./node_modules/lodash/includes.js"); +var without = __webpack_require__(/*! lodash/without */ "./node_modules/lodash/without.js"); +var find = __webpack_require__(/*! lodash/find */ "./node_modules/lodash/find.js"); + +var GridSettings = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "columns": [], + "columnMetadata": [], + "selectedColumns": [], + "settingsText": "", + "maxRowsText": "", + "resultsPerPage": 0, + "enableToggleCustom": false, + "useCustomComponent": false, + "useGriddleStyles": true, + "toggleCustomComponent": function toggleCustomComponent() {} + }; + }, + setPageSize: function setPageSize(event) { + var value = parseInt(event.target.value, 10); + this.props.setPageSize(value); + }, + handleChange: function handleChange(event) { + var columnName = event.target.dataset ? event.target.dataset.name : event.target.getAttribute('data-name'); + if (event.target.checked === true && includes(this.props.selectedColumns, columnName) === false) { + this.props.selectedColumns.push(columnName); + this.props.setColumns(this.props.selectedColumns); + } else { + /* redraw with the selected columns minus the one just unchecked */ + this.props.setColumns(without(this.props.selectedColumns, columnName)); + } + }, + render: function render() { + var that = this; + + var nodes = []; + //don't show column selector if we're on a custom component + if (that.props.useCustomComponent === false) { + nodes = this.props.columns.map(function (col, index) { + var checked = includes(that.props.selectedColumns, col); + //check column metadata -- if this one is locked make it disabled and don't put an onChange event + var meta = find(that.props.columnMetadata, { columnName: col }); + var displayName = col; + + if (typeof meta !== "undefined" && typeof meta.displayName !== "undefined" && meta.displayName != null) { + displayName = meta.displayName; + } + + if (typeof meta !== "undefined" && meta != null && meta.locked) { + return React.createElement('div', { className: 'column checkbox' }, React.createElement('label', null, React.createElement('input', { type: 'checkbox', disabled: true, name: 'check', checked: checked, 'data-name': col }), displayName)); + } else if (typeof meta !== "undefined" && meta != null && typeof meta.visible !== "undefined" && meta.visible === false) { + return null; + } + return React.createElement('div', { className: 'griddle-column-selection checkbox', key: col, style: that.props.useGriddleStyles ? { "float": "left", width: "20%" } : null }, React.createElement('label', null, React.createElement('input', { type: 'checkbox', name: 'check', onChange: that.handleChange, checked: checked, 'data-name': col }), displayName)); + }); + } + + var toggleCustom = that.props.enableToggleCustom ? React.createElement('div', { className: 'form-group' }, React.createElement('label', { htmlFor: 'maxRows' }, React.createElement('input', { type: 'checkbox', checked: this.props.useCustomComponent, onChange: this.props.toggleCustomComponent }), ' ', this.props.enableCustomFormatText)) : ""; + + var setPageSize = this.props.showSetPageSize ? React.createElement('div', null, React.createElement('label', { htmlFor: 'maxRows' }, this.props.maxRowsText, ':', React.createElement('select', { onChange: this.setPageSize, value: this.props.resultsPerPage }, React.createElement('option', { value: '5' }, '5'), React.createElement('option', { value: '10' }, '10'), React.createElement('option', { value: '25' }, '25'), React.createElement('option', { value: '50' }, '50'), React.createElement('option', { value: '100' }, '100')))) : ""; + + return React.createElement('div', { className: 'griddle-settings', style: this.props.useGriddleStyles ? { backgroundColor: "#FFF", border: "1px solid #DDD", color: "#222", padding: "10px", marginBottom: "10px" } : null }, React.createElement('h6', null, this.props.settingsText), React.createElement('div', { className: 'griddle-columns', style: this.props.useGriddleStyles ? { clear: "both", display: "table", width: "100%", borderBottom: "1px solid #EDEDED", marginBottom: "10px" } : null }, nodes), setPageSize, toggleCustom); + } +}); + +module.exports = GridSettings; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridTable.jsx.js": +/*!*************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridTable.jsx.js ***! + \*************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var GridTitle = __webpack_require__(/*! ./gridTitle.jsx */ "./node_modules/griddle-react/modules/gridTitle.jsx.js"); +var GridRowContainer = __webpack_require__(/*! ./gridRowContainer.jsx */ "./node_modules/griddle-react/modules/gridRowContainer.jsx.js"); +var ColumnProperties = __webpack_require__(/*! ./columnProperties.js */ "./node_modules/griddle-react/modules/columnProperties.js"); +var RowProperties = __webpack_require__(/*! ./rowProperties.js */ "./node_modules/griddle-react/modules/rowProperties.js"); + +var GridTable = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "data": [], + "columnSettings": null, + "rowSettings": null, + "sortSettings": null, + "multipleSelectionSettings": null, + "className": "", + "enableInfiniteScroll": false, + "nextPage": null, + "hasMorePages": false, + "useFixedHeader": false, + "useFixedLayout": true, + "paddingHeight": null, + "rowHeight": null, + "filterByColumn": null, + "infiniteScrollLoadTreshold": null, + "bodyHeight": null, + "useGriddleStyles": true, + "useGriddleIcons": true, + "isSubGriddle": false, + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "parentRowCollapsedComponent": "â–¶", + "parentRowExpandedComponent": "â–¼", + "externalLoadingComponent": null, + "externalIsLoading": false, + "onRowClick": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null + }; + }, + getInitialState: function getInitialState() { + return { + scrollTop: 0, + scrollHeight: this.props.bodyHeight, + clientHeight: this.props.bodyHeight + }; + }, + componentDidMount: function componentDidMount() { + // After the initial render, see if we need to load additional pages. + this.gridScroll(); + }, + componentDidUpdate: function componentDidUpdate(prevProps, prevState) { + // After the subsequent renders, see if we need to load additional pages. + this.gridScroll(); + }, + gridScroll: function gridScroll() { + if (this.props.enableInfiniteScroll && !this.props.externalIsLoading) { + // If the scroll height is greater than the current amount of rows displayed, update the page. + var scrollable = this.refs.scrollable; + var scrollTop = scrollable.scrollTop; + var scrollHeight = scrollable.scrollHeight; + var clientHeight = scrollable.clientHeight; + + // If the scroll position changed and the difference is greater than a row height + if (this.props.rowHeight !== null && this.state.scrollTop !== scrollTop && Math.abs(this.state.scrollTop - scrollTop) >= this.getAdjustedRowHeight()) { + var newState = { + scrollTop: scrollTop, + scrollHeight: scrollHeight, + clientHeight: clientHeight + }; + + // Set the state to the new state + this.setState(newState); + } + + // Determine the diff by subtracting the amount scrolled by the total height, taking into consideratoin + // the spacer's height. + var scrollHeightDiff = scrollHeight - (scrollTop + clientHeight) - this.props.infiniteScrollLoadTreshold; + + // Make sure that we load results a little before reaching the bottom. + var compareHeight = scrollHeightDiff * 0.6; + + if (compareHeight <= this.props.infiniteScrollLoadTreshold) { + this.props.nextPage(); + } + } + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridTable: The columnSettings prop is null and it shouldn't be"); + } + if (this.props.rowSettings === null) { + console.error("gridTable: The rowSettings prop is null and it shouldn't be"); + } + }, + getAdjustedRowHeight: function getAdjustedRowHeight() { + return this.props.rowHeight + this.props.paddingHeight * 2; // account for padding. + }, + getNodeContent: function getNodeContent() { + this.verifyProps(); + var that = this; + + //figure out if we need to wrap the group in one tbody or many + var anyHasChildren = false; + + // If the data is still being loaded, don't build the nodes unless this is an infinite scroll table. + if (!this.props.externalIsLoading || this.props.enableInfiniteScroll) { + var nodeData = that.props.data; + var aboveSpacerRow = null; + var belowSpacerRow = null; + var usingDefault = false; + + // If we have a row height specified, only render what's going to be visible. + if (this.props.enableInfiniteScroll && this.props.rowHeight !== null && this.refs.scrollable !== undefined) { + var adjustedHeight = that.getAdjustedRowHeight(); + var visibleRecordCount = Math.ceil(that.state.clientHeight / adjustedHeight); + + // Inspired by : http://jsfiddle.net/vjeux/KbWJ2/9/ + var displayStart = Math.max(0, Math.floor(that.state.scrollTop / adjustedHeight) - visibleRecordCount * 0.25); + var displayEnd = Math.min(displayStart + visibleRecordCount * 1.25, this.props.data.length - 1); + + // Split the amount of nodes. + nodeData = nodeData.slice(displayStart, displayEnd + 1); + + // Set the above and below nodes. + var aboveSpacerRowStyle = { height: displayStart * adjustedHeight + "px" }; + aboveSpacerRow = React.createElement('tr', { key: 'above-' + aboveSpacerRowStyle.height, style: aboveSpacerRowStyle }); + var belowSpacerRowStyle = { height: (this.props.data.length - displayEnd) * adjustedHeight + "px" }; + belowSpacerRow = React.createElement('tr', { key: 'below-' + belowSpacerRowStyle.height, style: belowSpacerRowStyle }); + } + + var nodes = nodeData.map(function (row, index) { + var hasChildren = typeof row["children"] !== "undefined" && row["children"].length > 0; + var uniqueId = that.props.rowSettings.getRowKey(row, index); + + //at least one item in the group has children. + if (hasChildren) { + anyHasChildren = hasChildren; + } + + return React.createElement(GridRowContainer, { + useGriddleStyles: that.props.useGriddleStyles, + isSubGriddle: that.props.isSubGriddle, + parentRowExpandedClassName: that.props.parentRowExpandedClassName, + parentRowCollapsedClassName: that.props.parentRowCollapsedClassName, + parentRowExpandedComponent: that.props.parentRowExpandedComponent, + parentRowCollapsedComponent: that.props.parentRowCollapsedComponent, + data: row, + key: uniqueId + '-container', + uniqueId: uniqueId, + columnSettings: that.props.columnSettings, + rowSettings: that.props.rowSettings, + paddingHeight: that.props.paddingHeight, + multipleSelectionSettings: that.props.multipleSelectionSettings, + rowHeight: that.props.rowHeight, + hasChildren: hasChildren, + tableClassName: that.props.className, + onRowClick: that.props.onRowClick, + onRowMouseEnter: that.props.onRowMouseEnter, + onRowMouseLeave: that.props.onRowMouseLeave, + onRowWillMount: that.props.onRowWillMount, + onRowWillUnmount: that.props.onRowWillUnmount + }); + }); + + // no data section + if (this.props.showNoData) { + var colSpan = this.props.columnSettings.getVisibleColumnCount(); + nodes.push(React.createElement('tr', { key: 'no-data-section' }, React.createElement('td', { colSpan: colSpan }, this.props.noDataSection))); + } + + // Add the spacer rows for nodes we're not rendering. + if (aboveSpacerRow) { + nodes.unshift(aboveSpacerRow); + } + if (belowSpacerRow) { + nodes.push(belowSpacerRow); + } + + // Send back the nodes. + return { + nodes: nodes, + anyHasChildren: anyHasChildren + }; + } else { + return null; + } + }, + render: function render() { + var that = this; + var nodes = []; + + // for if we need to wrap the group in one tbody or many + var anyHasChildren = false; + + // Grab the nodes to render + var nodeContent = this.getNodeContent(); + if (nodeContent) { + nodes = nodeContent.nodes; + anyHasChildren = nodeContent.anyHasChildren; + } + + var gridStyle = null; + var loadingContent = null; + var tableStyle = { + width: "100%" + }; + + if (this.props.useFixedLayout) { + tableStyle.tableLayout = "fixed"; + } + + if (this.props.enableInfiniteScroll) { + // If we're enabling infinite scrolling, we'll want to include the max height of the grid body + allow scrolling. + gridStyle = { + "position": "relative", + "overflowY": "scroll", + "height": this.props.bodyHeight + "px", + "width": "100%" + }; + } + + // If we're currently loading, populate the loading content + if (this.props.externalIsLoading) { + var defaultLoadingStyle = null; + var defaultColSpan = null; + + if (this.props.useGriddleStyles) { + defaultLoadingStyle = { + textAlign: "center", + paddingBottom: "40px" + }; + } + + defaultColSpan = this.props.columnSettings.getVisibleColumnCount(); + + var loadingComponent = this.props.externalLoadingComponent ? React.createElement(this.props.externalLoadingComponent, null) : React.createElement('div', null, 'Loading...'); + + loadingContent = React.createElement('tbody', null, React.createElement('tr', null, React.createElement('td', { style: defaultLoadingStyle, colSpan: defaultColSpan }, loadingComponent))); + } + + //construct the table heading component + var tableHeading = this.props.showTableHeading ? React.createElement(GridTitle, { useGriddleStyles: this.props.useGriddleStyles, useGriddleIcons: this.props.useGriddleIcons, + sortSettings: this.props.sortSettings, + multipleSelectionSettings: this.props.multipleSelectionSettings, + columnSettings: this.props.columnSettings, + filterByColumn: this.props.filterByColumn, + rowSettings: this.props.rowSettings }) : undefined; + + //check to see if any of the rows have children... if they don't wrap everything in a tbody so the browser doesn't auto do this + if (!anyHasChildren) { + nodes = React.createElement('tbody', null, nodes); + } + + var pagingContent = React.createElement('tbody', null); + if (this.props.showPager) { + var pagingStyles = this.props.useGriddleStyles ? { + padding: "0px", + backgroundColor: "#EDEDED", + border: "0px", + color: "#222", + height: this.props.showNoData ? "20px" : null + } : null; + pagingContent = React.createElement('tbody', null, React.createElement('tr', null, React.createElement('td', { colSpan: this.props.multipleSelectionSettings.isMultipleSelection ? this.props.columnSettings.getVisibleColumnCount() + 1 : this.props.columnSettings.getVisibleColumnCount(), style: pagingStyles, className: 'footer-container' }, !this.props.showNoData ? this.props.pagingContent : null))); + } + + // If we have a fixed header, split into two tables. + if (this.props.useFixedHeader) { + if (this.props.useGriddleStyles) { + tableStyle.tableLayout = "fixed"; + } + + return React.createElement('div', null, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading), React.createElement('div', { ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, nodes, loadingContent, pagingContent))); + } + + return React.createElement('div', { ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading, nodes, loadingContent, pagingContent)); + } +}); + +module.exports = GridTable; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridTitle.jsx.js": +/*!*************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridTitle.jsx.js ***! + \*************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE + */ + + +var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i];for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + }return target; +}; + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var ColumnProperties = __webpack_require__(/*! ./columnProperties.js */ "./node_modules/griddle-react/modules/columnProperties.js"); +var assign = __webpack_require__(/*! lodash/assign */ "./node_modules/lodash/assign.js"); + +var DefaultHeaderComponent = createReactClass({ + render: function render() { + return React.createElement('span', null, this.props.displayName); + } +}); + +var GridTitle = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "columnSettings": null, + "filterByColumn": function filterByColumn() {}, + "rowSettings": null, + "sortSettings": null, + "multipleSelectionSettings": null, + "headerStyle": null, + "useGriddleStyles": true, + "useGriddleIcons": true, + "headerStyles": {} + }; + }, + componentWillMount: function componentWillMount() { + this.verifyProps(); + }, + sort: function sort(column) { + var that = this; + return function (event) { + that.props.sortSettings.changeSort(column); + }; + }, + toggleSelectAll: function toggleSelectAll(event) { + this.props.multipleSelectionSettings.toggleSelectAll(); + }, + handleSelectionChange: function handleSelectionChange(event) { + //hack to get around warning message that's not helpful in this case + return; + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridTitle: The columnSettings prop is null and it shouldn't be"); + } + + if (this.props.sortSettings === null) { + console.error("gridTitle: The sortSettings prop is null and it shouldn't be"); + } + }, + render: function render() { + this.verifyProps(); + var that = this; + var titleStyles = {}; + + var nodes = this.props.columnSettings.getColumns().map(function (col, index) { + var defaultTitleStyles = {}; + var columnSort = ""; + var columnIsSortable = that.props.columnSettings.getMetadataColumnProperty(col, "sortable", true); + var sortComponent = columnIsSortable ? that.props.sortSettings.sortDefaultComponent : null; + + if (that.props.sortSettings.sortColumn == col && that.props.sortSettings.sortDirection === 'asc') { + columnSort = that.props.sortSettings.sortAscendingClassName; + sortComponent = that.props.useGriddleIcons && that.props.sortSettings.sortAscendingComponent; + } else if (that.props.sortSettings.sortColumn == col && that.props.sortSettings.sortDirection === 'desc') { + columnSort += that.props.sortSettings.sortDescendingClassName; + sortComponent = that.props.useGriddleIcons && that.props.sortSettings.sortDescendingComponent; + } + + var meta = that.props.columnSettings.getColumnMetadataByName(col); + var displayName = that.props.columnSettings.getMetadataColumnProperty(col, "displayName", col); + var HeaderComponent = that.props.columnSettings.getMetadataColumnProperty(col, "customHeaderComponent", DefaultHeaderComponent); + var headerProps = that.props.columnSettings.getMetadataColumnProperty(col, "customHeaderComponentProps", {}); + + columnSort = meta == null ? columnSort : (columnSort && columnSort + " " || columnSort) + that.props.columnSettings.getMetadataColumnProperty(col, "cssClassName", ""); + + if (that.props.useGriddleStyles) { + defaultTitleStyles = { + backgroundColor: "#EDEDEF", + border: "0px", + borderBottom: "1px solid #DDD", + color: "#222", + padding: "5px", + cursor: columnIsSortable ? "pointer" : "default" + }; + } + titleStyles = meta && meta.titleStyles ? assign({}, defaultTitleStyles, meta.titleStyles) : assign({}, defaultTitleStyles); + + var ComponentClass = displayName ? 'th' : 'td'; + return React.createElement(ComponentClass, { onClick: columnIsSortable ? that.sort(col) : null, 'data-title': col, className: columnSort, key: col, + style: titleStyles }, React.createElement(HeaderComponent, _extends({ columnName: col, displayName: displayName, + filterByColumn: that.props.filterByColumn }, headerProps)), sortComponent); + }); + + if (nodes && this.props.multipleSelectionSettings.isMultipleSelection) { + nodes.unshift(React.createElement('th', { key: 'selection', onClick: this.toggleSelectAll, style: titleStyles, className: 'griddle-select griddle-select-title' }, React.createElement('input', { + type: 'checkbox', + checked: this.props.multipleSelectionSettings.getIsSelectAllChecked(), + onChange: this.handleSelectionChange + }))); + } + + //Get the row from the row settings. + var className = that.props.rowSettings && that.props.rowSettings.getHeaderRowMetadataClass() || null; + + return React.createElement('thead', null, React.createElement('tr', { + className: className, + style: this.props.headerStyles }, nodes)); + } +}); + +module.exports = GridTitle; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/griddle.jsx.js": +/*!***********************************************************!*\ + !*** ./node_modules/griddle-react/modules/griddle.jsx.js ***! + \***********************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + Griddle - Simple Grid Component for React + https://github.com/DynamicTyped/Griddle + Copyright (c) 2014 Ryan Lanciaux | DynamicTyped + + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i];for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + }return target; +}; + +var React = __webpack_require__(/*! react */ "react"); +var PropTypes = __webpack_require__(/*! prop-types */ "prop-types"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var GridTable = __webpack_require__(/*! ./gridTable.jsx */ "./node_modules/griddle-react/modules/gridTable.jsx.js"); +var GridFilter = __webpack_require__(/*! ./gridFilter.jsx */ "./node_modules/griddle-react/modules/gridFilter.jsx.js"); +var GridPagination = __webpack_require__(/*! ./gridPagination.jsx */ "./node_modules/griddle-react/modules/gridPagination.jsx.js"); +var GridSettings = __webpack_require__(/*! ./gridSettings.jsx */ "./node_modules/griddle-react/modules/gridSettings.jsx.js"); +var GridNoData = __webpack_require__(/*! ./gridNoData.jsx */ "./node_modules/griddle-react/modules/gridNoData.jsx.js"); +var GridRow = __webpack_require__(/*! ./gridRow.jsx */ "./node_modules/griddle-react/modules/gridRow.jsx.js"); +var GridRowContainer = __webpack_require__(/*! ./gridRowContainer.jsx */ "./node_modules/griddle-react/modules/gridRowContainer.jsx.js"); +var CustomRowComponentContainer = __webpack_require__(/*! ./customRowComponentContainer.jsx */ "./node_modules/griddle-react/modules/customRowComponentContainer.jsx.js"); +var CustomPaginationContainer = __webpack_require__(/*! ./customPaginationContainer.jsx */ "./node_modules/griddle-react/modules/customPaginationContainer.jsx.js"); +var CustomFilterContainer = __webpack_require__(/*! ./customFilterContainer.jsx */ "./node_modules/griddle-react/modules/customFilterContainer.jsx.js"); +var ColumnProperties = __webpack_require__(/*! ./columnProperties */ "./node_modules/griddle-react/modules/columnProperties.js"); +var RowProperties = __webpack_require__(/*! ./rowProperties */ "./node_modules/griddle-react/modules/rowProperties.js"); +var deep = __webpack_require__(/*! ./deep */ "./node_modules/griddle-react/modules/deep.js"); + +var drop = __webpack_require__(/*! lodash/drop */ "./node_modules/lodash/drop.js"); +var dropRight = __webpack_require__(/*! lodash/dropRight */ "./node_modules/lodash/dropRight.js"); +var find = __webpack_require__(/*! lodash/find */ "./node_modules/lodash/find.js"); +var first = __webpack_require__(/*! lodash/take */ "./node_modules/lodash/take.js"); +var forEach = __webpack_require__(/*! lodash/forEach */ "./node_modules/lodash/forEach.js"); +var initial = __webpack_require__(/*! lodash/initial */ "./node_modules/lodash/initial.js"); +var intersection = __webpack_require__(/*! lodash/intersection */ "./node_modules/lodash/intersection.js"); +var isArray = __webpack_require__(/*! lodash/isArray */ "./node_modules/lodash/isArray.js"); +var isEmpty = __webpack_require__(/*! lodash/isEmpty */ "./node_modules/lodash/isEmpty.js"); +var isNull = __webpack_require__(/*! lodash/isNull */ "./node_modules/lodash/isNull.js"); +var isUndefined = __webpack_require__(/*! lodash/isUndefined */ "./node_modules/lodash/isUndefined.js"); +var omit = __webpack_require__(/*! lodash/omit */ "./node_modules/lodash/omit.js"); +var map = __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js"); +var extend = __webpack_require__(/*! lodash/assign */ "./node_modules/lodash/assign.js"); +var _filter = __webpack_require__(/*! lodash/filter */ "./node_modules/lodash/filter.js"); + +var _orderBy = __webpack_require__(/*! lodash/orderBy */ "./node_modules/lodash/orderBy.js"); +var _property = __webpack_require__(/*! lodash/property */ "./node_modules/lodash/property.js"); +var _get = __webpack_require__(/*! lodash/get */ "./node_modules/lodash/get.js"); +var _some = __webpack_require__(/*! lodash/some */ "./node_modules/lodash/some.js"); + +var Griddle = createReactClass({ + statics: { + GridTable: GridTable, + GridFilter: GridFilter, + GridPagination: GridPagination, + GridSettings: GridSettings, + GridRow: GridRow + }, + columnSettings: null, + rowSettings: null, + getDefaultProps: function getDefaultProps() { + return { + "columns": [], + "gridMetadata": null, + "columnMetadata": [], + "rowMetadata": null, + "results": [], // Used if all results are already loaded. + "initialSort": "", + "gridClassName": "", + "tableClassName": "", + "customRowComponentClassName": "", + "settingsText": "Settings", + "filterPlaceholderText": "Filter Results", + "nextText": "Next", + "previousText": "Previous", + "maxRowsText": "Rows per page", + "enableCustomFormatText": "Enable Custom Formatting", + //this column will determine which column holds subgrid data + //it will be passed through with the data object but will not be rendered + "childrenColumnName": "children", + //Any column in this list will be treated as metadata and will be passed through with the data but won't be rendered + "metadataColumns": [], + "showFilter": false, + "showSettings": false, + "useCustomRowComponent": false, + "useCustomGridComponent": false, + "useCustomPagerComponent": false, + "useCustomFilterer": false, + "useCustomFilterComponent": false, + "useGriddleStyles": true, + "useGriddleIcons": true, + "customRowComponent": null, + "customGridComponent": null, + "customPagerComponent": {}, + "customFilterComponent": null, + "customFilterer": null, + "globalData": null, + "enableToggleCustom": false, + "noDataMessage": "There is no data to display.", + "noDataClassName": "griddle-nodata", + "customNoDataComponent": null, + "customNoDataComponentProps": null, + "allowEmptyGrid": false, + "showTableHeading": true, + "showPager": true, + "useFixedHeader": false, + "useExternal": false, + "externalSetPage": null, + "externalChangeSort": null, + "externalSetFilter": null, + "externalSetPageSize": null, + "externalMaxPage": null, + "externalCurrentPage": null, + "externalSortColumn": null, + "externalSortAscending": true, + "externalLoadingComponent": null, + "externalIsLoading": false, + "enableInfiniteScroll": false, + "bodyHeight": null, + "paddingHeight": 5, + "rowHeight": 25, + "infiniteScrollLoadTreshold": 50, + "useFixedLayout": true, + "isSubGriddle": false, + "enableSort": true, + "onRowClick": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null, + /* css class names */ + "sortAscendingClassName": "sort-ascending", + "sortDescendingClassName": "sort-descending", + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "settingsToggleClassName": "settings", + "nextClassName": "griddle-next", + "previousClassName": "griddle-previous", + "headerStyles": {}, + /* icon components */ + "sortAscendingComponent": " â–²", + "sortDescendingComponent": " â–¼", + "sortDefaultComponent": null, + "parentRowCollapsedComponent": "â–¶", + "parentRowExpandedComponent": "â–¼", + "settingsIconComponent": "", + "nextIconComponent": "", + "previousIconComponent": "", + "isMultipleSelection": false, //currently does not support subgrids + "selectedRowIds": [], + "uniqueIdentifier": "id", + "onSelectionChange": null, + "columnFilterFunc": null + }; + }, + propTypes: { + isMultipleSelection: PropTypes.bool, + selectedRowIds: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.arrayOf(PropTypes.string)]), + uniqueIdentifier: PropTypes.string, + onSelectionChange: PropTypes.func, + columnFilterFunc: PropTypes.func + }, + defaultFilter: function defaultFilter(results, filter) { + var that = this; + return _filter(results, function (item) { + var arr = deep.keys(item); + for (var i = 0; i < arr.length; i++) { + var isFilterable = that.columnSettings.getMetadataColumnProperty(arr[i], "filterable", true); + if (isFilterable && (deep.getAt(item, arr[i]) || "").toString().toLowerCase().indexOf(filter.toLowerCase()) >= 0) { + return true; + } + } + return false; + }); + }, + + defaultColumnFilter: function defaultColumnFilter(columnName, value, filter) { + var filters = map(isArray(filter) ? filter : [filter], function (filter) { + return (filter || '').toLowerCase(); + }); + return _some(deep.getObjectValues(value), function (value) { + value = value.toString().toLowerCase(); + return _some(filters, function (filter) { + return value.indexOf(filter) >= 0; + }); + }); + }, + + filterByColumnFilters: function filterByColumnFilters(columnFilters) { + var filterFunction = this.props.columnFilterFunc || this.defaultColumnFilter; + var filteredResults = Object.keys(columnFilters).reduce(function (previous, current) { + return _filter(previous, function (item) { + var value = deep.getAt(item, current || ""); + var filter = columnFilters[current]; + return filterFunction(current || '', value, filter); + }); + }, this.props.results); + + var newState = { + columnFilters: columnFilters + }; + + if (columnFilters) { + newState.filteredResults = filteredResults; + newState.maxPage = this.getMaxPage(newState.filteredResults); + } else if (this.state.filter) { + newState.filteredResults = this.props.useCustomFilterer ? this.props.customFilterer(this.props.results, filter) : this.defaultFilter(this.props.results, filter); + } else { + newState.filteredResults = null; + } + + this.setState(newState); + }, + + filterByColumn: function filterByColumn(filter, column) { + var columnFilters = this.state.columnFilters; + + //if filter is "" remove it from the columnFilters object + if (columnFilters.hasOwnProperty(column) && !filter) { + columnFilters = omit(columnFilters, column); + } else { + var newObject = {}; + newObject[column] = filter; + columnFilters = extend({}, columnFilters, newObject); + } + + this.filterByColumnFilters(columnFilters); + }, + + /* if we have a filter display the max page and results accordingly */ + setFilter: function setFilter(filter) { + var updatedResults = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + + if (this.props.useExternal) { + this.props.externalSetFilter(filter); + return; + } + + var that = this, + updatedState = { + page: 0, + filter: filter + }; + + // Obtain the state results. + updatedState.filteredResults = this.props.useCustomFilterer ? this.props.customFilterer(updatedResults || this.props.results, filter) : this.defaultFilter(updatedResults || this.props.results, filter); + + // Update the max page. + updatedState.maxPage = that.getMaxPage(updatedState.filteredResults); + + //if filter is null or undefined reset the filter. + if (isUndefined(filter) || isNull(filter) || isEmpty(filter)) { + updatedState.filter = filter; + updatedState.filteredResults = null; + } + + // Set the state. + that.setState(updatedState); + + this._resetSelectedRows(); + }, + setPageSize: function setPageSize(size) { + if (this.props.useExternal) { + this.setState({ + resultsPerPage: size + }); + this.props.externalSetPageSize(size); + return; + } + //make this better. + this.state.resultsPerPage = size; + this.setMaxPage(); + }, + toggleColumnChooser: function toggleColumnChooser() { + this.setState({ + showColumnChooser: !this.state.showColumnChooser + }); + }, + isNullOrUndefined: function isNullOrUndefined(value) { + return value === undefined || value === null; + }, + shouldUseCustomRowComponent: function shouldUseCustomRowComponent() { + return this.isNullOrUndefined(this.state.useCustomRowComponent) ? this.props.useCustomRowComponent : this.state.useCustomRowComponent; + }, + shouldUseCustomGridComponent: function shouldUseCustomGridComponent() { + return this.isNullOrUndefined(this.state.useCustomGridComponent) ? this.props.useCustomGridComponent : this.state.useCustomGridComponent; + }, + toggleCustomComponent: function toggleCustomComponent() { + if (this.state.customComponentType === "grid") { + this.setState({ + useCustomGridComponent: !this.shouldUseCustomGridComponent() + }); + } else if (this.state.customComponentType === "row") { + this.setState({ + useCustomRowComponent: !this.shouldUseCustomRowComponent() + }); + } + }, + getMaxPage: function getMaxPage(results, totalResults) { + if (this.props.useExternal) { + return this.props.externalMaxPage; + } + + if (!totalResults) { + totalResults = (results || this.getCurrentResults()).length; + } + var maxPage = Math.ceil(totalResults / this.state.resultsPerPage); + return maxPage; + }, + setMaxPage: function setMaxPage(results) { + var maxPage = this.getMaxPage(results); + //re-render if we have new max page value + if (this.state.maxPage !== maxPage) { + this.setState({ page: 0, maxPage: maxPage, filteredColumns: this.columnSettings.filteredColumns }); + } + }, + setPage: function setPage(number) { + if (this.props.useExternal) { + this.props.externalSetPage(number); + return; + } + + //check page size and move the filteredResults to pageSize * pageNumber + if (number * this.state.resultsPerPage <= this.state.resultsPerPage * this.state.maxPage) { + var that = this, + state = { + page: number + }; + + that.setState(state); + } + + //When infinite scrolling is enabled, uncheck the "select all" checkbox, since more unchecked rows will be appended at the end + if (this.props.enableInfiniteScroll) { + this.setState({ + isSelectAllChecked: false + }); + } + }, + setColumns: function setColumns(columns) { + this.columnSettings.filteredColumns = isArray(columns) ? columns : [columns]; + + this.setState({ + filteredColumns: this.columnSettings.filteredColumns + }); + }, + nextPage: function nextPage() { + var currentPage = this.getCurrentPage(); + if (currentPage < this.getCurrentMaxPage() - 1) { + this.setPage(currentPage + 1); + } + }, + previousPage: function previousPage() { + var currentPage = this.getCurrentPage(); + if (currentPage > 0) { + this.setPage(currentPage - 1); + } + }, + changeSort: function changeSort(column) { + if (this.props.enableSort === false) { + return; + } + + if (this.props.useExternal) { + var isAscending = this.props.externalSortColumn === column ? !this.props.externalSortAscending : true; + this.setState({ + sortColumn: column, + sortDirection: isAscending ? 'asc' : 'desc' + }); + this.props.externalChangeSort(column, isAscending); + return; + } + var columnMeta = find(this.props.columnMetadata, { columnName: column }) || {}; + var sortDirectionCycle = columnMeta.sortDirectionCycle ? columnMeta.sortDirectionCycle : [null, 'asc', 'desc']; + var sortDirection = null; + // Find the current position in the cycle (or -1). + var i = sortDirectionCycle.indexOf(this.state.sortDirection && column === this.state.sortColumn ? this.state.sortDirection : null); + + // Proceed to the next position in the cycle (or start at the beginning). + i = (i + 1) % sortDirectionCycle.length; + + if (sortDirectionCycle[i]) { + sortDirection = sortDirectionCycle[i]; + } else { + sortDirection = null; + } + + var state = { + page: 0, + sortColumn: column, + sortDirection: sortDirection + }; + + this.setState(state); + }, + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + // Check if results props changed + if (nextProps.results !== this.props.results) { + this.setFilter(this.state.filter, nextProps.results); + } + + this.setMaxPage(nextProps.results); + if (nextProps.resultsPerPage !== this.props.resultsPerPage) { + this.setPageSize(nextProps.resultsPerPage); + } + //This will updaet the column Metadata + this.columnSettings.columnMetadata = nextProps.columnMetadata; + if (nextProps.results.length > 0) { + var deepKeys = deep.keys(nextProps.results[0]); + + var is_same = this.columnSettings.allColumns.length == deepKeys.length && this.columnSettings.allColumns.every(function (element, index) { + return element === deepKeys[index]; + }); + + if (!is_same) { + this.columnSettings.allColumns = deepKeys; + } + } else if (this.columnSettings.allColumns.length > 0) { + this.columnSettings.allColumns = []; + } + + if (nextProps.selectedRowIds) { + var visibleRows = this.getDataForRender(this.getCurrentResults(nextProps.results), this.columnSettings.getColumns(), true); + + this.setState({ + isSelectAllChecked: this._getAreAllRowsChecked(nextProps.selectedRowIds, map(visibleRows, this.props.uniqueIdentifier)), + selectedRowIds: nextProps.selectedRowIds + }); + } + }, + getInitialState: function getInitialState() { + var state = { + maxPage: 0, + page: 0, + filteredResults: null, + filteredColumns: [], + filter: "", + //this sets the individual column filters + columnFilters: {}, + resultsPerPage: this.props.resultsPerPage || 5, + showColumnChooser: false, + isSelectAllChecked: false, + selectedRowIds: this.props.selectedRowIds + }; + return state; + }, + componentWillMount: function componentWillMount() { + this.verifyExternal(); + this.verifyCustom(); + + this.columnSettings = new ColumnProperties(this.props.results.length > 0 ? deep.keys(this.props.results[0]) : [], this.props.columns, this.props.childrenColumnName, this.props.columnMetadata, this.props.metadataColumns); + + this.rowSettings = new RowProperties(this.props.rowMetadata, this.props.useCustomTableRowComponent && this.props.customTableRowComponent ? this.props.customTableRowComponent : GridRow, this.props.useCustomTableRowComponent); + + if (this.props.initialSort) { + // shouldn't change Sort on init for external + if (this.props.useExternal) { + this.setState({ + sortColumn: this.props.externalSortColumn, + sortDirection: this.props.externalSortAscending ? 'asc' : 'desc' + }); + } else { + this.changeSort(this.props.initialSort); + } + } + this.setMaxPage(); + + //don't like the magic strings + if (this.shouldUseCustomGridComponent()) { + this.setState({ + customComponentType: "grid" + }); + } else if (this.shouldUseCustomRowComponent()) { + this.setState({ + customComponentType: "row" + }); + } else { + this.setState({ + filteredColumns: this.columnSettings.filteredColumns + }); + } + }, + componentDidMount: function componentDidMount() { + if (this.props.componentDidMount && typeof this.props.componentDidMount === "function") { + return this.props.componentDidMount(); + } + }, + componentDidUpdate: function componentDidUpdate() { + if (this.props.componentDidUpdate && typeof this.props.componentDidUpdate === "function") { + return this.props.componentDidUpdate(this.state); + } + }, + //todo: clean these verify methods up + verifyExternal: function verifyExternal() { + if (this.props.useExternal === true) { + //hooray for big ugly nested if + if (this.props.externalSetPage === null) { + console.error("useExternal is set to true but there is no externalSetPage function specified."); + } + + if (this.props.externalChangeSort === null) { + console.error("useExternal is set to true but there is no externalChangeSort function specified."); + } + + if (this.props.externalSetFilter === null) { + console.error("useExternal is set to true but there is no externalSetFilter function specified."); + } + + if (this.props.externalSetPageSize === null) { + console.error("useExternal is set to true but there is no externalSetPageSize function specified."); + } + + if (this.props.externalMaxPage === null) { + console.error("useExternal is set to true but externalMaxPage is not set."); + } + + if (this.props.externalCurrentPage === null) { + console.error("useExternal is set to true but externalCurrentPage is not set. Griddle will not page correctly without that property when using external data."); + } + } + }, + //TODO: Do this with propTypes + verifyCustom: function verifyCustom() { + if (this.props.useCustomGridComponent === true && this.props.customGridComponent === null) { + console.error("useCustomGridComponent is set to true but no custom component was specified."); + } + if (this.props.useCustomRowComponent === true && this.props.customRowComponent === null) { + console.error("useCustomRowComponent is set to true but no custom component was specified."); + } + if (this.props.useCustomGridComponent === true && this.props.useCustomRowComponent === true) { + console.error("Cannot currently use both customGridComponent and customRowComponent."); + } + if (this.props.useCustomFilterer === true && this.props.customFilterer === null) { + console.error("useCustomFilterer is set to true but no custom filter function was specified."); + } + if (this.props.useCustomFilterComponent === true && this.props.customFilterComponent === null) { + console.error("useCustomFilterComponent is set to true but no customFilterComponent was specified."); + } + }, + getDataForRender: function getDataForRender(data, cols, pageList) { + var _this = this; + + var that = this; + + if (!this.props.useExternal) { + if (this.state.sortColumn !== "") { + var column = this.state.sortColumn; + var sortColumn = _filter(this.props.columnMetadata, { columnName: column }); + var customCompareFn; + var multiSort = { + columns: [], + orders: [] + }; + + if (sortColumn.length > 0) { + customCompareFn = sortColumn[0].hasOwnProperty("customCompareFn") && sortColumn[0]["customCompareFn"]; + if (sortColumn[0]["multiSort"]) { + multiSort = sortColumn[0]["multiSort"]; + } + } + + if (this.state.sortDirection) { + if (typeof customCompareFn === 'function') { + if (customCompareFn.length === 2) { + data = data.sort(function (a, b) { + return customCompareFn(_get(a, column), _get(b, column)); + }); + + if (this.state.sortDirection === 'desc') { + data.reverse(); + } + } else if (customCompareFn.length === 1) { + data = _orderBy(data, function (item) { + return customCompareFn(_get(item, column)); + }, [this.state.sortDirection]); + } + } else { + var iteratees = [function (row) { + return (_get(row, column) || '').toString().toLowerCase(); + }]; + var orders = [this.state.sortDirection]; + multiSort.columns.forEach(function (col, i) { + iteratees.push(function (row) { + return (_get(row, col) || '').toString().toLowerCase(); + }); + if (multiSort.orders[i] === 'asc' || multiSort.orders[i] === 'desc') { + orders.push(multiSort.orders[i]); + } else { + orders.push(_this.state.sortDirection); + } + }); + + data = _orderBy(data, iteratees, orders); + } + } + } + + var currentPage = this.getCurrentPage(); + + if (!this.props.useExternal && pageList && this.state.resultsPerPage * (currentPage + 1) <= this.state.resultsPerPage * this.state.maxPage && currentPage >= 0) { + if (this.isInfiniteScrollEnabled()) { + // If we're doing infinite scroll, grab all results up to the current page. + data = first(data, (currentPage + 1) * this.state.resultsPerPage); + } else { + //the 'rest' is grabbing the whole array from index on and the 'initial' is getting the first n results + var rest = drop(data, currentPage * this.state.resultsPerPage); + data = (dropRight || initial)(rest, rest.length - this.state.resultsPerPage); + } + } + } + + var transformedData = []; + + for (var i = 0; i < data.length; i++) { + var mappedData = data[i]; + + if (typeof mappedData[that.props.childrenColumnName] !== "undefined" && mappedData[that.props.childrenColumnName].length > 0) { + //internally we're going to use children instead of whatever it is so we don't have to pass the custom name around + mappedData["children"] = that.getDataForRender(mappedData[that.props.childrenColumnName], cols, false); + + if (that.props.childrenColumnName !== "children") { + delete mappedData[that.props.childrenColumnName]; + } + } + + transformedData.push(mappedData); + } + return transformedData; + }, + getCurrentResults: function getCurrentResults(results) { + return this.state.filteredResults || results || this.props.results; + }, + getCurrentPage: function getCurrentPage() { + return this.props.externalCurrentPage || this.state.page; + }, + getCurrentSort: function getCurrentSort() { + return this.props.useExternal ? this.props.externalSortColumn : this.state.sortColumn; + }, + getCurrentSortAscending: function getCurrentSortAscending() { + return this.props.useExternal ? this.props.externalSortAscending : this.state.sortDirection === 'asc'; + }, + getCurrentMaxPage: function getCurrentMaxPage() { + return this.props.useExternal ? this.props.externalMaxPage : this.state.maxPage; + }, + //This takes the props relating to sort and puts them in one object + getSortObject: function getSortObject() { + return { + enableSort: this.props.enableSort, + changeSort: this.changeSort, + sortColumn: this.getCurrentSort(), + sortAscending: this.getCurrentSortAscending(), + sortDirection: this.state.sortDirection, + sortAscendingClassName: this.props.sortAscendingClassName, + sortDescendingClassName: this.props.sortDescendingClassName, + sortAscendingComponent: this.props.sortAscendingComponent, + sortDescendingComponent: this.props.sortDescendingComponent, + sortDefaultComponent: this.props.sortDefaultComponent + }; + }, + _toggleSelectAll: function _toggleSelectAll() { + var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true), + newIsSelectAllChecked = !this.state.isSelectAllChecked, + newSelectedRowIds = JSON.parse(JSON.stringify(this.state.selectedRowIds)); + + var self = this; + forEach(visibleRows, function (row) { + self._updateSelectedRowIds(row[self.props.uniqueIdentifier], newSelectedRowIds, newIsSelectAllChecked); + }, this); + + this.setState({ + isSelectAllChecked: newIsSelectAllChecked, + selectedRowIds: newSelectedRowIds + }); + + if (this.props.onSelectionChange) { + this.props.onSelectionChange(newSelectedRowIds, newIsSelectAllChecked); + } + }, + _toggleSelectRow: function _toggleSelectRow(row, isChecked) { + var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true), + newSelectedRowIds = JSON.parse(JSON.stringify(this.state.selectedRowIds)); + + this._updateSelectedRowIds(row[this.props.uniqueIdentifier], newSelectedRowIds, isChecked); + + var newIsSelectAllChecked = this._getAreAllRowsChecked(newSelectedRowIds, map(visibleRows, this.props.uniqueIdentifier)); + + this.setState({ + isSelectAllChecked: newIsSelectAllChecked, + selectedRowIds: newSelectedRowIds + }); + + if (this.props.onSelectionChange) { + this.props.onSelectionChange(newSelectedRowIds, newIsSelectAllChecked); + } + }, + _updateSelectedRowIds: function _updateSelectedRowIds(id, selectedRowIds, isChecked) { + + var isFound; + + if (isChecked) { + isFound = find(selectedRowIds, function (item) { + return id === item; + }); + + if (isFound === undefined) { + selectedRowIds.push(id); + } + } else { + selectedRowIds.splice(selectedRowIds.indexOf(id), 1); + } + }, + _getIsSelectAllChecked: function _getIsSelectAllChecked() { + + return this.state.isSelectAllChecked; + }, + _getAreAllRowsChecked: function _getAreAllRowsChecked(selectedRowIds, visibleRowIds) { + + return visibleRowIds.length === intersection(visibleRowIds, selectedRowIds).length; + }, + _getIsRowChecked: function _getIsRowChecked(row) { + + return this.state.selectedRowIds.indexOf(row[this.props.uniqueIdentifier]) > -1 ? true : false; + }, + getSelectedRowIds: function getSelectedRowIds() { + + return this.state.selectedRowIds; + }, + _resetSelectedRows: function _resetSelectedRows() { + + this.setState({ + isSelectAllChecked: false, + selectedRowIds: [] + }); + }, + //This takes the props relating to multiple selection and puts them in one object + getMultipleSelectionObject: function getMultipleSelectionObject() { + + return { + isMultipleSelection: find(this.props.results, function (result) { + return 'children' in result; + }) ? false : this.props.isMultipleSelection, //does not support subgrids + toggleSelectAll: this._toggleSelectAll, + getIsSelectAllChecked: this._getIsSelectAllChecked, + toggleSelectRow: this._toggleSelectRow, + getSelectedRowIds: this.getSelectedRowIds, + getIsRowChecked: this._getIsRowChecked + }; + }, + isInfiniteScrollEnabled: function isInfiniteScrollEnabled() { + // If a custom pager is included, don't allow for infinite scrolling. + if (this.props.useCustomPagerComponent) { + return false; + } + + // Otherwise, send back the property. + return this.props.enableInfiniteScroll; + }, + getClearFixStyles: function getClearFixStyles() { + return { + clear: "both", + display: "table", + width: "100%" + }; + }, + getSettingsStyles: function getSettingsStyles() { + return { + "float": "left", + width: "50%", + textAlign: "right" + }; + }, + getFilterStyles: function getFilterStyles() { + return { + "float": "left", + width: "50%", + textAlign: "left", + color: "#222", + minHeight: "1px" + }; + }, + getFilter: function getFilter() { + return this.props.showFilter && this.shouldUseCustomGridComponent() === false ? this.props.useCustomFilterComponent ? React.createElement(CustomFilterContainer, { changeFilter: this.setFilter, placeholderText: this.props.filterPlaceholderText, customFilterComponent: this.props.customFilterComponent, results: this.props.results, currentResults: this.getCurrentResults() }) : React.createElement(GridFilter, { changeFilter: this.setFilter, placeholderText: this.props.filterPlaceholderText }) : ""; + }, + getSettings: function getSettings() { + return this.props.showSettings ? React.createElement('button', { type: 'button', className: this.props.settingsToggleClassName, onClick: this.toggleColumnChooser, + style: this.props.useGriddleStyles ? { background: "none", border: "none", padding: 0, margin: 0, fontSize: 14 } : null }, this.props.settingsText, this.props.settingsIconComponent) : ""; + }, + getTopSection: function getTopSection(filter, settings) { + if (this.props.showFilter === false && this.props.showSettings === false) { + return ""; + } + + var filterStyles = null, + settingsStyles = null, + topContainerStyles = null; + + if (this.props.useGriddleStyles) { + filterStyles = this.getFilterStyles(); + settingsStyles = this.getSettingsStyles(); + + topContainerStyles = this.getClearFixStyles(); + } + + return React.createElement('div', { className: 'top-section', style: topContainerStyles }, React.createElement('div', { className: 'griddle-filter', style: filterStyles }, filter), React.createElement('div', { className: 'griddle-settings-toggle', style: settingsStyles }, settings)); + }, + getPagingSection: function getPagingSection(currentPage, maxPage) { + if ((this.props.showPager && !this.isInfiniteScrollEnabled() && !this.shouldUseCustomGridComponent()) === false) { + return undefined; + } + + return React.createElement('div', { className: 'griddle-footer' }, this.props.useCustomPagerComponent ? React.createElement(CustomPaginationContainer, { customPagerComponentOptions: this.props.customPagerComponentOptions, next: this.nextPage, previous: this.previousPage, currentPage: currentPage, maxPage: maxPage, setPage: this.setPage, nextText: this.props.nextText, previousText: this.props.previousText, customPagerComponent: this.props.customPagerComponent }) : React.createElement(GridPagination, { useGriddleStyles: this.props.useGriddleStyles, next: this.nextPage, previous: this.previousPage, nextClassName: this.props.nextClassName, nextIconComponent: this.props.nextIconComponent, previousClassName: this.props.previousClassName, previousIconComponent: this.props.previousIconComponent, currentPage: currentPage, maxPage: maxPage, setPage: this.setPage, nextText: this.props.nextText, previousText: this.props.previousText })); + }, + getColumnSelectorSection: function getColumnSelectorSection(keys, cols) { + return this.state.showColumnChooser ? React.createElement(GridSettings, { columns: keys, selectedColumns: cols, setColumns: this.setColumns, settingsText: this.props.settingsText, + settingsIconComponent: this.props.settingsIconComponent, maxRowsText: this.props.maxRowsText, setPageSize: this.setPageSize, + showSetPageSize: !this.shouldUseCustomGridComponent(), resultsPerPage: this.state.resultsPerPage, enableToggleCustom: this.props.enableToggleCustom, + toggleCustomComponent: this.toggleCustomComponent, useCustomComponent: this.shouldUseCustomRowComponent() || this.shouldUseCustomGridComponent(), + useGriddleStyles: this.props.useGriddleStyles, enableCustomFormatText: this.props.enableCustomFormatText, columnMetadata: this.props.columnMetadata }) : ""; + }, + getCustomGridSection: function getCustomGridSection() { + return React.createElement(this.props.customGridComponent, _extends({ data: this.props.results, className: this.props.customGridComponentClassName }, this.props.gridMetadata)); + }, + getCustomRowSection: function getCustomRowSection(data, cols, meta, pagingContent, globalData) { + return React.createElement('div', null, React.createElement(CustomRowComponentContainer, { data: data, columns: cols, metadataColumns: meta, globalData: globalData, + className: this.props.customRowComponentClassName, customComponent: this.props.customRowComponent, + style: this.props.useGriddleStyles ? this.getClearFixStyles() : null }), this.props.showPager && pagingContent); + }, + getStandardGridSection: function getStandardGridSection(data, cols, meta, pagingContent, hasMorePages) { + var sortProperties = this.getSortObject(); + var multipleSelectionProperties = this.getMultipleSelectionObject(); + + // no data section + var showNoData = this.shouldShowNoDataSection(data); + var noDataSection = this.getNoDataSection(); + + return React.createElement('div', { className: 'griddle-body' }, React.createElement(GridTable, { useGriddleStyles: this.props.useGriddleStyles, + noDataSection: noDataSection, + showNoData: showNoData, + columnSettings: this.columnSettings, + rowSettings: this.rowSettings, + sortSettings: sortProperties, + multipleSelectionSettings: multipleSelectionProperties, + filterByColumn: this.filterByColumn, + isSubGriddle: this.props.isSubGriddle, + useGriddleIcons: this.props.useGriddleIcons, + useFixedLayout: this.props.useFixedLayout, + showPager: this.props.showPager, + pagingContent: pagingContent, + data: data, + className: this.props.tableClassName, + enableInfiniteScroll: this.isInfiniteScrollEnabled(), + nextPage: this.nextPage, + showTableHeading: this.props.showTableHeading, + useFixedHeader: this.props.useFixedHeader, + parentRowCollapsedClassName: this.props.parentRowCollapsedClassName, + parentRowExpandedClassName: this.props.parentRowExpandedClassName, + parentRowCollapsedComponent: this.props.parentRowCollapsedComponent, + parentRowExpandedComponent: this.props.parentRowExpandedComponent, + bodyHeight: this.props.bodyHeight, + paddingHeight: this.props.paddingHeight, + rowHeight: this.props.rowHeight, + infiniteScrollLoadTreshold: this.props.infiniteScrollLoadTreshold, + externalLoadingComponent: this.props.externalLoadingComponent, + externalIsLoading: this.props.externalIsLoading, + hasMorePages: hasMorePages, + onRowClick: this.props.onRowClick, + onRowMouseEnter: this.props.onRowMouseEnter, + onRowMouseLeave: this.props.onRowMouseLeave, + onRowWillMount: this.props.onRowWillMount, + onRowWillUnmount: this.props.onRowWillUnmount })); + }, + getContentSection: function getContentSection(data, cols, meta, pagingContent, hasMorePages, globalData) { + if (this.shouldUseCustomGridComponent() && this.props.customGridComponent !== null) { + return this.getCustomGridSection(); + } else if (this.shouldUseCustomRowComponent()) { + return this.getCustomRowSection(data, cols, meta, pagingContent, globalData); + } else { + return this.getStandardGridSection(data, cols, meta, pagingContent, hasMorePages); + } + }, + getNoDataSection: function getNoDataSection() { + if (this.props.customNoDataComponent != null) { + return React.createElement('div', { className: this.props.noDataClassName }, React.createElement(this.props.customNoDataComponent, this.props.customNoDataComponentProps)); + } + return React.createElement(GridNoData, { noDataMessage: this.props.noDataMessage }); + }, + shouldShowNoDataSection: function shouldShowNoDataSection(results) { + if (this.props.allowEmptyGrid) { + return false; + } + + return this.props.useExternal === false && (typeof results === 'undefined' || results.length === 0) || this.props.useExternal === true && this.props.externalIsLoading === false && results.length === 0; + }, + render: function render() { + var that = this, + results = this.getCurrentResults(); // Attempt to assign to the filtered results, if we have any. + + var headerTableClassName = this.props.tableClassName + " table-header"; + + //figure out if we want to show the filter section + var filter = this.getFilter(); + var settings = this.getSettings(); + + //if we have neither filter or settings don't need to render this stuff + var topSection = this.getTopSection(filter, settings); + + var keys = []; + var cols = this.columnSettings.getColumns(); + //figure out which columns are displayed and show only those + var data = this.getDataForRender(results, cols, true); + + var meta = this.columnSettings.getMetadataColumns(); + + if (this.props.columnMetadata) { + // Get column keys from column metadata + forEach(this.props.columnMetadata, function (meta) { + if (!(typeof meta.visible === 'boolean' && meta.visible === false)) { + keys.push(meta.columnName); + } + }); + } else { + // Grab the column keys from the first results + keys = deep.keys(omit(results[0], meta)); + } + + // sort keys by order + keys = this.columnSettings.orderColumns(keys); + + // Grab the current and max page values. + var currentPage = this.getCurrentPage(); + var maxPage = this.getCurrentMaxPage(); + + // Determine if we need to enable infinite scrolling on the table. + var hasMorePages = currentPage + 1 < maxPage; + + // Grab the paging content if it's to be displayed + var pagingContent = this.getPagingSection(currentPage, maxPage); + + var resultContent = this.getContentSection(data, cols, meta, pagingContent, hasMorePages, this.props.globalData); + + var columnSelector = this.getColumnSelectorSection(keys, cols); + + var gridClassName = this.props.gridClassName.length > 0 ? "griddle " + this.props.gridClassName : "griddle"; + //add custom to the class name so we can style it differently + gridClassName += this.shouldUseCustomRowComponent() ? " griddle-custom" : ""; + + return React.createElement('div', { className: gridClassName }, topSection, columnSelector, React.createElement('div', { className: 'griddle-container', style: this.props.useGriddleStyles && !this.props.isSubGriddle ? { border: "1px solid #DDD" } : null }, resultContent)); + } +}); + +GridRowContainer.Griddle = module.exports = Griddle; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/rowProperties.js": +/*!*************************************************************!*\ + !*** ./node_modules/griddle-react/modules/rowProperties.js ***! + \*************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + +var _uniqueId = __webpack_require__(/*! lodash/uniqueId */ "./node_modules/lodash/uniqueId.js"); + +var RowProperties = (function () { + function RowProperties() { + var rowMetadata = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + var rowComponent = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var isCustom = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2]; + + _classCallCheck(this, RowProperties); + + this.rowMetadata = rowMetadata; + this.rowComponent = rowComponent; + this.isCustom = isCustom; + // assign unique Id to each griddle instance + } + + _createClass(RowProperties, [{ + key: 'getRowKey', + value: function getRowKey(row, key) { + var uniqueId; + + if (this.hasRowMetadataKey()) { + uniqueId = row[this.rowMetadata.key]; + } else { + uniqueId = _uniqueId("grid_row"); + } + + //todo: add error handling + + return uniqueId; + } + }, { + key: 'hasRowMetadataKey', + value: function hasRowMetadataKey() { + return this.hasRowMetadata() && this.rowMetadata.key !== null && this.rowMetadata.key !== undefined; + } + }, { + key: 'getBodyRowMetadataClass', + value: function getBodyRowMetadataClass(rowData) { + if (this.hasRowMetadata() && this.rowMetadata.bodyCssClassName !== null && this.rowMetadata.bodyCssClassName !== undefined) { + if (typeof this.rowMetadata.bodyCssClassName === 'function') { + return this.rowMetadata.bodyCssClassName(rowData); + } else { + return this.rowMetadata.bodyCssClassName; + } + } + return null; + } + }, { + key: 'getHeaderRowMetadataClass', + value: function getHeaderRowMetadataClass() { + return this.hasRowMetadata() && this.rowMetadata.headerCssClassName !== null && this.rowMetadata.headerCssClassName !== undefined ? this.rowMetadata.headerCssClassName : null; + } + }, { + key: 'hasRowMetadata', + value: function hasRowMetadata() { + return this.rowMetadata !== null; + } + }]); + + return RowProperties; +})(); + +module.exports = RowProperties; + + +/***/ }), + +/***/ "./node_modules/lodash/_DataView.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_DataView.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'); + +module.exports = DataView; + + +/***/ }), + +/***/ "./node_modules/lodash/_Hash.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/_Hash.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var hashClear = __webpack_require__(/*! ./_hashClear */ "./node_modules/lodash/_hashClear.js"), + hashDelete = __webpack_require__(/*! ./_hashDelete */ "./node_modules/lodash/_hashDelete.js"), + hashGet = __webpack_require__(/*! ./_hashGet */ "./node_modules/lodash/_hashGet.js"), + hashHas = __webpack_require__(/*! ./_hashHas */ "./node_modules/lodash/_hashHas.js"), + hashSet = __webpack_require__(/*! ./_hashSet */ "./node_modules/lodash/_hashSet.js"); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +module.exports = Hash; + + +/***/ }), + +/***/ "./node_modules/lodash/_ListCache.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_ListCache.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "./node_modules/lodash/_listCacheClear.js"), + listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "./node_modules/lodash/_listCacheDelete.js"), + listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "./node_modules/lodash/_listCacheGet.js"), + listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "./node_modules/lodash/_listCacheHas.js"), + listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "./node_modules/lodash/_listCacheSet.js"); + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +module.exports = ListCache; + + +/***/ }), + +/***/ "./node_modules/lodash/_Map.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/_Map.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); + +module.exports = Map; + + +/***/ }), + +/***/ "./node_modules/lodash/_MapCache.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_MapCache.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var mapCacheClear = __webpack_require__(/*! ./_mapCacheClear */ "./node_modules/lodash/_mapCacheClear.js"), + mapCacheDelete = __webpack_require__(/*! ./_mapCacheDelete */ "./node_modules/lodash/_mapCacheDelete.js"), + mapCacheGet = __webpack_require__(/*! ./_mapCacheGet */ "./node_modules/lodash/_mapCacheGet.js"), + mapCacheHas = __webpack_require__(/*! ./_mapCacheHas */ "./node_modules/lodash/_mapCacheHas.js"), + mapCacheSet = __webpack_require__(/*! ./_mapCacheSet */ "./node_modules/lodash/_mapCacheSet.js"); + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +module.exports = MapCache; + + +/***/ }), + +/***/ "./node_modules/lodash/_Promise.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_Promise.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var Promise = getNative(root, 'Promise'); + +module.exports = Promise; + + +/***/ }), + +/***/ "./node_modules/lodash/_Set.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/_Set.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); + +module.exports = Set; + + +/***/ }), + +/***/ "./node_modules/lodash/_SetCache.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_SetCache.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/lodash/_MapCache.js"), + setCacheAdd = __webpack_require__(/*! ./_setCacheAdd */ "./node_modules/lodash/_setCacheAdd.js"), + setCacheHas = __webpack_require__(/*! ./_setCacheHas */ "./node_modules/lodash/_setCacheHas.js"); + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +module.exports = SetCache; + + +/***/ }), + +/***/ "./node_modules/lodash/_Stack.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/_Stack.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"), + stackClear = __webpack_require__(/*! ./_stackClear */ "./node_modules/lodash/_stackClear.js"), + stackDelete = __webpack_require__(/*! ./_stackDelete */ "./node_modules/lodash/_stackDelete.js"), + stackGet = __webpack_require__(/*! ./_stackGet */ "./node_modules/lodash/_stackGet.js"), + stackHas = __webpack_require__(/*! ./_stackHas */ "./node_modules/lodash/_stackHas.js"), + stackSet = __webpack_require__(/*! ./_stackSet */ "./node_modules/lodash/_stackSet.js"); + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +module.exports = Stack; + + +/***/ }), + +/***/ "./node_modules/lodash/_Symbol.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/_Symbol.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/** Built-in value references. */ +var Symbol = root.Symbol; + +module.exports = Symbol; + + +/***/ }), + +/***/ "./node_modules/lodash/_Uint8Array.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_Uint8Array.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/** Built-in value references. */ +var Uint8Array = root.Uint8Array; + +module.exports = Uint8Array; + + +/***/ }), + +/***/ "./node_modules/lodash/_WeakMap.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_WeakMap.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var WeakMap = getNative(root, 'WeakMap'); + +module.exports = WeakMap; + + +/***/ }), + +/***/ "./node_modules/lodash/_apply.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/_apply.js ***! + \***************************************/ +/***/ (function(module) { + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +module.exports = apply; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayEach.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_arrayEach.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEach; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayFilter.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_arrayFilter.js ***! + \*********************************************/ +/***/ (function(module) { + +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = arrayFilter; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayIncludes.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_arrayIncludes.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ "./node_modules/lodash/_baseIndexOf.js"); + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; +} + +module.exports = arrayIncludes; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayIncludesWith.js": +/*!***************************************************!*\ + !*** ./node_modules/lodash/_arrayIncludesWith.js ***! + \***************************************************/ +/***/ (function(module) { + +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +module.exports = arrayIncludesWith; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayLikeKeys.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_arrayLikeKeys.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseTimes = __webpack_require__(/*! ./_baseTimes */ "./node_modules/lodash/_baseTimes.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"), + isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/lodash/isTypedArray.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +module.exports = arrayLikeKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayMap.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_arrayMap.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +module.exports = arrayMap; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayPush.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_arrayPush.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +module.exports = arrayPush; + + +/***/ }), + +/***/ "./node_modules/lodash/_arraySome.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_arraySome.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +module.exports = arraySome; + + +/***/ }), + +/***/ "./node_modules/lodash/_assignValue.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_assignValue.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/lodash/_baseAssignValue.js"), + eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +module.exports = assignValue; + + +/***/ }), + +/***/ "./node_modules/lodash/_assocIndexOf.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_assocIndexOf.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"); + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +module.exports = assocIndexOf; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseAssign.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseAssign.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} + +module.exports = baseAssign; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseAssignIn.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseAssignIn.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); + +/** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); +} + +module.exports = baseAssignIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseAssignValue.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseAssignValue.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var defineProperty = __webpack_require__(/*! ./_defineProperty */ "./node_modules/lodash/_defineProperty.js"); + +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } +} + +module.exports = baseAssignValue; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseClone.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseClone.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/lodash/_Stack.js"), + arrayEach = __webpack_require__(/*! ./_arrayEach */ "./node_modules/lodash/_arrayEach.js"), + assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + baseAssign = __webpack_require__(/*! ./_baseAssign */ "./node_modules/lodash/_baseAssign.js"), + baseAssignIn = __webpack_require__(/*! ./_baseAssignIn */ "./node_modules/lodash/_baseAssignIn.js"), + cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ "./node_modules/lodash/_cloneBuffer.js"), + copyArray = __webpack_require__(/*! ./_copyArray */ "./node_modules/lodash/_copyArray.js"), + copySymbols = __webpack_require__(/*! ./_copySymbols */ "./node_modules/lodash/_copySymbols.js"), + copySymbolsIn = __webpack_require__(/*! ./_copySymbolsIn */ "./node_modules/lodash/_copySymbolsIn.js"), + getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "./node_modules/lodash/_getAllKeys.js"), + getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ "./node_modules/lodash/_getAllKeysIn.js"), + getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + initCloneArray = __webpack_require__(/*! ./_initCloneArray */ "./node_modules/lodash/_initCloneArray.js"), + initCloneByTag = __webpack_require__(/*! ./_initCloneByTag */ "./node_modules/lodash/_initCloneByTag.js"), + initCloneObject = __webpack_require__(/*! ./_initCloneObject */ "./node_modules/lodash/_initCloneObject.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), + isMap = __webpack_require__(/*! ./isMap */ "./node_modules/lodash/isMap.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + isSet = __webpack_require__(/*! ./isSet */ "./node_modules/lodash/isSet.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; +} + +module.exports = baseClone; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseCreate.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseCreate.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); + +/** Built-in value references. */ +var objectCreate = Object.create; + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); + +module.exports = baseCreate; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseDifference.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_baseDifference.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var SetCache = __webpack_require__(/*! ./_SetCache */ "./node_modules/lodash/_SetCache.js"), + arrayIncludes = __webpack_require__(/*! ./_arrayIncludes */ "./node_modules/lodash/_arrayIncludes.js"), + arrayIncludesWith = __webpack_require__(/*! ./_arrayIncludesWith */ "./node_modules/lodash/_arrayIncludesWith.js"), + arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + cacheHas = __webpack_require__(/*! ./_cacheHas */ "./node_modules/lodash/_cacheHas.js"); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ +function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; +} + +module.exports = baseDifference; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseEach.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseEach.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "./node_modules/lodash/_baseForOwn.js"), + createBaseEach = __webpack_require__(/*! ./_createBaseEach */ "./node_modules/lodash/_createBaseEach.js"); + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +module.exports = baseEach; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseFilter.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseFilter.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/lodash/_baseEach.js"); + +/** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; +} + +module.exports = baseFilter; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseFindIndex.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_baseFindIndex.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +module.exports = baseFindIndex; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseFlatten.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseFlatten.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"), + isFlattenable = __webpack_require__(/*! ./_isFlattenable */ "./node_modules/lodash/_isFlattenable.js"); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +module.exports = baseFlatten; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseFor.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_baseFor.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var createBaseFor = __webpack_require__(/*! ./_createBaseFor */ "./node_modules/lodash/_createBaseFor.js"); + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +module.exports = baseFor; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseForOwn.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseForOwn.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseFor = __webpack_require__(/*! ./_baseFor */ "./node_modules/lodash/_baseFor.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +module.exports = baseForOwn; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseGet.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_baseGet.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +module.exports = baseGet; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseGetAllKeys.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_baseGetAllKeys.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +module.exports = baseGetAllKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseGetTag.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseGetTag.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), + getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"), + objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js"); + +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +module.exports = baseGetTag; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseHasIn.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseHasIn.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +module.exports = baseHasIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIndexOf.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseIndexOf.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ "./node_modules/lodash/_baseFindIndex.js"), + baseIsNaN = __webpack_require__(/*! ./_baseIsNaN */ "./node_modules/lodash/_baseIsNaN.js"), + strictIndexOf = __webpack_require__(/*! ./_strictIndexOf */ "./node_modules/lodash/_strictIndexOf.js"); + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); +} + +module.exports = baseIndexOf; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIntersection.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_baseIntersection.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var SetCache = __webpack_require__(/*! ./_SetCache */ "./node_modules/lodash/_SetCache.js"), + arrayIncludes = __webpack_require__(/*! ./_arrayIncludes */ "./node_modules/lodash/_arrayIncludes.js"), + arrayIncludesWith = __webpack_require__(/*! ./_arrayIncludesWith */ "./node_modules/lodash/_arrayIncludesWith.js"), + arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + cacheHas = __webpack_require__(/*! ./_cacheHas */ "./node_modules/lodash/_cacheHas.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ +function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseIntersection; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsArguments.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseIsArguments.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +module.exports = baseIsArguments; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsEqual.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseIsEqual.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsEqualDeep = __webpack_require__(/*! ./_baseIsEqualDeep */ "./node_modules/lodash/_baseIsEqualDeep.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); +} + +module.exports = baseIsEqual; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsEqualDeep.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseIsEqualDeep.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/lodash/_Stack.js"), + equalArrays = __webpack_require__(/*! ./_equalArrays */ "./node_modules/lodash/_equalArrays.js"), + equalByTag = __webpack_require__(/*! ./_equalByTag */ "./node_modules/lodash/_equalByTag.js"), + equalObjects = __webpack_require__(/*! ./_equalObjects */ "./node_modules/lodash/_equalObjects.js"), + getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), + isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/lodash/isTypedArray.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} + +module.exports = baseIsEqualDeep; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsMap.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseIsMap.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]'; + +/** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ +function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; +} + +module.exports = baseIsMap; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsMatch.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseIsMatch.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/lodash/_Stack.js"), + baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ "./node_modules/lodash/_baseIsEqual.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; +} + +module.exports = baseIsMatch; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsNaN.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseIsNaN.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +module.exports = baseIsNaN; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsNative.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseIsNative.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/lodash/isFunction.js"), + isMasked = __webpack_require__(/*! ./_isMasked */ "./node_modules/lodash/_isMasked.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + toSource = __webpack_require__(/*! ./_toSource */ "./node_modules/lodash/_toSource.js"); + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +module.exports = baseIsNative; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsSet.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseIsSet.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var setTag = '[object Set]'; + +/** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ +function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; +} + +module.exports = baseIsSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsTypedArray.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_baseIsTypedArray.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +module.exports = baseIsTypedArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIteratee.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseIteratee.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseMatches = __webpack_require__(/*! ./_baseMatches */ "./node_modules/lodash/_baseMatches.js"), + baseMatchesProperty = __webpack_require__(/*! ./_baseMatchesProperty */ "./node_modules/lodash/_baseMatchesProperty.js"), + identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + property = __webpack_require__(/*! ./property */ "./node_modules/lodash/property.js"); + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +module.exports = baseIteratee; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseKeys.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseKeys.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"), + nativeKeys = __webpack_require__(/*! ./_nativeKeys */ "./node_modules/lodash/_nativeKeys.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +module.exports = baseKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseKeysIn.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseKeysIn.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"), + nativeKeysIn = __webpack_require__(/*! ./_nativeKeysIn */ "./node_modules/lodash/_nativeKeysIn.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +module.exports = baseKeysIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseMap.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_baseMap.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/lodash/_baseEach.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"); + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +module.exports = baseMap; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseMatches.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseMatches.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsMatch = __webpack_require__(/*! ./_baseIsMatch */ "./node_modules/lodash/_baseIsMatch.js"), + getMatchData = __webpack_require__(/*! ./_getMatchData */ "./node_modules/lodash/_getMatchData.js"), + matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ "./node_modules/lodash/_matchesStrictComparable.js"); + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +module.exports = baseMatches; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseMatchesProperty.js": +/*!*****************************************************!*\ + !*** ./node_modules/lodash/_baseMatchesProperty.js ***! + \*****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ "./node_modules/lodash/_baseIsEqual.js"), + get = __webpack_require__(/*! ./get */ "./node_modules/lodash/get.js"), + hasIn = __webpack_require__(/*! ./hasIn */ "./node_modules/lodash/hasIn.js"), + isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/lodash/_isKey.js"), + isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ "./node_modules/lodash/_isStrictComparable.js"), + matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ "./node_modules/lodash/_matchesStrictComparable.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; +} + +module.exports = baseMatchesProperty; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseOrderBy.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseOrderBy.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + baseMap = __webpack_require__(/*! ./_baseMap */ "./node_modules/lodash/_baseMap.js"), + baseSortBy = __webpack_require__(/*! ./_baseSortBy */ "./node_modules/lodash/_baseSortBy.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + compareMultiple = __webpack_require__(/*! ./_compareMultiple */ "./node_modules/lodash/_compareMultiple.js"), + identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee) { + if (isArray(iteratee)) { + return function(value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + } + } + return iteratee; + }); + } else { + iteratees = [identity]; + } + + var index = -1; + iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +module.exports = baseOrderBy; + + +/***/ }), + +/***/ "./node_modules/lodash/_basePick.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_basePick.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var basePickBy = __webpack_require__(/*! ./_basePickBy */ "./node_modules/lodash/_basePickBy.js"), + hasIn = __webpack_require__(/*! ./hasIn */ "./node_modules/lodash/hasIn.js"); + +/** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ +function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); +} + +module.exports = basePick; + + +/***/ }), + +/***/ "./node_modules/lodash/_basePickBy.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_basePickBy.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"), + baseSet = __webpack_require__(/*! ./_baseSet */ "./node_modules/lodash/_baseSet.js"), + castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"); + +/** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ +function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; +} + +module.exports = basePickBy; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseProperty.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseProperty.js ***! + \**********************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = baseProperty; + + +/***/ }), + +/***/ "./node_modules/lodash/_basePropertyDeep.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_basePropertyDeep.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"); + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +module.exports = basePropertyDeep; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseRest.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseRest.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"), + overRest = __webpack_require__(/*! ./_overRest */ "./node_modules/lodash/_overRest.js"), + setToString = __webpack_require__(/*! ./_setToString */ "./node_modules/lodash/_setToString.js"); + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} + +module.exports = baseRest; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSet.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_baseSet.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ +function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; +} + +module.exports = baseSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSetToString.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseSetToString.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var constant = __webpack_require__(/*! ./constant */ "./node_modules/lodash/constant.js"), + defineProperty = __webpack_require__(/*! ./_defineProperty */ "./node_modules/lodash/_defineProperty.js"), + identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"); + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +module.exports = baseSetToString; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSlice.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseSlice.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +module.exports = baseSlice; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSome.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseSome.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/lodash/_baseEach.js"); + +/** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; +} + +module.exports = baseSome; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSortBy.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseSortBy.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +module.exports = baseSortBy; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseTimes.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseTimes.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +module.exports = baseTimes; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseToPairs.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseToPairs.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"); + +/** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ +function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); +} + +module.exports = baseToPairs; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseToString.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseToString.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), + arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = baseToString; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseTrim.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseTrim.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var trimmedEndIndex = __webpack_require__(/*! ./_trimmedEndIndex */ "./node_modules/lodash/_trimmedEndIndex.js"); + +/** Used to match leading whitespace. */ +var reTrimStart = /^\s+/; + +/** + * The base implementation of `_.trim`. + * + * @private + * @param {string} string The string to trim. + * @returns {string} Returns the trimmed string. + */ +function baseTrim(string) { + return string + ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') + : string; +} + +module.exports = baseTrim; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseUnary.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseUnary.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +module.exports = baseUnary; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseUnset.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseUnset.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + last = __webpack_require__(/*! ./last */ "./node_modules/lodash/last.js"), + parent = __webpack_require__(/*! ./_parent */ "./node_modules/lodash/_parent.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ +function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; +} + +module.exports = baseUnset; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseValues.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseValues.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"); + +/** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ +function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); +} + +module.exports = baseValues; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseZipObject.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_baseZipObject.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ +function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; +} + +module.exports = baseZipObject; + + +/***/ }), + +/***/ "./node_modules/lodash/_cacheHas.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_cacheHas.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +module.exports = cacheHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_castArrayLikeObject.js": +/*!*****************************************************!*\ + !*** ./node_modules/lodash/_castArrayLikeObject.js ***! + \*****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ "./node_modules/lodash/isArrayLikeObject.js"); + +/** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ +function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; +} + +module.exports = castArrayLikeObject; + + +/***/ }), + +/***/ "./node_modules/lodash/_castFunction.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_castFunction.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"); + +/** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ +function castFunction(value) { + return typeof value == 'function' ? value : identity; +} + +module.exports = castFunction; + + +/***/ }), + +/***/ "./node_modules/lodash/_castPath.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_castPath.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/lodash/_isKey.js"), + stringToPath = __webpack_require__(/*! ./_stringToPath */ "./node_modules/lodash/_stringToPath.js"), + toString = __webpack_require__(/*! ./toString */ "./node_modules/lodash/toString.js"); + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); +} + +module.exports = castPath; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneArrayBuffer.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_cloneArrayBuffer.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "./node_modules/lodash/_Uint8Array.js"); + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +module.exports = cloneArrayBuffer; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneBuffer.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_cloneBuffer.js ***! + \*********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; +} + +module.exports = cloneBuffer; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneDataView.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_cloneDataView.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/lodash/_cloneArrayBuffer.js"); + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +module.exports = cloneDataView; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneRegExp.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_cloneRegExp.js ***! + \*********************************************/ +/***/ (function(module) { + +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +module.exports = cloneRegExp; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneSymbol.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_cloneSymbol.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +module.exports = cloneSymbol; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneTypedArray.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_cloneTypedArray.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/lodash/_cloneArrayBuffer.js"); + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +module.exports = cloneTypedArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_compareAscending.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_compareAscending.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +module.exports = compareAscending; + + +/***/ }), + +/***/ "./node_modules/lodash/_compareMultiple.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_compareMultiple.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var compareAscending = __webpack_require__(/*! ./_compareAscending */ "./node_modules/lodash/_compareAscending.js"); + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +module.exports = compareMultiple; + + +/***/ }), + +/***/ "./node_modules/lodash/_copyArray.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_copyArray.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +module.exports = copyArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_copyObject.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_copyObject.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/lodash/_baseAssignValue.js"); + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +module.exports = copyObject; + + +/***/ }), + +/***/ "./node_modules/lodash/_copySymbols.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_copySymbols.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/lodash/_getSymbols.js"); + +/** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +module.exports = copySymbols; + + +/***/ }), + +/***/ "./node_modules/lodash/_copySymbolsIn.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_copySymbolsIn.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "./node_modules/lodash/_getSymbolsIn.js"); + +/** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); +} + +module.exports = copySymbolsIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_coreJsData.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_coreJsData.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +module.exports = coreJsData; + + +/***/ }), + +/***/ "./node_modules/lodash/_createAssigner.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_createAssigner.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/lodash/_isIterateeCall.js"); + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +module.exports = createAssigner; + + +/***/ }), + +/***/ "./node_modules/lodash/_createBaseEach.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_createBaseEach.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"); + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +module.exports = createBaseEach; + + +/***/ }), + +/***/ "./node_modules/lodash/_createBaseFor.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_createBaseFor.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +module.exports = createBaseFor; + + +/***/ }), + +/***/ "./node_modules/lodash/_createFind.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_createFind.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ +function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; +} + +module.exports = createFind; + + +/***/ }), + +/***/ "./node_modules/lodash/_createToPairs.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_createToPairs.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseToPairs = __webpack_require__(/*! ./_baseToPairs */ "./node_modules/lodash/_baseToPairs.js"), + getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + mapToArray = __webpack_require__(/*! ./_mapToArray */ "./node_modules/lodash/_mapToArray.js"), + setToPairs = __webpack_require__(/*! ./_setToPairs */ "./node_modules/lodash/_setToPairs.js"); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ +function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; +} + +module.exports = createToPairs; + + +/***/ }), + +/***/ "./node_modules/lodash/_customOmitClone.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_customOmitClone.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isPlainObject = __webpack_require__(/*! ./isPlainObject */ "./node_modules/lodash/isPlainObject.js"); + +/** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ +function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; +} + +module.exports = customOmitClone; + + +/***/ }), + +/***/ "./node_modules/lodash/_defineProperty.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_defineProperty.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"); + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; + + +/***/ }), + +/***/ "./node_modules/lodash/_equalArrays.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_equalArrays.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var SetCache = __webpack_require__(/*! ./_SetCache */ "./node_modules/lodash/_SetCache.js"), + arraySome = __webpack_require__(/*! ./_arraySome */ "./node_modules/lodash/_arraySome.js"), + cacheHas = __webpack_require__(/*! ./_cacheHas */ "./node_modules/lodash/_cacheHas.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +module.exports = equalArrays; + + +/***/ }), + +/***/ "./node_modules/lodash/_equalByTag.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_equalByTag.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), + Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "./node_modules/lodash/_Uint8Array.js"), + eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"), + equalArrays = __webpack_require__(/*! ./_equalArrays */ "./node_modules/lodash/_equalArrays.js"), + mapToArray = __webpack_require__(/*! ./_mapToArray */ "./node_modules/lodash/_mapToArray.js"), + setToArray = __webpack_require__(/*! ./_setToArray */ "./node_modules/lodash/_setToArray.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]'; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +module.exports = equalByTag; + + +/***/ }), + +/***/ "./node_modules/lodash/_equalObjects.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_equalObjects.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "./node_modules/lodash/_getAllKeys.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +module.exports = equalObjects; + + +/***/ }), + +/***/ "./node_modules/lodash/_flatRest.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_flatRest.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var flatten = __webpack_require__(/*! ./flatten */ "./node_modules/lodash/flatten.js"), + overRest = __webpack_require__(/*! ./_overRest */ "./node_modules/lodash/_overRest.js"), + setToString = __webpack_require__(/*! ./_setToString */ "./node_modules/lodash/_setToString.js"); + +/** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ +function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); +} + +module.exports = flatRest; + + +/***/ }), + +/***/ "./node_modules/lodash/_freeGlobal.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_freeGlobal.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; + +module.exports = freeGlobal; + + +/***/ }), + +/***/ "./node_modules/lodash/_getAllKeys.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_getAllKeys.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "./node_modules/lodash/_baseGetAllKeys.js"), + getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/lodash/_getSymbols.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +module.exports = getAllKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_getAllKeysIn.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_getAllKeysIn.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "./node_modules/lodash/_baseGetAllKeys.js"), + getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "./node_modules/lodash/_getSymbolsIn.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); + +/** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); +} + +module.exports = getAllKeysIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_getMapData.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_getMapData.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isKeyable = __webpack_require__(/*! ./_isKeyable */ "./node_modules/lodash/_isKeyable.js"); + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +module.exports = getMapData; + + +/***/ }), + +/***/ "./node_modules/lodash/_getMatchData.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_getMatchData.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ "./node_modules/lodash/_isStrictComparable.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +module.exports = getMatchData; + + +/***/ }), + +/***/ "./node_modules/lodash/_getNative.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_getNative.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsNative = __webpack_require__(/*! ./_baseIsNative */ "./node_modules/lodash/_baseIsNative.js"), + getValue = __webpack_require__(/*! ./_getValue */ "./node_modules/lodash/_getValue.js"); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +module.exports = getNative; + + +/***/ }), + +/***/ "./node_modules/lodash/_getPrototype.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_getPrototype.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var overArg = __webpack_require__(/*! ./_overArg */ "./node_modules/lodash/_overArg.js"); + +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); + +module.exports = getPrototype; + + +/***/ }), + +/***/ "./node_modules/lodash/_getRawTag.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_getRawTag.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +module.exports = getRawTag; + + +/***/ }), + +/***/ "./node_modules/lodash/_getSymbols.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_getSymbols.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ "./node_modules/lodash/_arrayFilter.js"), + stubArray = __webpack_require__(/*! ./stubArray */ "./node_modules/lodash/stubArray.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +module.exports = getSymbols; + + +/***/ }), + +/***/ "./node_modules/lodash/_getSymbolsIn.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_getSymbolsIn.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"), + getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/lodash/_getPrototype.js"), + getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/lodash/_getSymbols.js"), + stubArray = __webpack_require__(/*! ./stubArray */ "./node_modules/lodash/stubArray.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; +}; + +module.exports = getSymbolsIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_getTag.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/_getTag.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var DataView = __webpack_require__(/*! ./_DataView */ "./node_modules/lodash/_DataView.js"), + Map = __webpack_require__(/*! ./_Map */ "./node_modules/lodash/_Map.js"), + Promise = __webpack_require__(/*! ./_Promise */ "./node_modules/lodash/_Promise.js"), + Set = __webpack_require__(/*! ./_Set */ "./node_modules/lodash/_Set.js"), + WeakMap = __webpack_require__(/*! ./_WeakMap */ "./node_modules/lodash/_WeakMap.js"), + baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + toSource = __webpack_require__(/*! ./_toSource */ "./node_modules/lodash/_toSource.js"); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; + +var dataViewTag = '[object DataView]'; + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +module.exports = getTag; + + +/***/ }), + +/***/ "./node_modules/lodash/_getValue.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_getValue.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +module.exports = getValue; + + +/***/ }), + +/***/ "./node_modules/lodash/_hasPath.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_hasPath.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"), + isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +module.exports = hasPath; + + +/***/ }), + +/***/ "./node_modules/lodash/_hashClear.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_hashClear.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +module.exports = hashClear; + + +/***/ }), + +/***/ "./node_modules/lodash/_hashDelete.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_hashDelete.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +module.exports = hashDelete; + + +/***/ }), + +/***/ "./node_modules/lodash/_hashGet.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_hashGet.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +module.exports = hashGet; + + +/***/ }), + +/***/ "./node_modules/lodash/_hashHas.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_hashHas.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +module.exports = hashHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_hashSet.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_hashSet.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +module.exports = hashSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_initCloneArray.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_initCloneArray.js ***! + \************************************************/ +/***/ (function(module) { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +module.exports = initCloneArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_initCloneByTag.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_initCloneByTag.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/lodash/_cloneArrayBuffer.js"), + cloneDataView = __webpack_require__(/*! ./_cloneDataView */ "./node_modules/lodash/_cloneDataView.js"), + cloneRegExp = __webpack_require__(/*! ./_cloneRegExp */ "./node_modules/lodash/_cloneRegExp.js"), + cloneSymbol = __webpack_require__(/*! ./_cloneSymbol */ "./node_modules/lodash/_cloneSymbol.js"), + cloneTypedArray = __webpack_require__(/*! ./_cloneTypedArray */ "./node_modules/lodash/_cloneTypedArray.js"); + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } +} + +module.exports = initCloneByTag; + + +/***/ }), + +/***/ "./node_modules/lodash/_initCloneObject.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_initCloneObject.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseCreate = __webpack_require__(/*! ./_baseCreate */ "./node_modules/lodash/_baseCreate.js"), + getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/lodash/_getPrototype.js"), + isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"); + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +module.exports = initCloneObject; + + +/***/ }), + +/***/ "./node_modules/lodash/_isFlattenable.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_isFlattenable.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** Built-in value references. */ +var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +module.exports = isFlattenable; + + +/***/ }), + +/***/ "./node_modules/lodash/_isIndex.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_isIndex.js ***! + \*****************************************/ +/***/ (function(module) { + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +module.exports = isIndex; + + +/***/ }), + +/***/ "./node_modules/lodash/_isIterateeCall.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_isIterateeCall.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +module.exports = isIterateeCall; + + +/***/ }), + +/***/ "./node_modules/lodash/_isKey.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/_isKey.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +module.exports = isKey; + + +/***/ }), + +/***/ "./node_modules/lodash/_isKeyable.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_isKeyable.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +module.exports = isKeyable; + + +/***/ }), + +/***/ "./node_modules/lodash/_isMasked.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_isMasked.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var coreJsData = __webpack_require__(/*! ./_coreJsData */ "./node_modules/lodash/_coreJsData.js"); + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +module.exports = isMasked; + + +/***/ }), + +/***/ "./node_modules/lodash/_isPrototype.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_isPrototype.js ***! + \*********************************************/ +/***/ (function(module) { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +module.exports = isPrototype; + + +/***/ }), + +/***/ "./node_modules/lodash/_isStrictComparable.js": +/*!****************************************************!*\ + !*** ./node_modules/lodash/_isStrictComparable.js ***! + \****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +module.exports = isStrictComparable; + + +/***/ }), + +/***/ "./node_modules/lodash/_listCacheClear.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_listCacheClear.js ***! + \************************************************/ +/***/ (function(module) { + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +module.exports = listCacheClear; + + +/***/ }), + +/***/ "./node_modules/lodash/_listCacheDelete.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_listCacheDelete.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +module.exports = listCacheDelete; + + +/***/ }), + +/***/ "./node_modules/lodash/_listCacheGet.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_listCacheGet.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +module.exports = listCacheGet; + + +/***/ }), + +/***/ "./node_modules/lodash/_listCacheHas.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_listCacheHas.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +module.exports = listCacheHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_listCacheSet.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_listCacheSet.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +module.exports = listCacheSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapCacheClear.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_mapCacheClear.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Hash = __webpack_require__(/*! ./_Hash */ "./node_modules/lodash/_Hash.js"), + ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"), + Map = __webpack_require__(/*! ./_Map */ "./node_modules/lodash/_Map.js"); + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +module.exports = mapCacheClear; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapCacheDelete.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_mapCacheDelete.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +module.exports = mapCacheDelete; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapCacheGet.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_mapCacheGet.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +module.exports = mapCacheGet; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapCacheHas.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_mapCacheHas.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +module.exports = mapCacheHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapCacheSet.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_mapCacheSet.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +module.exports = mapCacheSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapToArray.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_mapToArray.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +module.exports = mapToArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_matchesStrictComparable.js": +/*!*********************************************************!*\ + !*** ./node_modules/lodash/_matchesStrictComparable.js ***! + \*********************************************************/ +/***/ (function(module) { + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +module.exports = matchesStrictComparable; + + +/***/ }), + +/***/ "./node_modules/lodash/_memoizeCapped.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_memoizeCapped.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var memoize = __webpack_require__(/*! ./memoize */ "./node_modules/lodash/memoize.js"); + +/** Used as the maximum memoize cache size. */ +var MAX_MEMOIZE_SIZE = 500; + +/** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ +function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; +} + +module.exports = memoizeCapped; + + +/***/ }), + +/***/ "./node_modules/lodash/_nativeCreate.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_nativeCreate.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"); + +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); + +module.exports = nativeCreate; + + +/***/ }), + +/***/ "./node_modules/lodash/_nativeKeys.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_nativeKeys.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var overArg = __webpack_require__(/*! ./_overArg */ "./node_modules/lodash/_overArg.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +module.exports = nativeKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_nativeKeysIn.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_nativeKeysIn.js ***! + \**********************************************/ +/***/ (function(module) { + +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +module.exports = nativeKeysIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_nodeUtil.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_nodeUtil.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js"); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +module.exports = nodeUtil; + + +/***/ }), + +/***/ "./node_modules/lodash/_objectToString.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_objectToString.js ***! + \************************************************/ +/***/ (function(module) { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +module.exports = objectToString; + + +/***/ }), + +/***/ "./node_modules/lodash/_overArg.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_overArg.js ***! + \*****************************************/ +/***/ (function(module) { + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +module.exports = overArg; + + +/***/ }), + +/***/ "./node_modules/lodash/_overRest.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_overRest.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var apply = __webpack_require__(/*! ./_apply */ "./node_modules/lodash/_apply.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +module.exports = overRest; + + +/***/ }), + +/***/ "./node_modules/lodash/_parent.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/_parent.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"), + baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"); + +/** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ +function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); +} + +module.exports = parent; + + +/***/ }), + +/***/ "./node_modules/lodash/_root.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/_root.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js"); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +module.exports = root; + + +/***/ }), + +/***/ "./node_modules/lodash/_setCacheAdd.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_setCacheAdd.js ***! + \*********************************************/ +/***/ (function(module) { + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +module.exports = setCacheAdd; + + +/***/ }), + +/***/ "./node_modules/lodash/_setCacheHas.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_setCacheHas.js ***! + \*********************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +module.exports = setCacheHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_setToArray.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_setToArray.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +module.exports = setToArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_setToPairs.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_setToPairs.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ +function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; +} + +module.exports = setToPairs; + + +/***/ }), + +/***/ "./node_modules/lodash/_setToString.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_setToString.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseSetToString = __webpack_require__(/*! ./_baseSetToString */ "./node_modules/lodash/_baseSetToString.js"), + shortOut = __webpack_require__(/*! ./_shortOut */ "./node_modules/lodash/_shortOut.js"); + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +module.exports = setToString; + + +/***/ }), + +/***/ "./node_modules/lodash/_shortOut.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_shortOut.js ***! + \******************************************/ +/***/ (function(module) { + +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeNow = Date.now; + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + +module.exports = shortOut; + + +/***/ }), + +/***/ "./node_modules/lodash/_stackClear.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_stackClear.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"); + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +module.exports = stackClear; + + +/***/ }), + +/***/ "./node_modules/lodash/_stackDelete.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_stackDelete.js ***! + \*********************************************/ +/***/ (function(module) { + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +module.exports = stackDelete; + + +/***/ }), + +/***/ "./node_modules/lodash/_stackGet.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_stackGet.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +module.exports = stackGet; + + +/***/ }), + +/***/ "./node_modules/lodash/_stackHas.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_stackHas.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +module.exports = stackHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_stackSet.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_stackSet.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"), + Map = __webpack_require__(/*! ./_Map */ "./node_modules/lodash/_Map.js"), + MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/lodash/_MapCache.js"); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +module.exports = stackSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_strictIndexOf.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_strictIndexOf.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +module.exports = strictIndexOf; + + +/***/ }), + +/***/ "./node_modules/lodash/_stringToPath.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_stringToPath.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var memoizeCapped = __webpack_require__(/*! ./_memoizeCapped */ "./node_modules/lodash/_memoizeCapped.js"); + +/** Used to match property names within property paths. */ +var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +module.exports = stringToPath; + + +/***/ }), + +/***/ "./node_modules/lodash/_toKey.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/_toKey.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = toKey; + + +/***/ }), + +/***/ "./node_modules/lodash/_toSource.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_toSource.js ***! + \******************************************/ +/***/ (function(module) { + +/** Used for built-in method references. */ +var funcProto = Function.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +module.exports = toSource; + + +/***/ }), + +/***/ "./node_modules/lodash/_trimmedEndIndex.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_trimmedEndIndex.js ***! + \*************************************************/ +/***/ (function(module) { + +/** Used to match a single whitespace character. */ +var reWhitespace = /\s/; + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the last non-whitespace character. + */ +function trimmedEndIndex(string) { + var index = string.length; + + while (index-- && reWhitespace.test(string.charAt(index))) {} + return index; +} + +module.exports = trimmedEndIndex; + + +/***/ }), + +/***/ "./node_modules/lodash/assign.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/assign.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + createAssigner = __webpack_require__(/*! ./_createAssigner */ "./node_modules/lodash/_createAssigner.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ +var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } +}); + +module.exports = assign; + + +/***/ }), + +/***/ "./node_modules/lodash/constant.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/constant.js ***! + \*****************************************/ +/***/ (function(module) { + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +module.exports = constant; + + +/***/ }), + +/***/ "./node_modules/lodash/defaults.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/defaults.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"), + isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/lodash/_isIterateeCall.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; +}); + +module.exports = defaults; + + +/***/ }), + +/***/ "./node_modules/lodash/difference.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/difference.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseDifference = __webpack_require__(/*! ./_baseDifference */ "./node_modules/lodash/_baseDifference.js"), + baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js"), + baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ "./node_modules/lodash/isArrayLikeObject.js"); + +/** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ +var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; +}); + +module.exports = difference; + + +/***/ }), + +/***/ "./node_modules/lodash/drop.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/drop.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"), + toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/lodash/toInteger.js"); + +/** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); +} + +module.exports = drop; + + +/***/ }), + +/***/ "./node_modules/lodash/dropRight.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/dropRight.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"), + toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/lodash/toInteger.js"); + +/** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); +} + +module.exports = dropRight; + + +/***/ }), + +/***/ "./node_modules/lodash/eq.js": +/*!***********************************!*\ + !*** ./node_modules/lodash/eq.js ***! + \***********************************/ +/***/ (function(module) { + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +module.exports = eq; + + +/***/ }), + +/***/ "./node_modules/lodash/filter.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/filter.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ "./node_modules/lodash/_arrayFilter.js"), + baseFilter = __webpack_require__(/*! ./_baseFilter */ "./node_modules/lodash/_baseFilter.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] + */ +function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = filter; + + +/***/ }), + +/***/ "./node_modules/lodash/find.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/find.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var createFind = __webpack_require__(/*! ./_createFind */ "./node_modules/lodash/_createFind.js"), + findIndex = __webpack_require__(/*! ./findIndex */ "./node_modules/lodash/findIndex.js"); + +/** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ +var find = createFind(findIndex); + +module.exports = find; + + +/***/ }), + +/***/ "./node_modules/lodash/findIndex.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/findIndex.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ "./node_modules/lodash/_baseFindIndex.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/lodash/toInteger.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ +function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); +} + +module.exports = findIndex; + + +/***/ }), + +/***/ "./node_modules/lodash/flatten.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/flatten.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js"); + +/** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ +function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; +} + +module.exports = flatten; + + +/***/ }), + +/***/ "./node_modules/lodash/forEach.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/forEach.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayEach = __webpack_require__(/*! ./_arrayEach */ "./node_modules/lodash/_arrayEach.js"), + baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/lodash/_baseEach.js"), + castFunction = __webpack_require__(/*! ./_castFunction */ "./node_modules/lodash/_castFunction.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, castFunction(iteratee)); +} + +module.exports = forEach; + + +/***/ }), + +/***/ "./node_modules/lodash/forOwn.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/forOwn.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "./node_modules/lodash/_baseForOwn.js"), + castFunction = __webpack_require__(/*! ./_castFunction */ "./node_modules/lodash/_castFunction.js"); + +/** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forOwn(object, iteratee) { + return object && baseForOwn(object, castFunction(iteratee)); +} + +module.exports = forOwn; + + +/***/ }), + +/***/ "./node_modules/lodash/get.js": +/*!************************************!*\ + !*** ./node_modules/lodash/get.js ***! + \************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"); + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; + + +/***/ }), + +/***/ "./node_modules/lodash/hasIn.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/hasIn.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseHasIn = __webpack_require__(/*! ./_baseHasIn */ "./node_modules/lodash/_baseHasIn.js"), + hasPath = __webpack_require__(/*! ./_hasPath */ "./node_modules/lodash/_hasPath.js"); + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +module.exports = hasIn; + + +/***/ }), + +/***/ "./node_modules/lodash/identity.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/identity.js ***! + \*****************************************/ +/***/ (function(module) { + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; + + +/***/ }), + +/***/ "./node_modules/lodash/includes.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/includes.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ "./node_modules/lodash/_baseIndexOf.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + isString = __webpack_require__(/*! ./isString */ "./node_modules/lodash/isString.js"), + toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/lodash/toInteger.js"), + values = __webpack_require__(/*! ./values */ "./node_modules/lodash/values.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ +function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); +} + +module.exports = includes; + + +/***/ }), + +/***/ "./node_modules/lodash/initial.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/initial.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"); + +/** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ +function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; +} + +module.exports = initial; + + +/***/ }), + +/***/ "./node_modules/lodash/intersection.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/intersection.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseIntersection = __webpack_require__(/*! ./_baseIntersection */ "./node_modules/lodash/_baseIntersection.js"), + baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + castArrayLikeObject = __webpack_require__(/*! ./_castArrayLikeObject */ "./node_modules/lodash/_castArrayLikeObject.js"); + +/** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ +var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; +}); + +module.exports = intersection; + + +/***/ }), + +/***/ "./node_modules/lodash/isArguments.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/isArguments.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ "./node_modules/lodash/_baseIsArguments.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +module.exports = isArguments; + + +/***/ }), + +/***/ "./node_modules/lodash/isArray.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/isArray.js ***! + \****************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +module.exports = isArray; + + +/***/ }), + +/***/ "./node_modules/lodash/isArrayLike.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/isArrayLike.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/lodash/isFunction.js"), + isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js"); + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +module.exports = isArrayLike; + + +/***/ }), + +/***/ "./node_modules/lodash/isArrayLikeObject.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/isArrayLikeObject.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +module.exports = isArrayLikeObject; + + +/***/ }), + +/***/ "./node_modules/lodash/isBuffer.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isBuffer.js ***! + \*****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"), + stubFalse = __webpack_require__(/*! ./stubFalse */ "./node_modules/lodash/stubFalse.js"); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +module.exports = isBuffer; + + +/***/ }), + +/***/ "./node_modules/lodash/isEmpty.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/isEmpty.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseKeys = __webpack_require__(/*! ./_baseKeys */ "./node_modules/lodash/_baseKeys.js"), + getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), + isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"), + isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/lodash/isTypedArray.js"); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ +function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; +} + +module.exports = isEmpty; + + +/***/ }), + +/***/ "./node_modules/lodash/isFunction.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/isFunction.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); + +/** `Object#toString` result references. */ +var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +module.exports = isFunction; + + +/***/ }), + +/***/ "./node_modules/lodash/isLength.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isLength.js ***! + \*****************************************/ +/***/ (function(module) { + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = isLength; + + +/***/ }), + +/***/ "./node_modules/lodash/isMap.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/isMap.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsMap = __webpack_require__(/*! ./_baseIsMap */ "./node_modules/lodash/_baseIsMap.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/lodash/_nodeUtil.js"); + +/* Node.js helper references. */ +var nodeIsMap = nodeUtil && nodeUtil.isMap; + +/** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ +var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + +module.exports = isMap; + + +/***/ }), + +/***/ "./node_modules/lodash/isNull.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/isNull.js ***! + \***************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ +function isNull(value) { + return value === null; +} + +module.exports = isNull; + + +/***/ }), + +/***/ "./node_modules/lodash/isObject.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isObject.js ***! + \*****************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +module.exports = isObject; + + +/***/ }), + +/***/ "./node_modules/lodash/isObjectLike.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/isObjectLike.js ***! + \*********************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +module.exports = isObjectLike; + + +/***/ }), + +/***/ "./node_modules/lodash/isPlainObject.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/isPlainObject.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/lodash/_getPrototype.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +module.exports = isPlainObject; + + +/***/ }), + +/***/ "./node_modules/lodash/isSet.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/isSet.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsSet = __webpack_require__(/*! ./_baseIsSet */ "./node_modules/lodash/_baseIsSet.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/lodash/_nodeUtil.js"); + +/* Node.js helper references. */ +var nodeIsSet = nodeUtil && nodeUtil.isSet; + +/** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ +var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + +module.exports = isSet; + + +/***/ }), + +/***/ "./node_modules/lodash/isString.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isString.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var stringTag = '[object String]'; + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); +} + +module.exports = isString; + + +/***/ }), + +/***/ "./node_modules/lodash/isSymbol.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isSymbol.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); +} + +module.exports = isSymbol; + + +/***/ }), + +/***/ "./node_modules/lodash/isTypedArray.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/isTypedArray.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsTypedArray = __webpack_require__(/*! ./_baseIsTypedArray */ "./node_modules/lodash/_baseIsTypedArray.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/lodash/_nodeUtil.js"); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +module.exports = isTypedArray; + + +/***/ }), + +/***/ "./node_modules/lodash/isUndefined.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/isUndefined.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ +function isUndefined(value) { + return value === undefined; +} + +module.exports = isUndefined; + + +/***/ }), + +/***/ "./node_modules/lodash/keys.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/keys.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "./node_modules/lodash/_arrayLikeKeys.js"), + baseKeys = __webpack_require__(/*! ./_baseKeys */ "./node_modules/lodash/_baseKeys.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +module.exports = keys; + + +/***/ }), + +/***/ "./node_modules/lodash/keysIn.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/keysIn.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "./node_modules/lodash/_arrayLikeKeys.js"), + baseKeysIn = __webpack_require__(/*! ./_baseKeysIn */ "./node_modules/lodash/_baseKeysIn.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"); + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +module.exports = keysIn; + + +/***/ }), + +/***/ "./node_modules/lodash/last.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/last.js ***! + \*************************************/ +/***/ (function(module) { + +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; +} + +module.exports = last; + + +/***/ }), + +/***/ "./node_modules/lodash/map.js": +/*!************************************!*\ + !*** ./node_modules/lodash/map.js ***! + \************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + baseMap = __webpack_require__(/*! ./_baseMap */ "./node_modules/lodash/_baseMap.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ +function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, baseIteratee(iteratee, 3)); +} + +module.exports = map; + + +/***/ }), + +/***/ "./node_modules/lodash/memoize.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/memoize.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/lodash/_MapCache.js"); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Expose `MapCache`. +memoize.Cache = MapCache; + +module.exports = memoize; + + +/***/ }), + +/***/ "./node_modules/lodash/omit.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/omit.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseClone = __webpack_require__(/*! ./_baseClone */ "./node_modules/lodash/_baseClone.js"), + baseUnset = __webpack_require__(/*! ./_baseUnset */ "./node_modules/lodash/_baseUnset.js"), + castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + customOmitClone = __webpack_require__(/*! ./_customOmitClone */ "./node_modules/lodash/_customOmitClone.js"), + flatRest = __webpack_require__(/*! ./_flatRest */ "./node_modules/lodash/_flatRest.js"), + getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ "./node_modules/lodash/_getAllKeysIn.js"); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + +/** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ +var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; + } + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; +}); + +module.exports = omit; + + +/***/ }), + +/***/ "./node_modules/lodash/orderBy.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/orderBy.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseOrderBy = __webpack_require__(/*! ./_baseOrderBy */ "./node_modules/lodash/_baseOrderBy.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ +function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); +} + +module.exports = orderBy; + + +/***/ }), + +/***/ "./node_modules/lodash/pick.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/pick.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var basePick = __webpack_require__(/*! ./_basePick */ "./node_modules/lodash/_basePick.js"), + flatRest = __webpack_require__(/*! ./_flatRest */ "./node_modules/lodash/_flatRest.js"); + +/** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ +var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); +}); + +module.exports = pick; + + +/***/ }), + +/***/ "./node_modules/lodash/property.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/property.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseProperty = __webpack_require__(/*! ./_baseProperty */ "./node_modules/lodash/_baseProperty.js"), + basePropertyDeep = __webpack_require__(/*! ./_basePropertyDeep */ "./node_modules/lodash/_basePropertyDeep.js"), + isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/lodash/_isKey.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = property; + + +/***/ }), + +/***/ "./node_modules/lodash/some.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/some.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arraySome = __webpack_require__(/*! ./_arraySome */ "./node_modules/lodash/_arraySome.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + baseSome = __webpack_require__(/*! ./_baseSome */ "./node_modules/lodash/_baseSome.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/lodash/_isIterateeCall.js"); + +/** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ +function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = some; + + +/***/ }), + +/***/ "./node_modules/lodash/sortBy.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/sortBy.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js"), + baseOrderBy = __webpack_require__(/*! ./_baseOrderBy */ "./node_modules/lodash/_baseOrderBy.js"), + baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/lodash/_isIterateeCall.js"); + +/** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 30 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] + */ +var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); +}); + +module.exports = sortBy; + + +/***/ }), + +/***/ "./node_modules/lodash/stubArray.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/stubArray.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +module.exports = stubArray; + + +/***/ }), + +/***/ "./node_modules/lodash/stubFalse.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/stubFalse.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = stubFalse; + + +/***/ }), + +/***/ "./node_modules/lodash/take.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/take.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"), + toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/lodash/toInteger.js"); + +/** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ +function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); +} + +module.exports = take; + + +/***/ }), + +/***/ "./node_modules/lodash/toFinite.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/toFinite.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var toNumber = __webpack_require__(/*! ./toNumber */ "./node_modules/lodash/toNumber.js"); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_INTEGER = 1.7976931348623157e+308; + +/** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ +function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; +} + +module.exports = toFinite; + + +/***/ }), + +/***/ "./node_modules/lodash/toInteger.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/toInteger.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var toFinite = __webpack_require__(/*! ./toFinite */ "./node_modules/lodash/toFinite.js"); + +/** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ +function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; +} + +module.exports = toInteger; + + +/***/ }), + +/***/ "./node_modules/lodash/toNumber.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/toNumber.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseTrim = __webpack_require__(/*! ./_baseTrim */ "./node_modules/lodash/_baseTrim.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = baseTrim(value); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +module.exports = toNumber; + + +/***/ }), + +/***/ "./node_modules/lodash/toPairs.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/toPairs.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var createToPairs = __webpack_require__(/*! ./_createToPairs */ "./node_modules/lodash/_createToPairs.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ +var toPairs = createToPairs(keys); + +module.exports = toPairs; + + +/***/ }), + +/***/ "./node_modules/lodash/toPath.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/toPath.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + copyArray = __webpack_require__(/*! ./_copyArray */ "./node_modules/lodash/_copyArray.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"), + stringToPath = __webpack_require__(/*! ./_stringToPath */ "./node_modules/lodash/_stringToPath.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"), + toString = __webpack_require__(/*! ./toString */ "./node_modules/lodash/toString.js"); + +/** + * Converts `value` to a property path array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {*} value The value to convert. + * @returns {Array} Returns the new property path array. + * @example + * + * _.toPath('a.b.c'); + * // => ['a', 'b', 'c'] + * + * _.toPath('a[0].b.c'); + * // => ['a', '0', 'b', 'c'] + */ +function toPath(value) { + if (isArray(value)) { + return arrayMap(value, toKey); + } + return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); +} + +module.exports = toPath; + + +/***/ }), + +/***/ "./node_modules/lodash/toString.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/toString.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseToString = __webpack_require__(/*! ./_baseToString */ "./node_modules/lodash/_baseToString.js"); + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +module.exports = toString; + + +/***/ }), + +/***/ "./node_modules/lodash/uniqueId.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/uniqueId.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var toString = __webpack_require__(/*! ./toString */ "./node_modules/lodash/toString.js"); + +/** Used to generate unique IDs. */ +var idCounter = 0; + +/** + * Generates a unique ID. If `prefix` is given, the ID is appended to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {string} [prefix=''] The value to prefix the ID with. + * @returns {string} Returns the unique ID. + * @example + * + * _.uniqueId('contact_'); + * // => 'contact_104' + * + * _.uniqueId(); + * // => '105' + */ +function uniqueId(prefix) { + var id = ++idCounter; + return toString(prefix) + id; +} + +module.exports = uniqueId; + + +/***/ }), + +/***/ "./node_modules/lodash/values.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/values.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseValues = __webpack_require__(/*! ./_baseValues */ "./node_modules/lodash/_baseValues.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ +function values(object) { + return object == null ? [] : baseValues(object, keys(object)); +} + +module.exports = values; + + +/***/ }), + +/***/ "./node_modules/lodash/without.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/without.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseDifference = __webpack_require__(/*! ./_baseDifference */ "./node_modules/lodash/_baseDifference.js"), + baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ "./node_modules/lodash/isArrayLikeObject.js"); + +/** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ +var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; +}); + +module.exports = without; + + +/***/ }), + +/***/ "./node_modules/lodash/zipObject.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/zipObject.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + baseZipObject = __webpack_require__(/*! ./_baseZipObject */ "./node_modules/lodash/_baseZipObject.js"); + +/** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ +function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); +} + +module.exports = zipObject; + + +/***/ }), + +/***/ "./node_modules/object-assign/index.js": +/*!*********************************************!*\ + !*** ./node_modules/object-assign/index.js ***! + \*********************************************/ +/***/ (function(module) { + +"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + + +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; + + +/***/ }), + +/***/ "./node_modules/react-selectable/dist/react-selectable.js": +/*!****************************************************************!*\ + !*** ./node_modules/react-selectable/dist/react-selectable.js ***! + \****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +!function(e,t){if(true)module.exports=t(__webpack_require__(/*! react */ "react"),__webpack_require__(/*! react-dom */ "react-dom"));else { var r, n; }}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=12)}([function(e,t,n){"use strict";function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(s===setTimeout)return setTimeout(e,0);if((s===r||!s)&&setTimeout)return s=setTimeout,setTimeout(e,0);try{return s(e,0)}catch(t){try{return s.call(null,e,0)}catch(t){return s.call(this,e,0)}}}function u(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){b&&y&&(b=!1,y.length?h=y.concat(h):v=-1,h.length&&c())}function c(){if(!b){var e=i(a);b=!0;for(var t=h.length;t;){for(y=h,h=[];++v1)for(var n=1;n1?t-1:0),r=1;r2?n-2:0),o=2;o1&&void 0!==arguments[1]&&arguments[1],n=this.props,r=n.tolerance,o=n.onSelection,i=n.onEndSelection,u=[],a=(0,l.findDOMNode)(this.refs.selectbox);a&&(this._registry.forEach(function(e){e.domNode&&(0,x.default)(a,e.domNode,r)&&!u.includes(e.key)&&u.push(e.key)}),t?"function"==typeof i&&i(u,e):"function"==typeof o&&o(u,e))}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.enabled,r=e.fixedPosition,o=e.className,i=e.selectingClassName,u=this.state,a=u.isBoxSelecting,c=u.boxLeft,l=u.boxTop,s=u.boxWidth,p=u.boxHeight,d=this.props.component;if(!n)return f.default.createElement(d,{className:o},t);var h={left:c,top:l,width:s,height:p,zIndex:9e3,position:r?"fixed":"absolute",cursor:"default"},b={backgroundColor:"transparent",border:"1px dashed #999",width:"100%",height:"100%",float:"left"},v={position:"relative",overflow:"visible"};return f.default.createElement(d,{className:(0,y.default)(o,a?i:null),style:v},a?f.default.createElement("div",{style:h,ref:"selectbox"},f.default.createElement("span",{style:b})):null,t)}}]),t}(c.Component);j.propTypes={children:p.default.node,onBeginSelection:p.default.func,onEndSelection:p.default.func,onSelection:p.default.func,component:p.default.node,tolerance:p.default.number,fixedPosition:p.default.bool,preventDefault:p.default.bool,onNonItemClick:p.default.func,enabled:p.default.bool,className:p.default.string,selectingClassName:p.default.string},j.defaultProps={component:"div",tolerance:0,fixedPosition:!1,preventDefault:!0,enabled:!0},j.childContextTypes={selectable:p.default.object},t.default=j},function(e,t,n){"use strict";(function(t){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=n(1),i=n(2),u=n(8),a=n(15),c=n(3),f=n(16);e.exports=function(e,n){function l(e){var t=e&&(N&&e[N]||e[P]);if("function"==typeof t)return t}function s(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function p(e){this.message=e,this.stack=""}function d(e){function r(r,f,l,s,d,y,h){if(s=s||k,y=y||l,h!==c)if(n)i(!1,"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");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var b=s+":"+l;!o[b]&&a<3&&(u(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",y,s),o[b]=!0,a++)}return null==f[l]?r?new p(null===f[l]?"The "+d+" `"+y+"` is marked as required in `"+s+"`, but its value is `null`.":"The "+d+" `"+y+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(f,l,s,d,y)}if("production"!==t.env.NODE_ENV)var o={},a=0;var f=r.bind(null,!1);return f.isRequired=r.bind(null,!0),f}function y(e){function t(t,n,r,o,i,u){var a=t[n];if(S(a)!==e)return new p("Invalid "+o+" `"+i+"` of type `"+j(a)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return d(t)}function h(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var u=t[n];if(!Array.isArray(u)){return new p("Invalid "+o+" `"+i+"` of type `"+S(u)+"` supplied to `"+r+"`, expected an array.")}for(var a=0;an+a||t+o-cr+u)};t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=e instanceof HTMLElement?(0,o.default)(e):e,u=t instanceof HTMLElement?(0,o.default)(t):t;return i(r.top,r.left,u.top,u.left,r.offsetWidth,r.offsetHeight,u.offsetWidth,u.offsetHeight,n)}},function(e,t,n){"use strict";(function(t){function n(e,t,n){function r(t){var n=h,r=b;return h=b=void 0,w=t,m=e.apply(r,n)}function i(e){return w=e,g=setTimeout(l,t),j?r(e):m}function u(e){var n=e-_,r=e-w,o=t-n;return E?O(o,v-r):o}function c(e){var n=e-_,r=e-w;return void 0===_||n>=t||n<0||E&&r>=v}function l(){var e=S();if(c(e))return s(e);g=setTimeout(l,u(e))}function s(e){return g=void 0,T&&h?r(e):(h=b=void 0,m)}function p(){void 0!==g&&clearTimeout(g),w=0,h=_=b=g=void 0}function d(){return void 0===g?m:s(S())}function y(){var e=S(),n=c(e);if(h=arguments,b=this,_=e,n){if(void 0===g)return i(_);if(E)return g=setTimeout(l,t),r(_)}return void 0===g&&(g=setTimeout(l,t)),m}var h,b,v,m,g,_,w=0,j=!1,E=!1,T=!0;if("function"!=typeof e)throw new TypeError(f);return t=a(t)||0,o(n)&&(j=!!n.leading,E="maxWait"in n,v=E?x(a(n.maxWait)||0,t):v,T="trailing"in n?!!n.trailing:T),y.cancel=p,y.flush=d,y}function r(e,t,r){var i=!0,u=!0;if("function"!=typeof e)throw new TypeError(f);return o(r)&&(i="leading"in r?!!r.leading:i,u="trailing"in r?!!r.trailing:u),n(e,t,{leading:i,maxWait:t,trailing:u})}function o(e){var t=void 0===e?"undefined":c(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==(void 0===e?"undefined":c(e))}function u(e){return"symbol"==(void 0===e?"undefined":c(e))||i(e)&&w.call(e)==s}function a(e){if("number"==typeof e)return e;if(u(e))return l;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(p,"");var n=y.test(e);return n||h.test(e)?b(e.slice(2),n?2:8):d.test(e)?l:+e}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f="Expected a function",l=NaN,s="[object Symbol]",p=/^\s+|\s+$/g,d=/^[-+]0x[0-9a-f]+$/i,y=/^0b[01]+$/i,h=/^0o[0-7]+$/i,b=parseInt,v="object"==(void 0===t?"undefined":c(t))&&t&&t.Object===Object&&t,m="object"==("undefined"==typeof self?"undefined":c(self))&&self&&self.Object===Object&&self,g=v||m||Function("return this")(),_=Object.prototype,w=_.toString,x=Math.max,O=Math.min,S=function(){return g.Date.now()};e.exports=r}).call(t,n(21))},function(e,t,n){"use strict";var r,o="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};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":o(window))&&(r=window)}e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function u(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)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n"; + + +let $4ca367182776f80b$var$defaultOptions = { + /** + * Has to be specified on elements other than form (or when the form doesn't + * have an `action` attribute). + * + * You can also provide a function that will be called with `files` and + * `dataBlocks` and must return the url as string. + */ url: null, + /** + * Can be changed to `"put"` if necessary. You can also provide a function + * that will be called with `files` and must return the method (since `v3.12.0`). + */ method: "post", + /** + * Will be set on the XHRequest. + */ withCredentials: false, + /** + * The timeout for the XHR requests in milliseconds (since `v4.4.0`). + * If set to null or 0, no timeout is going to be set. + */ timeout: null, + /** + * How many file uploads to process in parallel (See the + * Enqueuing file uploads documentation section for more info) + */ parallelUploads: 2, + /** + * Whether to send multiple files in one request. If + * this it set to true, then the fallback file input element will + * have the `multiple` attribute as well. This option will + * also trigger additional events (like `processingmultiple`). See the events + * documentation section for more information. + */ uploadMultiple: false, + /** + * Whether you want files to be uploaded in chunks to your server. This can't be + * used in combination with `uploadMultiple`. + * + * See [chunksUploaded](#config-chunksUploaded) for the callback to finalise an upload. + */ chunking: false, + /** + * If `chunking` is enabled, this defines whether **every** file should be chunked, + * even if the file size is below chunkSize. This means, that the additional chunk + * form data will be submitted and the `chunksUploaded` callback will be invoked. + */ forceChunking: false, + /** + * If `chunking` is `true`, then this defines the chunk size in bytes. + */ chunkSize: 2097152, + /** + * If `true`, the individual chunks of a file are being uploaded simultaneously. + * The limit of concurrent connections is governed by `parallelUploads`. + */ parallelChunkUploads: false, + /** + * Whether a chunk should be retried if it fails. + */ retryChunks: false, + /** + * If `retryChunks` is true, how many times should it be retried. + */ retryChunksLimit: 3, + /** + * The maximum filesize (in MiB) that is allowed to be uploaded. + */ maxFilesize: 256, + /** + * The name of the file param that gets transferred. + * **NOTE**: If you have the option `uploadMultiple` set to `true`, then + * Dropzone will append `[]` to the name. + */ paramName: "file", + /** + * Whether thumbnails for images should be generated + */ createImageThumbnails: true, + /** + * In MB. When the filename exceeds this limit, the thumbnail will not be generated. + */ maxThumbnailFilesize: 10, + /** + * If `null`, the ratio of the image will be used to calculate it. + */ thumbnailWidth: 120, + /** + * The same as `thumbnailWidth`. If both are null, images will not be resized. + */ thumbnailHeight: 120, + /** + * How the images should be scaled down in case both, `thumbnailWidth` and `thumbnailHeight` are provided. + * Can be either `contain` or `crop`. + */ thumbnailMethod: "crop", + /** + * If set, images will be resized to these dimensions before being **uploaded**. + * If only one, `resizeWidth` **or** `resizeHeight` is provided, the original aspect + * ratio of the file will be preserved. + * + * The `options.transformFile` function uses these options, so if the `transformFile` function + * is overridden, these options don't do anything. + */ resizeWidth: null, + /** + * See `resizeWidth`. + */ resizeHeight: null, + /** + * The mime type of the resized image (before it gets uploaded to the server). + * If `null` the original mime type will be used. To force jpeg, for example, use `image/jpeg`. + * See `resizeWidth` for more information. + */ resizeMimeType: null, + /** + * The quality of the resized images. See `resizeWidth`. + */ resizeQuality: 0.8, + /** + * How the images should be scaled down in case both, `resizeWidth` and `resizeHeight` are provided. + * Can be either `contain` or `crop`. + */ resizeMethod: "contain", + /** + * The base that is used to calculate the **displayed** filesize. You can + * change this to 1024 if you would rather display kibibytes, mebibytes, + * etc... 1024 is technically incorrect, because `1024 bytes` are `1 kibibyte` + * not `1 kilobyte`. You can change this to `1024` if you don't care about + * validity. + */ filesizeBase: 1000, + /** + * If not `null` defines how many files this Dropzone handles. If it exceeds, + * the event `maxfilesexceeded` will be called. The dropzone element gets the + * class `dz-max-files-reached` accordingly so you can provide visual + * feedback. + */ maxFiles: null, + /** + * An optional object to send additional headers to the server. Eg: + * `{ "My-Awesome-Header": "header value" }` + */ headers: null, + /** + * Should the default headers be set or not? + * Accept: application/json <- for requesting json response + * Cache-Control: no-cache <- Request shouldn't be cached + * X-Requested-With: XMLHttpRequest <- We sent the request via XMLHttpRequest + */ defaultHeaders: true, + /** + * If `true`, the dropzone element itself will be clickable, if `false` + * nothing will be clickable. + * + * You can also pass an HTML element, a CSS selector (for multiple elements) + * or an array of those. In that case, all of those elements will trigger an + * upload when clicked. + */ clickable: true, + /** + * Whether hidden files in directories should be ignored. + */ ignoreHiddenFiles: true, + /** + * The default implementation of `accept` checks the file's mime type or + * extension against this list. This is a comma separated list of mime + * types or file extensions. + * + * Eg.: `image/*,application/pdf,.psd` + * + * If the Dropzone is `clickable` this option will also be used as + * [`accept`](https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept) + * parameter on the hidden file input as well. + */ acceptedFiles: null, + /** + * If false, files will be added to the queue but the queue will not be + * processed automatically. + * This can be useful if you need some additional user input before sending + * files (or if you want want all files sent at once). + * If you're ready to send the file simply call `myDropzone.processQueue()`. + * + * See the [enqueuing file uploads](#enqueuing-file-uploads) documentation + * section for more information. + */ autoProcessQueue: true, + /** + * If false, files added to the dropzone will not be queued by default. + * You'll have to call `enqueueFile(file)` manually. + */ autoQueue: true, + /** + * If `true`, this will add a link to every file preview to remove or cancel (if + * already uploading) the file. The `dictCancelUpload`, `dictCancelUploadConfirmation` + * and `dictRemoveFile` options are used for the wording. + */ addRemoveLinks: false, + /** + * Defines where to display the file previews – if `null` the + * Dropzone element itself is used. Can be a plain `HTMLElement` or a CSS + * selector. The element should have the `dropzone-previews` class so + * the previews are displayed properly. + */ previewsContainer: null, + /** + * Set this to `true` if you don't want previews to be shown. + */ disablePreviews: false, + /** + * This is the element the hidden input field (which is used when clicking on the + * dropzone to trigger file selection) will be appended to. This might + * be important in case you use frameworks to switch the content of your page. + * + * Can be a selector string, or an element directly. + */ hiddenInputContainer: "body", + /** + * If null, no capture type will be specified + * If camera, mobile devices will skip the file selection and choose camera + * If microphone, mobile devices will skip the file selection and choose the microphone + * If camcorder, mobile devices will skip the file selection and choose the camera in video mode + * On apple devices multiple must be set to false. AcceptedFiles may need to + * be set to an appropriate mime type (e.g. "image/*", "audio/*", or "video/*"). + */ capture: null, + /** + * **Deprecated**. Use `renameFile` instead. + */ renameFilename: null, + /** + * A function that is invoked before the file is uploaded to the server and renames the file. + * This function gets the `File` as argument and can use the `file.name`. The actual name of the + * file that gets used during the upload can be accessed through `file.upload.filename`. + */ renameFile: null, + /** + * If `true` the fallback will be forced. This is very useful to test your server + * implementations first and make sure that everything works as + * expected without dropzone if you experience problems, and to test + * how your fallbacks will look. + */ forceFallback: false, + /** + * The text used before any files are dropped. + */ dictDefaultMessage: "Drop files here to upload", + /** + * The text that replaces the default message text it the browser is not supported. + */ dictFallbackMessage: "Your browser does not support drag'n'drop file uploads.", + /** + * The text that will be added before the fallback form. + * If you provide a fallback element yourself, or if this option is `null` this will + * be ignored. + */ dictFallbackText: "Please use the fallback form below to upload your files like in the olden days.", + /** + * If the filesize is too big. + * `{{filesize}}` and `{{maxFilesize}}` will be replaced with the respective configuration values. + */ dictFileTooBig: "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.", + /** + * If the file doesn't match the file type. + */ dictInvalidFileType: "You can't upload files of this type.", + /** + * If the server response was invalid. + * `{{statusCode}}` will be replaced with the servers status code. + */ dictResponseError: "Server responded with {{statusCode}} code.", + /** + * If `addRemoveLinks` is true, the text to be used for the cancel upload link. + */ dictCancelUpload: "Cancel upload", + /** + * The text that is displayed if an upload was manually canceled + */ dictUploadCanceled: "Upload canceled.", + /** + * If `addRemoveLinks` is true, the text to be used for confirmation when cancelling upload. + */ dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?", + /** + * If `addRemoveLinks` is true, the text to be used to remove a file. + */ dictRemoveFile: "Remove file", + /** + * If this is not null, then the user will be prompted before removing a file. + */ dictRemoveFileConfirmation: null, + /** + * Displayed if `maxFiles` is st and exceeded. + * The string `{{maxFiles}}` will be replaced by the configuration value. + */ dictMaxFilesExceeded: "You cannot upload any more files.", + /** + * Allows you to translate the different units. Starting with `tb` for terabytes and going down to + * `b` for bytes. + */ dictFileSizeUnits: { + tb: "TB", + gb: "GB", + mb: "MB", + kb: "KB", + b: "b" + }, + /** + * Called when dropzone initialized + * You can add event listeners here + */ init () {}, + /** + * Can be an **object** of additional parameters to transfer to the server, **or** a `Function` + * that gets invoked with the `files`, `xhr` and, if it's a chunked upload, `chunk` arguments. In case + * of a function, this needs to return a map. + * + * The default implementation does nothing for normal uploads, but adds relevant information for + * chunked uploads. + * + * This is the same as adding hidden input fields in the form element. + */ params (files, xhr, chunk) { + if (chunk) return { + dzuuid: chunk.file.upload.uuid, + dzchunkindex: chunk.index, + dztotalfilesize: chunk.file.size, + dzchunksize: this.options.chunkSize, + dztotalchunkcount: chunk.file.upload.totalChunkCount, + dzchunkbyteoffset: chunk.index * this.options.chunkSize + }; + }, + /** + * A function that gets a [file](https://developer.mozilla.org/en-US/docs/DOM/File) + * and a `done` function as parameters. + * + * If the done function is invoked without arguments, the file is "accepted" and will + * be processed. If you pass an error message, the file is rejected, and the error + * message will be displayed. + * This function will not be called if the file is too big or doesn't match the mime types. + */ accept (file, done) { + return done(); + }, + /** + * The callback that will be invoked when all chunks have been uploaded for a file. + * It gets the file for which the chunks have been uploaded as the first parameter, + * and the `done` function as second. `done()` needs to be invoked when everything + * needed to finish the upload process is done. + */ chunksUploaded: function(file, done) { + done(); + }, + /** + * Sends the file as binary blob in body instead of form data. + * If this is set, the `params` option will be ignored. + * It's an error to set this to `true` along with `uploadMultiple` since + * multiple files cannot be in a single binary body. + */ binaryBody: false, + /** + * Gets called when the browser is not supported. + * The default implementation shows the fallback input field and adds + * a text. + */ fallback () { + // This code should pass in IE7... :( + let messageElement; + this.element.className = `${this.element.className} dz-browser-not-supported`; + for (let child of this.element.getElementsByTagName("div"))if (/(^| )dz-message($| )/.test(child.className)) { + messageElement = child; + child.className = "dz-message"; // Removes the 'dz-default' class + break; + } + if (!messageElement) { + messageElement = (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).createElement('
'); + this.element.appendChild(messageElement); + } + let span = messageElement.getElementsByTagName("span")[0]; + if (span) { + if (span.textContent != null) span.textContent = this.options.dictFallbackMessage; + else if (span.innerText != null) span.innerText = this.options.dictFallbackMessage; + } + return this.element.appendChild(this.getFallbackForm()); + }, + /** + * Gets called to calculate the thumbnail dimensions. + * + * It gets `file`, `width` and `height` (both may be `null`) as parameters and must return an object containing: + * + * - `srcWidth` & `srcHeight` (required) + * - `trgWidth` & `trgHeight` (required) + * - `srcX` & `srcY` (optional, default `0`) + * - `trgX` & `trgY` (optional, default `0`) + * + * Those values are going to be used by `ctx.drawImage()`. + */ resize (file, width, height, resizeMethod) { + let info = { + srcX: 0, + srcY: 0, + srcWidth: file.width, + srcHeight: file.height + }; + let srcRatio = file.width / file.height; + // Automatically calculate dimensions if not specified + if (width == null && height == null) { + width = info.srcWidth; + height = info.srcHeight; + } else if (width == null) width = height * srcRatio; + else if (height == null) height = width / srcRatio; + // Make sure images aren't upscaled + width = Math.min(width, info.srcWidth); + height = Math.min(height, info.srcHeight); + let trgRatio = width / height; + if (info.srcWidth > width || info.srcHeight > height) { + // Image is bigger and needs rescaling + if (resizeMethod === "crop") { + if (srcRatio > trgRatio) { + info.srcHeight = file.height; + info.srcWidth = info.srcHeight * trgRatio; + } else { + info.srcWidth = file.width; + info.srcHeight = info.srcWidth / trgRatio; + } + } else if (resizeMethod === "contain") { + // Method 'contain' + if (srcRatio > trgRatio) height = width / srcRatio; + else width = height * srcRatio; + } else throw new Error(`Unknown resizeMethod '${resizeMethod}'`); + } + info.srcX = (file.width - info.srcWidth) / 2; + info.srcY = (file.height - info.srcHeight) / 2; + info.trgWidth = width; + info.trgHeight = height; + return info; + }, + /** + * Can be used to transform the file (for example, resize an image if necessary). + * + * The default implementation uses `resizeWidth` and `resizeHeight` (if provided) and resizes + * images according to those dimensions. + * + * Gets the `file` as the first parameter, and a `done()` function as the second, that needs + * to be invoked with the file when the transformation is done. + */ transformFile (file, done) { + if ((this.options.resizeWidth || this.options.resizeHeight) && file.type.match(/image.*/)) return this.resizeImage(file, this.options.resizeWidth, this.options.resizeHeight, this.options.resizeMethod, done); + else return done(file); + }, + /** + * A string that contains the template used for each dropped + * file. Change it to fulfill your needs but make sure to properly + * provide all elements. + * + * If you want to use an actual HTML element instead of providing a String + * as a config option, you could create a div with the id `tpl`, + * put the template inside it and provide the element like this: + * + * document + * .querySelector('#tpl') + * .innerHTML + * + */ previewTemplate: (0, (/*@__PURE__*/$parcel$interopDefault($6ad14d34cb5b5425$exports))), + /* + Those functions register themselves to the events on init and handle all + the user interface specific stuff. Overwriting them won't break the upload + but can break the way it's displayed. + You can overwrite them if you don't like the default behavior. If you just + want to add an additional event handler, register it on the dropzone object + and don't overwrite those options. + */ // Those are self explanatory and simply concern the DragnDrop. + drop (e) { + return this.element.classList.remove("dz-drag-hover"); + }, + dragstart (e) {}, + dragend (e) { + return this.element.classList.remove("dz-drag-hover"); + }, + dragenter (e) { + return this.element.classList.add("dz-drag-hover"); + }, + dragover (e) { + return this.element.classList.add("dz-drag-hover"); + }, + dragleave (e) { + return this.element.classList.remove("dz-drag-hover"); + }, + paste (e) {}, + // Called whenever there are no files left in the dropzone anymore, and the + // dropzone should be displayed as if in the initial state. + reset () { + return this.element.classList.remove("dz-started"); + }, + // Called when a file is added to the queue + // Receives `file` + addedfile (file) { + if (this.element === this.previewsContainer) this.element.classList.add("dz-started"); + if (this.previewsContainer && !this.options.disablePreviews) { + file.previewElement = (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).createElement(this.options.previewTemplate.trim()); + file.previewTemplate = file.previewElement; // Backwards compatibility + this.previewsContainer.appendChild(file.previewElement); + for (var node of file.previewElement.querySelectorAll("[data-dz-name]"))node.textContent = file.name; + for (node of file.previewElement.querySelectorAll("[data-dz-size]"))node.innerHTML = this.filesize(file.size); + if (this.options.addRemoveLinks) { + file._removeLink = (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).createElement(`
${this.options.dictRemoveFile}`); + file.previewElement.appendChild(file._removeLink); + } + let removeFileEvent = (e)=>{ + e.preventDefault(); + e.stopPropagation(); + if (file.status === (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).UPLOADING) return (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).confirm(this.options.dictCancelUploadConfirmation, ()=>this.removeFile(file)); + else { + if (this.options.dictRemoveFileConfirmation) return (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).confirm(this.options.dictRemoveFileConfirmation, ()=>this.removeFile(file)); + else return this.removeFile(file); + } + }; + for (let removeLink of file.previewElement.querySelectorAll("[data-dz-remove]"))removeLink.addEventListener("click", removeFileEvent); + } + }, + // Called whenever a file is removed. + removedfile (file) { + if (file.previewElement != null && file.previewElement.parentNode != null) file.previewElement.parentNode.removeChild(file.previewElement); + return this._updateMaxFilesReachedClass(); + }, + // Called when a thumbnail has been generated + // Receives `file` and `dataUrl` + thumbnail (file, dataUrl) { + if (file.previewElement) { + file.previewElement.classList.remove("dz-file-preview"); + for (let thumbnailElement of file.previewElement.querySelectorAll("[data-dz-thumbnail]")){ + thumbnailElement.alt = file.name; + thumbnailElement.src = dataUrl; + } + return setTimeout(()=>file.previewElement.classList.add("dz-image-preview"), 1); + } + }, + // Called whenever an error occurs + // Receives `file` and `message` + error (file, message) { + if (file.previewElement) { + file.previewElement.classList.add("dz-error"); + if (typeof message !== "string" && message.error) message = message.error; + for (let node of file.previewElement.querySelectorAll("[data-dz-errormessage]"))node.textContent = message; + } + }, + errormultiple () {}, + // Called when a file gets processed. Since there is a queue, not all added + // files are processed immediately. + // Receives `file` + processing (file) { + if (file.previewElement) { + file.previewElement.classList.add("dz-processing"); + if (file._removeLink) return file._removeLink.innerHTML = this.options.dictCancelUpload; + } + }, + processingmultiple () {}, + // Called whenever the upload progress gets updated. + // Receives `file`, `progress` (percentage 0-100) and `bytesSent`. + // To get the total number of bytes of the file, use `file.size` + uploadprogress (file, progress, bytesSent) { + if (file.previewElement) for (let node of file.previewElement.querySelectorAll("[data-dz-uploadprogress]"))node.nodeName === "PROGRESS" ? node.value = progress : node.style.width = `${progress}%`; + }, + // Called whenever the total upload progress gets updated. + // Called with totalUploadProgress (0-100), totalBytes and totalBytesSent + totaluploadprogress () {}, + // Called just before the file is sent. Gets the `xhr` object as second + // parameter, so you can modify it (for example to add a CSRF token) and a + // `formData` object to add additional information. + sending () {}, + sendingmultiple () {}, + // When the complete upload is finished and successful + // Receives `file` + success (file) { + if (file.previewElement) return file.previewElement.classList.add("dz-success"); + }, + successmultiple () {}, + // When the upload is canceled. + canceled (file) { + return this.emit("error", file, this.options.dictUploadCanceled); + }, + canceledmultiple () {}, + // When the upload is finished, either with success or an error. + // Receives `file` + complete (file) { + if (file._removeLink) file._removeLink.innerHTML = this.options.dictRemoveFile; + if (file.previewElement) return file.previewElement.classList.add("dz-complete"); + }, + completemultiple () {}, + maxfilesexceeded () {}, + maxfilesreached () {}, + queuecomplete () {}, + addedfiles () {} +}; +var $4ca367182776f80b$export$2e2bcd8739ae039 = $4ca367182776f80b$var$defaultOptions; + + +class $3ed269f2f0fb224b$export$2e2bcd8739ae039 extends (0, $4040acfd8584338d$export$2e2bcd8739ae039) { + static initClass() { + // Exposing the emitter class, mainly for tests + this.prototype.Emitter = (0, $4040acfd8584338d$export$2e2bcd8739ae039); + /* + This is a list of all available events you can register on a dropzone object. + + You can register an event handler like this: + + dropzone.on("dragEnter", function() { }); + + */ this.prototype.events = [ + "drop", + "dragstart", + "dragend", + "dragenter", + "dragover", + "dragleave", + "addedfile", + "addedfiles", + "removedfile", + "thumbnail", + "error", + "errormultiple", + "processing", + "processingmultiple", + "uploadprogress", + "totaluploadprogress", + "sending", + "sendingmultiple", + "success", + "successmultiple", + "canceled", + "canceledmultiple", + "complete", + "completemultiple", + "reset", + "maxfilesexceeded", + "maxfilesreached", + "queuecomplete" + ]; + this.prototype._thumbnailQueue = []; + this.prototype._processingThumbnail = false; + } + constructor(el, options){ + super(); + let fallback, left; + this.element = el; + this.clickableElements = []; + this.listeners = []; + this.files = []; // All files + if (typeof this.element === "string") this.element = document.querySelector(this.element); + // make sure we actually have an HTML Element + if (this.element === null || !this.element instanceof HTMLElement) throw new Error("Invalid dropzone element: not an instance of HTMLElement."); + if (this.element.dropzone) throw new Error("Dropzone already attached."); + // Now add this dropzone to the instances. + $3ed269f2f0fb224b$export$2e2bcd8739ae039.instances.push(this); + // Put the dropzone inside the element itself. + this.element.dropzone = this; + let elementOptions = (left = $3ed269f2f0fb224b$export$2e2bcd8739ae039.optionsForElement(this.element)) != null ? left : {}; + this.options = Object.assign({}, (0, $4ca367182776f80b$export$2e2bcd8739ae039), elementOptions, options != null ? options : {}); + this.options.previewTemplate = this.options.previewTemplate.replace(/\n*/g, ""); + // If the browser failed, just call the fallback and leave + if (this.options.forceFallback || !$3ed269f2f0fb224b$export$2e2bcd8739ae039.isBrowserSupported()) return this.options.fallback.call(this); + // @options.url = @element.getAttribute "action" unless @options.url? + if (this.options.url == null) this.options.url = this.element.getAttribute("action"); + if (!this.options.url) throw new Error("No URL provided."); + if (this.options.uploadMultiple && this.options.chunking) throw new Error("You cannot set both: uploadMultiple and chunking."); + if (this.options.binaryBody && this.options.uploadMultiple) throw new Error("You cannot set both: binaryBody and uploadMultiple."); + if (typeof this.options.method === "string") this.options.method = this.options.method.toUpperCase(); + if ((fallback = this.getExistingFallback()) && fallback.parentNode) // Remove the fallback + fallback.parentNode.removeChild(fallback); + // Display previews in the previewsContainer element or the Dropzone element unless explicitly set to false + if (this.options.previewsContainer !== false) { + if (this.options.previewsContainer) this.previewsContainer = $3ed269f2f0fb224b$export$2e2bcd8739ae039.getElement(this.options.previewsContainer, "previewsContainer"); + else this.previewsContainer = this.element; + } + if (this.options.clickable) { + if (this.options.clickable === true) this.clickableElements = [ + this.element + ]; + else this.clickableElements = $3ed269f2f0fb224b$export$2e2bcd8739ae039.getElements(this.options.clickable, "clickable"); + } + this.init(); + } + // Returns all files that have been accepted + getAcceptedFiles() { + return this.files.filter((file)=>file.accepted).map((file)=>file); + } + // Returns all files that have been rejected + // Not sure when that's going to be useful, but added for completeness. + getRejectedFiles() { + return this.files.filter((file)=>!file.accepted).map((file)=>file); + } + getFilesWithStatus(status) { + return this.files.filter((file)=>file.status === status).map((file)=>file); + } + // Returns all files that are in the queue + getQueuedFiles() { + return this.getFilesWithStatus($3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED); + } + getUploadingFiles() { + return this.getFilesWithStatus($3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING); + } + getAddedFiles() { + return this.getFilesWithStatus($3ed269f2f0fb224b$export$2e2bcd8739ae039.ADDED); + } + // Files that are either queued or uploading + getActiveFiles() { + return this.files.filter((file)=>file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING || file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED).map((file)=>file); + } + // The function that gets called when Dropzone is initialized. You + // can (and should) setup event listeners inside this function. + init() { + // In case it isn't set already + if (this.element.tagName === "form") this.element.setAttribute("enctype", "multipart/form-data"); + if (this.element.classList.contains("dropzone") && !this.element.querySelector(".dz-message")) this.element.appendChild($3ed269f2f0fb224b$export$2e2bcd8739ae039.createElement(`
`)); + if (this.clickableElements.length) { + let setupHiddenFileInput = ()=>{ + if (this.hiddenFileInput) this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput); + this.hiddenFileInput = document.createElement("input"); + this.hiddenFileInput.setAttribute("type", "file"); + this.hiddenFileInput.setAttribute("form", this.element.id); + if (this.options.maxFiles === null || this.options.maxFiles > 1) this.hiddenFileInput.setAttribute("multiple", "multiple"); + this.hiddenFileInput.className = "dz-hidden-input"; + if (this.options.acceptedFiles !== null) this.hiddenFileInput.setAttribute("accept", this.options.acceptedFiles); + if (this.options.capture !== null) this.hiddenFileInput.setAttribute("capture", this.options.capture); + // Making sure that no one can "tab" into this field. + this.hiddenFileInput.setAttribute("tabindex", "-1"); + // Add arialabel for a11y + this.hiddenFileInput.setAttribute("aria-label", "dropzone hidden input"); + // Not setting `display="none"` because some browsers don't accept clicks + // on elements that aren't displayed. + this.hiddenFileInput.style.visibility = "hidden"; + this.hiddenFileInput.style.position = "absolute"; + this.hiddenFileInput.style.top = "0"; + this.hiddenFileInput.style.left = "0"; + this.hiddenFileInput.style.height = "0"; + this.hiddenFileInput.style.width = "0"; + $3ed269f2f0fb224b$export$2e2bcd8739ae039.getElement(this.options.hiddenInputContainer, "hiddenInputContainer").appendChild(this.hiddenFileInput); + this.hiddenFileInput.addEventListener("change", ()=>{ + let { files: files } = this.hiddenFileInput; + if (files.length) for (let file of files)this.addFile(file); + this.emit("addedfiles", files); + setupHiddenFileInput(); + }); + }; + setupHiddenFileInput(); + } + this.URL = window.URL !== null ? window.URL : window.webkitURL; + // Setup all event listeners on the Dropzone object itself. + // They're not in @setupEventListeners() because they shouldn't be removed + // again when the dropzone gets disabled. + for (let eventName of this.events)this.on(eventName, this.options[eventName]); + this.on("uploadprogress", ()=>this.updateTotalUploadProgress()); + this.on("removedfile", ()=>this.updateTotalUploadProgress()); + this.on("canceled", (file)=>this.emit("complete", file)); + // Emit a `queuecomplete` event if all files finished uploading. + this.on("complete", (file)=>{ + if (this.getAddedFiles().length === 0 && this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) // This needs to be deferred so that `queuecomplete` really triggers after `complete` + return setTimeout(()=>this.emit("queuecomplete"), 0); + }); + const containsFiles = function(e) { + return e.dataTransfer.types && e.dataTransfer.types.includes("Files"); + }; + let noPropagation = function(e) { + // If there are no files, we don't want to stop + // propagation so we don't interfere with other + // drag and drop behaviour. + if (!containsFiles(e)) return; + e.stopPropagation(); + return e.preventDefault(); + }; + // Create the listeners + this.listeners = [ + { + element: this.element, + events: { + dragstart: (e)=>{ + return this.emit("dragstart", e); + }, + dragenter: (e)=>{ + noPropagation(e); + return this.emit("dragenter", e); + }, + dragover: (e)=>{ + // Makes it possible to drag files from chrome's download bar + // http://stackoverflow.com/questions/19526430/drag-and-drop-file-uploads-from-chrome-downloads-bar + const efct = e.dataTransfer.effectAllowed; + e.dataTransfer.dropEffect = "move" === efct || "linkMove" === efct ? "move" : "copy"; + noPropagation(e); + return this.emit("dragover", e); + }, + dragleave: (e)=>{ + return this.emit("dragleave", e); + }, + drop: (e)=>{ + noPropagation(e); + return this.drop(e); + }, + dragend: (e)=>{ + return this.emit("dragend", e); + } + } + } + ]; + this.clickableElements.forEach((clickableElement)=>{ + return this.listeners.push({ + element: clickableElement, + events: { + click: (evt)=>{ + // Only the actual dropzone or the message element should trigger file selection + if (clickableElement !== this.element || evt.target === this.element || $3ed269f2f0fb224b$export$2e2bcd8739ae039.elementInside(evt.target, this.element.querySelector(".dz-message"))) this.hiddenFileInput.click(); // Forward the click + return true; + } + } + }); + }); + this.enable(); + return this.options.init.call(this); + } + // Not fully tested yet + destroy() { + this.disable(); + this.removeAllFiles(true); + if (this.hiddenFileInput != null ? this.hiddenFileInput.parentNode : undefined) { + this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput); + this.hiddenFileInput = null; + } + delete this.element.dropzone; + return $3ed269f2f0fb224b$export$2e2bcd8739ae039.instances.splice($3ed269f2f0fb224b$export$2e2bcd8739ae039.instances.indexOf(this), 1); + } + updateTotalUploadProgress() { + let totalUploadProgress; + let totalBytesSent = 0; + let totalBytes = 0; + let activeFiles = this.getActiveFiles(); + if (activeFiles.length) { + for (let file of this.getActiveFiles()){ + totalBytesSent += file.upload.bytesSent; + totalBytes += file.upload.total; + } + totalUploadProgress = 100 * totalBytesSent / totalBytes; + } else totalUploadProgress = 100; + return this.emit("totaluploadprogress", totalUploadProgress, totalBytes, totalBytesSent); + } + // @options.paramName can be a function taking one parameter rather than a string. + // A parameter name for a file is obtained simply by calling this with an index number. + _getParamName(n) { + if (typeof this.options.paramName === "function") return this.options.paramName(n); + else return `${this.options.paramName}${this.options.uploadMultiple ? `[${n}]` : ""}`; + } + // If @options.renameFile is a function, + // the function will be used to rename the file.name before appending it to the formData. + // MacOS 14+ screenshots contain narrow non-breaking space (U+202F) characters in filenames + // (e.g., "Screenshot 2024-01-30 at 10.32.07 AM.png" where the space after "07" and before "AM" is U+202F). + // This function now replaces these with regular spaces to prevent upload issues and maintain compatibility with MacOS + _renameFile(file) { + const cleanFile = { + ...file, + name: file.name.replace(/\u202F/g, " ") + }; + if (typeof this.options.renameFile !== "function") return cleanFile.name; + return this.options.renameFile(cleanFile); + } + // Returns a form that can be used as fallback if the browser does not support DragnDrop + // + // If the dropzone is already a form, only the input field and button are returned. Otherwise a complete form element is provided. + // This code has to pass in IE7 :( + getFallbackForm() { + let existingFallback, form; + if (existingFallback = this.getExistingFallback()) return existingFallback; + let fieldsString = '
'; + if (this.options.dictFallbackText) fieldsString += `

${this.options.dictFallbackText}

`; + fieldsString += `
`; + let fields = $3ed269f2f0fb224b$export$2e2bcd8739ae039.createElement(fieldsString); + if (this.element.tagName !== "FORM") { + form = $3ed269f2f0fb224b$export$2e2bcd8739ae039.createElement(`
`); + form.appendChild(fields); + } else { + // Make sure that the enctype and method attributes are set properly + this.element.setAttribute("enctype", "multipart/form-data"); + this.element.setAttribute("method", this.options.method); + } + return form != null ? form : fields; + } + // Returns the fallback elements if they exist already + // + // This code has to pass in IE7 :( + getExistingFallback() { + let getFallback = function(elements) { + for (let el of elements){ + if (/(^| )fallback($| )/.test(el.className)) return el; + } + }; + for (let tagName of [ + "div", + "form" + ]){ + var fallback; + if (fallback = getFallback(this.element.getElementsByTagName(tagName))) return fallback; + } + } + // Activates all listeners stored in @listeners + setupEventListeners() { + return this.listeners.map((elementListeners)=>(()=>{ + let result = []; + for(let event in elementListeners.events){ + let listener = elementListeners.events[event]; + result.push(elementListeners.element.addEventListener(event, listener, false)); + } + return result; + })()); + } + // Deactivates all listeners stored in @listeners + removeEventListeners() { + return this.listeners.map((elementListeners)=>(()=>{ + let result = []; + for(let event in elementListeners.events){ + let listener = elementListeners.events[event]; + result.push(elementListeners.element.removeEventListener(event, listener, false)); + } + return result; + })()); + } + // Removes all event listeners and cancels all files in the queue or being processed. + disable() { + this.clickableElements.forEach((element)=>element.classList.remove("dz-clickable")); + this.removeEventListeners(); + this.disabled = true; + return this.files.map((file)=>this.cancelUpload(file)); + } + enable() { + delete this.disabled; + this.clickableElements.forEach((element)=>element.classList.add("dz-clickable")); + return this.setupEventListeners(); + } + // Returns a nicely formatted filesize + filesize(size) { + let selectedSize = 0; + let selectedUnit = "b"; + if (size > 0) { + let units = [ + "tb", + "gb", + "mb", + "kb", + "b" + ]; + for(let i = 0; i < units.length; i++){ + let unit = units[i]; + let cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10; + if (size >= cutoff) { + selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i); + selectedUnit = unit; + break; + } + } + selectedSize = Math.round(10 * selectedSize) / 10; // Cutting of digits + } + return `${selectedSize} ${this.options.dictFileSizeUnits[selectedUnit]}`; + } + // Adds or removes the `dz-max-files-reached` class from the form. + _updateMaxFilesReachedClass() { + if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) { + if (this.getAcceptedFiles().length === this.options.maxFiles) this.emit("maxfilesreached", this.files); + return this.element.classList.add("dz-max-files-reached"); + } else return this.element.classList.remove("dz-max-files-reached"); + } + drop(e) { + if (!e.dataTransfer) return; + this.emit("drop", e); + // Convert the FileList to an Array + // This is necessary for IE11 + let files = []; + for(let i = 0; i < e.dataTransfer.files.length; i++)files[i] = e.dataTransfer.files[i]; + // Even if it's a folder, files.length will contain the folders. + if (files.length) { + let { items: items } = e.dataTransfer; + if (items && items.length && items[0].webkitGetAsEntry != null) // The browser supports dropping of folders, so handle items instead of files + this._addFilesFromItems(items); + else this.handleFiles(files); + } + this.emit("addedfiles", files); + } + paste(e) { + if ($3ed269f2f0fb224b$var$__guard__(e != null ? e.clipboardData : undefined, (x)=>x.items) == null) return; + this.emit("paste", e); + let { items: items } = e.clipboardData; + if (items.length) return this._addFilesFromItems(items); + } + handleFiles(files) { + for (let file of files)this.addFile(file); + } + // When a folder is dropped (or files are pasted), items must be handled + // instead of files. + _addFilesFromItems(items) { + return (()=>{ + let result = []; + for (let item of items){ + var entry; + if (item.webkitGetAsEntry != null && (entry = item.webkitGetAsEntry())) { + if (entry.isFile) result.push(this.addFile(item.getAsFile())); + else if (entry.isDirectory) // Append all files from that directory to files + result.push(this._addFilesFromDirectory(entry, entry.name)); + else result.push(undefined); + } else if (item.getAsFile != null) { + if (item.kind == null || item.kind === "file") result.push(this.addFile(item.getAsFile())); + else result.push(undefined); + } else result.push(undefined); + } + return result; + })(); + } + // Goes through the directory, and adds each file it finds recursively + _addFilesFromDirectory(directory, path) { + let dirReader = directory.createReader(); + let errorHandler = (error)=>$3ed269f2f0fb224b$var$__guardMethod__(console, "log", (o)=>o.log(error)); + var readEntries = ()=>{ + return dirReader.readEntries((entries)=>{ + if (entries.length > 0) { + for (let entry of entries){ + if (entry.isFile) entry.file((file)=>{ + if (this.options.ignoreHiddenFiles && file.name.substring(0, 1) === ".") return; + file.fullPath = `${path}/${file.name}`; + return this.addFile(file); + }); + else if (entry.isDirectory) this._addFilesFromDirectory(entry, `${path}/${entry.name}`); + } + // Recursively call readEntries() again, since browser only handle + // the first 100 entries. + // See: https://developer.mozilla.org/en-US/docs/Web/API/DirectoryReader#readEntries + readEntries(); + } + return null; + }, errorHandler); + }; + return readEntries(); + } + // If `done()` is called without argument the file is accepted + // If you call it with an error message, the file is rejected + // (This allows for asynchronous validation) + // + // This function checks the filesize, and if the file.type passes the + // `acceptedFiles` check. + accept(file, done) { + if (this.options.maxFilesize && file.size > this.options.maxFilesize * 1048576) done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize)); + else if (!$3ed269f2f0fb224b$export$2e2bcd8739ae039.isValidFile(file, this.options.acceptedFiles)) done(this.options.dictInvalidFileType); + else if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) { + done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}", this.options.maxFiles)); + this.emit("maxfilesexceeded", file); + } else this.options.accept.call(this, file, done); + } + addFile(file) { + file.upload = { + // note: this only works if window.isSecureContext is true, which includes localhost in http + uuid: window.isSecureContext ? self.crypto.randomUUID() : $3ed269f2f0fb224b$export$2e2bcd8739ae039.uuidv4(), + progress: 0, + // Setting the total upload size to file.size for the beginning + // It's actual different than the size to be transmitted. + total: file.size, + bytesSent: 0, + filename: this._renameFile(file) + }; + this.files.push(file); + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.ADDED; + this.emit("addedfile", file); + this._enqueueThumbnail(file); + this.accept(file, (error)=>{ + if (error) { + file.accepted = false; + this._errorProcessing([ + file + ], error); // Will set the file.status + } else { + file.accepted = true; + if (this.options.autoQueue) this.enqueueFile(file); + // Will set .accepted = true + } + this._updateMaxFilesReachedClass(); + }); + } + // Wrapper for enqueueFile + enqueueFiles(files) { + for (let file of files)this.enqueueFile(file); + return null; + } + enqueueFile(file) { + if (file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.ADDED && file.accepted === true) { + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED; + if (this.options.autoProcessQueue) return setTimeout(()=>this.processQueue(), 0); // Deferring the call + } else throw new Error("This file can't be queued because it has already been processed or was rejected."); + } + _enqueueThumbnail(file) { + if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1048576) { + this._thumbnailQueue.push(file); + return setTimeout(()=>this._processThumbnailQueue(), 0); // Deferring the call + } + } + _processThumbnailQueue() { + if (this._processingThumbnail || this._thumbnailQueue.length === 0) return; + this._processingThumbnail = true; + let file = this._thumbnailQueue.shift(); + return this.createThumbnail(file, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, true, (dataUrl)=>{ + this.emit("thumbnail", file, dataUrl); + this._processingThumbnail = false; + return this._processThumbnailQueue(); + }); + } + // Can be called by the user to remove a file + removeFile(file) { + if (file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING) this.cancelUpload(file); + this.files = $3ed269f2f0fb224b$var$without(this.files, file); + this.emit("removedfile", file); + if (this.files.length === 0) return this.emit("reset"); + } + // Removes all files that aren't currently processed from the list + removeAllFiles(cancelIfNecessary) { + // Create a copy of files since removeFile() changes the @files array. + if (cancelIfNecessary == null) cancelIfNecessary = false; + for (let file of this.files.slice())if (file.status !== $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING || cancelIfNecessary) this.removeFile(file); + return null; + } + // Resizes an image before it gets sent to the server. This function is the default behavior of + // `options.transformFile` if `resizeWidth` or `resizeHeight` are set. The callback is invoked with + // the resized blob. + resizeImage(file, width, height, resizeMethod, callback) { + return this.createThumbnail(file, width, height, resizeMethod, true, (dataUrl, canvas)=>{ + if (canvas == null) // The image has not been resized + return callback(file); + else { + let { resizeMimeType: resizeMimeType } = this.options; + if (resizeMimeType == null) resizeMimeType = file.type; + let resizedDataURL = canvas.toDataURL(resizeMimeType, this.options.resizeQuality); + if (resizeMimeType === "image/jpeg" || resizeMimeType === "image/jpg") // Now add the original EXIF information + resizedDataURL = $3ed269f2f0fb224b$var$restoreExif(file.dataURL, resizedDataURL); + return callback($3ed269f2f0fb224b$export$2e2bcd8739ae039.dataURItoBlob(resizedDataURL)); + } + }, true); + } + createThumbnail(file, width, height, resizeMethod, fixOrientation, callback, ignoreExif = false) { + let fileReader = new FileReader(); + fileReader.onload = ()=>{ + file.dataURL = fileReader.result; + // Don't bother creating a thumbnail for SVG images since they're vector + if (file.type === "image/svg+xml") { + if (callback != null) callback(fileReader.result); + return; + } + this.createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, undefined, ignoreExif); + }; + fileReader.readAsDataURL(file); + } + // `mockFile` needs to have these attributes: + // + // { name: 'name', size: 12345, imageUrl: '' } + // + // `callback` will be invoked when the image has been downloaded and displayed. + // `crossOrigin` will be added to the `img` tag when accessing the file. + displayExistingFile(mockFile, imageUrl, callback, crossOrigin, resizeThumbnail = true) { + this.emit("addedfile", mockFile); + this.emit("complete", mockFile); + if (!resizeThumbnail) { + this.emit("thumbnail", mockFile, imageUrl); + if (callback) callback(); + } else { + let onDone = (thumbnail)=>{ + this.emit("thumbnail", mockFile, thumbnail); + if (callback) callback(); + }; + mockFile.dataURL = imageUrl; + this.createThumbnailFromUrl(mockFile, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, this.options.fixOrientation, onDone, crossOrigin); + } + } + createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin, ignoreExif = false) { + // Not using `new Image` here because of a bug in latest Chrome versions. + // See https://github.com/enyo/dropzone/pull/226 + let img = document.createElement("img"); + if (crossOrigin) img.crossOrigin = crossOrigin; + // fixOrientation is not needed anymore with browsers handling imageOrientation + fixOrientation = getComputedStyle(document.body)["imageOrientation"] == "from-image" ? false : fixOrientation; + img.onload = ()=>{ + let loadExif = (callback)=>callback(1); + if (typeof EXIF !== "undefined" && EXIF !== null && fixOrientation) loadExif = (callback)=>EXIF.getData(img, function() { + return callback(EXIF.getTag(this, "Orientation")); + }); + return loadExif((orientation)=>{ + file.width = img.width; + file.height = img.height; + let resizeInfo = this.options.resize.call(this, file, width, height, resizeMethod); + let canvas = document.createElement("canvas"); + let ctx = canvas.getContext("2d"); + canvas.width = resizeInfo.trgWidth; + canvas.height = resizeInfo.trgHeight; + if (orientation > 4) { + canvas.width = resizeInfo.trgHeight; + canvas.height = resizeInfo.trgWidth; + } + switch(orientation){ + case 2: + // horizontal flip + ctx.translate(canvas.width, 0); + ctx.scale(-1, 1); + break; + case 3: + // 180° rotate left + ctx.translate(canvas.width, canvas.height); + ctx.rotate(Math.PI); + break; + case 4: + // vertical flip + ctx.translate(0, canvas.height); + ctx.scale(1, -1); + break; + case 5: + // vertical flip + 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.scale(1, -1); + break; + case 6: + // 90° rotate right + ctx.rotate(0.5 * Math.PI); + ctx.translate(0, -canvas.width); + break; + case 7: + // horizontal flip + 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.translate(canvas.height, -canvas.width); + ctx.scale(-1, 1); + break; + case 8: + // 90° rotate left + ctx.rotate(-0.5 * Math.PI); + ctx.translate(-canvas.height, 0); + break; + } + // This is a bugfix for iOS' scaling bug. + $3ed269f2f0fb224b$var$drawImageIOSFix(ctx, img, resizeInfo.srcX != null ? resizeInfo.srcX : 0, resizeInfo.srcY != null ? resizeInfo.srcY : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, resizeInfo.trgX != null ? resizeInfo.trgX : 0, resizeInfo.trgY != null ? resizeInfo.trgY : 0, resizeInfo.trgWidth, resizeInfo.trgHeight); + let thumbnail = canvas.toDataURL("image/png"); + if (callback != null) return callback(thumbnail, canvas); + }); + }; + if (callback != null) img.onerror = callback; + var dataURL = file.dataURL; + if (ignoreExif) dataURL = $3ed269f2f0fb224b$var$removeExif(dataURL); + return img.src = dataURL; + } + // Goes through the queue and processes files if there aren't too many already. + processQueue() { + let { parallelUploads: parallelUploads } = this.options; + let processingLength = this.getUploadingFiles().length; + let i = processingLength; + // There are already at least as many files uploading than should be + if (processingLength >= parallelUploads) return; + let queuedFiles = this.getQueuedFiles(); + if (!(queuedFiles.length > 0)) return; + if (this.options.uploadMultiple) // The files should be uploaded in one request + return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength)); + else while(i < parallelUploads){ + if (!queuedFiles.length) return; + // Nothing left to process + this.processFile(queuedFiles.shift()); + i++; + } + } + // Wrapper for `processFiles` + processFile(file) { + return this.processFiles([ + file + ]); + } + // Loads the file, then calls finishedLoading() + processFiles(files) { + for (let file of files){ + file.processing = true; // Backwards compatibility + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING; + this.emit("processing", file); + } + if (this.options.uploadMultiple) this.emit("processingmultiple", files); + return this.uploadFiles(files); + } + _getFilesWithXhr(xhr) { + let files; + return files = this.files.filter((file)=>file.xhr === xhr).map((file)=>file); + } + // Cancels the file upload and sets the status to CANCELED + // **if** the file is actually being uploaded. + // If it's still in the queue, the file is being removed from it and the status + // set to CANCELED. + cancelUpload(file) { + if (file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING) { + let groupedFiles = this._getFilesWithXhr(file.xhr); + for (let groupedFile of groupedFiles)groupedFile.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.CANCELED; + if (typeof file.xhr !== "undefined") file.xhr.abort(); + for (let groupedFile of groupedFiles)this.emit("canceled", groupedFile); + if (this.options.uploadMultiple) this.emit("canceledmultiple", groupedFiles); + } else if (file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.ADDED || file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED) { + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.CANCELED; + this.emit("canceled", file); + if (this.options.uploadMultiple) this.emit("canceledmultiple", [ + file + ]); + } + if (this.options.autoProcessQueue) return this.processQueue(); + } + resolveOption(option, ...args) { + if (typeof option === "function") return option.apply(this, args); + return option; + } + uploadFile(file) { + return this.uploadFiles([ + file + ]); + } + uploadFiles(files) { + this._transformFiles(files, (transformedFiles)=>{ + if (this.options.chunking) { + // Chunking is not allowed to be used with `uploadMultiple` so we know + // that there is only __one__file. + let transformedFile = transformedFiles[0]; + files[0].upload.chunked = this.options.chunking && (this.options.forceChunking || transformedFile.size > this.options.chunkSize); + files[0].upload.totalChunkCount = Math.ceil(transformedFile.size / this.options.chunkSize); + if (transformedFile.size === 0) files[0].upload.totalChunkCount = 1; + } + if (files[0].upload.chunked) { + // This file should be sent in chunks! + // If the chunking option is set, we **know** that there can only be **one** file, since + // uploadMultiple is not allowed with this option. + let file = files[0]; + let transformedFile = transformedFiles[0]; + file.upload.chunks = []; + let handleNextChunk = ()=>{ + let chunkIndex = 0; + // Find the next item in file.upload.chunks that is not defined yet. + while(file.upload.chunks[chunkIndex] !== undefined)chunkIndex++; + // This means, that all chunks have already been started. + if (chunkIndex >= file.upload.totalChunkCount) return; + let start = chunkIndex * this.options.chunkSize; + let end = Math.min(start + this.options.chunkSize, transformedFile.size); + let dataBlock = { + name: this._getParamName(0), + data: transformedFile.webkitSlice ? transformedFile.webkitSlice(start, end) : transformedFile.slice(start, end), + filename: file.upload.filename, + chunkIndex: chunkIndex + }; + file.upload.chunks[chunkIndex] = { + file: file, + index: chunkIndex, + dataBlock: dataBlock, + status: $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING, + progress: 0, + retries: 0 + }; + this._uploadData(files, [ + dataBlock + ]); + }; + file.upload.finishedChunkUpload = (chunk, response)=>{ + let allFinished = true; + chunk.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.SUCCESS; + // Clear the data from the chunk + chunk.dataBlock = null; + chunk.response = chunk.xhr.responseText; + chunk.responseHeaders = chunk.xhr.getAllResponseHeaders(); + // Leaving this reference to xhr will cause memory leaks. + chunk.xhr = null; + for(let i = 0; i < file.upload.totalChunkCount; i++){ + if (file.upload.chunks[i] === undefined) return handleNextChunk(); + if (file.upload.chunks[i].status !== $3ed269f2f0fb224b$export$2e2bcd8739ae039.SUCCESS) allFinished = false; + } + if (allFinished) this.options.chunksUploaded(file, ()=>{ + this._finished(files, response, null); + }); + }; + if (this.options.parallelChunkUploads) { + // we want to limit parallelChunkUploads to the same value as parallelUploads option + const parallelCount = Math.min(this.options.parallelChunkUploads === true ? this.options.parallelUploads : this.options.parallelChunkUploads, file.upload.totalChunkCount); + for(let i = 0; i < parallelCount; i++)handleNextChunk(); + } else handleNextChunk(); + } else { + let dataBlocks = []; + for(let i = 0; i < files.length; i++)dataBlocks[i] = { + name: this._getParamName(i), + data: transformedFiles[i], + filename: files[i].upload.filename + }; + this._uploadData(files, dataBlocks); + } + }); + } + /// Returns the right chunk for given file and xhr + _getChunk(file, xhr) { + for(let i = 0; i < file.upload.totalChunkCount; i++){ + if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].xhr === xhr) return file.upload.chunks[i]; + } + } + // This function actually uploads the file(s) to the server. + // + // If dataBlocks contains the actual data to upload (meaning, that this could + // either be transformed files, or individual chunks for chunked upload) then + // they will be used for the actual data to upload. + _uploadData(files, dataBlocks) { + let xhr = new XMLHttpRequest(); + // Put the xhr object in the file objects to be able to reference it later. + for (let file of files)file.xhr = xhr; + if (files[0].upload.chunked) // Put the xhr object in the right chunk object, so it can be associated + // later, and found with _getChunk. + files[0].upload.chunks[dataBlocks[0].chunkIndex].xhr = xhr; + let method = this.resolveOption(this.options.method, files, dataBlocks); + let url = this.resolveOption(this.options.url, files, dataBlocks); + xhr.open(method, url, true); + // Setting the timeout after open because of IE11 issue: https://gitlab.com/meno/dropzone/issues/8 + let timeout = this.resolveOption(this.options.timeout, files); + if (timeout) xhr.timeout = this.resolveOption(this.options.timeout, files); + // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179 + xhr.withCredentials = !!this.options.withCredentials; + xhr.onload = (e)=>{ + this._finishedUploading(files, xhr, e); + }; + xhr.ontimeout = ()=>{ + this._handleUploadError(files, xhr, `Request timedout after ${this.options.timeout / 1000} seconds`); + }; + xhr.onerror = ()=>{ + this._handleUploadError(files, xhr); + }; + // Some browsers do not have the .upload property + let progressObj = xhr.upload != null ? xhr.upload : xhr; + progressObj.onprogress = (e)=>this._updateFilesUploadProgress(files, xhr, e); + let headers = this.options.defaultHeaders ? { + Accept: "application/json", + "Cache-Control": "no-cache", + "X-Requested-With": "XMLHttpRequest" + } : {}; + if (this.options.binaryBody) headers["Content-Type"] = files[0].type; + if (this.options.headers) Object.assign(headers, this.options.headers); + for(let headerName in headers){ + let headerValue = headers[headerName]; + if (headerValue) xhr.setRequestHeader(headerName, headerValue); + } + if (this.options.binaryBody) { + // Since the file is going to be sent as binary body, it doesn't make + // any sense to generate `FormData` for it. + for (let file of files)this.emit("sending", file, xhr); + if (this.options.uploadMultiple) this.emit("sendingmultiple", files, xhr); + this.submitRequest(xhr, null, files); + } else { + let formData = new FormData(); + // Adding all @options parameters + if (this.options.params) { + let additionalParams = this.options.params; + if (typeof additionalParams === "function") additionalParams = additionalParams.call(this, files, xhr, files[0].upload.chunked ? this._getChunk(files[0], xhr) : null); + for(let key in additionalParams){ + let value = additionalParams[key]; + if (Array.isArray(value)) // The additional parameter contains an array, + // so lets iterate over it to attach each value + // individually. + for(let i = 0; i < value.length; i++)formData.append(key, value[i]); + else formData.append(key, value); + } + } + // Let the user add additional data if necessary + for (let file of files)this.emit("sending", file, xhr, formData); + if (this.options.uploadMultiple) this.emit("sendingmultiple", files, xhr, formData); + this._addFormElementData(formData); + // Finally add the files + // Has to be last because some servers (eg: S3) expect the file to be the last parameter + for(let i = 0; i < dataBlocks.length; i++){ + let dataBlock = dataBlocks[i]; + formData.append(dataBlock.name, dataBlock.data, dataBlock.filename); + } + this.submitRequest(xhr, formData, files); + } + } + // Transforms all files with this.options.transformFile and invokes done with the transformed files when done. + _transformFiles(files, done) { + let transformedFiles = []; + // Clumsy way of handling asynchronous calls, until I get to add a proper Future library. + let doneCounter = 0; + for(let i = 0; i < files.length; i++)this.options.transformFile.call(this, files[i], (transformedFile)=>{ + transformedFiles[i] = transformedFile; + if (++doneCounter === files.length) done(transformedFiles); + }); + } + // Takes care of adding other input elements of the form to the AJAX request + _addFormElementData(formData) { + // Take care of other input elements + if (this.element.tagName === "FORM") for (let input of this.element.querySelectorAll("input, textarea, select, button")){ + let inputName = input.getAttribute("name"); + let inputType = input.getAttribute("type"); + if (inputType) inputType = inputType.toLowerCase(); + // If the input doesn't have a name, we can't use it. + if (typeof inputName === "undefined" || inputName === null) continue; + if (input.tagName === "SELECT" && input.hasAttribute("multiple")) { + // Possibly multiple values + for (let option of input.options)if (option.selected) formData.append(inputName, option.value); + } else if (!inputType || inputType !== "checkbox" && inputType !== "radio" || input.checked) formData.append(inputName, input.value); + } + } + // Invoked when there is new progress information about given files. + // If e is not provided, it is assumed that the upload is finished. + _updateFilesUploadProgress(files, xhr, e) { + if (!files[0].upload.chunked) // Handle file uploads without chunking + for (let file of files){ + if (file.upload.total && file.upload.bytesSent && file.upload.bytesSent == file.upload.total) continue; + if (e) { + file.upload.progress = 100 * e.loaded / e.total; + file.upload.total = e.total; + file.upload.bytesSent = e.loaded; + } else { + // No event, so we're at 100% + file.upload.progress = 100; + file.upload.bytesSent = file.upload.total; + } + this.emit("uploadprogress", file, file.upload.progress, file.upload.bytesSent); + } + else { + // Handle chunked file uploads + // Chunked upload is not compatible with uploading multiple files in one + // request, so we know there's only one file. + let file = files[0]; + // Since this is a chunked upload, we need to update the appropriate chunk + // progress. + let chunk = this._getChunk(file, xhr); + if (e) { + chunk.progress = 100 * e.loaded / e.total; + chunk.total = e.total; + chunk.bytesSent = e.loaded; + } else { + // No event, so we're at 100% + chunk.progress = 100; + chunk.bytesSent = chunk.total; + } + // Now tally the *file* upload progress from its individual chunks + file.upload.progress = 0; + file.upload.total = 0; + file.upload.bytesSent = 0; + for(let i = 0; i < file.upload.totalChunkCount; i++)if (file.upload.chunks[i] && typeof file.upload.chunks[i].progress !== "undefined") { + file.upload.progress += file.upload.chunks[i].progress; + file.upload.total += file.upload.chunks[i].total; + file.upload.bytesSent += file.upload.chunks[i].bytesSent; + } + // Since the process is a percentage, we need to divide by the amount of + // chunks we've used. + file.upload.progress = file.upload.progress / file.upload.totalChunkCount; + this.emit("uploadprogress", file, file.upload.progress, file.upload.bytesSent); + } + } + _finishedUploading(files, xhr, e) { + let response; + if (files[0].status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.CANCELED) return; + if (xhr.readyState !== 4) return; + if (xhr.responseType !== "arraybuffer" && xhr.responseType !== "blob") { + response = xhr.responseText; + if (xhr.getResponseHeader("content-type") && ~xhr.getResponseHeader("content-type").indexOf("application/json")) try { + response = JSON.parse(response); + } catch (error) { + e = error; + response = "Invalid JSON response from server."; + } + } + this._updateFilesUploadProgress(files, xhr); + if (!(200 <= xhr.status && xhr.status < 300)) this._handleUploadError(files, xhr, response); + else if (files[0].upload.chunked) files[0].upload.finishedChunkUpload(this._getChunk(files[0], xhr), response); + else this._finished(files, response, e); + } + _handleUploadError(files, xhr, response) { + if (files[0].status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.CANCELED) return; + if (files[0].upload.chunked && this.options.retryChunks) { + let chunk = this._getChunk(files[0], xhr); + if (chunk.retries++ < this.options.retryChunksLimit) { + this._uploadData(files, [ + chunk.dataBlock + ]); + return; + } else console.warn("Retried this chunk too often. Giving up."); + } + this._errorProcessing(files, response || this.options.dictResponseError.replace("{{statusCode}}", xhr.status), xhr); + } + submitRequest(xhr, formData, files) { + if (xhr.readyState != 1) { + console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED."); + return; + } + if (this.options.binaryBody) { + if (files[0].upload.chunked) { + const chunk = this._getChunk(files[0], xhr); + xhr.send(chunk.dataBlock.data); + } else xhr.send(files[0]); + } else xhr.send(formData); + } + // Called internally when processing is finished. + // Individual callbacks have to be called in the appropriate sections. + _finished(files, responseText, e) { + for (let file of files){ + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.SUCCESS; + this.emit("success", file, responseText, e); + this.emit("complete", file); + } + if (this.options.uploadMultiple) { + this.emit("successmultiple", files, responseText, e); + this.emit("completemultiple", files); + } + if (this.options.autoProcessQueue) return this.processQueue(); + } + // Called internally when processing is finished. + // Individual callbacks have to be called in the appropriate sections. + _errorProcessing(files, message, xhr) { + for (let file of files){ + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.ERROR; + this.emit("error", file, message, xhr); + this.emit("complete", file); + } + if (this.options.uploadMultiple) { + this.emit("errormultiple", files, message, xhr); + this.emit("completemultiple", files); + } + if (this.options.autoProcessQueue) return this.processQueue(); + } + static uuidv4() { + return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c)=>(+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16)); + } +} +$3ed269f2f0fb224b$export$2e2bcd8739ae039.initClass(); +// This is a map of options for your different dropzones. Add configurations +// to this object for your different dropzone elements. +// +// Example: +// +// Dropzone.options.myDropzoneElementId = { maxFilesize: 1 }; +// +// And in html: +// +//
+$3ed269f2f0fb224b$export$2e2bcd8739ae039.options = {}; +// Returns the options for an element or undefined if none available. +$3ed269f2f0fb224b$export$2e2bcd8739ae039.optionsForElement = function(element) { + // Get the `Dropzone.options.elementId` for this element if it exists + if (element.getAttribute("id") && typeof $3ed269f2f0fb224b$export$2e2bcd8739ae039.options !== "undefined") return $3ed269f2f0fb224b$export$2e2bcd8739ae039.options[$3ed269f2f0fb224b$var$camelize(element.getAttribute("id"))]; + else return undefined; +}; +// Holds a list of all dropzone instances +$3ed269f2f0fb224b$export$2e2bcd8739ae039.instances = []; +// Returns the dropzone for given element if any +$3ed269f2f0fb224b$export$2e2bcd8739ae039.forElement = function(element) { + if (typeof element === "string") element = document.querySelector(element); + if ((element != null ? element.dropzone : undefined) == null) throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone."); + return element.dropzone; +}; +// Looks for all .dropzone elements and creates a dropzone for them +$3ed269f2f0fb224b$export$2e2bcd8739ae039.discover = function() { + let dropzones; + if (document.querySelectorAll) dropzones = document.querySelectorAll(".dropzone"); + else { + dropzones = []; + // IE :( + let checkElements = (elements)=>(()=>{ + let result = []; + for (let el of elements)if (/(^| )dropzone($| )/.test(el.className)) result.push(dropzones.push(el)); + else result.push(undefined); + return result; + })(); + checkElements(document.getElementsByTagName("div")); + checkElements(document.getElementsByTagName("form")); + } + return (()=>{ + let result = []; + for (let dropzone of dropzones)// Create a dropzone unless auto discover has been disabled for specific element + if ($3ed269f2f0fb224b$export$2e2bcd8739ae039.optionsForElement(dropzone) !== false) result.push(new $3ed269f2f0fb224b$export$2e2bcd8739ae039(dropzone)); + else result.push(undefined); + return result; + })(); +}; +// Checks if the browser is supported by simply checking if Promise is here: a good cutoff +$3ed269f2f0fb224b$export$2e2bcd8739ae039.isBrowserSupported = function() { + return typeof Promise !== "undefined"; +}; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.dataURItoBlob = function(dataURI) { + // convert base64 to raw binary data held in a string + // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this + let byteString = atob(dataURI.split(",")[1]); + // separate out the mime component + let mimeString = dataURI.split(",")[0].split(":")[1].split(";")[0]; + // write the bytes of the string to an ArrayBuffer + let ab = new ArrayBuffer(byteString.length); + let ia = new Uint8Array(ab); + for(let i = 0, end = byteString.length, asc = 0 <= end; asc ? i <= end : i >= end; asc ? i++ : i--)ia[i] = byteString.charCodeAt(i); + // write the ArrayBuffer to a blob + return new Blob([ + ab + ], { + type: mimeString + }); +}; +// Returns an array without the rejected item +const $3ed269f2f0fb224b$var$without = (list, rejectedItem)=>list.filter((item)=>item !== rejectedItem).map((item)=>item); +// abc-def_ghi -> abcDefGhi +const $3ed269f2f0fb224b$var$camelize = (str)=>str.replace(/[\-_](\w)/g, (match)=>match.charAt(1).toUpperCase()); +// Creates an element from string +$3ed269f2f0fb224b$export$2e2bcd8739ae039.createElement = function(string) { + let div = document.createElement("div"); + div.innerHTML = string; + return div.childNodes[0]; +}; +// Tests if given element is inside (or simply is) the container +$3ed269f2f0fb224b$export$2e2bcd8739ae039.elementInside = function(element, container) { + if (element === container) return true; + // Coffeescript doesn't support do/while loops + while(element = element.parentNode){ + if (element === container) return true; + } + return false; +}; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.getElement = function(el, name) { + let element; + if (typeof el === "string") element = document.querySelector(el); + else if (el.nodeType != null) element = el; + if (element == null) throw new Error(`Invalid \`${name}\` option provided. Please provide a CSS selector or a plain HTML element.`); + return element; +}; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.getElements = function(els, name) { + let el, elements; + if (els instanceof Array) { + elements = []; + try { + for (el of els)elements.push(this.getElement(el, name)); + } catch (e) { + elements = null; + } + } else if (typeof els === "string") { + elements = []; + for (el of document.querySelectorAll(els))elements.push(el); + } else if (els.nodeType != null) elements = [ + els + ]; + if (elements == null || !elements.length) throw new Error(`Invalid \`${name}\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`); + return elements; +}; +// Asks the user the question and calls accepted or rejected accordingly +// +// The default implementation just uses `window.confirm` and then calls the +// appropriate callback. +$3ed269f2f0fb224b$export$2e2bcd8739ae039.confirm = function(question, accepted, rejected) { + if (window.confirm(question)) return accepted(); + else if (rejected != null) return rejected(); +}; +// Validates the mime type like this: +// +// https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept +$3ed269f2f0fb224b$export$2e2bcd8739ae039.isValidFile = function(file, acceptedFiles) { + if (!acceptedFiles) return true; + // If there are no accepted mime types, it's OK + acceptedFiles = acceptedFiles.split(","); + let mimeType = file.type; + let baseMimeType = mimeType.replace(/\/.*$/, ""); + for (let validType of acceptedFiles){ + validType = validType.trim(); + if (validType.charAt(0) === ".") { + if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) return true; + } else if (/\/\*$/.test(validType)) { + // This is something like a image/* mime type + if (baseMimeType === validType.replace(/\/.*$/, "")) return true; + } else { + if (mimeType === validType) return true; + } + } + return false; +}; +// Augment jQuery +if (typeof jQuery !== "undefined" && jQuery !== null) jQuery.fn.dropzone = function(options) { + return this.each(function() { + return new $3ed269f2f0fb224b$export$2e2bcd8739ae039(this, options); + }); +}; +// Dropzone file status codes +$3ed269f2f0fb224b$export$2e2bcd8739ae039.ADDED = "added"; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED = "queued"; +// For backwards compatibility. Now, if a file is accepted, it's either queued +// or uploading. +$3ed269f2f0fb224b$export$2e2bcd8739ae039.ACCEPTED = $3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING = "uploading"; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.PROCESSING = $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING; // alias +$3ed269f2f0fb224b$export$2e2bcd8739ae039.CANCELED = "canceled"; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.ERROR = "error"; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.SUCCESS = "success"; +/* + + Bugfix for iOS 6 and 7 + Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios + based on the work of https://github.com/stomita/ios-imagefile-megapixel + + */ // Detecting vertical squash in loaded image. +// Fixes a bug which squash image vertically while drawing into canvas for some images. +// This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel +let $3ed269f2f0fb224b$var$detectVerticalSquash = function(img) { + let ih = img.naturalHeight; + let canvas = document.createElement("canvas"); + canvas.width = 1; + canvas.height = ih; + let ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0); + let { data: data } = ctx.getImageData(1, 0, 1, ih); + // search image edge pixel position in case it is squashed vertically. + let sy = 0; + let ey = ih; + let py = ih; + while(py > sy){ + let alpha = data[(py - 1) * 4 + 3]; + if (alpha === 0) ey = py; + else sy = py; + py = ey + sy >> 1; + } + let ratio = py / ih; + if (ratio === 0) return 1; + else return ratio; +}; +// A replacement for context.drawImage +// (args are for source and destination). +var $3ed269f2f0fb224b$var$drawImageIOSFix = function(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) { + let vertSquashRatio = $3ed269f2f0fb224b$var$detectVerticalSquash(img); + return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio); +}; +// Inspired by MinifyJpeg +// Source: http://www.perry.cz/files/ExifRestorer.js +// http://elicon.blog57.fc2.com/blog-entry-206.html +function $3ed269f2f0fb224b$var$removeExif(origFileBase64) { + var marker = "data:image/jpeg;base64,"; + if (!origFileBase64.startsWith(marker)) return origFileBase64; + var origFile = window.atob(origFileBase64.slice(marker.length)); + if (!origFile.startsWith("\xff\xd8\xff")) return origFileBase64; + // loop through the JPEG file segments and copy all but Exif segments into the filtered file. + var head = 0; + var filteredFile = ""; + while(head < origFile.length){ + if (origFile.slice(head, head + 2) == "\xff\xda") { + // this is the start of the image data, we don't expect exif data after that. + filteredFile += origFile.slice(head); + break; + } else if (origFile.slice(head, head + 2) == "\xff\xd8") { + // this is the global start marker. + filteredFile += origFile.slice(head, head + 2); + head += 2; + } else { + // we have a segment of variable size. + var length = origFile.charCodeAt(head + 2) * 256 + origFile.charCodeAt(head + 3); + var endPoint = head + length + 2; + var segment = origFile.slice(head, endPoint); + if (!segment.startsWith("\xff\xe1")) filteredFile += segment; + head = endPoint; + } + } + return marker + window.btoa(filteredFile); +} +function $3ed269f2f0fb224b$var$restoreExif(origFileBase64, resizedFileBase64) { + var marker = "data:image/jpeg;base64,"; + if (!(origFileBase64.startsWith(marker) && resizedFileBase64.startsWith(marker))) return resizedFileBase64; + var origFile = window.atob(origFileBase64.slice(marker.length)); + if (!origFile.startsWith("\xff\xd8\xff")) return resizedFileBase64; + // Go through the JPEG file segments one by one and collect any Exif segments we find. + var head = 0; + var exifData = ""; + while(head < origFile.length){ + if (origFile.slice(head, head + 2) == "\xff\xda") break; + else if (origFile.slice(head, head + 2) == "\xff\xd8") // this is the global start marker. + head += 2; + else { + // we have a segment of variable size. + var length = origFile.charCodeAt(head + 2) * 256 + origFile.charCodeAt(head + 3); + var endPoint = head + length + 2; + var segment = origFile.slice(head, endPoint); + if (segment.startsWith("\xff\xe1")) exifData += segment; + head = endPoint; + } + } + if (exifData == "") return resizedFileBase64; + var resizedFile = window.atob(resizedFileBase64.slice(marker.length)); + if (!resizedFile.startsWith("\xff\xd8\xff")) return resizedFileBase64; + // The first file segment is always header information so insert the Exif data as second segment. + var splitPoint = 4 + resizedFile.charCodeAt(4) * 256 + resizedFile.charCodeAt(5); + resizedFile = resizedFile.slice(0, splitPoint) + exifData + resizedFile.slice(splitPoint); + return marker + window.btoa(resizedFile); +} +function $3ed269f2f0fb224b$var$__guard__(value, transform) { + return typeof value !== "undefined" && value !== null ? transform(value) : undefined; +} +function $3ed269f2f0fb224b$var$__guardMethod__(obj, methodName, transform) { + if (typeof obj !== "undefined" && obj !== null && typeof obj[methodName] === "function") return transform(obj, methodName); + else return undefined; +} + + + +//# sourceMappingURL=dropzone.mjs.map + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ id: moduleId, +/******/ loaded: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ !function() { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function() { return module['default']; } : +/******/ function() { return module; }; +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ !function() { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/node module decorator */ +/******/ !function() { +/******/ __webpack_require__.nmd = function(module) { +/******/ module.paths = []; +/******/ if (!module.children) module.children = []; +/******/ return module; +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. +!function() { +"use strict"; +/*!***********************************************!*\ + !*** ./client/src/entwine/TinyMCE_ssmedia.js ***! + \***********************************************/ + + +var _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ "jquery")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _client = __webpack_require__(/*! react-dom/client */ "react-dom/client"); +var _Injector = _interopRequireWildcard(__webpack_require__(/*! lib/Injector */ "lib/Injector")); +var _InsertMediaModal = _interopRequireDefault(__webpack_require__(/*! containers/InsertMediaModal/InsertMediaModal */ "./client/src/containers/InsertMediaModal/InsertMediaModal.js")); +var _ShortcodeSerialiser = _interopRequireWildcard(__webpack_require__(/*! lib/ShortcodeSerialiser */ "lib/ShortcodeSerialiser")); +var modalActions = _interopRequireWildcard(__webpack_require__(/*! state/modal/ModalActions */ "./client/src/state/modal/ModalActions.js")); +var _TinyMCE_ssmedia_sizepressets = __webpack_require__(/*! ./TinyMCE_ssmedia_sizepressets */ "./client/src/entwine/TinyMCE_ssmedia_sizepressets.js"); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const InjectableInsertMediaModal = (0, _Injector.loadComponent)(_InsertMediaModal.default); +const filter = 'img[data-shortcode="image"]'; +(() => { + const ssmedia = { + init(editor) { + const insertTitle = _i18n.default._t('AssetAdmin.INSERT_FROM_FILES', 'Insert from Files'); + const editTitle = _i18n.default._t('AssetAdmin.EDIT_IMAGE', 'Edit image'); + const deleteTitle = _i18n.default._t('AssetAdmin.DELETE_IMAGE', 'Delete image'); + const contextTitle = _i18n.default._t('AssetAdmin.FILE', 'File'); + editor.addCommand('ssmedia', () => { + (0, _jquery.default)(`#${editor.id}`).entwine('ss').openMediaDialog(); + }); + editor.addCommand('ssmedia-delete', () => { + const node = editor.selection.getNode(); + if (editor.dom.is(node, filter)) { + node.remove(); + } else { + console.error({ + error: 'Unexpected selection - expected image', + selectedNode: node + }); + } + }); + editor.ui.registry.addButton('ssmedia', { + tooltip: insertTitle, + icon: 'image', + onAction: () => editor.execCommand('ssmedia'), + stateSelector: filter + }); + editor.ui.registry.addMenuItem('ssmedia', { + text: contextTitle, + icon: 'image', + onAction: () => editor.execCommand('ssmedia') + }); + editor.ui.registry.addButton('ssmediaedit', { + tooltip: editTitle, + icon: 'edit-block', + onAction: () => editor.execCommand('ssmedia') + }); + editor.ui.registry.addButton('ssmediadelete', { + tooltip: deleteTitle, + icon: 'remove', + onAction: () => editor.execCommand('ssmedia-delete') + }); + const sizePresets = editor.getParam('image_size_presets'); + let buttonList = []; + if (sizePresets) { + buttonList = (0, _TinyMCE_ssmedia_sizepressets.imageSizePresetButtons)(editor, sizePresets); + } + editor.ui.registry.addContextToolbar('ssmedia', { + predicate: node => editor.dom.is(node, filter), + position: 'node', + scope: 'node', + items: `${buttonList.join(' ')} | ssmediaedit ssmediadelete` + }); + editor.on('BeforeExecCommand', e => { + const cmd = e.command; + const ui = e.ui; + const val = e.value; + if (cmd === 'mceEditImage' || cmd === 'mceImage') { + e.preventDefault(); + editor.execCommand('ssmedia', ui, val); + } + }); + editor.on('GetContent', o => { + const content = (0, _jquery.default)(`
${o.content}
`); + content.find(filter).add(content.filter(filter)).each(function () { + const el = (0, _jquery.default)(this); + const obj = { + src: el.attr('src'), + id: el.data('id'), + width: el.attr('width'), + height: el.attr('height'), + class: el.attr('class'), + title: el.attr('title'), + alt: el.attr('alt'), + loading: el.data('loading') + }; + const shortCode = _ShortcodeSerialiser.default.serialise({ + name: 'image', + properties: (0, _ShortcodeSerialiser.sanitiseShortCodeProperties)(obj), + wrapped: false + }); + el.replaceWith(shortCode); + }); + o.content = ''; + content.each(function () { + if (this.innerHTML !== undefined) { + o.content += this.innerHTML; + } + }); + }); + editor.on('BeforeSetContent', o => { + let content = o.content; + let match = _ShortcodeSerialiser.default.match('image', false, content); + while (match) { + const attrs = match.properties; + const el = (0, _jquery.default)('').attr(Object.assign({}, attrs, { + id: undefined, + 'data-id': attrs.id, + 'data-shortcode': 'image', + 'data-loading': attrs.loading + })).addClass('ss-htmleditorfield-file image'); + content = content.replace(match.original, (0, _jquery.default)('
').append(el).html()); + match = _ShortcodeSerialiser.default.match('image', false, content); + } + o.content = content; + }); + return { + getMetadata() { + return { + name: 'Silverstripe Media', + url: 'https://docs.silverstripe.org/en/4/developer_guides/forms/field_types/htmleditorfield' + }; + } + }; + } + }; + tinymce.PluginManager.add('ssmedia', editor => ssmedia.init(editor)); +})(); +_jquery.default.entwine('ss', $ => { + $('.js-injector-boot #insert-media-react__dialog-wrapper').entwine({ + Element: null, + Data: {}, + ReactRoot: null, + onunmatch() { + this._clearModal(); + }, + _clearModal() { + const root = this.getReactRoot(); + if (root) { + root.unmount(); + this.setReactRoot(null); + } + }, + open() { + const { + dispatch + } = _Injector.default.reducer.store; + dispatch(modalActions.initFormStack('insert-media', 'admin')); + const imageSizePresets = tinymce.activeEditor.getParam('image_size_presets'); + dispatch(modalActions.defineImageSizePresets(imageSizePresets)); + this._renderModal(true); + }, + close() { + const { + dispatch + } = _Injector.default.reducer.store; + dispatch(modalActions.reset()); + this._renderModal(false); + }, + _renderModal(isOpen) { + var _this = this; + const handleHide = () => this.close(); + const handleInsert = function () { + return _this._handleInsert(...arguments); + }; + const { + url, + ...attrs + } = this.getOriginalAttributes(); + const fileSelected = attrs.hasOwnProperty('ID') && attrs.ID !== null; + const folderId = this.getFolderId(); + const editor = this.getElement().getEditor(); + const selection = editor.getInstance().selection; + const selectionContent = editor.getSelection(); + const tagName = selection.getNode().tagName; + const requireLinkText = tagName !== 'A' && (tagName === 'IMG' || selectionContent.trim() === ''); + let root = this.getReactRoot(); + if (!root) { + root = (0, _client.createRoot)(this[0]); + } + root.render(_react.default.createElement(InjectableInsertMediaModal, { + title: false, + isOpen: isOpen, + folderId: folderId, + onInsert: handleInsert, + onClosed: handleHide, + bodyClassName: "modal__dialog", + className: "insert-media-react__dialog-wrapper", + requireLinkText: requireLinkText, + fileAttributes: attrs, + fileSelected: fileSelected + })); + this.setReactRoot(root); + }, + _handleInsert(data, file) { + let result = false; + this.setData(Object.assign({}, data, file)); + try { + let category = null; + if (file) { + category = file.category; + } else { + category = 'image'; + } + switch (category) { + case 'image': + result = this.insertImage(); + break; + default: + result = this.insertFile(); + } + } catch (e) { + this.statusMessage(e, 'bad'); + } + if (result) { + this.close(); + } + return Promise.resolve(); + }, + getFolderId() { + const $field = this.getElement(); + if (!$field) { + return null; + } + const folderId = Number($field.data('config').upload_folder_id); + return isNaN(folderId) ? null : folderId; + }, + getOriginalAttributes() { + const $field = this.getElement(); + if (!$field) { + return {}; + } + const node = $field.getEditor().getSelectedNode(); + if (!node) { + return {}; + } + const $node = $(node); + const hrefParts = ($node.attr('href') || '').split('#'); + if (hrefParts[0]) { + const shortcode = _ShortcodeSerialiser.default.match('file_link', false, hrefParts[0]); + if (shortcode) { + return { + ID: shortcode.properties.id ? parseInt(shortcode.properties.id, 10) : 0, + Anchor: hrefParts[1] || '', + Description: $node.attr('title'), + TargetBlank: !!$node.attr('target') + }; + } + } + const $caption = $node.parent('.captionImage').find('.caption'); + const attr = { + url: $node.attr('src'), + AltText: $node.attr('alt'), + Width: $node.attr('width'), + Height: $node.attr('height'), + Loading: $node.attr('data-loading'), + TitleTooltip: $node.attr('title'), + Alignment: this.findPosition($node.attr('class')), + Caption: $caption.text(), + ID: $node.attr('data-id') + }; + ['Width', 'Height', 'ID'].forEach(item => { + attr[item] = typeof attr[item] === 'string' ? parseInt(attr[item], 10) : null; + }); + return attr; + }, + findPosition(cssClass) { + const alignments = ['leftAlone', 'center', 'rightAlone', 'left', 'right']; + if (typeof cssClass !== 'string') { + return ''; + } + const classes = cssClass.split(' '); + return alignments.find(alignment => classes.indexOf(alignment) > -1); + }, + getAttributes() { + const data = this.getData(); + return { + src: data.url, + alt: data.AltText, + width: data.Width, + height: data.Height, + title: data.TitleTooltip, + class: data.Alignment, + 'data-id': data.ID, + 'data-shortcode': 'image', + 'data-loading': data.Loading + }; + }, + getExtraData() { + const data = this.getData(); + return { + CaptionText: data && data.Caption + }; + }, + insertFile() { + const data = this.getData(); + const editor = this.getElement().getEditor(); + const $node = $(editor.getSelectedNode()); + const shortcode = _ShortcodeSerialiser.default.serialise({ + name: 'file_link', + properties: { + id: data.ID + } + }, true); + const selectionContent = editor.getSelection(); + let linkText = selectionContent || data.Text || data.filename; + if ($node.is('a') && $node.html()) { + linkText = ''; + } + const linkAttributes = { + href: shortcode, + target: data.TargetBlank ? '_blank' : '', + title: data.Description + }; + if ($node.is('img')) { + linkText = data.Text || data.filename; + const newLink = $('').attr(linkAttributes).text(linkText); + $node.replaceWith(newLink); + editor.addUndo(); + editor.repaint(); + } else { + this.insertLinkInEditor(linkAttributes, linkText); + } + return true; + }, + insertImage() { + const $field = this.getElement(); + if (!$field) { + return false; + } + const editor = $field.getEditor(); + if (!editor) { + return false; + } + const node = $(editor.getSelectedNode()); + const attrs = this.getAttributes(); + const extraData = this.getExtraData(); + let replacee = node && node.is('img,a') ? node : null; + if (replacee && replacee.parent().is('.captionImage')) replacee = replacee.parent(); + const img = node && node.is('img') ? node : $(''); + img.attr(attrs).addClass('ss-htmleditorfield-file image'); + let container = img.parent('.captionImage'); + let caption = container.find('.caption'); + if (extraData.CaptionText) { + if (!container.length) { + container = $('
'); + } + container.attr('class', `captionImage ${attrs.class}`).removeAttr('data-mce-style').width(attrs.width); + if (!caption.length) { + caption = $('

').appendTo(container); + } + caption.attr('class', `caption ${attrs.class}`).text(extraData.CaptionText); + } else { + container = null; + caption = null; + } + const replacer = container || img; + if (replacee && replacee.not(replacer).length) { + replacee.replaceWith(replacer); + } + if (container) { + container.prepend(img); + } + if (!replacee) { + editor.repaint(); + editor.insertContent($('
').append(replacer).html(), { + skip_undo: 1 + }); + } + editor.addUndo(); + editor.repaint(); + return true; + }, + statusMessage(text, type) { + const content = $('
').text(text).html(); + _jquery.default.noticeAdd({ + text: content, + type, + stayTime: 5000, + inEffect: { + left: '0', + opacity: 'show' + } + }); + } + }); +}); +}(); +/******/ })() +; +//# sourceMappingURL=TinyMCE_ssmedia.js.map \ No newline at end of file diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index e7a5e2ed6..b42029c86 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1 +1,29892 @@ -!function(){var e={9588:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(5207)),o=s(n(1991)),i=s(n(315));function s(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.transform("move-form-disabled",(e=>{e.component("TreeDropdownField.AssetAdmin.MoveForm",i.default)})),r.default.transform("owner-unpublishing",(e=>{e.component("FormAction.AssetAdmin.EditForm.action_unpublish",o.default)}))}},2038:function(e,t,n){"use strict";var r=d(n(6177)),o=d(n(6194)),i=d(n(4736)),s=d(n(9588)),l=d(n(420)),a=d(n(4121)),u=n(5125);function d(e){return e&&e.__esModule?e:{default:e}}document.addEventListener("DOMContentLoaded",(()=>{(0,a.default)(),(0,s.default)();const e=r.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdmin").reactRoutePath;o.default.add({path:"/",routes:[{path:(0,u.joinUrlPaths)(e,"show/:folderId/:viewAction/:fileId"),component:i.default},{path:(0,u.joinUrlPaths)(e,"show/:folderId/:viewAction"),component:i.default},{path:(0,u.joinUrlPaths)(e,"show/:folderId"),component:i.default},{path:e,component:i.default}]}),(0,l.default)()}))},4121:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=f(n(5207)),o=f(n(9725)),i=f(n(3058)),s=f(n(853)),l=f(n(6931)),a=f(n(3517)),u=f(n(2397)),d=f(n(9005)),c=f(n(6493)),p=n(1037);function f(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.component.registerMany({UploadField:o.default,UploadFieldItem:i.default,PreviewImageField:a.default,HistoryList:d.default,ProportionConstraintField:u.default,AssetDropzone:s.default,InsertMediaModal:l.default,GalleryToolbar:c.default,GalleryItemFile:p.File,GalleryItemFolder:p.Folder})}},420:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=f(n(5207)),o=n(9367),i=f(n(8518)),s=f(n(8310)),l=f(n(2726)),a=f(n(7668)),u=f(n(5214)),d=f(n(2482)),c=f(n(9266)),p=f(n(8178));function f(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.reducer.register("assetAdmin",(0,o.combineReducers)({gallery:i.default,queuedFiles:s.default,uploadField:l.default,previewField:a.default,imageLoad:u.default,displaySearch:d.default,confirmDeletion:c.default,modal:p.default}))}},853:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=u(n(5815)),i=u(n(4600)),s=u(n(1669)),l=n(5716),a=u(n(6935));function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}let c=0;class p extends r.Component{constructor(e){super(e),this.dropzone=null,this.dragging=!1,this.handleAccept=this.handleAccept.bind(this),this.handleAddedFile=this.handleAddedFile.bind(this),this.handleDragEnter=this.handleDragEnter.bind(this),this.handleDragLeave=this.handleDragLeave.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleUploadComplete=this.handleUploadComplete.bind(this),this.handleError=this.handleError.bind(this),this.handleSending=this.handleSending.bind(this),this.handleSuccess=this.handleSuccess.bind(this),this.handleQueueComplete=this.handleQueueComplete.bind(this),this.loadImage=this.loadImage.bind(this),this.handleMaxFilesExceeded=this.handleMaxFilesExceeded.bind(this)}componentDidMount(){this.dropzone=new i.default(this.dropzoneRef,Object.assign({},this.getDefaultOptions(),this.props.options));const{name:e}=this.props;e&&this.dropzone.hiddenFileInput&&this.dropzone.hiddenFileInput.classList.add(`dz-input-${e}`),void 0!==this.props.promptOnRemove&&this.setPromptOnRemove(this.props.promptOnRemove)}componentDidUpdate(e){const{name:t}=this.props;t&&this.dropzone.hiddenFileInput&&this.dropzone.hiddenFileInput.classList.add(`dz-input-${t}`),this.props.canUpload&&e.options!==this.props.options&&this.dropzone&&(this.dropzone.enable(),this.dropzone.options=Object.assign({},this.getDefaultOptions(),this.dropzone.options,this.props.options))}componentWillUnmount(){this.dropzone.files=[],this.dropzone.destroy()}getDefaultOptions(){let e=null,t=this.props.uploadSelector;if(!t&&this.props.uploadButton&&(t=".asset-dropzone__upload-button"),t){const n=(0,s.default)(this.dropzoneRef).find(t);n&&n.length&&(e=n.toArray())}return{accept:this.handleAccept,addedfile:this.handleAddedFile,dragenter:this.handleDragEnter,dragleave:this.handleDragLeave,drop:this.handleDrop,maxfilesexceeded:this.handleMaxFilesExceeded,uploadprogress:this.handleUploadProgress,complete:this.handleUploadComplete,dictDefaultMessage:o.default._t("AssetAdmin.DROPZONE_DEFAULT_MESSAGE","Drop files here to upload"),dictFallbackMessage:o.default._t("AssetAdmin.DROPZONE_FALLBACK_MESSAGE","Your browser does not support drag'n'drop file uploads."),dictFallbackText:o.default._t("AssetAdmin.DROPZONE_FALLBACK_TEXT","Please use the fallback form below to upload your files like in the olden days."),dictInvalidFileType:o.default._t("AssetAdmin.DROPZONE_INVALID_FILE_TYPE","You can't upload files of this type."),dictResponseError:o.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error."),dictCancelUpload:o.default._t("AssetAdmin.DROPZONE_CANCEL_UPLOAD","Cancel upload"),dictCancelUploadConfirmation:o.default._t("AssetAdmin.DROPZONE_CANCEL_UPLOAD_CONFIRMATION","Are you sure you want to cancel this upload?"),dictRemoveFile:o.default._t("AssetAdmin.DROPZONE_REMOVE_FILE","Remove file"),dictMaxFilesExceeded:o.default._t("AssetAdmin.DROPZONE_MAX_FILES_EXCEEDED","You can not upload any more files."),error:this.handleError,sending:this.handleSending,success:this.handleSuccess,queuecomplete:this.handleQueueComplete,thumbnailHeight:150,thumbnailWidth:200,timeout:0,clickable:e}}getFileCategory(e){return e.split("/")[0]}getLoadPreview(e){return new Promise((t=>{const n=new FileReader;n.onload=n=>{if("image"===this.getFileCategory(e.type)){const e=new Image;t(this.loadImage(e,n.target.result))}else t({})},n.readAsDataURL(e)}))}getFileTitle(e){return e.replace(/[.][^.]+$/,"").replace(/-_/," ")}setPromptOnRemove(e){this.dropzone.options.dictRemoveFileConfirmation=e}handleDragEnter(e){this.props.canUpload&&(this.dragging=!0,this.forceUpdate(),"function"==typeof this.props.onDragEnter&&this.props.onDragEnter(e))}handleDragLeave(e){const t=this.dropzoneRef;this.props.canUpload&&e.target===t&&(this.dragging=!1,this.forceUpdate(),"function"==typeof this.props.onDragLeave&&this.props.onDragLeave(e,t))}handleUploadProgress(e,t,n){"function"==typeof this.props.onUploadProgress&&this.props.onUploadProgress(e,t,n)}handleUploadComplete(e){"function"==typeof this.props.onUploadComplete&&this.props.onUploadComplete(e.status)}handleDrop(e){this.dragging=!1,this.forceUpdate(),"function"==typeof this.props.onDrop&&this.props.onDrop(e)}handleSending(e,t,n){"function"==typeof this.props.updateFormData&&this.props.updateFormData(n),n.append("SecurityID",this.props.securityID),n.append("ParentID",this.props.folderId);const r=Object.assign({},t,{abort:()=>{this.dropzone.cancelUpload(e),t.abort()}});"function"==typeof this.props.onSending&&this.props.onSending(e,r,n)}handleMaxFilesExceeded(e){return"function"!=typeof this.props.onMaxFilesExceeded||this.props.onMaxFilesExceeded(e)}generateQueuedId(){return c+=1,c}handleAccept(e,t){return("function"!=typeof this.props.canFileUpload||this.props.canFileUpload(e))&&this.props.canUpload?t():t(o.default._t("AssetAdmin.DROPZONE_CANNOT_UPLOAD","Uploading not permitted."))}handleAddedFile(e){e._queuedId=this.generateQueuedId();const t={category:this.getFileCategory(e.type),filename:e.name,queuedId:e._queuedId,size:e.size,title:this.getFileTitle(e.name),extension:(0,l.getFileExtension)(e.name),type:e.type,uploadedToFolderId:this.props.folderId};this.props.onAddedFile(t);return this.getLoadPreview(e).then((e=>{const n={height:e.height,width:e.width,url:e.thumbnailURL,thumbnail:e.thumbnailURL,smallThumbnail:e.thumbnailURL};return"function"==typeof this.props.onPreviewLoaded&&this.props.onPreviewLoaded(t,n),{...t,...n}}))}loadImage(e,t){return new Promise((n=>{const r=document.createElement("canvas"),o=r.getContext("2d");e.onload=()=>{const t=2*this.props.preview.width,i=2*this.props.preview.height,s=e.naturalWidth/e.naturalHeight;e.naturalWidth{this.dropzoneRef=e}},this.props.uploadButton&&r.default.createElement("button",t,o.default._t("AssetAdmin.DROPZONE_UPLOAD")),this.props.children)}}p.propTypes={folderId:a.default.number.isRequired,onAccept:a.default.func,onAddedFile:a.default.func.isRequired,onDragEnter:a.default.func,onDragLeave:a.default.func,onDrop:a.default.func,onError:a.default.func.isRequired,onPreviewLoaded:a.default.func,onSending:a.default.func,onSuccess:a.default.func.isRequired,onMaxFilesExceeded:a.default.func,updateFormData:a.default.func,canFileUpload:a.default.func,onQueueComplete:a.default.func,options:a.default.shape({url:a.default.string.isRequired}),promptOnRemove:a.default.string,securityID:a.default.string.isRequired,uploadButton:a.default.bool,uploadSelector:a.default.string,canUpload:a.default.bool.isRequired,preview:a.default.shape({width:a.default.number,height:a.default.number}),className:a.default.string},p.defaultProps={uploadButton:!0};t.default=p},7153:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=a(n(6935)),i=a(n(2932)),s=a(n(2926)),l=a(n(5815));function a(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}class d extends r.Component{render(){const{isDropping:e,badge:t,onClick:n}=this.props,o=["btn","btn-secondary","btn--no-text","font-icon-level-up","btn--icon-large","gallery__back"];e&&(o.push("z-depth-1"),o.push("gallery__back--droppable-hover"));const i=t?r.default.createElement(s.default,{className:"gallery__back-badge",status:t.status,message:t.message}):null;return r.default.createElement("button",{className:o.join(" "),title:l.default._t("AssetAdmin.BACK_DESCRIPTION","Navigate up a level"),onClick:n},i)}}t.Component=d,d.propTypes={onClick:o.default.func,isDropping:o.default.bool,badge:o.default.shape(s.default.propTypes)};t.default=(0,i.default)("GalleryItem")(d)},3229:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=c(n(5815)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),i=n(9040),s=n(5207),l=n(3556),a=c(n(6923)),u=c(n(6935));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function c(e){return e&&e.__esModule?e:{default:e}}class p extends o.Component{constructor(e){super(e),this.handleChangeValue=this.handleChangeValue.bind(this),this.renderChild=this.renderChild.bind(this)}getOptionByValue(e){return this.props.actions.find((t=>t.value===e))}handleChangeValue(e){let t=null;const n=this.getOptionByValue(e.target.value);return null===n?null:(t="function"==typeof n.confirm?n.confirm(this.props.items).then((()=>n.callback(e,this.props.items))).catch((e=>{if("cancelled"!==e)throw e})):n.callback(e,this.props.items)||Promise.resolve(),t)}renderChild(e,t){const n=(0,a.default)("bulk-actions__action",e.className||"font-icon-info-circled",{btn:t<2,"bulk-actions__action--more":t>2});return t<2?o.default.createElement(l.Button,{className:n,key:e.value,onClick:this.handleChangeValue,value:e.value,color:e.color},e.label):o.default.createElement(l.DropdownItem,{type:"button",className:n,key:e.value,onClick:this.handleChangeValue,value:e.value},e.label)}render(){if(!this.props.items.length)return null;let e=this.props.actions.filter((e=>!e.canApply||e.canApply(this.props.items)));if(e=e.map(this.renderChild),!e.length)return null;const{ActionMenu:t,showCount:n}=this.props,i=r.default._t("AssetAdmin.BULK_ACTIONS_SELECT_ALL","Select all"),s=r.default.sprintf(r.default._t("AssetAdmin.BULK_ACTIONS_SELECTED","%s selected"),this.props.items.length),a=r.default._t("AssetAdmin.BULK_ACTIONS_CLEAR_SELECTION","Clear selection");return o.default.createElement("div",{className:"bulk-actions fieldholder-small"},n&&o.default.createElement(o.default.Fragment,null,o.default.createElement(l.Button,{className:"bulk-actions-counter font-icon-cross-mark",onClick:this.props.onClearSelection,title:a},s),o.default.createElement("div",{className:"bulk-actions-select-all"},o.default.createElement(l.Button,{onClick:this.props.onSelectAll},i))),e.slice(0,2),e.length>2&&t?o.default.createElement(t,{id:"BulkActions",className:"bulk-actions__more-actions-menu"},e.slice(2)):e.slice(2))}}t.Component=p,p.propTypes={items:u.default.array,actions:u.default.arrayOf(u.default.shape({value:u.default.string.isRequired,label:u.default.string.isRequired,className:u.default.string,destructive:u.default.bool,callback:u.default.func,canApply:u.default.func,confirm:u.default.func})),ActionMenu:u.default.elementType,showCount:u.default.bool,onClearSelection:u.default.func.isRequired,onSelectAll:u.default.func.isRequired},p.defaultProps={items:[],actions:[],ActionMenu:null,total:null,showCount:!0,totalReachedMessage:r.default._t("")};const f=(0,i.connect)((function(e){return{gallery:e.assetAdmin.gallery}}))(p);t.default=(0,s.inject)(["ActionMenu"],(e=>({ActionMenu:e})),(()=>"BulkActions"))(f)},1037:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Folder=t.File=t.Component=void 0;var r=E(n(5815)),o=_(n(1594)),i=E(n(6923)),s=E(n(6379)),l=E(n(6022)),a=E(n(2063)),u=E(n(2932)),d=E(n(2926)),c=E(n(1990)),p=E(n(4350)),f=n(9040),h=n(9367),m=n(4172),g=_(n(769)),y=E(n(1838)),v=E(n(6935));function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}function _(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function E(e){return e&&e.__esModule?e:{default:e}}function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t{e.preventDefault()};class F extends o.Component{constructor(e){super(e),this.handleSelect=this.handleSelect.bind(this),this.handleActivate=this.handleActivate.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancelUpload=this.handleCancelUpload.bind(this)}componentDidUpdate(){S(this.props)&&this.props.actions.imageLoad.loadImage(this.props.item.thumbnail,this.props.sectionConfig.imageRetry)}getThumbnailStyles(){const{item:{thumbnail:e,version:t},bustCache:n}=this.props;if(!this.isImage()||!e||this.missing())return{};const r=!1===n||!t||e.startsWith("data:image/")?e:`${e}?vid=${t}`;switch(this.props.loadState){case y.default.SUCCESS:case y.default.DISABLED:return{backgroundImage:`url(${r})`};default:return{}}}getErrorMessage(){let e=null;const{item:t,loadState:n}=this.props;if(this.hasError()?e=t.message.value:this.missing()?e=r.default._t("AssetAdmin.FILE_MISSING","File cannot be found"):n===y.default.FAILED&&(e=r.default._t("AssetAdmin.FILE_LOAD_ERROR","Thumbnail not available")),null!==e){return e=this.getItemFunction("updateErrorMessage")(e,this.props),o.default.createElement("span",{className:"gallery-item__error-message"},e)}return null}getThumbnailClassNames(){const e=["gallery-item__thumbnail"];switch(this.isImageSmallerThanThumbnail()&&e.push("gallery-item__thumbnail--small"),!this.props.item.thumbnail&&this.isImage()&&e.push("gallery-item__thumbnail--no-preview"),this.props.loadState){case y.default.LOADING:case y.default.WAITING:e.push("gallery-item__thumbnail--loading");break;case y.default.FAILED:e.push("gallery-item__thumbnail--error")}return e.join(" ")}getItemClassNames(){const e=this.props.item.category||"false",t=this.props.selectable&&(this.props.item.selected||this.props.isDragging);return(0,i.default)({"gallery-item":!0,[`gallery-item--${e}`]:!0,"gallery-item--max-selected":this.props.maxSelected&&!t,"gallery-item--missing":this.missing(),"gallery-item--selectable":this.props.selectable,"gallery-item--selected":t,"gallery-item--dropping":this.props.isDropping,"gallery-item--highlighted":this.props.item.highlighted,"gallery-item--error":this.hasError(),"gallery-item--dragging":this.props.isDragging})}getItemFunction(e){const{item:t}=this.props;return"function"==typeof t[e]?t[e]:this.props[e]}getStatusFlags(){let e=[];const{item:t}=this.props;"folder"!==t.type&&(t.draft?e.push({key:"status-draft",title:r.default._t("File.DRAFT","Draft"),className:"gallery-item--draft"}):t.modified&&e.push({key:"status-modified",title:r.default._t("File.MODIFIED","Modified"),className:"gallery-item--modified"}));return e=this.getItemFunction("updateStatusFlags")(e,this.props),o.default.createElement("div",{className:"gallery-item__status-flags"},e.map((e=>o.default.createElement("span",e))))}getStatusIcons(){const{item:e}=this.props,t=[];return e.hasRestrictedAccess&&t.push({key:"status-restricted",fileID:e.id,hasRestrictedAccess:!0,placement:"top",disableTooltip:"folder"===e.type,includeBackground:"folder"!==e.type}),e.isTrackedFormUpload&&"folder"!==e.type&&t.push({key:"status-tracked-form-upload",fileID:e.id,isTrackedFormUpload:!0,hasRestrictedAccess:e.hasRestrictedAccess,placement:"top",includeBackground:!0}),o.default.createElement("div",{className:"gallery-item__status-icons"},t.map((e=>o.default.createElement(c.default,e))))}getProgressBar(){let e=null;const{item:t}=this.props,n={className:"gallery-item__progress-bar",style:{width:`${t.progress}%`}};this.hasError()||!this.uploading()||this.complete()||(e=o.default.createElement("div",{className:"gallery-item__upload-progress"},o.default.createElement("div",n)));return e=this.getItemFunction("updateProgressBar")(e,this.props),e}isImageSmallerThanThumbnail(){if(!this.isImage()||this.missing())return!1;const e=this.props.item.width,t=this.props.item.height;return t&&e&&t0}missing(){return!this.exists()&&this.saved()}uploading(){return this.props.item.queuedId&&!this.saved()}exists(){return this.props.item.exists}isImage(){return"image"===this.props.item.category}canBatchSelect(){return this.props.selectable&&this.props.item.canEdit}hasError(){let e=!1;return this.props.item.message&&(e="error"===this.props.item.message.type),e}handleActivate(e){e.stopPropagation(),"function"==typeof this.props.onActivate&&this.saved()&&this.props.onActivate(e,this.props.item)}handleSelect(e){e.stopPropagation(),e.preventDefault(),"function"==typeof this.props.onSelect&&this.props.onSelect(e,this.props.item)}handleKeyDown(e){s.default.SPACE_KEY_CODE===e.keyCode&&(e.preventDefault(),this.canBatchSelect()&&this.handleSelect(e)),s.default.RETURN_KEY_CODE===e.keyCode&&this.handleActivate(e)}handleCancelUpload(e){e.stopPropagation(),e.preventDefault(),this.hasError()?this.props.onRemoveErroredUpload(this.props.item):this.props.onCancelUpload&&this.props.onCancelUpload(this.props.item)}render(){let e=null,t=null,n=null;const{id:i,queuedId:s}=this.props.item,l=i?`item-${i}`:`queued-${s}`;if(this.props.selectable&&(this.canBatchSelect()&&(e=this.handleSelect),t="font-icon-tick"),this.uploading())e=this.handleCancelUpload,t="font-icon-cancel";else if(this.exists()){const e=r.default._t("AssetAdmin.VIEW","View");n=o.default.createElement("div",{className:"gallery-item--overlay font-icon-eye"},e)}const a=this.props.badge,u={className:"gallery-item__checkbox",type:"checkbox",title:r.default._t("AssetAdmin.SELECT","Select"),tabIndex:-1,onMouseDown:w,id:l},c=["gallery-item__checkbox-label",t];this.canBatchSelect()||(u.disabled=!0,c.push("gallery-item__checkbox-label--disabled"));const p={className:c.join(" "),onClick:e};return o.default.createElement("div",{className:this.getItemClassNames(),"data-id":this.props.item.id,tabIndex:0,role:"button",onKeyDown:this.handleKeyDown,onClick:this.handleActivate},!!a&&o.default.createElement(d.default,{className:"gallery-item__badge",status:a.status,message:a.message}),o.default.createElement("div",{ref:e=>{this.thumbnail=e},className:this.getThumbnailClassNames(),style:this.getThumbnailStyles()},n,this.getStatusFlags(),this.getStatusIcons()),this.getProgressBar(),this.getErrorMessage(),this.props.children,o.default.createElement("div",{className:"gallery-item__title",ref:e=>{this.title=e}},o.default.createElement("label",C({},p,{htmlFor:l}),o.default.createElement("input",u)),this.props.item.title))}}t.Component=F,F.propTypes={sectionConfig:p.default,item:l.default,loadState:v.default.oneOf(Object.values(y.default)),bustCache:v.default.bool,highlighted:v.default.bool,selected:v.default.bool,isDropping:v.default.bool,isDragging:v.default.bool,message:v.default.shape({value:v.default.string,type:v.default.string}),selectable:v.default.bool,onActivate:v.default.func,onSelect:v.default.func,onCancelUpload:v.default.func,onRemoveErroredUpload:v.default.func,badge:v.default.shape({status:v.default.string,message:v.default.string}),updateStatusFlags:v.default.func,updateProgressBar:v.default.func,updateErrorMessage:v.default.func},F.defaultProps={item:{},sectionConfig:{imageRetry:{}},updateStatusFlags:e=>e,updateProgressBar:e=>e,updateErrorMessage:e=>e,bustCache:!0};const I=(0,f.connect)((function(e,t){const{bustCache:n}=e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));let r=y.default.DISABLED;if(S(t)){const n=e.assetAdmin.imageLoad.files.find((e=>t.item.thumbnail===e.url));r=n&&n.status||y.default.NONE}return{bustCache:n,loadState:r}}),(function(e){return{actions:{imageLoad:(0,h.bindActionCreators)(g,e)}}}))(F),A="GalleryItem",O=t.File=(0,m.createSelectable)((0,a.default)(A)(I));t.Folder=(0,m.createSelectable)((0,u.default)(A)(O));t.default=I},2914:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=a(n(6935)),i=n(1820),s=a(n(2926)),l=a(n(1037));function a(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?r.default.createElement("div",{key:"1",className:"gallery-item__drag-shadow"}):null,t>2?r.default.createElement("div",{key:"2",className:"gallery-item__drag-shadow gallery-item__drag-shadow--second"}):null];return r.default.createElement("div",{className:"gallery-item__drag-layer"},r.default.createElement("div",{className:"gallery-item__drag-layer-item",style:this.getOffset()},r.default.createElement("div",{className:"gallery-item__drag-layer-preview"},n,r.default.createElement(l.default,d({},e.props,{isDragging:!0}))),t>1?r.default.createElement(s.default,{className:"gallery-item__drag-layer-count",status:"info",message:`${t}`}):null))}}c.propTypes={item:o.default.object,offset:o.default.shape({x:o.default.number.isRequired,y:o.default.number.isRequired}),isDragging:o.default.bool.isRequired};t.default=(0,i.DragLayer)((e=>({item:e.getItem(),offset:e.getInitialClientOffset(),dragged:e.getDifferenceFromInitialOffset(),isDragging:e.isDragging()})))(c)},2063:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t={canDrag(e){return e.canDrag},beginDrag(e){const{id:t}=e.item;"function"==typeof e.onDrag&&e.onDrag(!0,t);const n=e.selectedFiles.concat([]);return n.includes(t)||n.push(t),{selected:n,props:e}},endDrag(e){const{id:t}=e.item;"function"==typeof e.onDrag&&e.onDrag(!1,t)}},n=(0,s.DragSource)(e,t,((e,t)=>({connectDragPreview:e.dragPreview(),connectDragSource:e.dragSource(),isDragging:t.isDragging()})));return e=>{class t extends o.Component{componentDidMount(){this.props.connectDragPreview((0,l.getEmptyImage)(),{captureDraggingState:!0})}render(){const{connectDragSource:t}=this.props,n=o.default.createElement(e,this.props);return"string"==typeof n.type?t(n):t(o.default.createElement("div",{className:"gallery-item__draggable"},n))}}return t.propTypes={connectDragSource:i.default.func.isRequired,connectDragPreview:i.default.func.isRequired,item:i.default.shape({id:i.default.number.isRequired}).isRequired,onDrag:i.default.func,selectedFiles:i.default.arrayOf(i.default.number)},n(t)}};var r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),i=(r=n(6935))&&r.__esModule?r:{default:r},s=n(1820),l=n(8724);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}},2932:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t={drop(e,t){if(t.canDrop()){const n=t.getItem();e.onDropFiles(e.item.id,n.selected)}},canDrop(e,t){return!t.getItem().selected.includes(e.item.id)}},n=(0,s.DropTarget)(e,t,((e,t)=>{const n=t.isOver();return{isDropping:n&&t.canDrop(),connectDropTarget:e.dropTarget(),isOver:n}}));return e=>{class t extends o.Component{render(){const{connectDropTarget:t}=this.props,n=o.default.createElement(e,this.props);return"string"==typeof n.type?t(n):t(o.default.createElement("div",{className:"gallery-item__droppable"},n))}}return t.propTypes={connectDropTarget:i.default.func.isRequired,item:i.default.shape({id:i.default.number.isRequired}).isRequired},n(t)}};var r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),i=(r=n(6935))&&r.__esModule?r:{default:r},s=n(1820);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}},7847:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=s(n(6935)),i=s(n(5815));function s(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}class a extends r.Component{constructor(){super(),this.handleCreateFolder=this.handleCreateFolder.bind(this)}handleCreateFolder(e){const{onCreateFolder:t}=this.props;e.preventDefault(),"function"==typeof t&&t()}render(){const{canEdit:e}=this.props;return r.default.createElement("button",{id:"add-folder-button",className:"btn btn-secondary font-icon-folder-add btn--icon-xl",type:"button",onClick:this.handleCreateFolder,disabled:!e},r.default.createElement("span",{className:"btn__text btn__title"},i.default._t("AssetAdmin.ADD_FOLDER_BUTTON")))}}a.propTypes={canEdit:o.default.bool.isRequired,onCreateFolder:o.default.func.isRequired};t.default=a},3577:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=s(n(6935)),i=s(n(7153));function s(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}class a extends r.Component{constructor(e){super(e),this.handleBackClick=this.handleBackClick.bind(this)}handleBackClick(e){const{onOpenFolder:t,folder:n}=this.props;e.preventDefault(),"function"==typeof t&&t(n.parentId)}render(){const{folder:e,badges:t,onMoveFiles:n,BackComponent:o}=this.props,{parentId:i}=e;if(null===i)return null;const s=t.find((e=>e.id===i));return r.default.createElement("div",{className:"gallery__back-container"},r.default.createElement(o,{item:{id:i},onClick:this.handleBackClick,onDropFiles:n,badge:s}))}}a.propTypes={folder:o.default.shape({id:o.default.number,title:o.default.string,parentId:o.default.number,canView:o.default.bool,canEdit:o.default.bool}).isRequired,badges:o.default.arrayOf(o.default.shape({id:o.default.number,message:o.default.node,status:o.default.string})).isRequired,onOpenFolder:o.default.func.isRequired,onMoveFiles:o.default.func.isRequired,BackComponent:o.default.oneOfType([o.default.object,o.default.func])},a.defaultProps={BackComponent:i.default};t.default=a},1859:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=s(n(5815)),i=s(n(6935));function s(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}class a extends r.Component{render(){const{canEdit:e}=this.props;return r.default.createElement("button",{id:"upload-button",className:"btn btn-secondary font-icon-upload btn--icon-xl",type:"button",disabled:!e},r.default.createElement("span",{className:"btn__text btn__title"},o.default._t("AssetAdmin.DROPZONE_UPLOAD")))}}a.defaultProps={canEdit:i.default.func.isRequired};t.default=a},6493:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=u(n(6935)),i=n(9040),s=u(n(3577)),l=u(n(1859)),a=u(n(7847));function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}class c extends r.Component{constructor(e){super(e),this.handleSelectSort=this.handleSelectSort.bind(this),this.handleViewChange=this.handleViewChange.bind(this)}handleSelectSort(e){this.props.onSort(e.currentTarget.value)}handleViewChange(e){const t=e.currentTarget.value;this.props.onViewChange(t)}renderSort(){return"tile"!==this.props.view?null:r.default.createElement("div",{className:"gallery__sort fieldholder-small"},r.default.createElement("select",{className:"dropdown no-change-track no-chzn",tabIndex:"0",style:{width:"160px"},defaultValue:this.props.sort},this.props.sorters.map((e=>{const t=e.label.replace(/^\w|[\s\-]+\w/g,(e=>e.toUpperCase()));return r.default.createElement("option",{key:`${e.field}-${e.direction}`,onClick:this.handleSelectSort,"data-field":e.field,"data-direction":e.direction,value:`${e.field},${e.direction}`},t)}))))}renderViewChangeButtons(){return["tile","table"].map((e=>{const t="table"===e?"list":"thumbnails",n=["gallery__view-change-button","btn btn-secondary","btn--icon-sm","btn--no-text"];return e===this.props.view?null:(n.push(`font-icon-${t}`),r.default.createElement("button",{id:`button-view-${e}`,key:e,className:n.join(" "),type:"button",title:"Change view gallery/list",onClick:this.handleViewChange,value:e}))}))}render(){const{badges:e,children:t,folder:n,onMoveFiles:o,onOpenFolder:i,onCreateFolder:s,BackButton:l,UploadButton:a,AddFolderButton:u}=this.props,{canEdit:d}=n;return r.default.createElement("div",{className:"toolbar--content toolbar--space-save"},r.default.createElement("div",{className:"fill-width"},r.default.createElement("div",{className:"gallery__btn-toolbar flexbox-area-grow"},r.default.createElement("div",{className:"btn-toolbar"},r.default.createElement(l,{folder:n,badges:e,onOpenFolder:i,onMoveFiles:o}),r.default.createElement(a,{canEdit:d}),r.default.createElement(u,{canEdit:d,onCreateFolder:s}),t)),r.default.createElement("div",{className:"gallery__state-buttons"},this.renderSort(),r.default.createElement("div",{className:"btn-group",role:"group","aria-label":"View mode"},this.renderViewChangeButtons()))))}}t.Component=c,c.propTypes={onMoveFiles:o.default.func.isRequired,onCreateFolder:o.default.func.isRequired,onViewChange:o.default.func.isRequired,onOpenFolder:o.default.func.isRequired,onSort:o.default.func.isRequired,folder:o.default.shape({id:o.default.number,title:o.default.string,parentId:o.default.number,canView:o.default.bool,canEdit:o.default.bool}).isRequired,view:o.default.oneOf(["tile","table"]),sort:o.default.string,badges:o.default.arrayOf(o.default.shape({id:o.default.number,message:o.default.node,status:o.default.string})),BackButton:o.default.elementType,UploadButton:o.default.elementType,AddFolderButton:o.default.elementType},c.defaultProps={view:"tile",BackButton:s.default,UploadButton:l.default,AddFolderButton:a.default};t.default=(0,i.connect)((function(e,t){let{sort:n}=t;const{badges:r,sorters:o}=e.assetAdmin.gallery;return""===n&&(n=`${o[0].field},${o[0].direction}`),{badges:r,sorters:o,sort:n}}))(c)},4333:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=f(n(5815)),o=p(n(1594)),i=n(9367),s=n(9040),l=f(n(8737)),a=p(n(2811)),u=f(n(6935)),d=n(5125);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function p(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function f(e){return e&&e.__esModule?e:{default:e}}class h extends o.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this)}componentDidMount(){this.setOverrides(this.props)}componentDidUpdate(e){this.props.isOpen&&!e.isOpen&&this.setOverrides(this.props)}componentWillUnmount(){this.clearOverrides()}setOverrides(e){if(this.props.schemaUrl!==e.schemaUrl&&this.clearOverrides(),e.schemaUrl){const t=Object.assign({},e.fileAttributes);delete t.ID;const n={fields:Object.entries(t).map((e=>{const[t,n]=e;return{name:t,value:n}}))};this.props.actions.schema.setSchemaStateOverrides(e.schemaUrl,n)}}getModalProps(){const e=Object.assign({onSubmit:this.handleSubmit,onLoadingError:this.handleLoadingError,showErrorMessage:!0,responseClassBad:"alert alert-danger",identifier:"AssetAdmin.InsertEmbedModal"},this.props,{className:`insert-embed-modal ${this.props.className}`,size:"lg",onClosed:this.props.onClosed,title:this.props.targetUrl?r.default._t("AssetAdmin.EditTitle","Media from the web"):r.default._t("AssetAdmin.CreateTitle","Insert new media from the web")});return delete e.sectionConfig,delete e.onInsert,delete e.fileAttributes,e}clearOverrides(){this.props.actions.schema.setSchemaStateOverrides(this.props.schemaUrl,null)}handleLoadingError(e){"function"==typeof this.props.onLoadingError&&this.props.onLoadingError(e)}handleSubmit(e,t){switch(t){case"action_addmedia":this.props.onCreate(e);break;case"action_insertmedia":this.props.onInsert(e);break;case"action_cancel":this.props.onClosed()}return Promise.resolve()}render(){const{FormBuilderModalComponent:e}=this.props;return o.default.createElement(e,this.getModalProps())}}t.Component=h,h.propTypes={sectionConfig:u.default.shape({url:u.default.string,form:u.default.object}),isOpen:u.default.bool,onInsert:u.default.func.isRequired,onCreate:u.default.func.isRequired,fileAttributes:u.default.shape({Url:u.default.string,CaptionText:u.default.string,PreviewUrl:u.default.string,Placement:u.default.string,Width:u.default.number,Height:u.default.number}),onClosed:u.default.func.isRequired,className:u.default.string,actions:u.default.object,schemaUrl:u.default.string.isRequired,targetUrl:u.default.string,onLoadingError:u.default.func,FormBuilderModalComponent:u.default.oneOfType([u.default.object,u.default.func])},h.defaultProps={className:"",fileAttributes:{},FormBuilderModalComponent:l.default};t.default=(0,s.connect)((function(e,t){const n=e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name)),r=t.fileAttributes?t.fileAttributes.Url:"",o=n.form.remoteEditForm.schemaUrl,i=r&&(0,d.joinUrlPaths)(o,`/?embedurl=${encodeURIComponent(r)}`),s=n.form.remoteCreateForm.schemaUrl;return{sectionConfig:n,schemaUrl:i||s,targetUrl:r}}),(function(e){return{actions:{schema:(0,i.bindActionCreators)(a,e)}}}))(h)},3517:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=b(n(5815)),o=v(n(1594)),i=b(n(853)),s=b(n(6379)),l=n(9040),a=n(9367),u=n(5381),d=v(n(8795)),c=n(5716),p=b(n(3432)),f=b(n(6923)),h=b(n(6935)),m=b(n(7008)),g=b(n(7675));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}function v(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function b(e){return e&&e.__esModule?e:{default:e}}class _ extends o.Component{constructor(e){super(e),this.handleAddedFile=this.handleAddedFile.bind(this),this.handleFailedUpload=this.handleFailedUpload.bind(this),this.handleSuccessfulUpload=this.handleSuccessfulUpload.bind(this),this.handleSending=this.handleSending.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleUploadComplete=this.handleUploadComplete.bind(this),this.handleCancelUpload=this.handleCancelUpload.bind(this),this.handleRemoveErroredUpload=this.handleRemoveErroredUpload.bind(this),this.canFileUpload=this.canFileUpload.bind(this),this.updateFormData=this.updateFormData.bind(this),this.cacheBustUrl=this.cacheBustUrl.bind(this)}componentDidUpdate(e){(e.data.url&&this.props.data.url!==e.data.url||e.data.version&&this.props.data.version!==e.data.version)&&this.props.actions.previewField.removeFile(e.id)}componentWillUnmount(){this.props.actions.previewField.removeFile(this.props.id)}getDropzoneProps(){const e=this.props.data.uploadFileEndpoint,t=this.props.name,n={url:e&&e.url,method:e&&e.method,paramName:"Upload",clickable:!0,maxFiles:1},r={height:s.default.THUMBNAIL_HEIGHT,width:s.default.THUMBNAIL_WIDTH},o=this.props.securityID;return{name:t,className:["asset-dropzone--button","preview-image-field__container",this.props.className,this.props.extraClass].join(" "),canUpload:e&&this.canEdit(),preview:r,folderId:this.props.data.parentid,options:n,securityID:o,uploadButton:!1,onAddedFile:this.handleAddedFile,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,onUploadComplete:this.handleUploadComplete,canFileUpload:this.canFileUpload,updateFormData:this.updateFormData}}getButtonClasses(e){return(0,f.default)([`preview-image-field__toolbar-button--${e}`,"preview-image-field__toolbar-button"])}updateFormData(e){e.append("ID",this.props.data.id),e.append("Name",this.props.nameValue)}handleSending(e,t){this.props.actions.previewField.updateFile(this.props.id,{xhr:t})}handleSuccessfulUpload(e){const t=JSON.parse(e.xhr.response);"function"==typeof this.props.onAutofill&&(this.props.onAutofill("FileFilename",t.Filename),this.props.onAutofill("FileHash",t.Hash),this.props.onAutofill("FileVariant",t.Variant),t.Name&&this.props.onAutofill(this.props.data.nameField,t.Name))}handleFailedUpload(e,t){this.props.actions.previewField.failUpload(this.props.id,t)}handleAddedFile(e){this.props.actions.previewField.addFile(this.props.id,e)}handleRemoveErroredUpload(){if("function"==typeof this.props.onAutofill){const e=this.props.data.initialValues;this.props.onAutofill("FileFilename",e.FileFilename),this.props.onAutofill("FileHash",e.FileHash),this.props.onAutofill("FileVariant",e.FileVariant)}this.props.actions.previewField.removeFile(this.props.id)}handleCancelUpload(){this.props.upload.xhr&&this.props.upload.xhr.abort(),this.handleRemoveErroredUpload()}canFileUpload(e){const t=this.props.data.initialValues.FileFilename,n=(0,c.getFileExtension)(t),o=(0,c.getFileExtension)(e.name);if(!n||n===o)return!0;const i=r.default._t("AssetAdmin.CONFIRM_CHANGE_EXTENSION","Are you sure you want upload a file with a different extension?");return this.props.confirm(i)}preventDefault(e){e.preventDefault()}canEdit(){return!this.props.readOnly&&!this.props.disabled&&"folder"!==this.props.data.category}handleUploadProgress(e,t){this.props.actions.previewField.updateFile(this.props.id,{progress:t})}handleUploadComplete(e){this.props.actions.previewField.updateStatus(this.props.id,{status:e})}preview(e,t,n){if(e&&"image"!==e)return s.default.DEFAULT_PREVIEW;const r=t.url||n.preview||n.url;if(r){return r.startsWith("data:image/")?r:this.cacheBustUrl(r,n.version)}return null}cacheBustUrl(e){const t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"")||this.props.data.version;if(!1===this.props.bustCache||!t)return e;const n=m.default.parse(e),r={...g.default.parse(n.query),vid:t};return m.default.format({...n,search:g.default.stringify(r)})}renderImage(){const{data:e,upload:t}=this.props;if(!e.mock&&!e.exists&&!t.url)return o.default.createElement("div",{className:"editor__file-preview-message--file-missing"},r.default._t("AssetAdmin.FILE_MISSING","File cannot be found"));const{category:n,progress:i,message:s}=t,l=t.errors?t.errors[0]:null,a=t.status?t.status:null,u=this.preview(n,t,e),d=o.default.createElement("img",{alt:"preview",src:u,className:"editor__thumbnail"}),c=e.url&&!i?o.default.createElement("a",{className:"editor__file-preview-link",href:this.cacheBustUrl(e.url),target:"_blank",rel:"noopener noreferrer"},d):null,p=i>0&&i<100?o.default.createElement("div",{className:"preview-image-field__progress"},o.default.createElement("div",{className:"preview-image-field__progress-bar",style:{width:`${i}%`}})):null;let f=null;if(l||"error"===a){const e=l&&l.value?l.value:r.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error."),t=l&&l.type?l.type:"error";f=o.default.createElement("div",{className:`preview-image-field__message preview-image-field__message--${t}`},e)}else s?f=o.default.createElement("div",{className:`preview-image-field__message preview-image-field__message--${s.type}`},s.value):100===i&&"success"===a&&(f=o.default.createElement("div",{className:"preview-image-field__message preview-image-field__message--success"},r.default._t("AssetAdmin.REPlACE_FILE_SUCCESS","Upload successful, the file will be replaced when you Save."),(i||s)&&o.default.createElement("button",{onClick:this.handleCancelUpload,className:"preview-image-field__message-button btn btn-outline-light",type:"button"},r.default._t("AssetAdmin.REPLACE_FILE_UNDO","Undo"))));return o.default.createElement("div",{className:"editor__thumbnail-container"},c||d,p,f)}render(){const{AssetDropzoneComponent:e}=this.props,t=this.getDropzoneProps();if(this.canEdit())return o.default.createElement(e,t,this.renderImage());const n=["preview-image-field__container",this.props.className,this.props.extraClass];return o.default.createElement("div",{className:n.join(" ")},this.renderImage())}}t.Component=_,_.propTypes={id:h.default.string.isRequired,name:h.default.string,className:h.default.string,extraClass:h.default.string,readOnly:h.default.bool,disabled:h.default.bool,bustCache:h.default.bool,onAutofill:h.default.func,formid:h.default.string,nameValue:h.default.string,data:h.default.shape({id:h.default.number,parentid:h.default.number,version:h.default.number,url:h.default.string,mock:h.default.bool,exists:h.default.bool,preview:h.default.string,category:h.default.string,nameField:h.default.string,uploadFileEndpoint:h.default.shape({url:h.default.string.isRequired,method:h.default.string.isRequired,payloadFormat:h.default.string}),initialValues:h.default.object}).isRequired,upload:h.default.shape({url:h.default.string,progress:h.default.number,xhr:h.default.object,category:h.default.string,message:h.default.shape({type:h.default.string.isRequired,value:h.default.string.isRequired}),status:h.default.string}),actions:h.default.object,securityID:h.default.string,confirm:h.default.func,AssetDropzoneComponent:h.default.oneOfType([h.default.object,h.default.func])},_.defaultProps={extraClass:"",className:"",data:{},upload:{},confirm:e=>window.confirm(e),bustCache:!0,AssetDropzoneComponent:i.default};t.default=(0,l.connect)((function(e,t){const n=e.config.SecurityID,r=t.id,o=e.assetAdmin.previewField[r]||{},i=(0,u.formValueSelector)(t.formid,p.default),{bustCache:s}=e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));return{securityID:n,upload:o,nameValue:i(e,"Name"),bustCache:s}}),(function(e){return{actions:{previewField:(0,a.bindActionCreators)(d,e)}}}))(_)},3965:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(1594)),o=l(n(6935)),i=n(3556),s=l(n(5815));function l(e){return e&&e.__esModule?e:{default:e}}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{onSelect:t,currentWidth:n,originalWidth:o,width:l,text:a}=e;return r.default.createElement(i.Button,{color:"link",size:"sm",onClick:()=>t(l||o),disabled:os.default.inject(s.default._t("AssetAdmin.SET_IMAGE_SIZE_TO",'Set image size to "{preset}"'),{preset:e}))(a)),r.default.createElement("span",{"aria-hidden":"true"},a))},d=e=>{let{imageSizePresets:t,...n}=e;return t?r.default.createElement("ul",{className:"image-size-preset-list"},t.map((e=>r.default.createElement("li",{key:e.text,className:"image-size-preset-list__list-item"},r.default.createElement(u,a({},e,n)))))):null};d.propTypes={onSelect:o.default.func,imageSizePresets:o.default.arrayOf(o.default.shape({text:o.default.string,width:o.default.number})),currentWidth:o.default.number,originalWidth:o.default.number.isRequired};t.default=d},2397:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=c(n(6935)),i=n(5207),s=n(5381),l=c(n(3432)),a=n(9040),u=n(9367),d=c(n(3965));function c(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&this.syncFields(e,r)}syncFields(e,t){const{children:n,active:r,onAutofill:o,data:{ratio:i}}=this.props,s=0===e?1:0,l=n[e].props.name,a=n[s].props.name,u=0===e?1/i:i;o(l,t),r&&o(a,Math.round(t*u))}handlePresetSelect(e){this.syncFields(0,e);const{key:t}=this.props.children[0],n=document.getElementById(t);n&&n.focus()}handleBlur(e,t){this.setState({hasFocus:!1});const n=parseInt(t&&t.target&&t.target.value,10);(!n||n<=0)&&(t.preventDefault(),this.resetDimensions())}handleFocus(){this.setState({hasFocus:!0})}defaultWidth(){const{imageSizePresets:e,data:{originalWidth:t}}=this.props,n=e&&e.find((e=>e.default)),r=n&&n.width||t||600;return t&&t(0,r.cloneElement)(e,{onChange:(e,n)=>this.handleChange(t,e,n),onBlur:e=>this.handleBlur(t,e),onFocus:()=>this.handleFocus(),key:t},e.props.children))),!n&&r.default.createElement(d.default,{originalWidth:parseInt(t,10),currentWidth:o,imageSizePresets:i,onSelect:this.handlePresetSelect}))}}t.Component=h,h.propTypes={children:o.default.array,onAutofill:o.default.func,active:o.default.bool,data:o.default.shape({ratio:o.default.number.isRequired,isRemoteFile:o.default.bool,originalWidth:o.default.number,originalHeight:o.default.number}),current:o.default.shape({width:o.default.oneOfType([o.default.number,o.default.string]),height:o.default.oneOfType([o.default.number,o.default.string])}).isRequired,FieldGroup:o.default.elementType.isRequired,imageSizePresets:o.default.arrayOf(o.default.shape({width:o.default.number,text:o.default.string,default:o.default.bool}))},h.defaultProps={active:!0};t.default=(0,u.compose)((0,a.connect)((function(e,t){let{formid:n}=t;const r=(0,s.formValueSelector)(n,l.default),o=r(e,"Width"),i=r(e,"Height");return{current:{width:o?parseInt(o,10):void 0,heigth:i?parseInt(i,10):void 0},imageSizePresets:e.assetAdmin.modal.imageSizePresets}})),(0,i.inject)(["FieldGroup"]))(h)},9725:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ConnectedUploadField=t.Component=void 0;var r=v(n(5815)),o=y(n(1594)),i=n(9040),s=n(9367),l=n(5207),a=v(n(6379)),u=v(n(2623)),d=v(n(6022)),c=v(n(9247)),p=y(n(1433)),f=y(n(1021)),h=v(n(6935)),m=v(n(4636));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function v(e){return e&&e.__esModule?e:{default:e}}class b extends o.Component{constructor(e){super(e),this.getMaxFiles=this.getMaxFiles.bind(this),this.getFolderId=this.getFolderId.bind(this),this.renderChild=this.renderChild.bind(this),this.handleAddShow=this.handleAddShow.bind(this),this.handleHide=this.handleHide.bind(this),this.handleAddInsert=this.handleAddInsert.bind(this),this.handleInsertMany=this.handleInsertMany.bind(this),this.handleAddedFile=this.handleAddedFile.bind(this),this.handleSending=this.handleSending.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleFailedUpload=this.handleFailedUpload.bind(this),this.handleSuccessfulUpload=this.handleSuccessfulUpload.bind(this),this.handleItemRemove=this.handleItemRemove.bind(this),this.handleReplaceShow=this.handleReplaceShow.bind(this),this.handleChange=this.handleChange.bind(this),this.handleReplace=this.handleReplace.bind(this),this.canEdit=this.canEdit.bind(this),this.canAttach=this.canAttach.bind(this),this.canUpload=this.canUpload.bind(this),this.state={selecting:!1,selectingItem:null}}componentDidMount(){const{id:e,formSchemaFilesHash:t,data:n,value:r,actions:o,files:i}=this.props,s=(0,m.default)(JSON.stringify(r.Files)).toString();if(t!==s)return o.uploadField.setFormSchemaFilesHash(e,s),void o.uploadField.setFiles(e,n.files);o.uploadField.setFiles(e,i)}componentDidUpdate(e){const{id:t,formSchemaFilesHash:n,data:r,files:o,value:{Files:i},actions:{uploadField:{setFormSchemaFilesHash:s,setFiles:l}}}=this.props;(function(e,t){if(e.length!==t.length)return!0;for(let n=0;n!u.includes(e))).length)return;const d=o.map((e=>e.id));d.length===i.length&&0===d.filter((e=>!i.includes(e))).length||l(t,r.files)}getMaxFiles(){const e=this.props.data.multi?this.props.data.maxFiles:1;if(null==e)return null;const t=this.props.files.filter((e=>e.id>0&&(!e.message||"error"!==e.message.type))).length;return Math.max(e-t,0)}getMaxFilesize(){return this.props.data.maxFilesize||null}getFolderId(){const{selectingItem:e}=this.state;return e&&"object"==typeof e?e.parent.id:this.props.data.parentid||0}handleAddedFile(e){const t={...e,uploaded:!0};this.props.actions.uploadField.addFile(this.props.id,t)}handleSending(e,t){this.props.actions.uploadField.updateQueuedFile(this.props.id,e._queuedId,{xhr:t})}handleUploadProgress(e,t){this.props.actions.uploadField.updateQueuedFile(this.props.id,e._queuedId,{progress:t})}handleSuccessfulUpload(e){const t=JSON.parse(e.xhr.response);void 0===t[0].error?this.props.actions.uploadField.succeedUpload(this.props.id,e._queuedId,t[0]):this.handleFailedUpload(e)}handleFailedUpload(e,t){const n=e.xhr&&e.xhr.status?(0,c.default)(e.xhr.status,e.xhr):"";this.props.actions.uploadField.failUpload(this.props.id,e._queuedId,t,n)}handleItemRemove(e,t){this.props.actions.uploadField.removeFile(this.props.id,t)}handleReplaceShow(e,t){this.props.actions.modal.initFormStack("select","admin"),this.setState({selecting:!0,selectingItem:t})}handleChange(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props;if("function"==typeof t.onChange){const n={Files:t.files.filter((e=>e.id)).map((e=>e.id))};t.onChange(e,{id:t.id,value:n})}}handleUploadButton(e){e.preventDefault()}handleAddShow(e){e.preventDefault(),this.props.actions.modal.initFormStack("select","admin"),this.setState({selecting:!0,selectingItem:null})}handleHide(){this.props.actions.modal.reset(),this.setState({selecting:!1,selectingItem:null})}handleAddInsert(e,t,n){return this.props.actions.uploadField.addFile(this.props.id,n),this.handleHide(),Promise.resolve({})}handleInsertMany(e,t){const{selectingItem:n}=this.state;n?this.handleReplace(e,null,t[0]):t.forEach((t=>{this.handleAddInsert(e,null,t)}))}handleReplace(e,t,n){const{selectingItem:r}=this.state,{id:o,actions:{uploadField:{addFile:i,removeFile:s}}}=this.props;if(!r)throw new Error("Tried to replace a file when none was selected.");return s(o,r),i(o,n),this.handleHide(),Promise.resolve({})}canEdit(){return!this.props.disabled&&!this.props.readOnly&&(this.props.data.canUpload||this.props.data.canAttach)}canUpload(){return this.canEdit()&&this.props.data.canUpload}canAttach(){return this.canEdit()&&this.props.data.canAttach}renderDropzone(){const{AssetDropzone:e}=this.props;if(!this.props.data.endpoints.createFile)return null;const t={height:a.default.SMALL_THUMBNAIL_HEIGHT,width:a.default.SMALL_THUMBNAIL_WIDTH},n=this.getMaxFiles(),i=this.getMaxFilesize(),s={url:this.props.data.endpoints.createFile.url,method:this.props.data.endpoints.createFile.method,paramName:"Upload",maxFiles:n,maxFilesize:i,thumbnailWidth:a.default.SMALL_THUMBNAIL_WIDTH,thumbnailHeight:a.default.SMALL_THUMBNAIL_HEIGHT},l=["uploadfield__dropzone"];if(0===n&&l.push("uploadfield__dropzone--hidden"),!this.canEdit())return this.props.files.length?null:o.default.createElement("p",null,r.default._t("AssetAdmin.EMPTY","No files"));const u=this.props.securityId,d=[];return this.canUpload()&&d.push(o.default.createElement("button",{key:"uploadbutton",type:"button",onClick:this.handleUploadButton,className:"uploadfield__upload-button"},r.default._t("AssetAdmin.UPLOADFIELD_UPLOAD_NEW","Upload new"))),this.canAttach()&&(d.length&&d.push(o.default.createElement("span",{key:"uploadjoin",className:"uploadfield__join"},r.default._t("AssetAdmin.OR","or"))),d.push(o.default.createElement("button",{key:"attachbutton",type:"button",onClick:this.handleAddShow,className:"uploadfield__add-button"},r.default._t("AssetAdmin.UPLOADFIELD_CHOOSE_EXISTING","Choose existing")))),o.default.createElement(e,{name:this.props.name,canUpload:this.canUpload(),uploadButton:!1,uploadSelector:".uploadfield__upload-button, .uploadfield__backdrop",folderId:this.props.data.parentid,onAddedFile:this.handleAddedFile,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:t,options:s,securityID:u,className:l.join(" ")},o.default.createElement("div",{className:"uploadfield__backdrop"}),o.default.createElement("span",{className:"uploadfield__droptext"},d))}renderModal(){const{InsertMediaModal:e}=this.props,{selecting:t,selectingItem:n}=this.state,r=this.getMaxFiles(),i=this.getFolderId();return o.default.createElement(e,{title:!1,isOpen:t,onInsert:n?this.handleReplace:this.handleAddInsert,onClosed:this.handleHide,onInsertMany:this.handleInsertMany,maxFiles:n?1:r,type:"select",bodyClassName:"modal__dialog",className:"insert-media-react__dialog-wrapper",fileAttributes:n?{ID:n.id}:null,folderId:i})}renderChild(e,t){const{UploadFieldItem:n}=this.props,r={key:e.id?`file-${e.id}`:`queued-${e.queuedId}`,item:e,name:this.props.name,onRemove:this.handleItemRemove,canEdit:this.canEdit(),onView:this.handleReplaceShow},i=this.props.getItemProps(r,t,this.props);return o.default.createElement(n,i)}render(){return o.default.createElement("div",{className:"uploadfield"},this.renderDropzone(),this.props.files.map(this.renderChild),this.renderModal())}}t.Component=b,b.propTypes={id:h.default.string.isRequired,name:h.default.string.isRequired,onChange:h.default.func,value:h.default.shape({Files:h.default.arrayOf(h.default.number)}),files:h.default.arrayOf(d.default),formSchemaFilesHash:h.default.string,readOnly:h.default.bool,disabled:h.default.bool,data:h.default.shape({files:h.default.arrayOf(d.default),multi:h.default.bool,parentid:h.default.number,canUpload:h.default.bool,canAttach:h.default.bool,maxFiles:h.default.number,endpoints:h.default.object}),UploadFieldItem:h.default.elementType,AssetDropzone:h.default.elementType,InsertMediaModal:h.default.elementType,getItemProps:h.default.func},b.defaultProps={value:{Files:[]},className:"",getItemProps:e=>e};const _=t.ConnectedUploadField=(0,i.connect)((function(e,t){const n=t.id;let r=[],o=null;return e.assetAdmin&&e.assetAdmin.uploadField&&e.assetAdmin.uploadField.fields&&e.assetAdmin.uploadField.fields[n]&&(r=e.assetAdmin.uploadField.fields[n].files||[],o=e.assetAdmin.uploadField.fields[n].formSchemaFilesHash||null),{files:r,securityId:e.config.SecurityID,formSchemaFilesHash:o}}),(function(e){return{actions:{uploadField:(0,s.bindActionCreators)(p,e),modal:(0,s.bindActionCreators)(f,e)}}}))(b);t.default=(0,s.compose)((0,l.inject)(["UploadFieldItem","AssetDropzone","InsertMediaModal"]),u.default)(_)},3058:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=c(n(5815)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),i=c(n(6379)),s=c(n(6022)),l=n(5716),a=c(n(6935)),u=c(n(1990));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function c(e){return e&&e.__esModule?e:{default:e}}class p extends o.Component{constructor(e){super(e),this.handleRemove=this.handleRemove.bind(this),this.handleItemClick=this.handleItemClick.bind(this),this.handleView=this.handleView.bind(this)}getThumbnailStyles(){if(this.isImage()&&(this.exists()||this.uploading())){return{backgroundImage:`url(${this.props.item.smallThumbnail||this.props.item.url||""})`}}return{}}getThumbnailClassNames(){const e=["uploadfield-item__thumbnail"];return this.isImageSmallerThanThumbnail()&&e.push("uploadfield-item__thumbnail--small"),e.join(" ")}getItemClassNames(){const e=["fill-width","uploadfield-item",`uploadfield-item--${this.props.item.category||"none"}`];return this.missing()&&e.push("uploadfield-item--missing"),this.hasError()&&e.push("uploadfield-item--error"),e.join(" ")}hasError(){return!!this.props.item.message&&"error"===this.props.item.message.type}isImage(){return"image"===this.props.item.category}exists(){return this.props.item.exists}uploading(){return this.props.item.queuedId&&!this.saved()}complete(){return this.props.item.queuedId&&this.saved()}saved(){return this.props.item.id>0}missing(){return!this.exists()&&this.saved()}isImageSmallerThanThumbnail(){if(!this.isImage()||this.missing())return!1;const e=this.props.item.width,t=this.props.item.height;return t&&e&&te.every((e=>e&&e.canDelete))},{value:"archive",label:o.default._t("AssetAdmin.BULK_ACTIONS_ARCHIVE","Archive"),className:"font-icon-box",destructive:!0,callback:null,canApply:e=>e.every((e=>e&&e.canDelete))},{value:"edit",label:o.default._t("AssetAdmin.BULK_ACTIONS_EDIT","Edit"),className:"font-icon-edit",destructive:!1,canApply:e=>1===e.length,callback:null},{value:"move",label:o.default._t("AssetAdmin.BULK_ACTIONS_MOVE","Move"),className:"font-icon-folder-move",canApply:e=>e.every((e=>e&&e.canEdit)),destructive:!1,callback:null},{value:"publish",label:o.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH","Publish"),className:"font-icon-rocket",destructive:!1,callback:null,canApply:e=>e.some((e=>e&&e.modified))&&e.every((e=>e.canEdit&&"folder"!==e.type)),confirm:null},{value:"unpublish",label:o.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH","Unpublish"),className:"font-icon-cancel-circled",destructive:!1,callback:null,canApply:e=>e.some((e=>e.published))&&e.every((e=>e.canEdit&&"folder"!==e.type)),confirm:null},{value:"insert",label:o.default._t("AssetAdmin.BULK_ACTIONS_INSERT","Insert"),className:"font-icon-plus-circled btn-primary",destructive:!1,callback:null,canApply:e=>e.length,confirm:null}],BULK_ACTIONS_PLACEHOLDER:o.default._t("AssetAdmin.BULK_ACTIONS_PLACEHOLDER"),SPACE_KEY_CODE:32,RETURN_KEY_CODE:13,DEFAULT_PREVIEW:"framework/client/dist/images/app_icons/generic_92.png",MODAL_MOVE:"MODAL_MOVE"}},7917:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=x(n(1594)),o=A(n(6935)),i=n(9040),s=n(9367),l=A(n(5609)),a=A(n(5815)),u=A(n(6923)),d=x(n(4201)),c=x(n(8918)),p=x(n(1369)),f=x(n(9517)),h=A(n(1869)),m=A(n(5789)),g=A(n(2294)),y=x(n(6303)),v=A(n(6175)),b=A(n(6379)),_=A(n(4350)),E=A(n(6177)),C=x(n(4461)),S=A(n(8268)),w=A(n(4014)),F=A(n(175)),I=A(n(2308));function A(e){return e&&e.__esModule?e:{default:e}}function O(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(O=function(e){return e?n:t})(e)}function x(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=O(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}class D extends r.Component{constructor(e){super(e),this.handleOpenFile=this.handleOpenFile.bind(this),this.handleCloseFile=this.handleCloseFile.bind(this),this.handleDelete=this.handleDelete.bind(this),this.doPublish=this.doPublish.bind(this),this.doUnpublish=this.doUnpublish.bind(this),this.handleUnpublish=this.handleUnpublish.bind(this),this.handleDoSearch=this.handleDoSearch.bind(this),this.handleClearSearch=this.handleClearSearch.bind(this),this.handleSubmitEditor=this.handleSubmitEditor.bind(this),this.handleOpenFolder=this.handleOpenFolder.bind(this),this.handleSort=this.handleSort.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.createEndpoint=this.createEndpoint.bind(this),this.handleBackButtonClick=this.handleBackButtonClick.bind(this),this.handleFolderIcon=this.handleFolderIcon.bind(this),this.handleBrowse=this.handleBrowse.bind(this),this.handleViewChange=this.handleViewChange.bind(this),this.handleUpload=this.handleUpload.bind(this),this.handleUploadQueue=this.handleUploadQueue.bind(this),this.handleCreateFolder=this.handleCreateFolder.bind(this),this.handleMoveFilesSuccess=this.handleMoveFilesSuccess.bind(this),this.refetchFolder=this.refetchFolder.bind(this),this.state={loading:!1,folder:null,files:[],totalCount:0,forceRefetch:!1}}componentDidMount(){this.refetchFolder()}componentDidUpdate(e){(this.props.folderId!==e.folderId||this.props.fileId!==e.fileId&&0!==this.props.fileId||this.state.forceRefetch)&&this.refetchFolder(),this.state.forceRefetch&&this.setState({forceRefetch:!1})}getFolderId(){return null!==this.props.folderId?this.props.folderId:this.state.folder?this.state.folder.id:0}refetchFolder(){const e=this.getFolderId(),t=new URLSearchParams(window.location.search),n=[];t.forEach(((e,t)=>{"page"!==t&&"filter"!==t.substring(0,6)&&"sort"!==t.substring(0,4)||n.push(`${t}=${e}`)}));let r="";n.length&&(r=`?${n.join("&")}`);const o=`${E.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdminOpen").endpoints.read.url}/${e}${r}`;l.default.get(o).then((async e=>{const t=await e.json();this.setState({loading:!1,folder:t,files:t.children.nodes,totalCount:t.children.pageInfo.totalCount})})).catch((async e=>{this.setState({loading:!1,folder:null,files:[],totalCount:0});const t=await(0,w.default)(e);this.props.actions.toasts.error(t)}))}getFiles(){const{queuedFiles:e,folderId:t}=this.props,n=this.state.files,r=[...e.items.filter((e=>!(e.id&&n.find((t=>t.id===e.id))||e.hasOwnProperty("uploadedToFolderId")&&e.uploadedToFolderId!==t))),...n],o=r.filter((e=>"folder"===e.type)),i=r.filter((e=>"folder"!==e.type));return o.concat(i)}handleBrowse(e,t,n){"function"==typeof this.props.onBrowse&&(this.props.onBrowse(e,t,n),this.setState({forceRefetch:!0})),e!==this.getFolderId()&&this.props.actions.gallery.deselectFiles()}handleSetPage(e){this.handleBrowse(this.getFolderId(),this.props.fileId,Object.assign({},this.props.query,{page:e})),this.setState({forceRefetch:!0})}handleDoSearch(e){this.props.actions.gallery.deselectFiles(),this.props.actions.queuedFiles.purgeUploadQueue(),this.handleBrowse(e.currentFolderOnly?this.getFolderId():0,null,{filter:e,view:this.props.query.view})}handleClearSearch(e){this.props.actions.displaySearch.closeSearch(),this.props.actions.gallery.deselectFiles(),this.props.actions.queuedFiles.purgeUploadQueue(),this.refetchFolder();const t=this.state.folder;this.handleOpenFolder(e,t)}handleSort(e){this.handleBrowse(this.getFolderId(),this.props.fileId,{...this.props.query,sort:e,limit:void 0,page:void 0}),this.setState({forceRefetch:!0})}handleViewChange(e){this.handleBrowse(this.getFolderId(),this.props.fileId,Object.assign({},this.props.query,{view:e}))}createEndpoint(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return l.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:this.props.securityId}}:{}))}handleBackButtonClick(e){e.preventDefault(),this.props.actions.gallery.deselectFiles();const t=this.state.folder;t?this.handleOpenFolder(t.parentId||0):this.handleOpenFolder(0)}resetFile(e){e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId),this.props.fileId===e.id&&this.props.resetFileDetails(this.getFolderId(),e.id,this.props.query)}handleFolderIcon(){this.handleOpenFile(this.getFolderId())}handleOpenFile(e){this.handleBrowse(this.getFolderId(),e,this.props.query)}handleSubmitEditor(e,t,n){let r=null;if("action_insert"===t&&"select"===this.props.type){const t=this.getFiles().find((t=>t.id===parseInt(e.ID,10)));return this.props.onInsertMany(null,[t]),this.setState({forceRefetch:!0}),Promise.resolve()}if("function"==typeof this.props.onSubmitEditor){const o=this.findFile(this.props.fileId);r=this.props.onSubmitEditor(e,t,n,o)}else r=n();if(!r)throw new Error("Promise was not returned for submitting");return this.setState({forceRefetch:!0}),r.then((e=>("action_createfolder"===t?"admin"===this.props.type?this.handleOpenFile(e.record.id):this.handleOpenFolder(this.getFolderId()):"action_save"!==t&&"action_publish"!==t||this.getFolderId()===e.record.parent.id||this.handleBrowse(e.record.parent.id,e.record.id,null),e)))}handleCloseFile(){this.handleBrowse(this.getFolderId(),null,this.props.query)}handleOpenFolder(e){const{page:t,filter:n,...r}=this.props.query;this.handleBrowse(e,null,r)}handleDelete(e){this.props.actions.confirmDeletion.deleting();const t=e.map((e=>{const t=this.findFile(e);if(!t)throw new Error(`File selected for deletion cannot be found: ${e}`);return t.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(t.queuedId),t})).map((e=>e.id)),n=this.state.folder,r=n?n.id:0,o=this.props.sectionConfig.endpoints.delete.url;return l.default.post(o,{ids:t},{"X-SecurityID":E.default.get("SecurityID")}).then((()=>{this.handleBrowse(r,null,this.props.query);this.props.queuedFiles.items.filter((e=>t.includes(e.id))).forEach((e=>{e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}));let e="AssetAdmin.BULK_ACTIONS_DELETE_SUCCESS_02",n="%s folders/files were successfully deleted.";this.props.sectionConfig.filesAreVersioned&&this.props.sectionConfig.archiveFiles&&(e="AssetAdmin.BULK_ACTIONS_ARCHIVE_SUCCESS_02",n="%s folders/files were successfully archived."),this.props.actions.toasts.success(a.default.sprintf(a.default._t(e,n),t.length)),this.props.actions.gallery.deselectFiles(),this.refetchFolder()})).catch((async e=>{const t=await(0,w.default)(e);this.props.actions.toasts.error(t)})).finally((()=>this.props.actions.confirmDeletion.reset()))}doUnpublish(e){const t=e.map((e=>{const t=this.findFile(e);if(!t)throw new Error(`File selected for unpublishing cannot be found: ${e}`);if("folder"===t.type)throw new Error("Cannot unpublish folders");return t})),n=t.map((e=>e.id)),r=n.map((e=>`ids[]=${e}`)).join("&");let o=`${this.props.sectionConfig.endpoints.readLiveOwnerCounts.url}?${r}`;return l.default.get(o).then((async e=>{const t=(await e.json()).filter((e=>e.count>0)),n=t.slice(0,4).map((e=>e.message)),r=t.slice(5).length;let o="";if(r>0&&(o=a.default.inject(a.default._t("AssetAdmin.BULK_OWNED_WARNING_REMAINING","And {count} other file(s)"),{count:r})),n.length){const e=[a.default.inject(a.default._t("AssetAdmin.BULK_OWNED_WARNING_HEADING","{count} file(s) are being used by other published content."),{count:n.length}),...n,o,a.default._t("AssetAdmin.BULK_OWNED_WARNING_FOOTER","Unpublishing will only remove files from the published version of the content. They will remain on the draft version. Unpublish anyway?")].filter((e=>e)).join("\n\n");if(!confirm(e))return Promise.reject()}return Promise.resolve()})).then((()=>(o=this.props.sectionConfig.endpoints.unpublish.url,l.default.post(o,{ids:n},{"X-SecurityID":E.default.get("SecurityID")}).catch((async e=>{const t=await(0,w.default)(e);this.props.actions.toasts.error(t)}))))).then((()=>(this.refetchFolder(),t))).catch((async e=>{const t=await(0,w.default)(e);return this.props.actions.toasts.error(t),[]}))}handleUnpublish(e){return this.doUnpublish(e).then((e=>{const{fileId:t}=this.props;this.refetchFolder().then((()=>{t&&e.find((e=>e.id===t))&&this.props.resetFileDetails(this.getFolderId(),t,this.props.query)}))}))}doPublish(e){const t=e.map((e=>{const t=this.findFile(e);if(!t)throw new Error(`File selected for publishing cannot be found: ${e}`);if("folder"===t.type)throw new Error("Cannot publish folders");return t})),n=t.map((e=>e.id)),r=this.props.sectionConfig.endpoints.publish.url;return l.default.post(r,{ids:n},{"X-SecurityID":E.default.get("SecurityID")}).then((()=>(t.forEach((e=>this.resetFile(e))),this.refetchFolder(),t))).catch((async e=>{const t=await(0,w.default)(e);this.props.actions.toasts.error(t)}))}findFile(e){return this.getFiles().find((t=>t.id===parseInt(e,10)))}handleUpload(){}handleUploadQueue(){this.props.fileId&&this.refetchFolder()}handleCreateFolder(){this.props.onBrowse(this.getFolderId(),null,this.props.query,b.default.ACTIONS.CREATE_FOLDER)}handleMoveFilesSuccess(e,t){this.props.queuedFiles.items.filter((e=>t.includes(e.id))).forEach((e=>{e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)})),this.props.actions.gallery.deselectFiles(),this.refetchFolder()}renderGallery(){const{GalleryComponent:e}=this.props,t=this.props.sectionConfig,n=t.endpoints.createFile.url,o=t.endpoints.createFile.method,i=this.props.query&&parseInt(this.props.query.limit||t.limit,10),s=this.props.query&&parseInt(this.props.query.page||1,10),l=this.props.query&&this.props.query.sort,a=this.props.query&&this.props.query.view,u=this.props.query.filter||{},d=this.state.folder,c=this.state.loading;return r.default.createElement(e,{files:this.getFiles(),fileId:this.props.fileId,folderId:this.getFolderId(),folder:d,type:this.props.type,limit:i,page:s,totalCount:this.state.totalCount,view:a,filters:u,createFileApiUrl:n,createFileApiMethod:o,onInsertMany:this.props.onInsertMany,onPublish:this.doPublish,onUnpublish:this.doUnpublish,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSuccessfulUpload:this.handleUpload,onSuccessfulUploadQueue:this.handleUploadQueue,onCreateFolder:this.handleCreateFolder,onMoveFilesSuccess:this.handleMoveFilesSuccess,onClearSearch:this.handleClearSearch,onSort:this.handleSort,onSetPage:this.handleSetPage,onViewChange:this.handleViewChange,sort:l,sectionConfig:t,loading:c,maxFilesSelect:this.props.maxFiles,dialog:this.props.dialog})}renderEditor(){const{sectionConfig:e,viewAction:t,type:n,fileId:o,dialog:i,requireLinkText:s,fileSelected:l,EditorComponent:a}=this.props,{schemaUrl:u,targetId:d}=(0,S.default)({config:e,viewAction:t,folderId:this.getFolderId(),type:n,fileId:o});if(!u)return null;const c=[];s&&c.push({name:"requireLinkText",value:!0}),l&&c.push({name:"fileSelected",value:!0});const p={dialog:i,fileId:d,schemaUrl:u,schemaUrlQueries:c,onClose:this.handleCloseFile,onSubmit:this.handleSubmitEditor,onUnpublish:this.handleUnpublish};return r.default.createElement(a,p)}render(){const{folderId:e,query:t,getUrl:n,type:o,maxFiles:i,toolbarChildren:s,SearchComponent:l,BulkDeleteConfirmationComponent:a}=this.props;if(null===this.state.folder)return null;const d=Boolean(e||(0,y.hasFilters)(t.filter)),c=this.props.sectionConfig.form.fileSearchForm.schemaUrl,p=t.filter||{},f=(0,u.default)("fill-height asset-admin","select"===o&&{"asset-admin--single-select":1===i,"asset-admin--multi-select":1!==i}),h=(0,y.hasFilters)(t.filter)||this.props.showSearch,m=this.props.actions.displaySearch?this.props.actions.displaySearch.toggleSearch:void 0,b=this.state.folder,_={folder:b,query:t,getUrl:n,onBrowse:this.handleBrowse,onFolderIcon:this.handleFolderIcon};return r.default.createElement("div",{className:f},r.default.createElement(g.default,{showBackButton:d,onBackButtonClick:this.handleBackButtonClick},b&&r.default.createElement(I.default,_),r.default.createElement("div",{className:"asset-admin__toolbar-extra pull-xs-right fill-width vertical-align-items"},r.default.createElement(v.default,{toggled:h,onToggle:m}),s)),h&&r.default.createElement(l,{onSearch:this.handleDoSearch,id:"AssetSearchForm",formSchemaUrl:c,onHide:this.handleClearSearch,displayBehavior:"HIDEABLE",filters:p,name:"name"}),r.default.createElement("div",{className:"flexbox-area-grow fill-width fill-height gallery"},this.renderGallery(),this.renderEditor()),r.default.createElement(a,{onConfirm:this.handleDelete,filesAreVersioned:this.props.sectionConfig.filesAreVersioned,archiveFiles:this.props.sectionConfig.archiveFiles}))}}t.Component=D,D.propTypes={dialog:o.default.bool,sectionConfig:_.default,fileId:o.default.number,folderId:o.default.number,resetFileDetails:o.default.func,onBrowse:o.default.func,onReplaceUrl:o.default.func,onInsertMany:o.default.func,getUrl:o.default.func,query:o.default.shape({sort:o.default.string,limit:o.default.oneOfType([o.default.number,o.default.string]),page:o.default.oneOfType([o.default.number,o.default.string]),filter:o.default.object}),onSubmitEditor:o.default.func,type:o.default.oneOf(["insert-media","insert-link","select","admin"]),queuedFiles:o.default.shape({items:o.default.array.isRequired}),filesTotalCount:o.default.number,loading:o.default.bool,actions:o.default.object,maxFiles:o.default.number,fileSelected:o.default.bool,EditorComponent:o.default.oneOfType([o.default.object,o.default.func]),GalleryComponent:o.default.oneOfType([o.default.object,o.default.func]),SearchComponent:o.default.oneOfType([o.default.object,o.default.func]),BulkDeleteConfirmationComponent:o.default.oneOfType([o.default.object,o.default.func])},D.defaultProps={type:"admin",query:{sort:"",limit:null,page:0,filter:{}},maxFiles:null,EditorComponent:h.default,GalleryComponent:m.default,SearchComponent:y.default,BulkDeleteConfirmationComponent:F.default};t.default=(0,s.compose)((0,i.connect)((function(e,t){const{formSchema:n}=e.assetAdmin.modal;return{securityId:e.config.SecurityID,queuedFiles:e.assetAdmin.queuedFiles,showSearch:e.assetAdmin.displaySearch.isOpen,type:n&&n.type||t.type}}),(function(e){return{actions:{gallery:(0,s.bindActionCreators)(d,e),toasts:(0,s.bindActionCreators)(c,e),displaySearch:(0,s.bindActionCreators)(f,e),queuedFiles:(0,s.bindActionCreators)(p,e),confirmDeletion:(0,s.bindActionCreators)(C,e)}}})))(D)},2308:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(1594)),o=a(n(6935)),i=a(n(5815)),s=n(6418),l=n(6303);function a(e){return e&&e.__esModule?e:{default:e}}const u=e=>{let{folder:t,query:n,getUrl:o,onBrowse:s,onFolderIcon:a,PlainBreadcrumbComponent:u}=e;const d=function(){for(var e=arguments.length,t=new Array(e),n=0;n{e.preventDefault(),s(...t)}},c=function(){return o&&o(...arguments)},p=[{text:i.default._t("AssetAdmin.FILES","Files"),href:c(0,null,n),onClick:d(0,null,n)}];if(t&&t.id){t.ancestors&&t.ancestors.forEach((e=>{p.push({text:e.title,href:c(e.id,null,n),onClick:d(e.id,null,n)})}));const e=[{className:"icon font-icon-edit-list",onClick:e=>{e.preventDefault(),a()}}];t.hasRestrictedAccess&&e.push({nodeName:"FileStatusIcon",hasRestrictedAccess:!0}),p.push({text:t.title,href:c(t.id,null,n),onClick:d(t.id,null,n),icons:e})}return(0,l.hasFilters)(n.filter)&&p.push({text:i.default._t("LeftAndMain.SEARCHRESULTS","Search results")}),r.default.createElement(u,{multiline:!0,crumbs:p})};u.propTypes={onBrowse:o.default.func,onFolderIcon:o.default.func,getUrl:o.default.func,query:o.default.shape({sort:o.default.string,limit:o.default.oneOfType([o.default.number,o.default.string]),page:o.default.oneOfType([o.default.number,o.default.string]),filter:o.default.object,view:o.default.string}),folder:o.default.shape({id:o.default.number,title:o.default.string,ancestors:o.default.array,parentId:o.default.number,canView:o.default.bool,canEdit:o.default.bool}),PlainBreadcrumbComponent:o.default.oneOfType([o.default.object,o.default.func])},u.defaultProps={PlainBreadcrumbComponent:s.Component};t.default=u},4736:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0,t.buildUrl=v,t.default=void 0;var r=g(n(1594)),o=n(8926),i=n(9040),s=g(n(6478)),l=h(n(7917)),a=n(5716),u=h(n(7675)),d=h(n(6379)),c=h(n(4350)),p=n(5125),f=h(n(6935));function h(e){return e&&e.__esModule?e:{default:e}}function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}function g(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}const y=Object.keys(d.default.ACTIONS).map((e=>d.default.ACTIONS[e]));function v(e){let{base:t,folderId:n,fileId:r,query:o,action:i}=e;if(i&&-1===y.indexOf(i))throw new Error(`Invalid action provided: ${i}`);let s=null;s=r?(0,p.joinUrlPaths)(t,`show/${n}/${d.default.ACTIONS.EDIT_FILE}/${r}`):n?(0,p.joinUrlPaths)(t,`show/${n}`):t,i===d.default.ACTIONS.CREATE_FOLDER&&(s=(0,p.joinUrlPaths)(t,`show/${n||0}/${i}`));return o&&Object.keys(o).length>0&&(s=`${s}?${u.default.stringify(o)}`),s}class b extends r.Component{constructor(e){super(e),this.handleBrowse=this.handleBrowse.bind(this),this.handleReplaceUrl=this.handleReplaceUrl.bind(this),this.handleResetDetails=this.handleResetDetails.bind(this),this.getUrl=this.getUrl.bind(this)}getUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.default.ACTIONS.EDIT_FILE;const o=parseInt(e||0,10),i=parseInt(t||0,10),s=o!==this.getFolderId(),l=Object.assign({},n);return(s||l.page<=1)&&delete l.page,v({base:`/${this.props.sectionConfig.reactRoutePath}`,folderId:o,fileId:i,query:l,action:r})}getFolderId(){return this.props.router.params&&this.props.router.params.folderId?parseInt(this.props.router.params.folderId,10):0}getFileId(){return this.props.router.params&&this.props.router.params.fileId?parseInt(this.props.router.params.fileId,10):0}getViewAction(){return this.props.router.params&&this.props.router.params.viewAction?this.props.router.params.viewAction:d.default.ACTIONS.EDIT_FILE}getSectionProps(){return{sectionConfig:this.props.sectionConfig,type:"admin",folderId:this.getFolderId(),viewAction:this.getViewAction(),fileId:this.getFileId(),query:this.getQuery(),getUrl:this.getUrl,onBrowse:this.handleBrowse,onReplaceUrl:this.handleReplaceUrl,resetFileDetails:this.handleResetDetails}}getQuery(){return(0,a.decodeQuery)(this.props.router.location.search)}handleBrowse(e,t,n,r){const o=this.getUrl(e,t,n,r);this.props.router.navigate(o)}handleReplaceUrl(e,t,n,r){const o=this.getUrl(e,t,n,r);this.props.router.navigate(o,{replace:!0})}handleResetDetails(e,t,n){const r=this.getUrl(e,t,n),o=this.getUrl(e,null,n);this.props.router.navigate(o,{replace:!0,state:{reset:!0,resetPath:r}})}render(){const{AssetAdminComponent:e}=this.props,t=this.props.router.location.state;return t&&t&&t.reset?r.default.createElement(o.Navigate,{to:t.resetPath,replace:!0}):this.props.sectionConfig?r.default.createElement(e,this.getSectionProps()):null}}t.Component=b,b.propTypes={sectionConfig:c.default,router:s.routerPropTypes,AssetAdminComponent:f.default.oneOfType([f.default.object,f.default.func])},b.defaultProps={AssetAdminComponent:l.default};t.default=(0,s.default)((0,i.connect)((function(e){return{sectionConfig:e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name))}}))(b))},2908:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.AssetAdminStateRouter=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=u(n(6935)),i=n(9040),s=n(4736),l=u(n(6379)),a=n(1021);function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}const c={folderId:null,fileId:null,query:{},action:l.default.ACTIONS.EDIT_FILE};class p extends r.Component{constructor(e){super(e),this.handleBrowse=this.handleBrowse.bind(this),this.getUrl=this.getUrl.bind(this),this.state=Object.assign({},c,{folderId:e.folderId})}getUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.default.ACTIONS.EDIT_FILE;const o=parseInt(e||0,10),i=parseInt(t||0,10),a=this.getFolderId(),u=o!==a&&null!==a,d=Object.assign({},n);return(u||d.page<=1)&&delete d.page,(0,s.buildUrl)({base:this.props.sectionConfig.reactRoutePath,folderId:o,fileId:i,query:d,action:r})}getFolderId(){return null===this.state.folderId?null:parseInt(this.state.folderId||0,10)}getFileId(){return parseInt(this.state.fileId||this.props.fileId||0,10)}getViewAction(){return this.state.action||l.default.ACTIONS.EDIT_FILE}getSectionProps(){const e=Object.assign({},this.props,{folderId:this.getFolderId(),fileId:this.getFileId(),viewAction:this.getViewAction(),query:this.state.query,getUrl:this.getUrl,onBrowse:this.handleBrowse});return delete e.Component,e}handleBrowse(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.default.ACTIONS.EDIT_FILE;if(r&&-1===Object.values(l.default.ACTIONS).indexOf(r))throw new Error(`Invalid action provided: ${r}`);this.state.fileId!==t&&this.props.actions.resetFormStack(),this.setState({folderId:e,fileId:t,query:n,action:r})}render(){const e=this.getSectionProps(),t=this.props.Component;return r.default.createElement(t,e)}}function f(e){return{actions:{resetFormStack:()=>e((0,a.resetFormStack)())}}}t.AssetAdminStateRouter=p,p.propTypes={Component:o.default.elementType,sectionConfig:o.default.shape({url:o.default.string.isRequired}).isRequired,fileId:o.default.number};t.default=function(e){return(0,i.connect)((function(t){const n=t.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));return{Component:e,sectionConfig:n}}),f)(p)}},175:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=_(n(1594)),o=n(9367),i=n(9040),s=v(n(6935)),l=n(5207),a=_(n(4461)),u=_(n(762)),d=_(n(8918)),c=v(n(5815)),p=v(n(6022)),f=v(n(5609)),h=v(n(6177)),m=v(n(4014)),g=v(n(134)),y=v(n(7871));function v(e){return e&&e.__esModule?e:{default:e}}function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}function _(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{LoadingComponent:t,transition:n,files:o,onModalClose:i,onCancel:s,onConfirm:l,filesAreVersioned:a,archiveFiles:d,actions:p}=e;const[v,b]=(0,r.useState)(!0),[_,E]=(0,r.useState)({});(0,r.useEffect)((()=>{const e=h.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"),t=o.map((e=>e.id)).map((e=>`ids[]=${e}`)).join("&"),n=`${e.endpoints.readDescendantCounts.url}?${t}`;b(!0),f.default.get(n).then((async e=>{const t=await e.json();b(!1),E(t)})).catch((async e=>{const t=await(0,m.default)(e);p.toasts.error(t)}))}),[o]);let C=null;const S=a&&d?"AssetAdmin.ARCHIVE":"AssetAdmin.DELETE",w=a&&d?"Archive":"Delete";let F=[{label:c.default._t(S,w),handler:()=>l(o.map((e=>{let{id:t}=e;return t}))),color:"danger"},{label:c.default._t("AssetAdmin.CANCEL","Cancel"),handler:s}];if(v)C=r.default.createElement(t,null);else{const e=_.filter((e=>"folder"===e.type)).length,t=_.filter((e=>"file"===e.type)).length,n=_.reduce(((e,t)=>e+t.count),0),i={topLevelFolderCount:e,topLevelFileCount:t,descendantFileCount:n,filesAreVersioned:a,archiveFiles:d};C=r.default.createElement(y.default,i),t+n>0&&(F=[{label:c.default._t("AssetAdmin.CANCEL","Cancel"),handler:s,color:"primary"},{label:c.default._t(S,w),handler:()=>l(o.map((e=>{let{id:t}=e;return t}))),color:"danger"}])}const I=![u.CANCELING,u.DELETING].includes(n);return r.default.createElement(g.default,{body:C,isOpen:I,actions:F,onCancel:s,onClosed:i,filesAreVersioned:a,archiveFiles:d})};t.Component=C,C.propTypes={LoadingComponent:s.default.elementType,transition:s.default.oneOf(["canceling","deleting",!1]),files:s.default.arrayOf(p.default),descendantFileCounts:s.default.object,onCancel:s.default.func.isRequired,onModalClose:s.default.func.isRequired,onConfirm:s.default.func.isRequired,filesAreVersioned:s.default.bool.isRequired,archiveFiles:s.default.bool.isRequired,actions:s.default.object.isRequired};const S=(0,o.compose)((0,l.inject)(["Loading"],(e=>({LoadingComponent:e}))))(C);t.default=(0,o.compose)((0,i.connect)((e=>{let{assetAdmin:{confirmDeletion:t}}=e;return t}),(e=>({onCancel:()=>e(a.cancel()),onModalClose:()=>e(a.modalClose()),actions:{toasts:(0,o.bindActionCreators)(d,e),confirmation:(0,o.bindActionCreators)(a,e)}}))))((e=>{let{showConfirmation:t,files:n,...o}=e;return t&&n.length>0?r.default.createElement(S,E({},o,{files:n})):null}))},7871:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(5815)),o=s(n(1594)),i=s(n(6935));function s(e){return e&&e.__esModule?e:{default:e}}const l=e=>{let{topLevelFolderCount:t,topLevelFileCount:n,descendantFileCount:i,filesAreVersioned:s,archiveFiles:l}=e,a="AssetAdmin.BULK_ACTIONS_DELETE_WARNING",u="Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.";s&&l&&(a="AssetAdmin.BULK_ACTIONS_ARCHIVE_WARNING",u="Ensure files are removed from content areas prior to archiving them, otherwise they will appear as broken links.");const d=((e,t,n,o,i)=>{const s=t+n;if(s>0){let e="AssetAdmin.BULK_ACTIONS_DELETE_ITEMS_CONFIRM",t=["You're about to delete %s file(s) which may be used in your site's content.","Carefully check the file usage on the files before deleting the file(s)."].join(" ");return o&&i&&(e="AssetAdmin.BULK_ACTIONS_ARCHIVE_ITEMS_CONFIRM",t=["You're about to archive %s file(s) which may be used in your site's content.","Carefully check the file usage on the files before archiving the file(s)."].join(" ")),r.default.sprintf(r.default._t(e,t),s)}if(1===e){let e="AssetAdmin.BULK_ACTIONS_DELETE_FOLDER_CONFIRM",t="Are you sure you want to delete this folder?";return o&&i&&(e="AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDER_CONFIRM",t="Are you sure you want to archive this folder?"),r.default._t(e,t)}let l="AssetAdmin.BULK_ACTIONS_DELETE_FOLDERS_CONFIRM",a="Are you sure you want to delete these folders?";return o&&i&&(l="AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDERS_CONFIRM",a="Are you sure you want to archive these folders?"),r.default._t(l,a)})(t,n,i,s,l);return o.default.createElement(o.default.Fragment,null,o.default.createElement("p",null,d),n+i>0&&o.default.createElement("p",null,r.default._t(a,u)))};l.propTypes={topLevelFolderCount:i.default.number,topLevelFileCount:i.default.number,descendantFileCount:i.default.number},l.defaultProps={topLevelFolderCount:0,topLevelFileCount:0,descendantFileCount:0};t.default=l},134:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(5815)),o=l(n(1594)),i=l(n(6935)),s=n(3556);function l(e){return e&&e.__esModule?e:{default:e}}const a=e=>{let{isOpen:t,body:n,onCancel:i,actions:l,filesAreVersioned:a,archiveFiles:u}=e,d="AssetAdmin.CONFIRM_FILE_DELETION",c="Confirm deletion";return a&&u&&(d="AssetAdmin.CONFIRM_FILE_ARCHIVE",c="Confirm archive"),o.default.createElement(s.Modal,{isOpen:t,toggle:i},o.default.createElement(s.ModalHeader,{toggle:i},r.default._t(d,c)),o.default.createElement(s.ModalBody,null,n),o.default.createElement(s.ModalFooter,null,l.map((e=>{let{label:t,handler:n,color:r}=e;return o.default.createElement(s.Button,{key:t,color:r,onClick:n},t)}))))};a.propTypes={isOpen:i.default.bool.isRequired,body:i.default.node.isRequired,onCancel:i.default.func.isRequired,actions:i.default.arrayOf(i.default.shape({label:i.default.string.isRequired,handler:i.default.func,color:i.default.string})),filesAreVersioned:i.default.bool.isRequired,archiveFiles:i.default.bool.isRequired};t.default=a},1869:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=C(n(5815)),o=n(9040),i=n(9367),s=E(n(1594)),l=C(n(6379)),a=C(n(55)),u=E(n(9077)),d=C(n(6935)),c=n(5207),p=C(n(6177)),f=C(n(5609)),h=E(n(4461)),m=E(n(1021)),g=C(n(6923)),y=C(n(7008)),v=C(n(7675)),b=E(n(1584));function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_=function(e){return e?n:t})(e)}function E(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=_(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function C(e){return e&&e.__esModule?e:{default:e}}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;te.json())).then((e=>{this.setState({file:e})}))}getFormSchemaUrl(){const{schemaUrlQueries:e,schemaUrl:t,fileId:n}=this.props,r=y.default.parse(t),o=e.reduce(((e,t)=>{let{name:n,value:r}=t;return{...e,[n]:r}}),{});return y.default.format({...r,pathname:`${r.path}/${n}`,search:v.default.stringify(o)})}handleAction(e){const t=this.state.file;switch(e.currentTarget.name){case"action_replacefile":this.replaceFile(),e.preventDefault();break;case"action_downloadfile":this.downloadFile(),e.preventDefault();break;case"action_delete":this.props.actions.confirmDeletion.confirm([t]),e.preventDefault()}}handleCancelKeyDown(e){e.keyCode!==l.default.SPACE_KEY_CODE&&e.keyCode!==l.default.RETURN_KEY_CODE||this.handleClose(e)}handleSubmit(e,t,n){const{showingSubForm:r,actions:o}=this.props;return"function"==typeof this.props.onSubmit?this.props.onSubmit(e,t,n).finally((()=>{r&&-1!==["action_save","action_publish"].indexOf(t)&&o.modal.popFormStackEntry()})):n()}handleClose(e){const{showingSubForm:t,onClose:n,actions:r}=this.props;t?r.modal.popFormStackEntry():n(),e&&e.preventDefault()}replaceFile(){const e=document.querySelector(".dz-input-PreviewImage");e&&e.click()}downloadFile(){const e=this.state.file;!function(e,t){const n=document.createElement("a");n.download=t,n.href=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}(e.url,e.name),document.getElementById("Form_fileEditForm_PopoverActions").focus()}handleLoadingError(e){this.setState({loadingForm:!1,loadingError:e.errors[0]})}handleLoadingSuccess(){this.setState({loadingForm:!1,loadingError:null})}handleFetchingSchema(){this.setState({loadingForm:!0})}editorHeader(e){let{SchemaComponent:t,...n}=e;const{dialog:r,nextType:o,showingSubForm:i,actions:l,EditorHeaderComponent:a}=this.props,u=this.getFormSchemaUrl(),d=this.state.file;let c=b.buttonStates.SWITCH;r&&d&&"folder"!==d.type&&(c=i?b.buttonStates.ALWAYS_BACK:b.buttonStates.ONLY_BACK);const{formid:p}=n,f=o&&d&&"folder"!==d.type?()=>{l.modal.stashFormValues(p,u),l.modal.pushFormStackEntry(o)}:void 0,h={onCancel:this.handleClose,showButton:c,onDetails:f};return s.default.createElement(a,h,s.default.createElement(t,n))}createFn(e,t){if("AssetEditorHeaderFieldGroup"===t.name){const n=this.editorHeader,r={key:t.id,SchemaComponent:e,...t};return s.default.createElement(n,r)}return s.default.createElement(e,S({key:t.id},t))}render(){if(!this.state.file)return null;const{FormBuilderLoaderComponent:e}=this.props,t=this.getFormSchemaUrl(),n=(0,g.default)("panel","form--no-dividers","editor",{"editor--asset-dropzone--disable":!this.props.enableDropzone},this.props.className);let o=null;if(this.state.loadingError){let e=this.state.loadingError.value;404===this.state.loadingError.code&&(e=r.default._t("AssetAdmin.FILE_MISSING","File cannot be found")),e||(e=r.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")),o=s.default.createElement("div",{className:"editor__file-preview-message--file-missing"},e)}const i=this.props.loadingComponent;return s.default.createElement("div",{className:n},s.default.createElement("div",{className:"editor__details fill-height"},s.default.createElement(e,{identifier:"AssetAdmin.EditForm",schemaUrl:t,onSubmit:this.handleSubmit,onAction:this.handleAction,onLoadingSuccess:this.handleLoadingSuccess,onLoadingError:this.handleLoadingError,onFetchingSchema:this.handleFetchingSchema,createFn:this.createFn,file:this.state.file}),o,this.state.loadingForm&&s.default.createElement(i,null)))}}t.Component=w,w.propTypes={className:d.default.string,fileId:d.default.number.isRequired,enableDropzone:d.default.bool,dialog:d.default.bool,onClose:d.default.func.isRequired,onSubmit:d.default.func.isRequired,schemaUrl:d.default.string.isRequired,schemaUrlQueries:d.default.arrayOf(d.default.shape({name:d.default.string,value:d.default.any})),actions:d.default.object,showingSubForm:d.default.bool,nextType:d.default.string,EditorHeaderComponent:d.default.oneOfType([d.default.object,d.default.func]),FormBuilderLoaderComponent:d.default.oneOfType([d.default.object,d.default.func])},w.defaultProps={EditorHeaderComponent:b.default,FormBuilderLoaderComponent:a.default};t.default=(0,i.compose)((0,c.inject)(["Loading"],(e=>({loadingComponent:e})),(()=>"AssetAdmin.Editor")),(0,o.connect)((function(e){let{assetAdmin:{gallery:t,modal:n}}=e;return{enableDropzone:t.enableDropzone,nextType:n.formSchema&&n.formSchema.nextType,showingSubForm:n.formSchemaStack&&n.formSchemaStack.length>1}}),(function(e){return{actions:{unsavedForms:(0,i.bindActionCreators)(u,e),confirmDeletion:(0,i.bindActionCreators)(h,e),modal:(0,i.bindActionCreators)(m,e)}}})))(w)},1584:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.buttonStates=void 0;var r=u(n(1594)),o=u(n(5815)),i=u(n(551)),s=u(n(2164)),l=u(n(6935)),a=u(n(6923));function u(e){return e&&e.__esModule?e:{default:e}}const d=e=>t=>{t.preventDefault(),e&&e()},c="ALWAYS_BACK",p="ALWAYS_CANCEL",f="SWITCH",h="ONLY_BACK",m="ONLY_CANCEL",g=t.buttonStates={ALWAYS_BACK:c,ALWAYS_CANCEL:p,SWITCH:f,ONLY_BACK:h,ONLY_CANCEL:m,NONE:"NONE"},y=e=>{let{onCancel:t,onDetails:n,showButton:l,children:u}=e;const g=d(t),y=[c,f,h].indexOf(l)>=0,v=[p,f,m].indexOf(l)>=0,b=(0,a.default)("editor-header__back-button","btn--icon-xl",{"editor-header__back-button--md-below":[f,h].indexOf(l)>=0}),_=(0,a.default)("editor-header__cancel-button","btn--icon-xl",{"editor-header__cancel-button--lg-above":[f,m].indexOf(l)>=0});return r.default.createElement("div",{className:"editor-header"},y&&r.default.createElement(s.default,{className:b,onClick:g}),r.default.createElement("div",{className:"editor-header__field"},u),n&&r.default.createElement(i.default,{onClick:d(n),icon:"edit-list",className:"editor-header__edit",outline:!0},o.default._t("AssetAdmin.DETAILS","Details")),v&&r.default.createElement("div",null,r.default.createElement(i.default,{icon:"cancel",className:_,noText:!0,onClick:g},o.default._t("AssetAdmin.CANCEL"))))};y.propTypes={onCancel:l.default.func,onDetails:l.default.func,showButton:l.default.oneOf(Object.keys(g).map((e=>g[e]))),children:l.default.node};t.default=y},5789:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.galleryViewPropTypes=t.galleryViewDefaultProps=t.default=t.Component=void 0;var r=x(n(1669)),o=x(n(5815)),i=O(n(1594)),s=n(9040),l=n(9367),a=x(n(853)),u=x(n(3229)),d=x(n(2853)),c=x(n(6609)),p=x(n(6379)),f=x(n(6621)),h=O(n(4201)),m=O(n(8918)),g=O(n(1369)),y=O(n(4461)),v=n(4172),b=x(n(4350)),_=x(n(6177)),E=x(n(9247)),C=n(5207),S=x(n(6935)),w=x(n(5609)),F=x(n(5769)),I=x(n(3863));function A(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(A=function(e){return e?n:t})(e)}function O(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=A(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function x(e){return e&&e.__esModule?e:{default:e}}const D={DELETE:"delete",ARCHIVE:"archive",EDIT:"edit",MOVE:"move",PUBLISH:"publish",UNPUBLISH:"unpublish",INSERT:"insert",ADMIN:"admin",SELECT:"select"};class P extends i.Component{constructor(e){super(e),this.handleOpenFolder=this.handleOpenFolder.bind(this),this.handleOpenFile=this.handleOpenFile.bind(this),this.handleSelect=this.handleSelect.bind(this),this.handleAddedFile=this.handleAddedFile.bind(this),this.handlePreviewLoaded=this.handlePreviewLoaded.bind(this),this.handleCancelUpload=this.handleCancelUpload.bind(this),this.handleRemoveErroredUpload=this.handleRemoveErroredUpload.bind(this),this.handleUploadProgress=this.handleUploadProgress.bind(this),this.handleSending=this.handleSending.bind(this),this.handleSort=this.handleSort.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.handleSuccessfulUpload=this.handleSuccessfulUpload.bind(this),this.handleQueueComplete=this.handleQueueComplete.bind(this),this.handleFailedUpload=this.handleFailedUpload.bind(this),this.handleClearSearch=this.handleClearSearch.bind(this),this.handleEnableDropzone=this.handleEnableDropzone.bind(this),this.handleMoveFiles=this.handleMoveFiles.bind(this),this.handleBulkEdit=this.handleBulkEdit.bind(this),this.handleBulkPublish=this.handleBulkPublish.bind(this),this.handleBulkUnpublish=this.handleBulkUnpublish.bind(this),this.handleBulkMove=this.handleBulkMove.bind(this),this.handleBulkInsert=this.handleBulkInsert.bind(this),this.handleBeginSelection=this.handleBeginSelection.bind(this),this.handleGroupSelect=this.handleGroupSelect.bind(this),this.handleClearSelection=this.handleClearSelection.bind(this),this.handleSelectAll=this.handleSelectAll.bind(this),this.toggleSelectConcat=this.toggleSelectConcat.bind(this),this.getSelectableFiles=this.getSelectableFiles.bind(this)}componentDidMount(){this.initSortDropdown(),window.addEventListener("keydown",this.toggleSelectConcat),window.addEventListener("keyup",this.toggleSelectConcat)}componentDidUpdate(e){this.initSortDropdown(),this.initFlushUploadFiles(e)}componentWillUnmount(){window.removeEventListener("keydown",this.toggleSelectConcat),window.removeEventListener("keyup",this.toggleSelectConcat)}initFlushUploadFiles(e){if("tile"!==this.props.view){this.getSortElement().off("change")}e.folderId!==this.props.folderId&&this.props.actions.queuedFiles.purgeUploadQueue()}getSortElement(){return(0,r.default)(this.gallery).find(".gallery__sort .dropdown")}getSearchMessage(e){const t=[];e.name&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEKEYWORDS","with keywords '{name}'")),e.lastEditedFrom&&e.lastEditedTo?t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEEDITEDBETWEEN","last edited between '{lastEditedFrom}' and '{lastEditedTo}'")):e.lastEditedFrom?t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEEDITEDFROM","last edited after '{lastEditedFrom}'")):e.lastEditedTo&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGEEDITEDTO","last edited before '{lastEditedTo}'")),e.appCategory&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGECATEGORY","categorised as '{appCategory}'")),e.currentFolderOnly&&this.props.folder.title&&t.push(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGELIMIT","limited to the folder '{folder}'"));const n=[t.slice(0,-1).join(`${o.default._t("AssetAdmin.JOIN",",")} `),t.slice(-1)].filter((e=>e)).join(` ${o.default._t("AssetAdmin.JOINLAST","and")} `);if(""===n)return"";const r={parts:o.default.inject(n,Object.assign({folder:this.props.folder.title},e,{appCategory:e.appCategory?e.appCategory.toLowerCase():void 0}))};return o.default.inject(o.default._t("AssetAdmin.SEARCHRESULTSMESSAGE","Search results {parts}"),r)}getSelection(e,t){const n=this.getSelectableFiles(),r=[e,t].map((e=>n.findIndex((t=>t.id===e)))).filter((e=>-1!==e)).sort(((e,t)=>e-t));if(2!==r.length)return r.map((e=>n[e].id));const[o,i]=r;return n.filter(((e,t)=>t>=o&&t<=i)).map((e=>e.id))}getSelectableFiles(){const e=this.props.files.filter((e=>e.id));return this.props.type===D.SELECT?e.filter((e=>"folder"!==e.type)):e}handleBulkInsert(e,t){this.props.onInsertMany(e,t)}handleBulkPublish(e,t){const n=t.map((e=>e.id));return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onPublish(n).then((e=>{this.props.actions.gallery.setLoading(!1),this.props.actions.toasts.success(o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH_SUCCESS","%s folders/files were successfully published."),e.length)),this.props.actions.gallery.deselectFiles()}))):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}handleBulkUnpublish(e,t){const n=t.filter((e=>e.published)).map((e=>e.id));return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onUnpublish(n).then((e=>{this.props.actions.gallery.setLoading(!1),this.props.actions.toasts.success(o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH_SUCCESS","%s folders/files were successfully unpublished."),e.length)),this.props.actions.gallery.deselectFiles()}))):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}initSortDropdown(){if("tile"===this.props.view){const e=this.getSortElement();e.chosen({allow_single_deselect:!0,disable_search_threshold:20}),e.off("change"),e.on("change",(()=>e.find(":selected")[0].click()))}}handleSort(e){this.props.actions.queuedFiles.purgeUploadQueue(),this.props.onSort(e)}handleSetPage(e){this.props.onSetPage(e)}handleCancelUpload(e){e.xhr.abort(),this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}handleRemoveErroredUpload(e){this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}handleAddedFile(e){this.props.actions.queuedFiles.addQueuedFile(e)}handlePreviewLoaded(e,t){this.props.actions.queuedFiles.updateQueuedFile(e.queuedId,t)}handleSending(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{xhr:t})}handleUploadProgress(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{progress:t})}handleSuccessfulUpload(e){const t=JSON.parse(e.xhr.response);if(void 0!==t[0].error)return void this.handleFailedUpload(e);this.props.actions.queuedFiles.succeedUpload(e._queuedId,t[0]),this.props.onSuccessfulUpload&&this.props.onSuccessfulUpload(t);const n=this.props.queuedFiles.items.reduce(((e,t)=>100!==t.progress?e+1:e),0);if(!this.props.fileId&&!this.props.selectedFiles.length&&0===n){const e=t.pop();this.props.onOpenFile(e.id)}}handleQueueComplete(){this.props.onSuccessfulUploadQueue&&this.props.onSuccessfulUploadQueue()}handleFailedUpload(e,t){const n=e.xhr&&e.xhr.status?(0,E.default)(e.xhr.status,e.xhr):"";this.props.actions.queuedFiles.failUpload(e._queuedId,t,n)}itemIsSelected(e){return this.props.selectedFiles.indexOf(e)>-1}toggleSelectConcat(e){this.props.actions.gallery.setConcatenateSelect(this.isConcat(e))}isConcat(e){return e.metaKey||e.ctrlKey||e.shiftKey}itemIsHighlighted(e){return this.props.fileId===e}hasOpenedItem(){return!!this.props.fileId}handleClearSearch(e){this.props.onClearSearch(e)}handleGroupSelect(e,t){const{setSelectedFiles:n,selectFiles:r}=this.props.actions.gallery,o=this.getSelectableFiles(),i=e.filter(((t,n)=>e.indexOf(t)===n&&o.find((e=>e.id===t)))),s=this.props.concatenateSelect||this.isConcat(t);if(null!==this.props.maxFilesSelect){let e=i.length;if(s){e=this.props.selectedFiles.filter((e=>!this.props.selectedFiles.includes(e))).concat(this.props.selectedFiles).length}if(e>=this.props.maxFilesSelect)return}s?r(i):n(i)}handleClearSelection(){this.props.actions.gallery.deselectFiles()}handleSelectAll(){const e=this.props.files.map((e=>e.id));this.handleGroupSelect(e,new Event("na"))}handleBeginSelection(e){let t=e.target;for(;t;){if(t.classList.contains("griddle-footer"))return!1;if(t.classList.contains("gallery__main--selectable"))break;t=t.parentNode}return!0}handleOpenFolder(e,t){e.preventDefault(),this.props.onOpenFolder(t.id)}handleOpenFile(e,t){e.preventDefault(),null!==t.created&&(this.props.selectedFiles.length&&1!==this.props.maxFilesSelect||this.props.type!==D.SELECT||this.handleSelect(e,t),this.props.onOpenFile(t.id,t))}handleSelect(e,t){const n=this.props.maxFilesSelect;let r=this.getSelectableFiles().filter((e=>e.id===t.id)).map((e=>e.id));if(1!==n)if(-1===this.props.selectedFiles.indexOf(t.id)){e.shiftKey&&(r=this.getSelection(this.props.lastSelected,t.id));if(this.props.selectedFiles.filter((e=>!r.includes(e))).concat(r).length>n&&null!==n)return;this.props.actions.gallery.selectFiles(r),this.props.actions.gallery.setLastSelected(t.id)}else this.props.actions.gallery.deselectFiles([t.id]),e.shiftKey&&this.props.actions.gallery.setLastSelected(null);else this.props.actions.gallery.setSelectedFiles(r)}handleEnableDropzone(e){this.props.actions.gallery.setEnableDropzone(e)}handleMoveFiles(e,t){const n=this.props.sectionConfig.endpoints.move.url;return w.default.post(n,{ids:t,folderID:e},{"X-SecurityID":_.default.get("SecurityID")}).then((()=>{const n=p.default.MOVE_SUCCESS_DURATION,r=`+${t.length}`;this.props.actions.gallery.setFileBadge(e,r,"success",n),"function"==typeof this.props.onMoveFilesSuccess&&this.props.onMoveFilesSuccess(e,t)})).catch((()=>{this.props.actions.toasts.error(o.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))}))}handleBulkEdit(e,t){this.handleOpenFile(e,t[0])}handleBulkMove(){this.props.actions.gallery.activateModal(p.default.MODAL_MOVE)}renderTransitionBulkActions(){return this.renderBulkActions()}renderBulkActions(){const{type:e,dialog:t,maxFilesSelect:n,files:r,selectedFiles:o,BulkActionsComponent:s,sectionConfig:l}=this.props,a=e===D.SELECT||t?e=>e.value===D.INSERT:e=>e.value!==D.INSERT,u=l.filesAreVersioned&&l.archiveFiles?e=>e.value!==D.DELETE:e=>e.value!==D.ARCHIVE,d=p.default.BULK_ACTIONS.filter(a).filter(u).map((e=>{if(e.callback)return e;switch(e.value){case D.DELETE:case D.ARCHIVE:return{...e,callback:(e,t)=>{this.props.actions.confirmDeletion.confirm(t)},confirm:void 0};case D.EDIT:return{...e,callback:this.handleBulkEdit};case D.MOVE:return{...e,callback:this.handleBulkMove};case D.PUBLISH:return{...e,callback:this.handleBulkPublish};case D.UNPUBLISH:return{...e,callback:this.handleBulkUnpublish};case D.INSERT:return{...e,callback:this.handleBulkInsert,color:"primary"};default:return e}})),c=o.map((e=>r.find((t=>t&&e===t.id)))).filter((e=>e));return c.length>0&&[D.ADMIN,D.SELECT].includes(e)?i.default.createElement(s,{actions:d,items:c,total:n,key:c.length>0,container:this.gallery,showCount:1!==n,onClearSelection:this.handleClearSelection,onSelectAll:this.handleSelectAll}):null}renderGalleryView(){const e="table"===this.props.view?c.default:d.default,t=this.props.files.map((e=>{const t=this.itemIsSelected(e.id),n=this.itemIsHighlighted(e.id),r=(e.queuedId?`queueId${e.queuedId}`:`id${e.id}`)+(t?"--selected":"");return{...e,selected:t,highlighted:n,key:r}})),{type:n,loading:r,dialog:o,page:s,totalCount:l,limit:a,sort:u,selectedFiles:p,badges:f,maxFilesSelect:h,sectionConfig:m}=this.props,g={selectableItems:n===D.SELECT||n===D.ADMIN&&(!h||h>1),selectableFolders:n!==D.SELECT&&!o,files:t,loading:r,page:s,totalCount:l,limit:a,sort:u,selectedFiles:p,badges:f,onSort:this.handleSort,onSetPage:this.handleSetPage,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSelect:this.handleSelect,onCancelUpload:this.handleCancelUpload,onDropFiles:this.handleMoveFiles,onRemoveErroredUpload:this.handleRemoveErroredUpload,onEnableDropzone:this.handleEnableDropzone,sectionConfig:m,canDrag:n===D.ADMIN,maxFilesSelect:h};return i.default.createElement(e,g)}renderToolbar(){const{GalleryToolbar:e,sort:t,view:n,folder:r,onCreateFolder:o,onOpenFolder:s,onViewChange:l}=this.props,a={onMoveFiles:this.handleMoveFiles,onSort:this.handleSort,onCreateFolder:o,onOpenFolder:s,onViewChange:l,view:n,sort:t,folder:r};return i.default.createElement(e,a)}render(){const{folder:e,loading:t,errorMessage:n,noticeMessage:r}=this.props,s=this.props.LoadingComponent;if(!e)return n?i.default.createElement("div",{className:"gallery__error flexbox-area-grow"},i.default.createElement("div",{className:"gallery__error-message"},i.default.createElement("h3",null,o.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error.")),n&&i.default.createElement("p",null,n))):t?i.default.createElement("div",{className:"flexbox-area-grow"},i.default.createElement(s,null)):i.default.createElement("div",{className:"flexbox-area-grow"},i.default.createElement("div",{className:"editor__file-preview-message--file-missing m-t-3"},o.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")));const l=i.default.createElement("div",{className:"gallery_messages"},n&&i.default.createElement(f.default,{value:n,type:"danger"}),r&&i.default.createElement(f.default,{value:r,type:"success"})),u={height:p.default.THUMBNAIL_HEIGHT,width:p.default.THUMBNAIL_WIDTH},d={url:this.props.createFileApiUrl,method:this.props.createFileApiMethod,paramName:"Upload",clickable:"#upload-button",...this.props.sectionConfig.dropzoneOptions},c=this.props.securityId,h=this.props.folder.canEdit&&this.props.enableDropzone,m=["panel","panel--padded","panel--scrollable","gallery__main","fill-height"];this.props.type===D.INSERT&&m.push("insert-media-modal__main");const g=m;return this.hasOpenedItem()&&g.push("gallery__main--has-opened-item"),i.default.createElement("div",{className:"flexbox-area-grow gallery__outer",ref:e=>{this.gallery=e}},this.renderTransitionBulkActions(),i.default.createElement(I.default,{className:m.join(" ")},this.renderToolbar(),i.default.createElement(v.SelectableGroup,{enabled:"tile"===this.props.view&&this.props.type===D.ADMIN,className:"flexbox-area-grow fill-height gallery__main--selectable",onSelection:this.handleGroupSelect,onNonItemClick:this.handleClearSelection,onBeginSelection:this.handleBeginSelection,preventDefault:!1,fixedPosition:!0},i.default.createElement(a.default,{name:"gallery-container",className:"flexbox-area-grow",canUpload:h,onAddedFile:this.handleAddedFile,onPreviewLoaded:this.handlePreviewLoaded,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onQueueComplete:this.handleQueueComplete,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:u,folderId:this.props.folderId,options:d,securityID:c,uploadButton:!1},l,this.renderGalleryView()))),this.props.loading&&i.default.createElement(s,null),i.default.createElement(F.default,{sectionConfig:this.props.sectionConfig,folderId:this.props.folderId,onSuccess:this.props.onMoveFilesSuccess,onOpenFolder:this.props.onOpenFolder}))}}t.Component=P;const M={page:1,limit:15},R={sectionConfig:b.default,loading:S.default.bool,sort:S.default.string,files:S.default.arrayOf(S.default.shape({id:S.default.number,parent:S.default.shape({id:S.default.number})})).isRequired,selectedFiles:S.default.arrayOf(S.default.number),totalCount:S.default.number,page:S.default.number,limit:S.default.number,badges:S.default.arrayOf(S.default.shape({id:S.default.number,message:S.default.node,status:S.default.string})),onOpenFile:S.default.func.isRequired,onOpenFolder:S.default.func.isRequired,onSort:S.default.func.isRequired,onSetPage:S.default.func.isRequired,maxFilesSelect:S.default.number};t.galleryViewDefaultProps=Object.assign({},M,{selectableItems:!1}),t.galleryViewPropTypes=Object.assign({},R,{selectableItems:S.default.bool,selectableFolders:S.default.bool,onSelect:S.default.func,onCancelUpload:S.default.func,onRemoveErroredUpload:S.default.func,onEnableDropzone:S.default.func});P.defaultProps=Object.assign({},M,{type:D.ADMIN,view:"tile",enableDropzone:!0,dialog:!1,BulkActionsComponent:u.default}),P.propTypes=Object.assign({},R,{onSuccessfulUpload:S.default.func,onSuccessfulUploadQueue:S.default.func,onCreateFolder:S.default.func,onMoveFilesSuccess:S.default.func,onPublish:S.default.func,onUnpublish:S.default.func,type:S.default.oneOf(["insert-media","insert-link",D.SELECT,D.ADMIN]),view:S.default.oneOf(["tile","table"]),lastSelected:S.default.number,dialog:S.default.bool,fileId:S.default.number,folderId:S.default.number.isRequired,folder:S.default.shape({id:S.default.number,title:S.default.string,parentId:S.default.number,canView:S.default.bool,canEdit:S.default.bool}),files:S.default.array,errorMessage:S.default.string,actions:S.default.object,securityId:S.default.string,onViewChange:S.default.func.isRequired,createFileApiUrl:S.default.string,createFileApiMethod:S.default.string,search:S.default.object,enableDropzone:S.default.bool,concatenateSelect:S.default.bool,GalleryToolbar:S.default.elementType,sorters:S.default.arrayOf(S.default.shape({field:S.default.string.isRequired,direction:S.default.oneOf(["asc","desc"]).isRequired,label:S.default.string.isRequired})).isRequired,BulkActionsComponent:S.default.oneOfType([S.default.object,S.default.func])});t.default=(0,l.compose)((0,C.inject)(["GalleryToolbar","Loading"],((e,t)=>({GalleryToolbar:e,LoadingComponent:t})),(()=>"AssetAdmin.Gallery")),(0,s.connect)((function(e,t){let{sort:n}=t;const{selectedFiles:r,errorMessage:o,noticeMessage:i,enableDropzone:s,badges:l,concatenateSelect:a,loading:u,sorters:d,lastSelected:c}=e.assetAdmin.gallery;return!n&&d&&d[0]&&(n=`${d[0].field},${d[0].direction}`),{lastSelected:c,selectedFiles:r,errorMessage:o,noticeMessage:i,enableDropzone:s,badges:l,concatenateSelect:a,loading:t.loading||u,queuedFiles:e.assetAdmin.queuedFiles,securityId:e.config.SecurityID,sorters:d,sort:n}}),(function(e){return{actions:{gallery:(0,l.bindActionCreators)(h,e),toasts:(0,l.bindActionCreators)(m,e),queuedFiles:(0,l.bindActionCreators)(g,e),confirmDeletion:(0,l.bindActionCreators)(y,e)}}})))(P)},3863:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=a(n(6923)),i=a(n(2914)),s=a(n(6935)),l=a(n(5799));function a(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}class d extends r.Component{constructor(e){super(e),this.state={dragging:!1},this.mounted=!1,this.handleDrop=this.handleDrop.bind(this)}componentDidMount(){this.mounted=!0,window.addEventListener("drop",this.handleDrop,!0)}componentDidUpdate(){setTimeout((()=>{if(!this.mounted||!this.context.dragDropManager)return;const e=this.context.dragDropManager.monitor.isDragging();this.state.dragging!==e&&this.setState({dragging:e})}))}componentWillUnmount(){this.mounted=!1,window.removeEventListener("drop",this.handleDrop,!0)}handleDrop(){const e=this.context.dragDropManager,t=e&&e.backend;t&&t.isDraggingNativeItem()&&t.endDragNativeItem()}render(){const{className:e,children:t}=this.props;return r.default.createElement("div",{className:(0,o.default)(e,{"gallery__main--dragging":this.state.dragging})},t,r.default.createElement(i.default,null))}}d.contextTypes={dragDropManager:s.default.object},d.propTypes={className:s.default.string,children:s.default.oneOfType([s.default.arrayOf(s.default.node),s.default.node])};t.default=(0,l.default)(d)},9478:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var l=o?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(r,i,l):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),i=(r=n(6935))&&r.__esModule?r:{default:r};function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class l extends o.Component{constructor(e){super(e),this.handleClick=this.handleClick.bind(this)}handleClick(e){e.preventDefault(),"function"==typeof this.props.onClick&&this.props.onClick(this.props.versionid)}render(){let e=null;return"Published"===this.props.status&&(e=o.default.createElement("p",null,o.default.createElement("span",{className:"history-item__status-flag"},this.props.status)," at ",this.props.date_formatted)),o.default.createElement("li",{className:"list-group-item history-item",onClick:this.handleClick},o.default.createElement("p",null,o.default.createElement("span",{className:"history-item__version"},"v.",this.props.versionid),o.default.createElement("span",{className:"history-item__date"},this.props.date_ago," ",this.props.author),this.props.summary),e)}}l.propTypes={versionid:i.default.number.isRequired,summary:i.default.oneOfType([i.default.bool,i.default.string]).isRequired,status:i.default.string,author:i.default.string,date_formatted:i.default.string,date_ago:i.default.string,onClick:i.default.func};t.default=l},9005:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=n(9040),i=d(n(5609)),s=d(n(6177)),l=d(n(9478)),a=d(n(55)),u=d(n(6935));function d(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1];return i.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:s.default.get("SecurityID")}}:{}))}(e.sectionConfig.endpoints.history)}componentDidMount(){this.refreshHistoryIfNeeded()}componentDidUpdate(e){this.refreshHistoryIfNeeded(e)}componentWillUnmount(){clearTimeout(this.timer),this.timer=null}refreshHistoryIfNeeded(e){if(!e&&!this.state.loadedDetails||this.props.data.fileId!==e.data.fileId||this.props.data.latestVersionId!==e.data.latestVersionId){this.setState({loadedDetails:!1});const t=this.props?this.props.data.fileId:e.data.fileId;clearTimeout(this.timer),this.timer=setTimeout((()=>{this.api({fileId:t}).then((e=>{this.timer&&this.setState({history:e,loadedDetails:!0})}))}),250)}}handleClick(e){this.setState({viewDetails:e})}handleBack(e){e.preventDefault(),this.setState({viewDetails:null})}render(){if(!this.state.loadedDetails)return r.default.createElement("div",{className:"history-list history-list--loading"},"Loading...");if(this.state.viewDetails){const e=[this.props.historySchemaUrl,this.props.data.fileId,this.state.viewDetails].join("/"),t=["btn","btn-secondary","btn--icon-xl","btn--no-text","font-icon-left-open-big","history-list__back"].join(" ");return r.default.createElement("div",{className:"history-list"},r.default.createElement("a",{href:"#",className:t,onClick:this.handleBack}),r.default.createElement(a.default,{identifier:"AssetAdmin.HistoryList",schemaUrl:e,formTag:"div"}))}const e=this.state.history||[];return r.default.createElement("div",{className:"history-list"},r.default.createElement("ul",{className:"list-group list-group-flush history-list__list"},e.map((e=>r.default.createElement(l.default,p({key:e.versionid},e,{onClick:this.handleClick}))))))}}t.Component=f,f.propTypes={sectionConfig:u.default.shape({form:u.default.object,historyEndpoint:u.default.shape({url:u.default.string,method:u.default.string,responseFormat:u.default.string})}),historySchemaUrl:u.default.string,data:u.default.object},f.defaultProps={data:{fieldId:0}};t.default=(0,o.connect)((function(e){const t=e.config.sections.find((e=>"SilverStripe\\AssetAdmin\\Controller\\AssetAdmin"===e.name));return{sectionConfig:t,historySchemaUrl:t.form.fileHistoryForm.schemaUrl}}))(f)},6931:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=b(n(5815)),o=v(n(1594)),i=n(9367),s=n(9040),l=b(n(7917)),a=b(n(2908)),u=b(n(1957)),d=v(n(4201)),c=v(n(1021)),p=b(n(8737)),f=b(n(6923)),h=b(n(6935)),m=b(n(8268)),g=b(n(7675));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}function v(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function b(e){return e&&e.__esModule?e:{default:e}}class _ extends o.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this)}componentDidMount(){const{isOpen:e,onBrowse:t,setOverrides:n,fileAttributes:r,folderId:o}=this.props;e?"function"==typeof n&&r.ID&&(n(this.props),t(o,r.ID)):t(o||0)}componentDidUpdate(e){!this.props.isOpen&&e.isOpen&&(this.props.onBrowse(this.props.folderId),this.props.actions.gallery.deselectFiles()),"function"==typeof e.setOverrides&&this.props.isOpen&&!e.isOpen&&(e.setOverrides(this.props),this.props.onBrowse(this.props.folderId,this.props.fileAttributes?this.props.fileAttributes.ID:null))}getSectionProps(){return{...this.props,dialog:!0,toolbarChildren:this.renderToolbarChildren(),onSubmitEditor:this.handleSubmit,onReplaceUrl:this.props.onBrowse}}getModalProps(){const{onHide:e,onInsert:t,sectionConfig:n,schemaUrl:r,className:o,...i}=this.props;return{...i,className:(0,f.default)("insert-media-modal",o),size:"lg",showCloseButton:!1}}handleSubmit(e,t,n,r){return"action_insert"===t?this.props.onInsert(e,r):n()}renderToolbarChildren(){return o.default.createElement("button",{type:"button",className:"close modal__close-button insert-media-modal__close-button",onClick:this.props.onClosed,"aria-label":r.default._t("FormBuilderModal.CLOSE","Close")},o.default.createElement("span",{"aria-hidden":"true"},"×"))}render(){const e=this.getModalProps(),t=this.getSectionProps(),n=this.props.isOpen?o.default.createElement(l.default,t):null;return o.default.createElement(p.default,e,n)}}t.Component=_,_.propTypes={sectionConfig:h.default.shape({url:h.default.string,form:h.default.object}),type:h.default.oneOf(["insert-media","insert-link","select","admin"]),schemaUrl:h.default.string,isOpen:h.default.bool,setOverrides:h.default.func,onInsert:h.default.func.isRequired,fileAttributes:h.default.shape({ID:h.default.number,AltText:h.default.string,Width:h.default.number,Height:h.default.number,Loading:h.default.string,TitleTooltip:h.default.string,Alignment:h.default.string,Description:h.default.string,TargetBlank:h.default.bool}),requireLinkText:h.default.bool,folderId:h.default.number,fileId:h.default.number,viewAction:h.default.string,query:h.default.object,getUrl:h.default.func,onBrowse:h.default.func.isRequired,onClosed:h.default.func,className:h.default.string,actions:h.default.object,maxFiles:h.default.number,fileSelected:h.default.bool},_.defaultProps={className:"",fileAttributes:{},type:"insert-media",folderId:0,maxFiles:1};t.default=(0,i.compose)(a.default,(0,s.connect)((function(e,t){const n=t.sectionConfig;if(!n)return{};let r=0;null!==t.folderId?r=t.folderId:t.folder&&(r=t.folder.id);const o=t.fileAttributes?t.fileAttributes.ID:t.fileId,i=e.assetAdmin.modal.formSchema,s={config:n,viewAction:t.viewAction,folderId:r,type:i&&i.type,fileId:o},{schemaUrl:l,targetId:a}=(0,m.default)(s);if(!l)return{};const u={};t.requireLinkText&&(u.requireLinkText=!0),t.fileSelected&&(u.fileSelected=!0);let d=g.default.stringify(u);return d=d?`?${d}`:"",{schemaUrl:`${l}/${a}${d}`,type:i&&i.type}}),(function(e){return{actions:{gallery:(0,i.bindActionCreators)(d,e),modal:(0,i.bindActionCreators)(c,e)}}})),u.default)(_)},5769:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=m(n(1594)),o=n(9040),i=n(9367),s=m(n(5815)),l=m(n(6379)),a=m(n(6935)),u=n(4201),d=n(8918),c=m(n(8737)),p=m(n(4350)),f=m(n(6177)),h=m(n(5609));function m(e){return e&&e.__esModule?e:{default:e}}class g extends r.default.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this),this.timeout=null}handleSubmit(e){let{FolderID:t}=e;const{selectedFiles:n,onSuccess:r,onClosed:o,setNotice:i,setError:a,setBadge:u}=this.props;let d=this.props.sectionConfig.endpoints.move.url;return h.default.post(d,{ids:n,folderID:t},{"X-SecurityID":f.default.get("SecurityID")}).then((()=>(d=`${this.props.sectionConfig.endpoints.read.url}/${t}`,h.default.get(d)))).then((e=>e.json())).then((e=>{"function"==typeof r&&r(e.id,n),u(e.id,`${n.length}`,"success",l.default.MOVE_SUCCESS_DURATION),i(s.default.sprintf(s.default._t("AssetAdmin.MOVED_ITEMS_TO","Moved %s item(s) to %s"),n.length,e.name),[{label:s.default._t("AssetAdmin.GO_TO_FOLDER","Go to folder"),onClick:()=>this.props.onOpenFolder(e.id)}]),o()})).catch((()=>{a(s.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))}))}render(){const{isOpen:e,onClosed:t,title:n,folderId:o,sectionConfig:i}=this.props,{schemaUrl:s}=i.form.moveForm;return r.default.createElement(c.default,{title:n,isOpen:e,onClosed:t,onSubmit:this.handleSubmit,identifier:"AssetAdmin.MoveForm",schemaUrl:`${s}/${o}`})}}g.propTypes={sectionConfig:p.default,folderId:a.default.number.isRequired,isOpen:a.default.bool,onClosed:a.default.func,setNotice:a.default.func,setBadge:a.default.func,setError:a.default.func,title:a.default.string,onSuccess:a.default.func,onOpenFolder:a.default.func.isRequired,selectedFiles:a.default.array.isRequired},g.defaultProps={isOpen:!1};t.default=(0,i.compose)((0,o.connect)((function(e){const{modal:t,selectedFiles:n}=e.assetAdmin.gallery;return{isOpen:t===l.default.MODAL_MOVE,selectedFiles:n,title:s.default.sprintf(s.default._t("AssetAdmin.MOVE_ITEMS_TO","Move %s item(s) to..."),n.length)}}),(function(e){return{onClosed(){e((0,u.deactivateModal)())},setNotice(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e((0,d.display)({text:t,type:"success",actions:n}))},setError(t){e((0,d.display)({text:t,type:"error"}))},setBadge(){e((0,u.setFileBadge)(...arguments))}}})))(g)},6609:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=p(n(6935)),i=p(n(9888)),s=p(n(5815)),l=p(n(1990)),a=n(5789),u=n(5716),d=n(5207),c=n(9367);function p(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}class h extends r.Component{constructor(e){super(e),this.getColumns=this.getColumns.bind(this),this.handleSort=this.handleSort.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.handleRowClick=this.handleRowClick.bind(this),this.renderSelect=this.renderSelect.bind(this),this.renderTitle=this.renderTitle.bind(this),this.renderStatus=this.renderStatus.bind(this),this.renderNoItemsNotice=this.renderNoItemsNotice.bind(this)}getColumns(){const e=["thumbnail","title","status","size","lastEdited"];return this.props.selectableItems&&e.unshift("selected"),e}getColumnConfig(){return[{columnName:"selected",sortable:!1,displayName:"",cssClassName:"gallery__table-column--select",customComponent:this.renderSelect},{columnName:"thumbnail",sortable:!1,displayName:"",cssClassName:"gallery__table-column--image",customComponent:this.renderThumbnail},{columnName:"title",customCompareFn:()=>0,displayName:s.default._t("File.TITLE","Title"),cssClassName:"gallery__table-column--title",customComponent:this.renderTitle},{columnName:"status",sortable:!1,cssClassName:"sort--disabled",customComponent:this.renderStatus,displayName:s.default._t("File.STATUS","Status")},{columnName:"lastEdited",displayName:s.default._t("File.MODIFIED","Modified"),customComponent:this.renderDate},{columnName:"size",sortable:!1,displayName:s.default._t("File.SIZE","Size"),cssClassName:"sort--disabled",customComponent:this.renderSize}]}getRowMetadata(e){return"gallery__table-row "+(e.highlighted?"gallery__table-row--highlighted":"")}getTableProps(){const[e,t]=this.props.sort.split(",");return{tableClassName:"gallery__table table table-hover",gridClassName:"gallery__main-view--table",rowMetadata:{bodyCssClassName:this.getRowMetadata,key:"key"},sortAscendingComponent:"",sortDescendingComponent:"",useExternal:!0,externalSetPage:this.handleSetPage,externalChangeSort:this.handleSort,externalSetFilter:()=>null,externalSetPageSize:()=>null,externalCurrentPage:this.props.page-1,externalMaxPage:Math.ceil(this.props.totalCount/this.props.limit),externalSortColumn:e,externalSortAscending:"asc"===t,initialSort:e,columns:this.getColumns(),columnMetadata:this.getColumnConfig(),useGriddleStyles:!1,onRowClick:this.handleRowClick,results:this.props.files,customNoDataComponent:this.renderNoItemsNotice}}handleActivate(e,t){"folder"===t.type?this.props.onOpenFolder(e,t):this.props.onOpenFile(e,t)}handleRowClick(e,t){const n=e.props.data;t.currentTarget.classList.contains("gallery__table-column--select")&&(t.stopPropagation(),t.preventDefault(),"function"==typeof this.props.onSelect)?this.props.onSelect(t,n):this.handleActivate(t,n)}handleSort(e,t){const n=t?"asc":"desc";this.props.onSort(`${e},${n}`)}handleSetPage(e){this.props.onSetPage(e+1)}preventFocus(e){e.preventDefault()}renderNoItemsNotice(){return 0!==this.props.files.length||this.props.loading?null:r.default.createElement("p",{className:"gallery__no-item-notice"},s.default._t("AssetAdmin.NOITEMSFOUND"))}renderSize(e){if("folder"===e.rowData.type)return null;const t=(0,u.fileSize)(e.data);return r.default.createElement("span",null,t)}renderStatus(e){let t=[];const n=e.rowData,{VersionedBadge:o}=this.props;return"folder"!==n.type&&(n.draft?t.push({key:"status-draft",status:"draft"}):n.modified&&t.push({key:"status-modified",status:"modified"})),t=t.map((e=>{let{...t}=e;return r.default.createElement(o,t)})),t?r.default.createElement("span",null,t):null}renderProgressBar(e){if(!e.queuedId||e.message&&"error"===e.message.type)return null;if(e.id>0)return r.default.createElement("div",{className:"gallery__progress-bar--complete"});const t={className:"gallery__progress-bar-progress",style:{width:`${e.progress}%`}};return r.default.createElement("div",{className:"gallery__progress-bar"},r.default.createElement("div",t))}renderRestrictedAccess(e){const{hasRestrictedAccess:t}=e,n={fileID:e.id,placement:"top",hasRestrictedAccess:t};return r.default.createElement(l.default,n)}renderTrackedFormUpload(e){const{isTrackedFormUpload:t,hasRestrictedAccess:n}=e,o={fileID:e.id,placement:"top",isTrackedFormUpload:t,hasRestrictedAccess:n};return r.default.createElement(l.default,o)}renderTitle(e){const t=this.renderProgressBar(e.rowData);return r.default.createElement("div",{className:"fill-width"},r.default.createElement("div",{className:"flexbox-area-grow"},r.default.createElement("span",null,e.data),e.rowData.hasRestrictedAccess&&this.renderRestrictedAccess(e.rowData),e.rowData.isTrackedFormUpload&&this.renderTrackedFormUpload(e.rowData)),t)}renderSelect(e){if(this.props.selectableItems&&(this.props.selectableFolders||"folder"!==e.rowData.type)){const t={type:"checkbox",title:s.default._t("AssetAdmin.SELECT"),defaultChecked:e.data,tabIndex:-1,onMouseDown:this.preventFocus};return![null,1].includes(this.props.maxFilesSelect)&&this.props.selectedFiles.length>=this.props.maxFilesSelect&&!e.data&&(t.disabled=!0),r.default.createElement("input",t)}return null}renderDate(e){return"folder"===e.rowData.type?null:(moment.locale(s.default.detectLocale()),r.default.createElement("span",null,moment(e.data).format("L LT")))}renderThumbnail(e){const t=e.data||e.rowData.url,n=e.rowData.queuedId&&!e.rowData.id,o=e.rowData.category||"false",i="gallery__table-image",s=[i],l={};return s.push(`${i}--${o}`),"image"===o&&t&&(l.backgroundImage=`url("${t}")`),n||t||"folder"===o||s.push(`${i}--error`),r.default.createElement("div",{className:s.join(" "),style:l})}render(){return r.default.createElement(i.default,this.getTableProps())}}t.Component=h,h.defaultProps=a.galleryViewDefaultProps,h.propTypes={...a.galleryViewPropTypes,sort:o.default.string.isRequired,VersionedBadge:o.default.elementType};t.default=(0,c.compose)((0,d.inject)(["VersionedBadge"],(e=>({VersionedBadge:e}))))(h)},2853:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=d(n(5815)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594)),i=n(5207),s=n(5789),l=d(n(9888)),a=d(n(6935));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function d(e){return e&&e.__esModule?e:{default:e}}class c extends o.Component{constructor(e){super(e),this.renderItem=this.renderItem.bind(this),this.handleSetPage=this.handleSetPage.bind(this),this.handlePrevPage=this.handlePrevPage.bind(this),this.handleNextPage=this.handleNextPage.bind(this),this.handleDrag=this.handleDrag.bind(this)}handleDrag(e){this.props.onEnableDropzone(!e)}handleSetPage(e){this.props.onSetPage(e+1)}handleNextPage(){const e=this.props.page-1;this.handleSetPage(e+1)}handlePrevPage(){const e=this.props.page-1;0!==e?this.handleSetPage(e-1):this.handleSetPage(e)}folderFilter(e){return"folder"===e.type}fileFilter(e){return"folder"!==e.type}renderPagination(){if(this.props.totalCount<=this.props.limit)return null;const e={setPage:this.handleSetPage,maxPage:Math.ceil(this.props.totalCount/this.props.limit),next:this.handleNextPage,nextText:r.default._t("AssetAdmin.NEXT","Next"),previous:this.handlePrevPage,previousText:r.default._t("AssetAdmin.PREVIOUS","Previous"),currentPage:this.props.page-1,useGriddleStyles:!1};return o.default.createElement("div",{className:"griddle-footer"},o.default.createElement(l.default.GridPagination,e))}renderItem(e){const{File:t,Folder:n,badges:r,sectionConfig:i,selectedFiles:s,selectableItems:l,selectableFolders:a}=this.props,u=r.find((t=>t.id===e.id));let d={sectionConfig:i,key:e.key,selectableKey:e.id,item:e,selectedFiles:s,onDrag:this.handleDrag,badge:u,canDrag:this.props.canDrag};if(e.queuedId&&!e.id){const{onCancelUpload:e,onRemoveErroredUpload:t}=this.props;d={...d,onCancelUpload:e,onRemoveErroredUpload:t}}else{const{onOpenFolder:t,onOpenFile:n}=this.props;d={...d,onActivate:"folder"===e.type?t:n}}if(l&&(a||"folder"!==e.type)){const e=![null,1].includes(this.props.maxFilesSelect)&&this.props.selectedFiles.length>=this.props.maxFilesSelect,t=1===this.props.maxFilesSelect?d.onActivate:this.props.onSelect;d={...d,selectable:!0,onSelect:t,maxSelected:e}}if("folder"===e.type){const{onDropFiles:e}=this.props;return d={...d,onDropFiles:e},o.default.createElement(n,d)}return o.default.createElement(t,d)}render(){return o.default.createElement("div",{className:"gallery__main-view--tile"},o.default.createElement("div",{className:"gallery__folders"},this.props.files.filter(this.folderFilter).map(this.renderItem)),o.default.createElement("div",{className:"gallery__files"},this.props.files.filter(this.fileFilter).map(this.renderItem)),0===this.props.files.length&&!this.props.loading&&o.default.createElement("p",{className:"gallery__no-item-notice"},r.default._t("AssetAdmin.NOITEMSFOUND")),o.default.createElement("div",{className:"gallery__load"},this.renderPagination()))}}t.Component=c,c.defaultProps=s.galleryViewDefaultProps,c.propTypes={...s.galleryViewPropTypes,File:a.default.elementType.isRequired,Folder:a.default.elementType.isRequired};const p=(0,i.inject)(["GalleryItemFile","GalleryItemFolder"],((e,t)=>({File:e,Folder:t})),(()=>"AssetAdmin.Gallery.ThumbnailView"));t.default=p(c)},9329:function(e,t,n){"use strict";var r=a(n(1669)),o=a(n(1594)),i=n(5145),s=n(3398),l=n(5207);function a(e){return e&&e.__esModule?e:{default:e}}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t{e(".js-injector-boot input.entwine-uploadfield").entwine({Component:null,ReactRoot:null,getContainer(){let t=this.siblings(".uploadfield-holder")[0];if(!t){const n=e('
');this.before(n),t=n[0]}return t},onunmatch(){this._super();const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))},onmatch(){const e=this.closest(".cms-content").attr("id"),t=e?{context:e}:{},n=(0,l.loadComponent)("UploadField",t);this.setComponent(n),this._super(),this.hide(),this.refresh()},onclick(e){e.preventDefault()},refresh(){const t=this.getAttributes(),n=e(this).closest("form"),r=this.getComponent();let s=this.getReactRoot();s||(s=(0,i.createRoot)(this.getContainer()),this.setReactRoot(s)),s.render(o.default.createElement(r,u({},t,{onChange:()=>{setTimeout((()=>{n.trigger("change")}),0)},noHolder:!0})))},getAttributes(){const t=e(this).data("state"),n=e(this).data("schema");return(0,s.schemaMerge)(n,t)}})}))},4350:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(6935))&&r.__esModule?r:{default:r};const i=o.default.shape({url:o.default.string,limit:o.default.number,imageRetry:o.default.shape({minRetry:o.default.number,maxRetry:o.default.number,expiry:o.default.number}),form:o.default.object,dropzoneOptions:o.default.object});t.default=i},6022:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(6935))&&r.__esModule?r:{default:r};const i=o.default.shape({canEdit:o.default.bool,canDelete:o.default.bool,canView:o.default.bool,exists:o.default.bool,type:o.default.string,smallThumbnail:o.default.string,thumbnail:o.default.string,width:o.default.number,height:o.default.number,category:o.default.oneOfType([o.default.bool,o.default.string]),id:o.default.number,url:o.default.string,title:o.default.string,progress:o.default.number,visibility:o.default.string,hasRestrictedAccess:o.default.bool,isTrackedFormUpload:o.default.bool});t.default=i},4886:function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;const o=(0,((r=n(2923))&&r.__esModule?r:{default:r}).default)({name:null,canDelete:!1,canEdit:!1,category:null,created:null,extension:null,filename:null,id:0,lastEdited:null,messages:null,owner:{id:0,title:null},parent:{filename:null,id:0,title:null},queuedId:null,size:null,title:null,type:null,url:null,xhr:null,thumbnail:null,smallThumbnail:null,height:null,width:null});t.default=o},8268:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{config:{form:t},viewAction:n,folderId:r,fileId:o,type:l}=e,a=null,u=null;if(n===i)return a=t.folderCreateForm.schemaUrl,u=r,{schemaUrl:a,targetId:u};if(n===s&&o){switch(l){case"insert-media":a=t.fileInsertForm.schemaUrl;break;case"insert-link":a=t.fileEditorLinkForm.schemaUrl;break;case"select":a=t.fileSelectForm.schemaUrl;break;default:a=t.fileEditForm.schemaUrl}return u=o,{schemaUrl:a,targetId:u}}return{}};var r,o=(r=n(6379))&&r.__esModule?r:{default:r};const{CREATE_FOLDER:i,EDIT_FILE:s}=o.default.ACTIONS},9247:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(413===e)return o.default._t("AssetAdmin.ERROR_FILE_SIZE","File size limit exceeded");if(403===e&&t&&"string"==typeof t.response)return t.response;return o.default._t("AssetAdmin.ERROR_DEFAULT","Something went wrong, please try again")};var r,o=(r=n(5815))&&r.__esModule?r:{default:r}},6405:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={CONFIRM_DELETION_ASK:"CONFIRM_DELETION_ASK",CONFIRM_DELETION_CONFIRM:"CONFIRM_DELETION_CONFIRM",CONFIRM_DELETION_CANCEL:"CONFIRM_DELETION_CANCEL",CONFIRM_DELETION_RESET:"CONFIRM_DELETION_RESET",CONFIRM_DELETION_MODAL_CLOSE:"CONFIRM_DELETION_MODAL_CLOSE"}},4461:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cancel=function(){return{type:o.default.CONFIRM_DELETION_CANCEL,payload:{}}},t.confirm=function(e){return{type:o.default.CONFIRM_DELETION_ASK,payload:{files:e}}},t.deleting=function(){return{type:o.default.CONFIRM_DELETION_CONFIRM,payload:{}}},t.modalClose=function(){return{type:o.default.CONFIRM_DELETION_MODAL_CLOSE,payload:{}}},t.reset=function(){return{type:o.default.CONFIRM_DELETION_RESET,payload:{}}};var r,o=(r=n(6405))&&r.__esModule?r:{default:r}},9266:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initialState=t.default=void 0;var r,o=(r=n(6405))&&r.__esModule?r:{default:r},i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var l=o?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(r,i,l):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(762));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}const l=t.initialState={showConfirmation:!1,files:[],transition:i.NO_TRANSITION};t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case o.default.CONFIRM_DELETION_ASK:return{...l,showConfirmation:!0,files:t.payload.files};case o.default.CONFIRM_DELETION_CANCEL:if(e.showConfirmation)return{...e,transition:i.CANCELING};break;case o.default.CONFIRM_DELETION_CONFIRM:if(e.showConfirmation)return{...e,transition:i.DELETING};break;case o.default.CONFIRM_DELETION_MODAL_CLOSE:return{...e,showConfirmation:!1,transition:i.NO_TRANSITION};case o.default.CONFIRM_DELETION_RESET:return l}return e}},762:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NO_TRANSITION=t.DELETING=t.CANCELING=void 0;t.NO_TRANSITION=!1,t.CANCELING="canceling",t.DELETING="deleting"},6533:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={TOGGLE_SEARCH:"TOGGLE_SEARCH",OPEN_SEARCH:"OPEN_SEARCH",CLOSE_SEARCH:"CLOSE_SEARCH"}},9517:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.closeSearch=function(){return{type:o.default.CLOSE_SEARCH,payload:null}},t.openSearch=function(){return{type:o.default.OPEN_SEARCH,payload:null}},t.toggleSearch=function(){return{type:o.default.TOGGLE_SEARCH,payload:null}};var r,o=(r=n(6533))&&r.__esModule?r:{default:r}},2482:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(2923)),o=i(n(6533));function i(e){return e&&e.__esModule?e:{default:e}}const s={isOpen:!1};t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;switch((arguments.length>1?arguments[1]:void 0).type){case o.default.TOGGLE_SEARCH:return(0,r.default)({...e,isOpen:!e.isOpen});case o.default.OPEN_SEARCH:return(0,r.default)({...e,isOpen:!0});case o.default.CLOSE_SEARCH:return(0,r.default)({...e,isOpen:!1});default:return e}}},4913:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=["SET_LAST_SELECTED","SET_SELECTED_FILES","DESELECT_FILES","SELECT_FILES","LOAD_FILE_REQUEST","LOAD_FILE_SUCCESS","HIGHLIGHT_FILES","UPDATE_BATCH_ACTIONS","SET_NOTICE_MESSAGE","SET_ERROR_MESSAGE","SET_ENABLE_DROPZONE","SET_FILE_BADGE","CLEAR_FILE_BADGE","ACTIVATE_MODAL","DEACTIVATE_MODAL","CONCATENATE_SELECT","SET_LOADING"].reduce(((e,t)=>Object.assign(e,{[t]:`GALLERY.${t}`})),{})},4201:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activateModal=function(e){return t=>{t({type:o.default.ACTIVATE_MODAL,payload:e})}},t.clearFileBadge=i,t.deactivateModal=function(){return e=>{e({type:o.default.DEACTIVATE_MODAL})}},t.deselectFiles=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>t({type:o.default.DESELECT_FILES,payload:{ids:e}})},t.loadFile=function(e,t){return n=>{n({type:o.default.LOAD_FILE_SUCCESS,payload:{id:e,file:t}})}},t.selectFiles=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>t({type:o.default.SELECT_FILES,payload:{ids:e}})},t.setConcatenateSelect=function(e){return t=>t({type:o.default.CONCATENATE_SELECT,payload:!!e})},t.setEnableDropzone=function(e){return t=>t({type:o.default.SET_ENABLE_DROPZONE,payload:{enableDropzone:e}})},t.setErrorMessage=function(e){return t=>t({type:o.default.SET_ERROR_MESSAGE,payload:{message:e}})},t.setFileBadge=function(e,t,n,r){return(s,l)=>{const{assetAdmin:a}=l(),u=a.gallery.badges.find((t=>t.id===e));u&&u.timer&&clearTimeout(u.timer);const d=r>0?setTimeout((()=>i(e)(s)),r):null;s({type:o.default.SET_FILE_BADGE,payload:{id:e,message:t,status:n,timer:d}})}},t.setLastSelected=function(e){return t=>{t({type:o.default.SET_LAST_SELECTED,payload:{id:e}})}},t.setLoading=function(e){return t=>{t({type:o.default.SET_LOADING,payload:!!e})}},t.setNoticeMessage=function(e){return t=>t({type:o.default.SET_NOTICE_MESSAGE,payload:{message:e}})},t.setSelectedFiles=function(e){return t=>{t({type:o.default.SET_SELECTED_FILES,payload:{files:e}})}};var r,o=(r=n(4913))&&r.__esModule?r:{default:r};function i(e){return t=>{t({type:o.default.CLEAR_FILE_BADGE,payload:{id:e}})}}},8518:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,{type:t,payload:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t){case i.default.SET_LAST_SELECTED:return{...e,lastSelected:n.id};case i.default.SET_FILE_BADGE:return{...e,badges:e.badges.filter((e=>e.id!==n.id)).concat([n])};case i.default.CLEAR_FILE_BADGE:return{...e,badges:e.badges.filter((e=>e.id!==n.id))};case i.default.SET_ENABLE_DROPZONE:return{...e,enableDropzone:n.enableDropzone};case i.default.SET_NOTICE_MESSAGE:return{...e,noticeMessage:n.message};case i.default.SET_ERROR_MESSAGE:return{...e,errorMessage:n.message};case i.default.LOAD_FILE_SUCCESS:{const t=e.files.find((e=>e.id===n.id));if(t){const o={...t,...n.file};return(0,r.default)({...e,files:e.files.map((e=>e.id===o.id?o:e))})}return e.folder.id===n.id?(0,r.default)({...e,folder:{...e.folder,...n.file}}):e}case i.default.SET_SELECTED_FILES:return(0,r.default)({...e,selectedFiles:Array.isArray(n.files)?n.files:[]});case i.default.SELECT_FILES:{let t=null;return t=null===n.ids?e.files.map((e=>e.id)):e.selectedFiles.concat(n.ids.filter((t=>-1===e.selectedFiles.indexOf(t)))),(0,r.default)({...e,selectedFiles:t})}case i.default.DESELECT_FILES:{let t=null;return t=null===n.ids?[]:e.selectedFiles.filter((e=>-1===n.ids.indexOf(e))),(0,r.default)({...e,selectedFiles:t})}case i.default.ACTIVATE_MODAL:return(0,r.default)({...e,modal:n});case i.default.DEACTIVATE_MODAL:return(0,r.default)({...e,modal:null});case i.default.CONCATENATE_SELECT:return(0,r.default)({...e,concatenateSelect:n});case i.default.SET_LOADING:return(0,r.default)({...e,loading:n});default:return e}};var r=s(n(2923)),o=s(n(5815)),i=s(n(4913));function s(e){return e&&e.__esModule?e:{default:e}}const l={selectedFiles:[],errorMessage:null,noticeMessage:null,enableDropzone:!0,modal:null,badges:[],concatenateSelect:!1,loading:!1,sorters:[{field:"title",direction:"asc",label:o.default._t("AssetAdmin.FILTER_TITLE_ASC","title a-z")},{field:"title",direction:"desc",label:o.default._t("AssetAdmin.FILTER_TITLE_DESC","title z-a")},{field:"lastEdited",direction:"desc",label:o.default._t("AssetAdmin.FILTER_DATE_DESC","newest")},{field:"lastEdited",direction:"asc",label:o.default._t("AssetAdmin.FILTER_DATE_ASC","oldest")}],lastSelected:null}},423:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultImageFactory=t.default=void 0;var r=i(n(1838)),o=i(n(8632));function i(e){return e&&e.__esModule?e:{default:e}}const s={minRetry:0,maxRetry:0,expiry:0,onStatusChange:()=>null,onRetry:()=>null,onReset:()=>null,onTimeout:()=>null},l=(e,t,n)=>{const r=new Image;r.onload=t,r.onerror=n,r.src=e};t.defaultImageFactory=l;t.default=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;this.options={...s,...e},this.factory=t}loadImage(e){return this.options.minRetry&&o.default.lock(e)?this.loadImageLoop(e,this.options.minRetry):null}loadImageLoop(e,t){return this.options.onStatusChange(e,r.default.LOADING),new Promise(((t,n)=>this.factory(e,t,n))).then((()=>this.handleSuccess(e))).catch((()=>this.handleError(e,t)))}handleReset(e,t){this.options.onReset(e),t()}handleTimeout(e,t){const n=setTimeout(e,t);return this.options.onTimeout(n,t),n}handleSuccess(e){o.default.unlock(e),this.options.onStatusChange(e,r.default.SUCCESS)}handleFailure(e){return o.default.unlock(e),this.options.onStatusChange(e,r.default.FAILED),this.options.expiry?new Promise((t=>{this.handleTimeout((()=>this.handleReset(e,t)),1e3*this.options.expiry)})):null}handleError(e,t){return t>this.options.maxRetry?this.handleFailure(e):(this.options.onStatusChange(e,r.default.WAITING),this.handleRetry(e,t))}handleRetry(e,t){const n=new Promise((n=>{this.handleTimeout((()=>n(this.loadImageLoop(e,2*t))),1e3*t)}));return this.options.onRetry(e,t,n),n}setOnRetry(e){this.options.onRetry=e}setOnReset(e){this.options.onReset=e}setOnStatusChange(e){this.options.onStatusChange=e}setOnTimeout(e){this.options.onTimeout=e}}},2153:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={SET_STATUS:"IMAGE_LOAD_SET_STATUS",RESET:"IMAGE_LOAD_RESET"}},769:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadImage=function(e,t){return(n,i)=>{if(!e)return null;if(i().assetAdmin.imageLoad.files.find((t=>t.url===e)))return null;const s={...t,onStatusChange:(e,t)=>n({type:r.default.SET_STATUS,payload:{status:t,url:e}}),onReset:e=>n({type:r.default.RESET,payload:{url:e}})};return new o.default(s).loadImage(e)}};var r=i(n(2153)),o=i(n(423));function i(e){return e&&e.__esModule?e:{default:e}}},8632:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;class n{constructor(){this.urls=[]}lock(e){return!(this.urls.indexOf(e)>=0)&&(this.urls=[...this.urls,e],!0)}unlock(e){this.urls=this.urls.filter((t=>t!==e))}}t.Component=n,window.ss=window.ss||{},window.ss.imagelocker=window.ss.imagelocker||new n;t.default=window.ss.imagelocker},5214:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,{type:t,payload:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t){case o.default.SET_STATUS:return{...e,files:[...e.files.filter((e=>e.url!==n.url)),n]};case o.default.RESET:return{...e,files:[...e.files.filter((e=>e.url!==n.url))]};default:return e}};var r,o=(r=n(2153))&&r.__esModule?r:{default:r};const i={files:[]}},1838:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={DISABLED:"DISABLED",NONE:"NONE",SUCCESS:"SUCCESS",LOADING:"LOADING",WAITING:"WAITING",FAILED:"FAILED"}},2613:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={DEFINE_IMAGE_SIZE_PRESETS:"DEFINE_IMAGE_SIZE_PRESETS",INIT_FORM_SCHEMA_STACK:"INIT_FORM_SCHEMA_STACK",POP_FORM_SCHEMA:"POP_FORM_SCHEMA",PUSH_FORM_SCHEMA:"PUSH_FORM_SCHEMA",RESET:"RESET",RESET_FORM_STACK:"RESET_FORM_STACK"}},1021:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defineImageSizePresets=function(e){return{type:i.default.DEFINE_IMAGE_SIZE_PRESETS,payload:{imageSizePresets:e}}},t.initFormStack=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:i.default.INIT_FORM_SCHEMA_STACK,payload:{formSchema:{type:e,nextType:t}}}},t.popFormStackEntry=function(){return{type:i.default.POP_FORM_SCHEMA}},t.pushFormStackEntry=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:i.default.PUSH_FORM_SCHEMA,payload:{formSchema:{type:e,nextType:t}}}},t.reset=function(){return{type:i.default.RESET}},t.resetFormStack=function(){return{type:i.default.RESET_FORM_STACK}},t.stashFormValues=function(e,t){return(n,i)=>{const l=i(),a=(0,r.default)(l.form.formState,`${e}.values`),u=(0,r.default)(l.form.formSchemas,`${t}.schema.fields`);if(a){const e=Object.keys(a).filter((e=>null!==a[e]&&(0,s.default)(e,u))).map((e=>({name:e,value:a[e]})));n((0,o.setSchemaStateOverrides)(t,{fields:e}))}}};var r=l(n(6104)),o=n(2811),i=l(n(2613)),s=l(n(8896));function l(e){return e&&e.__esModule?e:{default:e}}},8178:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initialState=t.default=void 0;var r,o=(r=n(2613))&&r.__esModule?r:{default:r};const i=t.initialState={imageSizePresets:[],formSchemaStack:[],formSchema:void 0};t.default=function(){return e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,{type:t,payload:n}=arguments.length>1?arguments[1]:void 0;const{formSchemaStack:r}=e;switch(t){case o.default.DEFINE_IMAGE_SIZE_PRESETS:return{...e,imageSizePresets:n.imageSizePresets};case o.default.PUSH_FORM_SCHEMA:return{...e,formSchemaStack:[...r,n.formSchema]};case o.default.INIT_FORM_SCHEMA_STACK:return{...e,formSchemaStack:[n.formSchema]};case o.default.POP_FORM_SCHEMA:return{...e,formSchemaStack:r.slice(0,-1)};case o.default.RESET:return i;case o.default.RESET_FORM_STACK:return{...e,formSchemaStack:r.slice(0,1)};default:return e}}(...arguments),{...e,formSchema:e.formSchemaStack.slice(-1).pop()};var e}},8896:function(e,t){"use strict";function n(e,t){let r;for(r=0;r0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case o.default.PREVIEWFIELD_ADD_FILE:return(0,r.default)(Object.assign({},e,{[t.payload.id]:t.payload.file}));case o.default.PREVIEWFIELD_FAIL_UPLOAD:return(0,r.default)(Object.assign({},e,{[t.payload.id]:Object.assign({},e[t.payload.id],t.payload.message)}));case o.default.PREVIEWFIELD_REMOVE_FILE:return(0,r.default)(Object.assign({},e,{[t.payload.id]:void 0}));case o.default.PREVIEWFIELD_UPDATE_FILE:return(0,r.default)(Object.assign({},e,{[t.payload.id]:Object.assign({},e[t.payload.id],t.payload.data)}));case o.default.PREVIEWFIELD_UPDATE_STATUS:return(0,r.default)(Object.assign({},e,{[t.payload.id]:Object.assign({},e[t.payload.id],t.payload.status)}));default:return e}}},5793:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={ADD_QUEUED_FILE:"ADD_QUEUED_FILE",FAIL_UPLOAD:"FAIL_UPLOAD",PURGE_UPLOAD_QUEUE:"PURGE_UPLOAD_QUEUE",REMOVE_QUEUED_FILE:"REMOVE_QUEUED_FILE",SUCCEED_UPLOAD:"SUCCEED_UPLOAD",UPDATE_QUEUED_FILE:"UPDATE_QUEUED_FILE"}},1369:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addQueuedFile=function(e){return t=>t({type:o.default.ADD_QUEUED_FILE,payload:{file:e}})},t.failUpload=function(e,t,n){return r=>{let i=t.message;return t.errors&&t.errors.length&&(i=t.errors[0]),"string"==typeof t&&(i={value:n||t,type:"error"}),r({type:o.default.FAIL_UPLOAD,payload:{queuedId:e,message:i}})}},t.purgeUploadQueue=function(){return e=>e({type:o.default.PURGE_UPLOAD_QUEUE,payload:null})},t.removeQueuedFile=function(e){return t=>t({type:o.default.REMOVE_QUEUED_FILE,payload:{queuedId:e}})},t.succeedUpload=function(e,t){return n=>n({type:o.default.SUCCEED_UPLOAD,payload:{queuedId:e,json:t}})},t.updateQueuedFile=function(e,t){return n=>n({type:o.default.UPDATE_QUEUED_FILE,payload:{queuedId:e,updates:t}})};var r,o=(r=n(5793))&&r.__esModule?r:{default:r}},8310:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(2923)),o=l(n(4886)),i=l(n(5815)),s=l(n(5793));function l(e){return e&&e.__esModule?e:{default:e}}const a={items:[]};t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s.default.ADD_QUEUED_FILE:return(0,r.default)({...e,items:[...e.items,{...o.default,...t.payload.file}]});case s.default.FAIL_UPLOAD:return(0,r.default)({...e,items:e.items.map((e=>e.queuedId===t.payload.queuedId?{...e,message:t.payload.message}:e))});case s.default.PURGE_UPLOAD_QUEUE:return(0,r.default)({...e,items:e.items.filter((e=>!e.id))});case s.default.REMOVE_QUEUED_FILE:return(0,r.default)({...e,items:e.items.filter((e=>e.queuedId!==t.payload.queuedId))});case s.default.SUCCEED_UPLOAD:return(0,r.default)({...e,items:e.items.map((e=>e.queuedId===t.payload.queuedId?{...e,...t.payload.json,messages:[{value:i.default._t("AssetAdmin.DROPZONE_SUCCESS_UPLOAD"),type:"success",extraClass:"success"}]}:e))});case s.default.UPDATE_QUEUED_FILE:return(0,r.default)({...e,items:e.items.map((e=>e.queuedId===t.payload.queuedId?{...e,...t.payload.updates}:e))});default:return e}}},9918:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH:"UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH",UPLOADFIELD_ADD_FILE:"UPLOADFIELD_ADD_FILE",UPLOADFIELD_SET_FILES:"UPLOADFIELD_SET_FILES",UPLOADFIELD_REMOVE_FILE:"UPLOADFIELD_REMOVE_FILE",UPLOADFIELD_UPLOAD_FAILURE:"UPLOADFIELD_UPLOAD_FAILURE",UPLOADFIELD_UPLOAD_SUCCESS:"UPLOADFIELD_UPLOAD_SUCCESS",UPLOADFIELD_UPDATE_QUEUED_FILE:"UPLOADFIELD_UPDATE_QUEUED_FILE"}},1433:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addFile=function(e,t){return n=>n({type:o.default.UPLOADFIELD_ADD_FILE,payload:{fieldId:e,file:t}})},t.failUpload=function(e,t,n,r){return i=>{let s=n.message;return"string"==typeof n&&(s={value:r||n,type:"error"}),i({type:o.default.UPLOADFIELD_UPLOAD_FAILURE,payload:{fieldId:e,queuedId:t,message:s}})}},t.removeFile=function(e,t){return n=>n({type:o.default.UPLOADFIELD_REMOVE_FILE,payload:{fieldId:e,file:t}})},t.setFiles=function(e,t){return n=>n({type:o.default.UPLOADFIELD_SET_FILES,payload:{fieldId:e,files:t}})},t.setFormSchemaFilesHash=function(e,t){return n=>n({type:o.default.UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH,payload:{fieldId:e,hash:t}})},t.succeedUpload=function(e,t,n){return r=>r({type:o.default.UPLOADFIELD_UPLOAD_SUCCESS,payload:{fieldId:e,queuedId:t,json:n}})},t.updateQueuedFile=function(e,t,n){return r=>r({type:o.default.UPLOADFIELD_UPDATE_QUEUED_FILE,payload:{fieldId:e,queuedId:t,updates:n}})};var r,o=(r=n(9918))&&r.__esModule?r:{default:r}},2726:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(4886)),o=s(n(6595)),i=s(n(9918));function s(e){return e&&e.__esModule?e:{default:e}}const l={fields:{}},a={formSchemaFilesHash:null,files:[]};t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;const n=(0,o.default)(e,t,a);switch(t.type){case i.default.UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH:return n((()=>({formSchemaFilesHash:t.payload.hash})));case i.default.UPLOADFIELD_ADD_FILE:return n((e=>e.files.find((e=>e.id===t.payload.file.id))?e:{...e,files:[...e.files,{...r.default,...t.payload.file}]}));case i.default.UPLOADFIELD_SET_FILES:return n((()=>({files:t.payload.files})));case i.default.UPLOADFIELD_UPLOAD_FAILURE:return n((e=>({files:e.files.map((e=>e.queuedId===t.payload.queuedId?Object.assign({},e,{message:t.payload.message}):e))})));case i.default.UPLOADFIELD_REMOVE_FILE:return n((e=>({files:e.files.filter((e=>!(t.payload.file.queuedId&&e.queuedId===t.payload.file.queuedId||t.payload.file.id&&e.id===t.payload.file.id)))})));case i.default.UPLOADFIELD_UPLOAD_SUCCESS:return n((e=>({files:e.files.map((e=>e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.json):e))})));case i.default.UPLOADFIELD_UPDATE_QUEUED_FILE:return n((e=>({files:e.files.map((e=>e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.updates):e))})));default:return e}}},1991:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(1594)),o=i(n(5815));function i(e){return e&&e.__esModule?e:{default:e}}t.default=e=>t=>{const n=t.onClick,i={...t,onClick(e,r){const{owners:i}=t.data;let s=null;s=i&&parseInt(i,10)>0?[o.default.inject(o.default._t("AssetAdmin.SINGLE_OWNED_WARNING_1","This file is being used in {count} other published section(s)."),{count:i}),o.default._t("AssetAdmin.SINGLE_OWNED_WARNING_2","Ensure files are removed from content areas prior to unpublishing them. Otherwise, they will appear as broken links."),o.default._t("AssetAdmin.SINGLE_OWNED_WARNING_3","Do you want to unpublish this file anyway?")].join("\n\n"):o.default._t("AssetAdmin.CONFIRMUNPUBLISH","Are you sure you want to unpublish this record?"),confirm(s)?n(e,r):e.preventDefault()}};return r.default.createElement(e,i)}},315:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disabledTreeDropdownField=t.default=void 0;var r,o=(r=n(1594))&&r.__esModule?r:{default:r},i=n(9040),s=n(9367),l=n(7818);const a=e=>t=>{const{disabledIDs:n}=t,r=t.findTreeByPath||l.findTreeByPath,i={...t,findTreeByPath(e,t){const o=r(e,t),i=t.some((e=>n.includes(e)));return o?{...o,children:o.children.map((e=>({...e,disabled:i||n.includes(e.id)})))}:null}};return o.default.createElement(e,i)};t.disabledTreeDropdownField=a;const u=(0,s.compose)((0,i.connect)((e=>({disabledIDs:e.assetAdmin.gallery.selectedFiles}))),a);t.default=u},1804:function(e,t,n){"use strict";var r=n(5228),o={};function i(e,t,n,r,o,i,s,l){if(!e){var a;if(void 0===t)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,i,s,l],d=0;(a=new Error(t.replace(/%s/g,(function(){return u[d++]})))).name="Invariant Violation"}throw a.framesToPop=1,a}}var s="mixins";e.exports=function(e,t,n){var l=[],a={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},u={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},d={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n>>2]>>>24-i%4*8&255;t[r+i>>>2]|=s<<24-(r+i)%4*8}else for(var l=0;l>>2]=n[l>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},p=d.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},f=d.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},h=l.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,s=this.blockSize,l=i/(4*s),a=(l=t?e.ceil(l):e.max((0|l)-this._minBufferSize,0))*s,d=e.min(4*a,i);if(a){for(var c=0;c>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,s=e[t+0],a=e[t+1],f=e[t+2],h=e[t+3],m=e[t+4],g=e[t+5],y=e[t+6],v=e[t+7],b=e[t+8],_=e[t+9],E=e[t+10],C=e[t+11],S=e[t+12],w=e[t+13],F=e[t+14],I=e[t+15],A=i[0],O=i[1],x=i[2],D=i[3];A=u(A,O,x,D,s,7,l[0]),D=u(D,A,O,x,a,12,l[1]),x=u(x,D,A,O,f,17,l[2]),O=u(O,x,D,A,h,22,l[3]),A=u(A,O,x,D,m,7,l[4]),D=u(D,A,O,x,g,12,l[5]),x=u(x,D,A,O,y,17,l[6]),O=u(O,x,D,A,v,22,l[7]),A=u(A,O,x,D,b,7,l[8]),D=u(D,A,O,x,_,12,l[9]),x=u(x,D,A,O,E,17,l[10]),O=u(O,x,D,A,C,22,l[11]),A=u(A,O,x,D,S,7,l[12]),D=u(D,A,O,x,w,12,l[13]),x=u(x,D,A,O,F,17,l[14]),A=d(A,O=u(O,x,D,A,I,22,l[15]),x,D,a,5,l[16]),D=d(D,A,O,x,y,9,l[17]),x=d(x,D,A,O,C,14,l[18]),O=d(O,x,D,A,s,20,l[19]),A=d(A,O,x,D,g,5,l[20]),D=d(D,A,O,x,E,9,l[21]),x=d(x,D,A,O,I,14,l[22]),O=d(O,x,D,A,m,20,l[23]),A=d(A,O,x,D,_,5,l[24]),D=d(D,A,O,x,F,9,l[25]),x=d(x,D,A,O,h,14,l[26]),O=d(O,x,D,A,b,20,l[27]),A=d(A,O,x,D,w,5,l[28]),D=d(D,A,O,x,f,9,l[29]),x=d(x,D,A,O,v,14,l[30]),A=c(A,O=d(O,x,D,A,S,20,l[31]),x,D,g,4,l[32]),D=c(D,A,O,x,b,11,l[33]),x=c(x,D,A,O,C,16,l[34]),O=c(O,x,D,A,F,23,l[35]),A=c(A,O,x,D,a,4,l[36]),D=c(D,A,O,x,m,11,l[37]),x=c(x,D,A,O,v,16,l[38]),O=c(O,x,D,A,E,23,l[39]),A=c(A,O,x,D,w,4,l[40]),D=c(D,A,O,x,s,11,l[41]),x=c(x,D,A,O,h,16,l[42]),O=c(O,x,D,A,y,23,l[43]),A=c(A,O,x,D,_,4,l[44]),D=c(D,A,O,x,S,11,l[45]),x=c(x,D,A,O,I,16,l[46]),A=p(A,O=c(O,x,D,A,f,23,l[47]),x,D,s,6,l[48]),D=p(D,A,O,x,v,10,l[49]),x=p(x,D,A,O,F,15,l[50]),O=p(O,x,D,A,g,21,l[51]),A=p(A,O,x,D,S,6,l[52]),D=p(D,A,O,x,h,10,l[53]),x=p(x,D,A,O,E,15,l[54]),O=p(O,x,D,A,a,21,l[55]),A=p(A,O,x,D,b,6,l[56]),D=p(D,A,O,x,I,10,l[57]),x=p(x,D,A,O,y,15,l[58]),O=p(O,x,D,A,w,21,l[59]),A=p(A,O,x,D,m,6,l[60]),D=p(D,A,O,x,C,10,l[61]),x=p(x,D,A,O,f,15,l[62]),O=p(O,x,D,A,_,21,l[63]),i[0]=i[0]+A|0,i[1]=i[1]+O|0,i[2]=i[2]+x|0,i[3]=i[3]+D|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;n[o>>>5]|=128<<24-o%32;var i=e.floor(r/4294967296),s=r;n[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(o+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(n.length+1),this._process();for(var l=this._hash,a=l.words,u=0;u<4;u++){var d=a[u];a[u]=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8)}return l},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,r,o,i,s){var l=e+(t&n|~t&r)+o+s;return(l<>>32-i)+t}function d(e,t,n,r,o,i,s){var l=e+(t&r|n&~r)+o+s;return(l<>>32-i)+t}function c(e,t,n,r,o,i,s){var l=e+(t^n^r)+o+s;return(l<>>32-i)+t}function p(e,t,n,r,o,i,s){var l=e+(n^(t|~r))+o+s;return(l<>>32-i)+t}t.MD5=i._createHelper(a),t.HmacMD5=i._createHmacHelper(a)}(Math),r.MD5)},4639:function(e,t,n){var r=n(4333),o=n(4160);void 0===o.InsertEmbedModal&&(o.InsertEmbedModal=r),e.exports=r},6166:function(e,t,n){var r=n(6931),o=n(4160);void 0===o.InsertMediaModal&&(o.InsertMediaModal=r),e.exports=r},4160:function(e,t,n){"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},493:function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n0}},{key:"getMetadataColumnProperty",value:function(e,t,n){var r=this.getColumnMetadataByName(e);return null==r?n:r.hasOwnProperty(t)?r[t]:n}},{key:"orderColumns",value:function(e){var t=this;return l(e,(function(e){var n=s(t.columnMetadata,{columnName:e});return null==n||isNaN(n.order)?100:n.order}))}},{key:"getColumns",value:function(){var e=0===this.filteredColumns.length?this.allColumns:this.filteredColumns;return e=a(e,this.metadataColumns),e=this.orderColumns(e)}}]),e}();e.exports=u},3715:function(e,t,n){"use strict";var r=n(1594),o=n(2306)({getDefaultProps:function(){return{placeholderText:""}},render:function(){return"function"!=typeof this.props.customFilterComponent?(console.log("Couldn't find valid template."),r.createElement("div",null)):r.createElement(this.props.customFilterComponent,{changeFilter:this.props.changeFilter,results:this.props.results,currentResults:this.props.currentResults,placeholderText:this.props.placeholderText})}});e.exports=o},8465:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t0&&(e=r.createElement("button",{type:"button",onClick:this.props.previous,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 0 0 10px"}:null},this.props.previousIconComponent,this.props.previousText)),this.props.currentPage!==this.props.maxPage-1&&(t=r.createElement("button",{type:"button",onClick:this.props.next,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 10px 0 0"}:null},this.props.nextText,this.props.nextIconComponent));var n=null,o=null,s=null;if(!0===this.props.useGriddleStyles){var l={float:"left",minHeight:"1px",marginTop:"5px"};s=i({textAlign:"right",width:"34%"},l),o=i({textAlign:"center",width:"33%"},l),n=i({width:"33%"},l)}for(var a=[],u=1;u<=this.props.maxPage;u++)a.push(r.createElement("option",{value:u,key:u},u));return r.createElement("div",{style:this.props.useGriddleStyles?{minHeight:"35px"}:null},r.createElement("div",{className:this.props.previousClassName,style:n},e),r.createElement("div",{className:"griddle-page",style:o},r.createElement("select",{value:this.props.currentPage+1,onChange:this.pageChange},a)," / ",this.props.maxPage),r.createElement("div",{className:this.props.nextClassName,style:s},t))}});e.exports=s},1507:function(e,t,n){"use strict";var r=n(1594),o=n(2306),i=(n(493),n(9280)),s=n(1882),l=n(7248),a=n(6139),u=n(4684),d=n(8938),c=n(1648),p=o({getDefaultProps:function(){return{isChildRow:!1,showChildren:!1,data:{},columnSettings:null,rowSettings:null,hasChildren:!1,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null,onRowMouseEnter:null,onRowMouseLeave:null,onRowWillMount:null,onRowWillUnmount:null}},componentWillMount:function(){null!==this.props.onRowWillMount&&s(this.props.onRowWillMount)&&this.props.onRowWillMount(this)},componentWillUnmount:function(){null!==this.props.onRowWillUnmount&&s(this.props.onRowWillUnmount)&&this.props.onRowWillUnmount(this)},handleClick:function(e){null!==this.props.onRowClick&&s(this.props.onRowClick)?this.props.onRowClick(this,e):this.props.hasChildren&&this.props.toggleChildren()},handleMouseEnter:function(e){null!==this.props.onRowMouseEnter&&s(this.props.onRowMouseEnter)&&this.props.onRowMouseEnter(this,e)},handleMouseLeave:function(e){null!==this.props.onRowMouseLeave&&s(this.props.onRowMouseLeave)&&this.props.onRowMouseLeave(this,e)},handleSelectionChange:function(e){},handleSelectClick:function(e){this.props.multipleSelectionSettings.isMultipleSelection&&("checkbox"===e.target.type?this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,this.refs.selected.checked):this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,!this.refs.selected.checked))},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRow: The columnSettings prop is null and it shouldn't be")},formatData:function(e){return"boolean"==typeof e?String(e):e},render:function(){var e=this;this.verifyProps();var t=this,n=null;this.props.useGriddleStyles&&(n={margin:"0px",padding:t.props.paddingHeight+"px 5px "+t.props.paddingHeight+"px 5px",height:t.props.rowHeight?this.props.rowHeight-2*t.props.paddingHeight+"px":null,backgroundColor:"#FFF",borderTopColor:"#DDD",color:"#222"});var o=this.props.columnSettings.getColumns(),p=l(o,[]),f=a({},this.props.data);u(f,p);var h,m,g=d(i.pick(f,c(o,"children"))).map((function(t,o){var i=null,s=e.props.columnSettings.getColumnMetadataByName(t[0]),l=0===o&&e.props.hasChildren&&!1===e.props.showChildren&&e.props.useGriddleIcons?r.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px",marginRight:"5px"}:null},e.props.parentRowCollapsedComponent):0===o&&e.props.hasChildren&&e.props.showChildren&&e.props.useGriddleIcons?r.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px"}:null},e.props.parentRowExpandedComponent):"";if(0===o&&e.props.isChildRow&&e.props.useGriddleStyles&&(n=a(n,{paddingLeft:10})),e.props.columnSettings.hasColumnMetadata()&&null!=s)if(void 0!==s.customComponent&&null!==s.customComponent){var u=r.createElement(s.customComponent,{data:t[1],rowData:f,metadata:s});i=r.createElement("td",{onClick:e.handleClick,onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,className:s.cssClassName,key:o,style:n},u)}else i=r.createElement("td",{onClick:e.handleClick,onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,className:s.cssClassName,key:o,style:n},l,e.formatData(t[1]));return i||r.createElement("td",{onClick:e.handleClick,onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,key:o,style:n},l,t[1])}));if(null!==this.props.onRowClick&&s(this.props.onRowClick)?(h=null,m=this.handleSelectClick):this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection?(h=this.handleSelectClick,m=null):(h=null,m=null),g&&this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection){this.props.multipleSelectionSettings.getSelectedRowIds();g.unshift(r.createElement("td",{key:"selection",style:n,className:"griddle-select griddle-select-cell",onClick:m},r.createElement("input",{type:"checkbox",checked:this.props.multipleSelectionSettings.getIsRowChecked(f),onChange:this.handleSelectionChange,ref:"selected"})))}var y=t.props.rowSettings&&t.props.rowSettings.getBodyRowMetadataClass(t.props.data)||"standard-row";return t.props.isChildRow?y="child-row":t.props.hasChildren&&(y=t.props.showChildren?this.props.parentRowExpandedClassName:this.props.parentRowCollapsedClassName),r.createElement("tr",{onClick:h,className:y},g)}});e.exports=p},4734:function(e,t,n){"use strict";var r=n(1594),o=n(2306),i=(n(493),n(4383)),s=o({getDefaultProps:function(){return{useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,columnSettings:null,rowSettings:null,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,onRowMouseEnter:null,onRowMouseLeave:null,onRowWillMount:null,onRowWillUnmount:null,multipleSelectionSettings:null}},getInitialState:function(){return{data:{},showChildren:!1}},componentWillReceiveProps:function(){this.setShowChildren(!1)},toggleChildren:function(){this.setShowChildren(!1===this.state.showChildren)},setShowChildren:function(e){this.setState({showChildren:e})},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be")},render:function(){this.verifyProps();var e=this;if(void 0===this.props.data)return r.createElement("tbody",null);var t=[],n=this.props.columnSettings.getColumns();t.push(r.createElement(this.props.rowSettings.rowComponent,{useGriddleStyles:this.props.useGriddleStyles,isSubGriddle:this.props.isSubGriddle,data:this.props.rowSettings.isCustom?i(this.props.data,n):this.props.data,rowData:this.props.rowSettings.isCustom?this.props.data:null,columnSettings:this.props.columnSettings,rowSettings:this.props.rowSettings,hasChildren:e.props.hasChildren,toggleChildren:e.toggleChildren,showChildren:e.state.showChildren,key:e.props.uniqueId+"_base_row",useGriddleIcons:e.props.useGriddleIcons,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedComponent:this.props.parentRowExpandedComponent,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight,onRowClick:e.props.onRowClick,onRowMouseEnter:e.props.onRowMouseEnter,onRowMouseLeave:e.props.onRowMouseLeave,multipleSelectionSettings:this.props.multipleSelectionSettings,onRowWillMount:e.props.onRowWillMount,onRowWillUnmount:e.props.onRowWillUnmount}));var o=null;return e.state.showChildren&&(o=e.props.hasChildren&&this.props.data.children.map((function(t,n){var o=e.props.rowSettings.getRowKey(t,n);if(void 0!==t.children){var i=e.constructor.Griddle;return r.createElement("tr",{key:o,style:{paddingLeft:5}},r.createElement("td",{colSpan:e.props.columnSettings.getVisibleColumnCount(),className:"griddle-parent",style:e.props.useGriddleStyles?{border:"none",padding:"0 0 0 5px"}:null},r.createElement(i,{rowMetadata:{key:"id"},isSubGriddle:!0,results:[t],columns:e.props.columnSettings.getColumns(),tableClassName:e.props.tableClassName,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,showTableHeading:!1,showPager:!1,columnMetadata:e.props.columnSettings.columnMetadata,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight})))}return r.createElement(e.props.rowSettings.rowComponent,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,data:t,columnSettings:e.props.columnSettings,isChildRow:!0,columnMetadata:e.props.columnSettings.columnMetadata,key:o})}))),!1===e.props.hasChildren?t[0]:r.createElement("tbody",null,e.state.showChildren?t.concat(o):t)}});e.exports=s},4376:function(e,t,n){"use strict";var r=n(1594),o=n(2306),i=n(9859),s=n(1648),l=n(7309),a=o({getDefaultProps:function(){return{columns:[],columnMetadata:[],selectedColumns:[],settingsText:"",maxRowsText:"",resultsPerPage:0,enableToggleCustom:!1,useCustomComponent:!1,useGriddleStyles:!0,toggleCustomComponent:function(){}}},setPageSize:function(e){var t=parseInt(e.target.value,10);this.props.setPageSize(t)},handleChange:function(e){var t=e.target.dataset?e.target.dataset.name:e.target.getAttribute("data-name");!0===e.target.checked&&!1===i(this.props.selectedColumns,t)?(this.props.selectedColumns.push(t),this.props.setColumns(this.props.selectedColumns)):this.props.setColumns(s(this.props.selectedColumns,t))},render:function(){var e=this,t=[];!1===e.props.useCustomComponent&&(t=this.props.columns.map((function(t,n){var o=i(e.props.selectedColumns,t),s=l(e.props.columnMetadata,{columnName:t}),a=t;return void 0!==s&&void 0!==s.displayName&&null!=s.displayName&&(a=s.displayName),void 0!==s&&null!=s&&s.locked?r.createElement("div",{className:"column checkbox"},r.createElement("label",null,r.createElement("input",{type:"checkbox",disabled:!0,name:"check",checked:o,"data-name":t}),a)):void 0!==s&&null!=s&&void 0!==s.visible&&!1===s.visible?null:r.createElement("div",{className:"griddle-column-selection checkbox",key:t,style:e.props.useGriddleStyles?{float:"left",width:"20%"}:null},r.createElement("label",null,r.createElement("input",{type:"checkbox",name:"check",onChange:e.handleChange,checked:o,"data-name":t}),a))})));var n=e.props.enableToggleCustom?r.createElement("div",{className:"form-group"},r.createElement("label",{htmlFor:"maxRows"},r.createElement("input",{type:"checkbox",checked:this.props.useCustomComponent,onChange:this.props.toggleCustomComponent})," ",this.props.enableCustomFormatText)):"",o=this.props.showSetPageSize?r.createElement("div",null,r.createElement("label",{htmlFor:"maxRows"},this.props.maxRowsText,":",r.createElement("select",{onChange:this.setPageSize,value:this.props.resultsPerPage},r.createElement("option",{value:"5"},"5"),r.createElement("option",{value:"10"},"10"),r.createElement("option",{value:"25"},"25"),r.createElement("option",{value:"50"},"50"),r.createElement("option",{value:"100"},"100")))):"";return r.createElement("div",{className:"griddle-settings",style:this.props.useGriddleStyles?{backgroundColor:"#FFF",border:"1px solid #DDD",color:"#222",padding:"10px",marginBottom:"10px"}:null},r.createElement("h6",null,this.props.settingsText),r.createElement("div",{className:"griddle-columns",style:this.props.useGriddleStyles?{clear:"both",display:"table",width:"100%",borderBottom:"1px solid #EDEDED",marginBottom:"10px"}:null},t),o,n)}});e.exports=a},2991:function(e,t,n){"use strict";var r=n(1594),o=n(2306),i=n(9593),s=n(4734),l=(n(493),n(1545),o({getDefaultProps:function(){return{data:[],columnSettings:null,rowSettings:null,sortSettings:null,multipleSelectionSettings:null,className:"",enableInfiniteScroll:!1,nextPage:null,hasMorePages:!1,useFixedHeader:!1,useFixedLayout:!0,paddingHeight:null,rowHeight:null,filterByColumn:null,infiniteScrollLoadTreshold:null,bodyHeight:null,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",externalLoadingComponent:null,externalIsLoading:!1,onRowClick:null,onRowMouseEnter:null,onRowMouseLeave:null,onRowWillMount:null,onRowWillUnmount:null}},getInitialState:function(){return{scrollTop:0,scrollHeight:this.props.bodyHeight,clientHeight:this.props.bodyHeight}},componentDidMount:function(){this.gridScroll()},componentDidUpdate:function(e,t){this.gridScroll()},gridScroll:function(){if(this.props.enableInfiniteScroll&&!this.props.externalIsLoading){var e=this.refs.scrollable,t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;if(null!==this.props.rowHeight&&this.state.scrollTop!==t&&Math.abs(this.state.scrollTop-t)>=this.getAdjustedRowHeight()){var o={scrollTop:t,scrollHeight:n,clientHeight:r};this.setState(o)}.6*(n-(t+r)-this.props.infiniteScrollLoadTreshold)<=this.props.infiniteScrollLoadTreshold&&this.props.nextPage()}},verifyProps:function(){null===this.props.columnSettings&&console.error("gridTable: The columnSettings prop is null and it shouldn't be"),null===this.props.rowSettings&&console.error("gridTable: The rowSettings prop is null and it shouldn't be")},getAdjustedRowHeight:function(){return this.props.rowHeight+2*this.props.paddingHeight},getNodeContent:function(){this.verifyProps();var e=this,t=!1;if(!this.props.externalIsLoading||this.props.enableInfiniteScroll){var n=e.props.data,o=null,i=null;if(this.props.enableInfiniteScroll&&null!==this.props.rowHeight&&void 0!==this.refs.scrollable){var l=e.getAdjustedRowHeight(),a=Math.ceil(e.state.clientHeight/l),u=Math.max(0,Math.floor(e.state.scrollTop/l)-.25*a),d=Math.min(u+1.25*a,this.props.data.length-1);n=n.slice(u,d+1);var c={height:u*l+"px"};o=r.createElement("tr",{key:"above-"+c.height,style:c});var p={height:(this.props.data.length-d)*l+"px"};i=r.createElement("tr",{key:"below-"+p.height,style:p})}var f=n.map((function(n,o){var i=void 0!==n.children&&n.children.length>0,l=e.props.rowSettings.getRowKey(n,o);return i&&(t=i),r.createElement(s,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,data:n,key:l+"-container",uniqueId:l,columnSettings:e.props.columnSettings,rowSettings:e.props.rowSettings,paddingHeight:e.props.paddingHeight,multipleSelectionSettings:e.props.multipleSelectionSettings,rowHeight:e.props.rowHeight,hasChildren:i,tableClassName:e.props.className,onRowClick:e.props.onRowClick,onRowMouseEnter:e.props.onRowMouseEnter,onRowMouseLeave:e.props.onRowMouseLeave,onRowWillMount:e.props.onRowWillMount,onRowWillUnmount:e.props.onRowWillUnmount})}));if(this.props.showNoData){var h=this.props.columnSettings.getVisibleColumnCount();f.push(r.createElement("tr",{key:"no-data-section"},r.createElement("td",{colSpan:h},this.props.noDataSection)))}return o&&f.unshift(o),i&&f.push(i),{nodes:f,anyHasChildren:t}}return null},render:function(){var e=[],t=!1,n=this.getNodeContent();n&&(e=n.nodes,t=n.anyHasChildren);var o=null,s=null,l={width:"100%"};if(this.props.useFixedLayout&&(l.tableLayout="fixed"),this.props.enableInfiniteScroll&&(o={position:"relative",overflowY:"scroll",height:this.props.bodyHeight+"px",width:"100%"}),this.props.externalIsLoading){var a,u=null;this.props.useGriddleStyles&&(u={textAlign:"center",paddingBottom:"40px"}),a=this.props.columnSettings.getVisibleColumnCount();var d=this.props.externalLoadingComponent?r.createElement(this.props.externalLoadingComponent,null):r.createElement("div",null,"Loading...");s=r.createElement("tbody",null,r.createElement("tr",null,r.createElement("td",{style:u,colSpan:a},d)))}var c=this.props.showTableHeading?r.createElement(i,{useGriddleStyles:this.props.useGriddleStyles,useGriddleIcons:this.props.useGriddleIcons,sortSettings:this.props.sortSettings,multipleSelectionSettings:this.props.multipleSelectionSettings,columnSettings:this.props.columnSettings,filterByColumn:this.props.filterByColumn,rowSettings:this.props.rowSettings}):void 0;t||(e=r.createElement("tbody",null,e));var p=r.createElement("tbody",null);if(this.props.showPager){var f=this.props.useGriddleStyles?{padding:"0px",backgroundColor:"#EDEDED",border:"0px",color:"#222",height:this.props.showNoData?"20px":null}:null;p=r.createElement("tbody",null,r.createElement("tr",null,r.createElement("td",{colSpan:this.props.multipleSelectionSettings.isMultipleSelection?this.props.columnSettings.getVisibleColumnCount()+1:this.props.columnSettings.getVisibleColumnCount(),style:f,className:"footer-container"},this.props.showNoData?null:this.props.pagingContent)))}return this.props.useFixedHeader?(this.props.useGriddleStyles&&(l.tableLayout="fixed"),r.createElement("div",null,r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&l||null},c),r.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:o},r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&l||null},e,s,p)))):r.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:o},r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&l||null},c,e,s,p))}}));e.exports=l},9593:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t=0)return!0}return!1}))},defaultColumnFilter:function(e,t,n){var r=M(A(n)?n:[n],(function(e){return(e||"").toLowerCase()}));return k(b.getObjectValues(t),(function(e){return e=e.toString().toLowerCase(),k(r,(function(t){return e.indexOf(t)>=0}))}))},filterByColumnFilters:function(e){var t=this.props.columnFilterFunc||this.defaultColumnFilter,n=Object.keys(e).reduce((function(n,r){return N(n,(function(n){var o=b.getAt(n,r||""),i=e[r];return t(r||"",o,i)}))}),this.props.results),r={columnFilters:e};e?(r.filteredResults=n,r.maxPage=this.getMaxPage(r.filteredResults)):this.state.filter?r.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,filter):this.defaultFilter(this.props.results,filter):r.filteredResults=null,this.setState(r)},filterByColumn:function(e,t){var n=this.state.columnFilters;if(n.hasOwnProperty(t)&&!e)n=P(n,t);else{var r={};r[t]=e,n=R({},n,r)}this.filterByColumnFilters(n)},setFilter:function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(this.props.useExternal)this.props.externalSetFilter(e);else{var n={page:0,filter:e};n.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(t||this.props.results,e):this.defaultFilter(t||this.props.results,e),n.maxPage=this.getMaxPage(n.filteredResults),(D(e)||x(e)||O(e))&&(n.filter=e,n.filteredResults=null),this.setState(n),this._resetSelectedRows()}},setPageSize:function(e){if(this.props.useExternal)return this.setState({resultsPerPage:e}),void this.props.externalSetPageSize(e);this.state.resultsPerPage=e,this.setMaxPage()},toggleColumnChooser:function(){this.setState({showColumnChooser:!this.state.showColumnChooser})},isNullOrUndefined:function(e){return null==e},shouldUseCustomRowComponent:function(){return this.isNullOrUndefined(this.state.useCustomRowComponent)?this.props.useCustomRowComponent:this.state.useCustomRowComponent},shouldUseCustomGridComponent:function(){return this.isNullOrUndefined(this.state.useCustomGridComponent)?this.props.useCustomGridComponent:this.state.useCustomGridComponent},toggleCustomComponent:function(){"grid"===this.state.customComponentType?this.setState({useCustomGridComponent:!this.shouldUseCustomGridComponent()}):"row"===this.state.customComponentType&&this.setState({useCustomRowComponent:!this.shouldUseCustomRowComponent()})},getMaxPage:function(e,t){return this.props.useExternal?this.props.externalMaxPage:(t||(t=(e||this.getCurrentResults()).length),Math.ceil(t/this.state.resultsPerPage))},setMaxPage:function(e){var t=this.getMaxPage(e);this.state.maxPage!==t&&this.setState({page:0,maxPage:t,filteredColumns:this.columnSettings.filteredColumns})},setPage:function(e){if(this.props.useExternal)this.props.externalSetPage(e);else{if(e*this.state.resultsPerPage<=this.state.resultsPerPage*this.state.maxPage){var t={page:e};this.setState(t)}this.props.enableInfiniteScroll&&this.setState({isSelectAllChecked:!1})}},setColumns:function(e){this.columnSettings.filteredColumns=A(e)?e:[e],this.setState({filteredColumns:this.columnSettings.filteredColumns})},nextPage:function(){var e=this.getCurrentPage();e0&&this.setPage(e-1)},changeSort:function(e){if(!1!==this.props.enableSort){if(this.props.useExternal){var t=this.props.externalSortColumn!==e||!this.props.externalSortAscending;return this.setState({sortColumn:e,sortDirection:t?"asc":"desc"}),void this.props.externalChangeSort(e,t)}var n=C(this.props.columnMetadata,{columnName:e})||{},r=n.sortDirectionCycle?n.sortDirectionCycle:[null,"asc","desc"],o=r.indexOf(this.state.sortDirection&&e===this.state.sortColumn?this.state.sortDirection:null),i={page:0,sortColumn:e,sortDirection:r[o=(o+1)%r.length]?r[o]:null};this.setState(i)}},componentWillReceiveProps:function(e){if(e.results!==this.props.results&&this.setFilter(this.state.filter,e.results),this.setMaxPage(e.results),e.resultsPerPage!==this.props.resultsPerPage&&this.setPageSize(e.resultsPerPage),this.columnSettings.columnMetadata=e.columnMetadata,e.results.length>0){var t=b.keys(e.results[0]);this.columnSettings.allColumns.length==t.length&&this.columnSettings.allColumns.every((function(e,n){return e===t[n]}))||(this.columnSettings.allColumns=t)}else this.columnSettings.allColumns.length>0&&(this.columnSettings.allColumns=[]);if(e.selectedRowIds){var n=this.getDataForRender(this.getCurrentResults(e.results),this.columnSettings.getColumns(),!0);this.setState({isSelectAllChecked:this._getAreAllRowsChecked(e.selectedRowIds,M(n,this.props.uniqueIdentifier)),selectedRowIds:e.selectedRowIds})}},getInitialState:function(){return{maxPage:0,page:0,filteredResults:null,filteredColumns:[],filter:"",columnFilters:{},resultsPerPage:this.props.resultsPerPage||5,showColumnChooser:!1,isSelectAllChecked:!1,selectedRowIds:this.props.selectedRowIds}},componentWillMount:function(){this.verifyExternal(),this.verifyCustom(),this.columnSettings=new y(this.props.results.length>0?b.keys(this.props.results[0]):[],this.props.columns,this.props.childrenColumnName,this.props.columnMetadata,this.props.metadataColumns),this.rowSettings=new v(this.props.rowMetadata,this.props.useCustomTableRowComponent&&this.props.customTableRowComponent?this.props.customTableRowComponent:p,this.props.useCustomTableRowComponent),this.props.initialSort&&(this.props.useExternal?this.setState({sortColumn:this.props.externalSortColumn,sortDirection:this.props.externalSortAscending?"asc":"desc"}):this.changeSort(this.props.initialSort)),this.setMaxPage(),this.shouldUseCustomGridComponent()?this.setState({customComponentType:"grid"}):this.shouldUseCustomRowComponent()?this.setState({customComponentType:"row"}):this.setState({filteredColumns:this.columnSettings.filteredColumns})},componentDidMount:function(){if(this.props.componentDidMount&&"function"==typeof this.props.componentDidMount)return this.props.componentDidMount()},componentDidUpdate:function(){if(this.props.componentDidUpdate&&"function"==typeof this.props.componentDidUpdate)return this.props.componentDidUpdate(this.state)},verifyExternal:function(){!0===this.props.useExternal&&(null===this.props.externalSetPage&&console.error("useExternal is set to true but there is no externalSetPage function specified."),null===this.props.externalChangeSort&&console.error("useExternal is set to true but there is no externalChangeSort function specified."),null===this.props.externalSetFilter&&console.error("useExternal is set to true but there is no externalSetFilter function specified."),null===this.props.externalSetPageSize&&console.error("useExternal is set to true but there is no externalSetPageSize function specified."),null===this.props.externalMaxPage&&console.error("useExternal is set to true but externalMaxPage is not set."),null===this.props.externalCurrentPage&&console.error("useExternal is set to true but externalCurrentPage is not set. Griddle will not page correctly without that property when using external data."))},verifyCustom:function(){!0===this.props.useCustomGridComponent&&null===this.props.customGridComponent&&console.error("useCustomGridComponent is set to true but no custom component was specified."),!0===this.props.useCustomRowComponent&&null===this.props.customRowComponent&&console.error("useCustomRowComponent is set to true but no custom component was specified."),!0===this.props.useCustomGridComponent&&!0===this.props.useCustomRowComponent&&console.error("Cannot currently use both customGridComponent and customRowComponent."),!0===this.props.useCustomFilterer&&null===this.props.customFilterer&&console.error("useCustomFilterer is set to true but no custom filter function was specified."),!0===this.props.useCustomFilterComponent&&null===this.props.customFilterComponent&&console.error("useCustomFilterComponent is set to true but no customFilterComponent was specified.")},getDataForRender:function(e,t,n){var r=this,o=this;if(!this.props.useExternal){if(""!==this.state.sortColumn){var i,s=this.state.sortColumn,l=N(this.props.columnMetadata,{columnName:s}),a={columns:[],orders:[]};if(l.length>0&&(i=l[0].hasOwnProperty("customCompareFn")&&l[0].customCompareFn,l[0].multiSort&&(a=l[0].multiSort)),this.state.sortDirection)if("function"==typeof i)2===i.length?(e=e.sort((function(e,t){return i(L(e,s),L(t,s))})),"desc"===this.state.sortDirection&&e.reverse()):1===i.length&&(e=T(e,(function(e){return i(L(e,s))}),[this.state.sortDirection]));else{var u=[function(e){return(L(e,s)||"").toString().toLowerCase()}],d=[this.state.sortDirection];a.columns.forEach((function(e,t){u.push((function(t){return(L(t,e)||"").toString().toLowerCase()})),"asc"===a.orders[t]||"desc"===a.orders[t]?d.push(a.orders[t]):d.push(r.state.sortDirection)})),e=T(e,u,d)}}var c=this.getCurrentPage();if(!this.props.useExternal&&n&&this.state.resultsPerPage*(c+1)<=this.state.resultsPerPage*this.state.maxPage&&c>=0)if(this.isInfiniteScrollEnabled())e=S(e,(c+1)*this.state.resultsPerPage);else{var p=_(e,c*this.state.resultsPerPage);e=(E||F)(p,p.length-this.state.resultsPerPage)}}for(var f=[],h=0;h0&&(m.children=o.getDataForRender(m[o.props.childrenColumnName],t,!1),"children"!==o.props.childrenColumnName&&delete m[o.props.childrenColumnName]),f.push(m)}return f},getCurrentResults:function(e){return this.state.filteredResults||e||this.props.results},getCurrentPage:function(){return this.props.externalCurrentPage||this.state.page},getCurrentSort:function(){return this.props.useExternal?this.props.externalSortColumn:this.state.sortColumn},getCurrentSortAscending:function(){return this.props.useExternal?this.props.externalSortAscending:"asc"===this.state.sortDirection},getCurrentMaxPage:function(){return this.props.useExternal?this.props.externalMaxPage:this.state.maxPage},getSortObject:function(){return{enableSort:this.props.enableSort,changeSort:this.changeSort,sortColumn:this.getCurrentSort(),sortAscending:this.getCurrentSortAscending(),sortDirection:this.state.sortDirection,sortAscendingClassName:this.props.sortAscendingClassName,sortDescendingClassName:this.props.sortDescendingClassName,sortAscendingComponent:this.props.sortAscendingComponent,sortDescendingComponent:this.props.sortDescendingComponent,sortDefaultComponent:this.props.sortDefaultComponent}},_toggleSelectAll:function(){var e=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),t=!this.state.isSelectAllChecked,n=JSON.parse(JSON.stringify(this.state.selectedRowIds)),r=this;w(e,(function(e){r._updateSelectedRowIds(e[r.props.uniqueIdentifier],n,t)}),this),this.setState({isSelectAllChecked:t,selectedRowIds:n}),this.props.onSelectionChange&&this.props.onSelectionChange(n,t)},_toggleSelectRow:function(e,t){var n=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),r=JSON.parse(JSON.stringify(this.state.selectedRowIds));this._updateSelectedRowIds(e[this.props.uniqueIdentifier],r,t);var o=this._getAreAllRowsChecked(r,M(n,this.props.uniqueIdentifier));this.setState({isSelectAllChecked:o,selectedRowIds:r}),this.props.onSelectionChange&&this.props.onSelectionChange(r,o)},_updateSelectedRowIds:function(e,t,n){n?void 0===C(t,(function(t){return e===t}))&&t.push(e):t.splice(t.indexOf(e),1)},_getIsSelectAllChecked:function(){return this.state.isSelectAllChecked},_getAreAllRowsChecked:function(e,t){return t.length===I(t,e).length},_getIsRowChecked:function(e){return this.state.selectedRowIds.indexOf(e[this.props.uniqueIdentifier])>-1},getSelectedRowIds:function(){return this.state.selectedRowIds},_resetSelectedRows:function(){this.setState({isSelectAllChecked:!1,selectedRowIds:[]})},getMultipleSelectionObject:function(){return{isMultipleSelection:!C(this.props.results,(function(e){return"children"in e}))&&this.props.isMultipleSelection,toggleSelectAll:this._toggleSelectAll,getIsSelectAllChecked:this._getIsSelectAllChecked,toggleSelectRow:this._toggleSelectRow,getSelectedRowIds:this.getSelectedRowIds,getIsRowChecked:this._getIsRowChecked}},isInfiniteScrollEnabled:function(){return!this.props.useCustomPagerComponent&&this.props.enableInfiniteScroll},getClearFixStyles:function(){return{clear:"both",display:"table",width:"100%"}},getSettingsStyles:function(){return{float:"left",width:"50%",textAlign:"right"}},getFilterStyles:function(){return{float:"left",width:"50%",textAlign:"left",color:"#222",minHeight:"1px"}},getFilter:function(){return this.props.showFilter&&!1===this.shouldUseCustomGridComponent()?this.props.useCustomFilterComponent?o.createElement(g,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText,customFilterComponent:this.props.customFilterComponent,results:this.props.results,currentResults:this.getCurrentResults()}):o.createElement(a,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText}):""},getSettings:function(){return this.props.showSettings?o.createElement("button",{type:"button",className:this.props.settingsToggleClassName,onClick:this.toggleColumnChooser,style:this.props.useGriddleStyles?{background:"none",border:"none",padding:0,margin:0,fontSize:14}:null},this.props.settingsText,this.props.settingsIconComponent):""},getTopSection:function(e,t){if(!1===this.props.showFilter&&!1===this.props.showSettings)return"";var n=null,r=null,i=null;return this.props.useGriddleStyles&&(n=this.getFilterStyles(),r=this.getSettingsStyles(),i=this.getClearFixStyles()),o.createElement("div",{className:"top-section",style:i},o.createElement("div",{className:"griddle-filter",style:n},e),o.createElement("div",{className:"griddle-settings-toggle",style:r},t))},getPagingSection:function(e,t){if(!1!==(this.props.showPager&&!this.isInfiniteScrollEnabled()&&!this.shouldUseCustomGridComponent()))return o.createElement("div",{className:"griddle-footer"},this.props.useCustomPagerComponent?o.createElement(m,{customPagerComponentOptions:this.props.customPagerComponentOptions,next:this.nextPage,previous:this.previousPage,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText,customPagerComponent:this.props.customPagerComponent}):o.createElement(u,{useGriddleStyles:this.props.useGriddleStyles,next:this.nextPage,previous:this.previousPage,nextClassName:this.props.nextClassName,nextIconComponent:this.props.nextIconComponent,previousClassName:this.props.previousClassName,previousIconComponent:this.props.previousIconComponent,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText}))},getColumnSelectorSection:function(e,t){return this.state.showColumnChooser?o.createElement(d,{columns:e,selectedColumns:t,setColumns:this.setColumns,settingsText:this.props.settingsText,settingsIconComponent:this.props.settingsIconComponent,maxRowsText:this.props.maxRowsText,setPageSize:this.setPageSize,showSetPageSize:!this.shouldUseCustomGridComponent(),resultsPerPage:this.state.resultsPerPage,enableToggleCustom:this.props.enableToggleCustom,toggleCustomComponent:this.toggleCustomComponent,useCustomComponent:this.shouldUseCustomRowComponent()||this.shouldUseCustomGridComponent(),useGriddleStyles:this.props.useGriddleStyles,enableCustomFormatText:this.props.enableCustomFormatText,columnMetadata:this.props.columnMetadata}):""},getCustomGridSection:function(){return o.createElement(this.props.customGridComponent,r({data:this.props.results,className:this.props.customGridComponentClassName},this.props.gridMetadata))},getCustomRowSection:function(e,t,n,r,i){return o.createElement("div",null,o.createElement(h,{data:e,columns:t,metadataColumns:n,globalData:i,className:this.props.customRowComponentClassName,customComponent:this.props.customRowComponent,style:this.props.useGriddleStyles?this.getClearFixStyles():null}),this.props.showPager&&r)},getStandardGridSection:function(e,t,n,r,i){var s=this.getSortObject(),a=this.getMultipleSelectionObject(),u=this.shouldShowNoDataSection(e),d=this.getNoDataSection();return o.createElement("div",{className:"griddle-body"},o.createElement(l,{useGriddleStyles:this.props.useGriddleStyles,noDataSection:d,showNoData:u,columnSettings:this.columnSettings,rowSettings:this.rowSettings,sortSettings:s,multipleSelectionSettings:a,filterByColumn:this.filterByColumn,isSubGriddle:this.props.isSubGriddle,useGriddleIcons:this.props.useGriddleIcons,useFixedLayout:this.props.useFixedLayout,showPager:this.props.showPager,pagingContent:r,data:e,className:this.props.tableClassName,enableInfiniteScroll:this.isInfiniteScrollEnabled(),nextPage:this.nextPage,showTableHeading:this.props.showTableHeading,useFixedHeader:this.props.useFixedHeader,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,parentRowExpandedComponent:this.props.parentRowExpandedComponent,bodyHeight:this.props.bodyHeight,paddingHeight:this.props.paddingHeight,rowHeight:this.props.rowHeight,infiniteScrollLoadTreshold:this.props.infiniteScrollLoadTreshold,externalLoadingComponent:this.props.externalLoadingComponent,externalIsLoading:this.props.externalIsLoading,hasMorePages:i,onRowClick:this.props.onRowClick,onRowMouseEnter:this.props.onRowMouseEnter,onRowMouseLeave:this.props.onRowMouseLeave,onRowWillMount:this.props.onRowWillMount,onRowWillUnmount:this.props.onRowWillUnmount}))},getContentSection:function(e,t,n,r,o,i){return this.shouldUseCustomGridComponent()&&null!==this.props.customGridComponent?this.getCustomGridSection():this.shouldUseCustomRowComponent()?this.getCustomRowSection(e,t,n,r,i):this.getStandardGridSection(e,t,n,r,o)},getNoDataSection:function(){return null!=this.props.customNoDataComponent?o.createElement("div",{className:this.props.noDataClassName},o.createElement(this.props.customNoDataComponent,this.props.customNoDataComponentProps)):o.createElement(c,{noDataMessage:this.props.noDataMessage})},shouldShowNoDataSection:function(e){return!this.props.allowEmptyGrid&&(!1===this.props.useExternal&&(void 0===e||0===e.length)||!0===this.props.useExternal&&!1===this.props.externalIsLoading&&0===e.length)},render:function(){var e=this.getCurrentResults(),t=(this.props.tableClassName,this.getFilter()),n=this.getSettings(),r=this.getTopSection(t,n),i=[],s=this.columnSettings.getColumns(),l=this.getDataForRender(e,s,!0),a=this.columnSettings.getMetadataColumns();this.props.columnMetadata?w(this.props.columnMetadata,(function(e){"boolean"==typeof e.visible&&!1===e.visible||i.push(e.columnName)})):i=b.keys(P(e[0],a)),i=this.columnSettings.orderColumns(i);var u=this.getCurrentPage(),d=this.getCurrentMaxPage(),c=u+10?"griddle "+this.props.gridClassName:"griddle";return m+=this.shouldUseCustomRowComponent()?" griddle-custom":"",o.createElement("div",{className:m},r,h,o.createElement("div",{className:"griddle-container",style:this.props.useGriddleStyles&&!this.props.isSubGriddle?{border:"1px solid #DDD"}:null},f))}});f.Griddle=e.exports=U},1545:function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n-1}},9905:function(e){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r=200&&(c=a,p=!1,t=new r(t));e:for(;++d0&&i(d)?n>1?e(d,n-1,i,s,l):r(l,d):s||(l[l.length]=d)}return l}},6649:function(e,t,n){var r=n(3221)();e.exports=r},641:function(e,t,n){var r=n(6649),o=n(5950);e.exports=function(e,t){return e&&r(e,t,o)}},7422:function(e,t,n){var r=n(1769),o=n(7797);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n=120&&y.length>=120)?new r(f&&y):void 0}y=e[0];var v=-1,b=h[0];e:for(;++vo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++rt||s&&l&&u&&!a&&!d||o&&l&&u||!n&&u||!i)return 1;if(!o&&!s&&!d&&e=a?u:u*("desc"==n[o]?-1:1)}return e.index-t.index}},3007:function(e){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n1?n[i-1]:void 0,l=i>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(i--,s):void 0,l&&o(n[0],n[1],l)&&(s=i<3?void 0:s,i=1),t=Object(t);++r-1?l[a?t[u]:u]:void 0}}},2963:function(e,t,n){var r=n(1372),o=n(5861),i=n(317),s=n(799);e.exports=function(e){return function(t){var n=o(t);return"[object Map]"==n?i(t):"[object Set]"==n?s(t):r(t,e(t))}}},3138:function(e,t,n){var r=n(1331);e.exports=function(e){return r(e)?void 0:e}},3243:function(e,t,n){var r=n(6110),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},5911:function(e,t,n){var r=n(8859),o=n(4248),i=n(9219);e.exports=function(e,t,n,s,l,a){var u=1&n,d=e.length,c=t.length;if(d!=c&&!(u&&c>d))return!1;var p=a.get(e),f=a.get(t);if(p&&f)return p==t&&f==e;var h=-1,m=!0,g=2&n?new r:void 0;for(a.set(e,t),a.set(t,e);++h-1&&e%1==0&&e-1}},1175:function(e,t,n){var r=n(6025);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},3040:function(e,t,n){var r=n(1549),o=n(79),i=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},7670:function(e,t,n){var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289:function(e,t,n){var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509:function(e,t,n){var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949:function(e,t,n){var r=n(2651);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},317:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},7197:function(e){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},2224:function(e,t,n){var r=n(104);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},1042:function(e,t,n){var r=n(6110)(Object,"create");e.exports=r},3650:function(e,t,n){var r=n(4335)(Object.keys,Object);e.exports=r},181:function(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},6009:function(e,t,n){e=n.nmd(e);var r=n(4840),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o&&r.process,l=function(){try{var e=i&&i.require&&i.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=l},9350:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},6757:function(e,t,n){var r=n(1033),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,s=-1,l=o(i.length-t,0),a=Array(l);++s0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},1420:function(e,t,n){var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605:function(e){e.exports=function(e){return this.__data__.get(e)}},9817:function(e){e.exports=function(e){return this.__data__.has(e)}},945:function(e,t,n){var r=n(79),o=n(8223),i=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!o||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(e,t),this.size=n.size,this}},6959:function(e){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r2?t[2]:void 0;for(u&&i(t[0],t[1],u)&&(r=1);++n-1:!!d&&r(e,t,n)>-1}},3424:function(e,t,n){var r=n(5160);e.exports=function(e){return(null==e?0:e.length)?r(e,0,-1):[]}},5287:function(e,t,n){var r=n(4932),o=n(7185),i=n(9302),s=n(741),l=i((function(e){var t=r(e,s);return t.length&&t[0]===e[0]?o(t):[]}));e.exports=l},2428:function(e,t,n){var r=n(7534),o=n(346),i=Object.prototype,s=i.hasOwnProperty,l=i.propertyIsEnumerable,a=r(function(){return arguments}())?r:function(e){return o(e)&&s.call(e,"callee")&&!l.call(e,"callee")};e.exports=a},6449:function(e){var t=Array.isArray;e.exports=t},4894:function(e,t,n){var r=n(1882),o=n(294);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},3693:function(e,t,n){var r=n(4894),o=n(346);e.exports=function(e){return o(e)&&r(e)}},3656:function(e,t,n){e=n.nmd(e);var r=n(9325),o=n(9935),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,l=s&&s.exports===i?r.Buffer:void 0,a=(l?l.isBuffer:void 0)||o;e.exports=a},2193:function(e,t,n){var r=n(8984),o=n(5861),i=n(2428),s=n(6449),l=n(4894),a=n(3656),u=n(5527),d=n(7167),c=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(l(e)&&(s(e)||"string"==typeof e||"function"==typeof e.splice||a(e)||d(e)||i(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(c.call(e,n))return!1;return!0}},1882:function(e,t,n){var r=n(2552),o=n(3805);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730:function(e,t,n){var r=n(9172),o=n(7301),i=n(6009),s=i&&i.isMap,l=s?o(s):r;e.exports=l},5187:function(e){e.exports=function(e){return null===e}},3805:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},1331:function(e,t,n){var r=n(2552),o=n(8879),i=n(346),s=Function.prototype,l=Object.prototype,a=s.toString,u=l.hasOwnProperty,d=a.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&a.call(n)==d}},8440:function(e,t,n){var r=n(6038),o=n(7301),i=n(6009),s=i&&i.isSet,l=s?o(s):r;e.exports=l},5015:function(e,t,n){var r=n(2552),o=n(6449),i=n(346);e.exports=function(e){return"string"==typeof e||!o(e)&&i(e)&&"[object String]"==r(e)}},4394:function(e,t,n){var r=n(2552),o=n(346);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7167:function(e,t,n){var r=n(4901),o=n(7301),i=n(6009),s=i&&i.isTypedArray,l=s?o(s):r;e.exports=l},2216:function(e){e.exports=function(e){return void 0===e}},5950:function(e,t,n){var r=n(695),o=n(8984),i=n(4894);e.exports=function(e){return i(e)?r(e):o(e)}},7241:function(e,t,n){var r=n(695),o=n(2903),i=n(4894);e.exports=function(e){return i(e)?r(e,!0):o(e)}},8090:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5378:function(e,t,n){var r=n(4932),o=n(5389),i=n(5128),s=n(6449);e.exports=function(e,t){return(s(e)?r:i)(e,o(t,3))}},104:function(e,t,n){var r=n(3661);function o(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 s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},179:function(e,t,n){var r=n(4932),o=n(9999),i=n(9931),s=n(1769),l=n(1791),a=n(3138),u=n(8816),d=n(3349),c=u((function(e,t){var n={};if(null==e)return n;var u=!1;t=r(t,(function(t){return t=s(t,e),u||(u=t.length>1),t})),l(e,d(e),n),u&&(n=o(n,7,a));for(var c=t.length;c--;)i(n,t[c]);return n}));e.exports=c},2877:function(e,t,n){var r=n(6155),o=n(6449);e.exports=function(e,t,n,i){return null==e?[]:(o(t)||(t=null==t?[]:[t]),o(n=i?void 0:n)||(n=null==n?[]:[n]),r(e,t,n))}},4383:function(e,t,n){var r=n(6001),o=n(8816)((function(e,t){return null==e?{}:r(e,t)}));e.exports=o},583:function(e,t,n){var r=n(7237),o=n(7255),i=n(8586),s=n(7797);e.exports=function(e){return i(e)?r(s(e)):o(e)}},2426:function(e,t,n){var r=n(4248),o=n(5389),i=n(916),s=n(6449),l=n(6800);e.exports=function(e,t,n){var a=s(e)?r:i;return n&&l(e,t,n)&&(t=void 0),a(e,o(t,3))}},3031:function(e,t,n){var r=n(3120),o=n(6155),i=n(9302),s=n(6800),l=i((function(e,t){if(null==e)return[];var n=t.length;return n>1&&s(e,t[0],t[1])?t=[]:n>2&&s(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])}));e.exports=l},3345:function(e){e.exports=function(){return[]}},9935:function(e){e.exports=function(){return!1}},4921:function(e,t,n){var r=n(5160),o=n(1489);e.exports=function(e,t,n){return e&&e.length?(t=n||void 0===t?1:o(t),r(e,0,t<0?0:t)):[]}},7400:function(e,t,n){var r=n(9374),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489:function(e,t,n){var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374:function(e,t,n){var r=n(4128),o=n(3805),i=n(4394),s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,a=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||a.test(e)?u(e.slice(2),n?2:8):s.test(e)?NaN:+e}},8938:function(e,t,n){var r=n(2963)(n(5950));e.exports=r},2072:function(e,t,n){var r=n(4932),o=n(3007),i=n(6449),s=n(4394),l=n(1802),a=n(7797),u=n(3222);e.exports=function(e){return i(e)?r(e,a):s(e)?[e]:o(l(u(e)))}},3222:function(e,t,n){var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},7200:function(e,t,n){var r=n(3222),o=0;e.exports=function(e){var t=++o;return r(e)+t}},5880:function(e,t,n){var r=n(514),o=n(5950);e.exports=function(e){return null==e?[]:r(e,o(e))}},1648:function(e,t,n){var r=n(3915),o=n(9302),i=n(3693),s=o((function(e,t){return i(e)?r(e,t):[]}));e.exports=s},7248:function(e,t,n){var r=n(6547),o=n(1234);e.exports=function(e,t){return o(e||[],t||[],r)}},5228:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var i,s,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),a=1;a1)for(var n=1;n1?t-1:0),r=1;r2?n-2:0),i=2;i1&&void 0!==arguments[1]&&arguments[1],n=this.props,r=n.tolerance,o=n.onSelection,i=n.onEndSelection,s=[],l=(0,d.findDOMNode)(this.refs.selectbox);l&&(this._registry.forEach((function(e){e.domNode&&(0,g.default)(l,e.domNode,r)&&!s.includes(e.key)&&s.push(e.key)})),t?"function"==typeof i&&i(s,e):"function"==typeof o&&o(s,e))}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.enabled,r=e.fixedPosition,o=e.className,i=e.selectingClassName,s=this.state,l=s.isBoxSelecting,a=s.boxLeft,d=s.boxTop,c=s.boxWidth,f=s.boxHeight,h=this.props.component;if(!n)return u.default.createElement(h,{className:o},t);var m={left:a,top:d,width:c,height:f,zIndex:9e3,position:r?"fixed":"absolute",cursor:"default"},g={backgroundColor:"transparent",border:"1px dashed #999",width:"100%",height:"100%",float:"left"},y={position:"relative",overflow:"visible"};return u.default.createElement(h,{className:(0,p.default)(o,l?i:null),style:y},l?u.default.createElement("div",{style:m,ref:"selectbox"},u.default.createElement("span",{style:g})):null,t)}}]),t}(a.Component);v.propTypes={children:c.default.node,onBeginSelection:c.default.func,onEndSelection:c.default.func,onSelection:c.default.func,component:c.default.node,tolerance:c.default.number,fixedPosition:c.default.bool,preventDefault:c.default.bool,onNonItemClick:c.default.func,enabled:c.default.bool,className:c.default.string,selectingClassName:c.default.string},v.defaultProps={component:"div",tolerance:0,fixedPosition:!1,preventDefault:!0,enabled:!0},v.childContextTypes={selectable:c.default.object},t.default=v},function(e,t,n){"use strict";(function(t){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=n(1),i=n(2),s=n(8),l=n(15),a=n(3),u=n(16);e.exports=function(e,n){function d(e){var t=e&&(O&&e[O]||e[x]);if("function"==typeof t)return t}function c(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e){this.message=e,this.stack=""}function f(e){function r(r,u,d,c,f,h,m){if(c=c||D,h=h||d,m!==a)if(n)i(!1,"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");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var g=c+":"+d;!o[g]&&l<3&&(s(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",h,c),o[g]=!0,l++)}return null==u[d]?r?new p(null===u[d]?"The "+f+" `"+h+"` is marked as required in `"+c+"`, but its value is `null`.":"The "+f+" `"+h+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(u,d,c,f,h)}if("production"!==t.env.NODE_ENV)var o={},l=0;var u=r.bind(null,!1);return u.isRequired=r.bind(null,!0),u}function h(e){function t(t,n,r,o,i,s){var l=t[n];return w(l)!==e?new p("Invalid "+o+" `"+i+"` of type `"+F(l)+"` supplied to `"+r+"`, expected `"+e+"`."):null}return f(t)}function m(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new p("Invalid "+o+" `"+i+"` of type `"+w(s)+"` supplied to `"+r+"`, expected an array.");for(var l=0;ln+l||t+o-ar+s)};t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=e instanceof HTMLElement?(0,r.default)(e):e,s=t instanceof HTMLElement?(0,r.default)(t):t;return o(i.top,i.left,s.top,s.left,i.offsetWidth,i.offsetHeight,s.offsetWidth,s.offsetHeight,n)}},function(e,t,n){"use strict";(function(t){function n(e,t,n){function r(t){var n=m,r=g;return m=g=void 0,w=t,v=e.apply(r,n)}function i(e){return w=e,b=setTimeout(d,t),F?r(e):v}function s(e){var n=t-(e-_);return I?C(n,y-(e-w)):n}function a(e){var n=e-_;return void 0===_||n>=t||n<0||I&&e-w>=y}function d(){var e=S();if(a(e))return c(e);b=setTimeout(d,s(e))}function c(e){return b=void 0,A&&m?r(e):(m=g=void 0,v)}function p(){void 0!==b&&clearTimeout(b),w=0,m=_=g=b=void 0}function f(){return void 0===b?v:c(S())}function h(){var e=S(),n=a(e);if(m=arguments,g=this,_=e,n){if(void 0===b)return i(_);if(I)return b=setTimeout(d,t),r(_)}return void 0===b&&(b=setTimeout(d,t)),v}var m,g,y,v,b,_,w=0,F=!1,I=!1,A=!0;if("function"!=typeof e)throw new TypeError(u);return t=l(t)||0,o(n)&&(F=!!n.leading,y=(I="maxWait"in n)?E(l(n.maxWait)||0,t):y,A="trailing"in n?!!n.trailing:A),h.cancel=p,h.flush=f,h}function r(e,t,r){var i=!0,s=!0;if("function"!=typeof e)throw new TypeError(u);return o(r)&&(i="leading"in r?!!r.leading:i,s="trailing"in r?!!r.trailing:s),n(e,t,{leading:i,maxWait:t,trailing:s})}function o(e){var t=void 0===e?"undefined":a(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==(void 0===e?"undefined":a(e))}function s(e){return"symbol"==(void 0===e?"undefined":a(e))||i(e)&&_.call(e)==c}function l(e){if("number"==typeof e)return e;if(s(e))return d;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(p,"");var n=h.test(e);return n||m.test(e)?g(e.slice(2),n?2:8):f.test(e)?d:+e}var 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},u="Expected a function",d=NaN,c="[object Symbol]",p=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,m=/^0o[0-7]+$/i,g=parseInt,y="object"==(void 0===t?"undefined":a(t))&&t&&t.Object===Object&&t,v="object"==("undefined"==typeof self?"undefined":a(self))&&self&&self.Object===Object&&self,b=y||v||Function("return this")(),_=Object.prototype.toString,E=Math.max,C=Math.min,S=function(){return b.Date.now()};e.exports=r}).call(t,n(21))},function(e,t,n){"use strict";var r,o="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};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":o(window))&&(r=window)}e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function s(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)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n
'),this.element.appendChild(e));let t=e.getElementsByTagName("span")[0];return t&&(null!=t.textContent?t.textContent=this.options.dictFallbackMessage:null!=t.innerText&&(t.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize(e,t,n,r){let o={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},i=e.width/e.height;null==t&&null==n?(t=o.srcWidth,n=o.srcHeight):null==t?t=n*i:null==n&&(n=t/i);let s=(t=Math.min(t,o.srcWidth))/(n=Math.min(n,o.srcHeight));if(o.srcWidth>t||o.srcHeight>n)if("crop"===r)i>s?(o.srcHeight=e.height,o.srcWidth=o.srcHeight*s):(o.srcWidth=e.width,o.srcHeight=o.srcWidth/s);else{if("contain"!==r)throw new Error(`Unknown resizeMethod '${r}'`);i>s?n=t/i:t=n*i}return o.srcX=(e.width-o.srcWidth)/2,o.srcY=(e.height-o.srcHeight)/2,o.trgWidth=t,o.trgHeight=n,o},transformFile(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:r('
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n'),drop(e){return this.element.classList.remove("dz-drag-hover")},dragstart(e){},dragend(e){return this.element.classList.remove("dz-drag-hover")},dragenter(e){return this.element.classList.add("dz-drag-hover")},dragover(e){return this.element.classList.add("dz-drag-hover")},dragleave(e){return this.element.classList.remove("dz-drag-hover")},paste(e){},reset(){return this.element.classList.remove("dz-started")},addedfile(e){if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){for(var t of(e.previewElement=s.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),e.previewElement.querySelectorAll("[data-dz-name]")))t.textContent=e.name;for(t of e.previewElement.querySelectorAll("[data-dz-size]"))t.innerHTML=this.filesize(e.size);this.options.addRemoveLinks&&(e._removeLink=s.createElement(`
${this.options.dictRemoveFile}`),e.previewElement.appendChild(e._removeLink));let n=t=>(t.preventDefault(),t.stopPropagation(),e.status===s.UPLOADING?s.confirm(this.options.dictCancelUploadConfirmation,(()=>this.removeFile(e))):this.options.dictRemoveFileConfirmation?s.confirm(this.options.dictRemoveFileConfirmation,(()=>this.removeFile(e))):this.removeFile(e));for(let t of e.previewElement.querySelectorAll("[data-dz-remove]"))t.addEventListener("click",n)}},removedfile(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");for(let n of e.previewElement.querySelectorAll("[data-dz-thumbnail]"))n.alt=e.name,n.src=t;return setTimeout((()=>e.previewElement.classList.add("dz-image-preview")),1)}},error(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"string"!=typeof t&&t.error&&(t=t.error);for(let n of e.previewElement.querySelectorAll("[data-dz-errormessage]"))n.textContent=t}},errormultiple(){},processing(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple(){},uploadprogress(e,t,n){if(e.previewElement)for(let n of e.previewElement.querySelectorAll("[data-dz-uploadprogress]"))"PROGRESS"===n.nodeName?n.value=t:n.style.width=`${t}%`},totaluploadprogress(){},sending(){},sendingmultiple(){},success(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple(){},canceled(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple(){},complete(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple(){},maxfilesexceeded(){},maxfilesreached(){},queuecomplete(){},addedfiles(){}};class s extends o{static initClass(){this.prototype.Emitter=o,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}constructor(e,t){let n,r;if(super(),this.element=e,this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),null===this.element||!this.element instanceof HTMLElement)throw new Error("Invalid dropzone element: not an instance of HTMLElement.");if(this.element.dropzone)throw new Error("Dropzone already attached.");s.instances.push(this),this.element.dropzone=this;let o=null!=(r=s.optionsForElement(this.element))?r:{};if(this.options=Object.assign({},i,o,null!=t?t:{}),this.options.previewTemplate=this.options.previewTemplate.replace(/\n*/g,""),this.options.forceFallback||!s.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.uploadMultiple&&this.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");if(this.options.binaryBody&&this.options.uploadMultiple)throw new Error("You cannot set both: binaryBody and uploadMultiple.");"string"==typeof this.options.method&&(this.options.method=this.options.method.toUpperCase()),(n=this.getExistingFallback())&&n.parentNode&&n.parentNode.removeChild(n),!1!==this.options.previewsContainer&&(this.options.previewsContainer?this.previewsContainer=s.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(!0===this.options.clickable?this.clickableElements=[this.element]:this.clickableElements=s.getElements(this.options.clickable,"clickable")),this.init()}getAcceptedFiles(){return this.files.filter((e=>e.accepted)).map((e=>e))}getRejectedFiles(){return this.files.filter((e=>!e.accepted)).map((e=>e))}getFilesWithStatus(e){return this.files.filter((t=>t.status===e)).map((e=>e))}getQueuedFiles(){return this.getFilesWithStatus(s.QUEUED)}getUploadingFiles(){return this.getFilesWithStatus(s.UPLOADING)}getAddedFiles(){return this.getFilesWithStatus(s.ADDED)}getActiveFiles(){return this.files.filter((e=>e.status===s.UPLOADING||e.status===s.QUEUED)).map((e=>e))}init(){if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(s.createElement(`
`)),this.clickableElements.length){let e=()=>{this.hiddenFileInput&&this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=document.createElement("input"),this.hiddenFileInput.setAttribute("type","file"),this.hiddenFileInput.setAttribute("form",this.element.id),(null===this.options.maxFiles||this.options.maxFiles>1)&&this.hiddenFileInput.setAttribute("multiple","multiple"),this.hiddenFileInput.className="dz-hidden-input",null!==this.options.acceptedFiles&&this.hiddenFileInput.setAttribute("accept",this.options.acceptedFiles),null!==this.options.capture&&this.hiddenFileInput.setAttribute("capture",this.options.capture),this.hiddenFileInput.setAttribute("tabindex","-1"),this.hiddenFileInput.setAttribute("aria-label","dropzone hidden input"),this.hiddenFileInput.style.visibility="hidden",this.hiddenFileInput.style.position="absolute",this.hiddenFileInput.style.top="0",this.hiddenFileInput.style.left="0",this.hiddenFileInput.style.height="0",this.hiddenFileInput.style.width="0",s.getElement(this.options.hiddenInputContainer,"hiddenInputContainer").appendChild(this.hiddenFileInput),this.hiddenFileInput.addEventListener("change",(()=>{let{files:t}=this.hiddenFileInput;if(t.length)for(let e of t)this.addFile(e);this.emit("addedfiles",t),e()}))};e()}this.URL=null!==window.URL?window.URL:window.webkitURL;for(let e of this.events)this.on(e,this.options[e]);this.on("uploadprogress",(()=>this.updateTotalUploadProgress())),this.on("removedfile",(()=>this.updateTotalUploadProgress())),this.on("canceled",(e=>this.emit("complete",e))),this.on("complete",(e=>{if(0===this.getAddedFiles().length&&0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length)return setTimeout((()=>this.emit("queuecomplete")),0)}));let e=function(e){if(function(e){return e.dataTransfer.types&&e.dataTransfer.types.includes("Files")}(e))return e.stopPropagation(),e.preventDefault()};return this.listeners=[{element:this.element,events:{dragstart:e=>this.emit("dragstart",e),dragenter:t=>(e(t),this.emit("dragenter",t)),dragover:t=>{const n=t.dataTransfer.effectAllowed;return t.dataTransfer.dropEffect="move"===n||"linkMove"===n?"move":"copy",e(t),this.emit("dragover",t)},dragleave:e=>this.emit("dragleave",e),drop:t=>(e(t),this.drop(t)),dragend:e=>this.emit("dragend",e)}}],this.clickableElements.forEach((e=>this.listeners.push({element:e,events:{click:t=>((e!==this.element||t.target===this.element||s.elementInside(t.target,this.element.querySelector(".dz-message")))&&this.hiddenFileInput.click(),!0)}}))),this.enable(),this.options.init.call(this)}destroy(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,s.instances.splice(s.instances.indexOf(this),1)}updateTotalUploadProgress(){let e,t=0,n=0;if(this.getActiveFiles().length){for(let e of this.getActiveFiles())t+=e.upload.bytesSent,n+=e.upload.total;e=100*t/n}else e=100;return this.emit("totaluploadprogress",e,n,t)}_getParamName(e){return"function"==typeof this.options.paramName?this.options.paramName(e):`${this.options.paramName}${this.options.uploadMultiple?`[${e}]`:""}`}_renameFile(e){const t={...e,name:e.name.replace(/\u202F/g," ")};return"function"!=typeof this.options.renameFile?t.name:this.options.renameFile(t)}getFallbackForm(){let e,t;if(e=this.getExistingFallback())return e;let n='
';this.options.dictFallbackText&&(n+=`

${this.options.dictFallbackText}

`),n+=`
`;let r=s.createElement(n);return"FORM"!==this.element.tagName?(t=s.createElement(`
`),t.appendChild(r)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:r}getExistingFallback(){let e=function(e){for(let t of e)if(/(^| )fallback($| )/.test(t.className))return t};for(let n of["div","form"]){var t;if(t=e(this.element.getElementsByTagName(n)))return t}}setupEventListeners(){return this.listeners.map((e=>(()=>{let t=[];for(let n in e.events){let r=e.events[n];t.push(e.element.addEventListener(n,r,!1))}return t})()))}removeEventListeners(){return this.listeners.map((e=>(()=>{let t=[];for(let n in e.events){let r=e.events[n];t.push(e.element.removeEventListener(n,r,!1))}return t})()))}disable(){return this.clickableElements.forEach((e=>e.classList.remove("dz-clickable"))),this.removeEventListeners(),this.disabled=!0,this.files.map((e=>this.cancelUpload(e)))}enable(){return delete this.disabled,this.clickableElements.forEach((e=>e.classList.add("dz-clickable"))),this.setupEventListeners()}filesize(e){let t=0,n="b";if(e>0){let r=["tb","gb","mb","kb","b"];for(let o=0;o=Math.pow(this.options.filesizeBase,4-o)/10){t=e/Math.pow(this.options.filesizeBase,4-o),n=i;break}}t=Math.round(10*t)/10}return`${t} ${this.options.dictFileSizeUnits[n]}`}_updateMaxFilesReachedClass(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}drop(e){if(!e.dataTransfer)return;this.emit("drop",e);let t=[];for(let n=0;ne.items,null!=t?n(t):void 0))return;var t,n;this.emit("paste",e);let{items:r}=e.clipboardData;return r.length?this._addFilesFromItems(r):void 0}handleFiles(e){for(let t of e)this.addFile(t)}_addFilesFromItems(e){return(()=>{let t=[];for(let r of e){var n;null!=r.webkitGetAsEntry&&(n=r.webkitGetAsEntry())?n.isFile?t.push(this.addFile(r.getAsFile())):n.isDirectory?t.push(this._addFilesFromDirectory(n,n.name)):t.push(void 0):null!=r.getAsFile&&(null==r.kind||"file"===r.kind)?t.push(this.addFile(r.getAsFile())):t.push(void 0)}return t})()}_addFilesFromDirectory(e,t){let n=e.createReader(),r=e=>{return t=console,n="log",r=t=>t.log(e),null!=t&&"function"==typeof t[n]?r(t,n):void 0;var t,n,r};var o=()=>n.readEntries((e=>{if(e.length>0){for(let n of e)n.isFile?n.file((e=>{if(!this.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath=`${t}/${e.name}`,this.addFile(e)})):n.isDirectory&&this._addFilesFromDirectory(n,`${t}/${n.name}`);o()}return null}),r);return o()}accept(e,t){this.options.maxFilesize&&e.size>1048576*this.options.maxFilesize?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):s.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)}addFile(e){e.upload={uuid:window.isSecureContext?self.crypto.randomUUID():s.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e)},this.files.push(e),e.status=s.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,(t=>{t?(e.accepted=!1,this._errorProcessing([e],t)):(e.accepted=!0,this.options.autoQueue&&this.enqueueFile(e)),this._updateMaxFilesReachedClass()}))}enqueueFiles(e){for(let t of e)this.enqueueFile(t);return null}enqueueFile(e){if(e.status!==s.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=s.QUEUED,this.options.autoProcessQueue)return setTimeout((()=>this.processQueue()),0)}_enqueueThumbnail(e){if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1048576*this.options.maxThumbnailFilesize)return this._thumbnailQueue.push(e),setTimeout((()=>this._processThumbnailQueue()),0)}_processThumbnailQueue(){if(this._processingThumbnail||0===this._thumbnailQueue.length)return;this._processingThumbnail=!0;let e=this._thumbnailQueue.shift();return this.createThumbnail(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,(t=>(this.emit("thumbnail",e,t),this._processingThumbnail=!1,this._processThumbnailQueue())))}removeFile(e){if(e.status===s.UPLOADING&&this.cancelUpload(e),this.files=l(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}removeAllFiles(e){null==e&&(e=!1);for(let t of this.files.slice())(t.status!==s.UPLOADING||e)&&this.removeFile(t);return null}resizeImage(e,t,n,r,o){return this.createThumbnail(e,t,n,r,!0,((t,n)=>{if(null==n)return o(e);{let{resizeMimeType:t}=this.options;null==t&&(t=e.type);let r=n.toDataURL(t,this.options.resizeQuality);return"image/jpeg"!==t&&"image/jpg"!==t||(r=function(e,t){var n="data:image/jpeg;base64,";if(!e.startsWith(n)||!t.startsWith(n))return t;var r=window.atob(e.slice(n.length));if(!r.startsWith("ÿØÿ"))return t;var o=0,i="";for(;o{e.dataURL=l.result,"image/svg+xml"!==e.type?this.createThumbnailFromUrl(e,t,n,r,o,i,void 0,s):null!=i&&i(l.result)},l.readAsDataURL(e)}displayExistingFile(e,t,n,r,o=!0){if(this.emit("addedfile",e),this.emit("complete",e),o){let o=t=>{this.emit("thumbnail",e,t),n&&n()};e.dataURL=t,this.createThumbnailFromUrl(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,o,r)}else this.emit("thumbnail",e,t),n&&n()}createThumbnailFromUrl(e,t,n,r,o,i,s,l=!1){let a=document.createElement("img");s&&(a.crossOrigin=s),o="from-image"!=getComputedStyle(document.body).imageOrientation&&o,a.onload=()=>{let s=e=>e(1);return"undefined"!=typeof EXIF&&null!==EXIF&&o&&(s=e=>EXIF.getData(a,(function(){return e(EXIF.getTag(this,"Orientation"))}))),s((o=>{e.width=a.width,e.height=a.height;let s=this.options.resize.call(this,e,t,n,r),l=document.createElement("canvas"),d=l.getContext("2d");switch(l.width=s.trgWidth,l.height=s.trgHeight,o>4&&(l.width=s.trgHeight,l.height=s.trgWidth),o){case 2:d.translate(l.width,0),d.scale(-1,1);break;case 3:d.translate(l.width,l.height),d.rotate(Math.PI);break;case 4:d.translate(0,l.height),d.scale(1,-1);break;case 5:d.rotate(.5*Math.PI),d.scale(1,-1);break;case 6:d.rotate(.5*Math.PI),d.translate(0,-l.width);break;case 7:d.rotate(.5*Math.PI),d.translate(l.height,-l.width),d.scale(-1,1);break;case 8:d.rotate(-.5*Math.PI),d.translate(-l.height,0)}u(d,a,null!=s.srcX?s.srcX:0,null!=s.srcY?s.srcY:0,s.srcWidth,s.srcHeight,null!=s.trgX?s.trgX:0,null!=s.trgY?s.trgY:0,s.trgWidth,s.trgHeight);let c=l.toDataURL("image/png");if(null!=i)return i(c,l)}))},null!=i&&(a.onerror=i);var d=e.dataURL;return l&&(d=function(e){var t="data:image/jpeg;base64,";if(!e.startsWith(t))return e;var n=window.atob(e.slice(t.length));if(!n.startsWith("ÿØÿ"))return e;var r=0,o="";for(;r=e)return;let r=this.getQueuedFiles();if(r.length>0){if(this.options.uploadMultiple)return this.processFiles(r.slice(0,e-t));for(;nt.xhr===e)).map((e=>e))}cancelUpload(e){if(e.status===s.UPLOADING){let t=this._getFilesWithXhr(e.xhr);for(let e of t)e.status=s.CANCELED;void 0!==e.xhr&&e.xhr.abort();for(let e of t)this.emit("canceled",e);this.options.uploadMultiple&&this.emit("canceledmultiple",t)}else e.status!==s.ADDED&&e.status!==s.QUEUED||(e.status=s.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}resolveOption(e,...t){return"function"==typeof e?e.apply(this,t):e}uploadFile(e){return this.uploadFiles([e])}uploadFiles(e){this._transformFiles(e,(t=>{if(this.options.chunking){let n=t[0];e[0].upload.chunked=this.options.chunking&&(this.options.forceChunking||n.size>this.options.chunkSize),e[0].upload.totalChunkCount=Math.ceil(n.size/this.options.chunkSize),0===n.size&&(e[0].upload.totalChunkCount=1)}if(e[0].upload.chunked){let n=e[0],r=t[0];n.upload.chunks=[];let o=()=>{let t=0;for(;void 0!==n.upload.chunks[t];)t++;if(t>=n.upload.totalChunkCount)return;let o=t*this.options.chunkSize,i=Math.min(o+this.options.chunkSize,r.size),l={name:this._getParamName(0),data:r.webkitSlice?r.webkitSlice(o,i):r.slice(o,i),filename:n.upload.filename,chunkIndex:t};n.upload.chunks[t]={file:n,index:t,dataBlock:l,status:s.UPLOADING,progress:0,retries:0},this._uploadData(e,[l])};if(n.upload.finishedChunkUpload=(t,r)=>{let i=!0;t.status=s.SUCCESS,t.dataBlock=null,t.response=t.xhr.responseText,t.responseHeaders=t.xhr.getAllResponseHeaders(),t.xhr=null;for(let e=0;e{this._finished(e,r,null)}))},this.options.parallelChunkUploads){const e=Math.min(!0===this.options.parallelChunkUploads?this.options.parallelUploads:this.options.parallelChunkUploads,n.upload.totalChunkCount);for(let t=0;t{this._finishedUploading(e,n,t)},n.ontimeout=()=>{this._handleUploadError(e,n,`Request timedout after ${this.options.timeout/1e3} seconds`)},n.onerror=()=>{this._handleUploadError(e,n)},(null!=n.upload?n.upload:n).onprogress=t=>this._updateFilesUploadProgress(e,n,t);let i=this.options.defaultHeaders?{Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"}:{};this.options.binaryBody&&(i["Content-Type"]=e[0].type),this.options.headers&&Object.assign(i,this.options.headers);for(let e in i){let t=i[e];t&&n.setRequestHeader(e,t)}if(this.options.binaryBody){for(let t of e)this.emit("sending",t,n);this.options.uploadMultiple&&this.emit("sendingmultiple",e,n),this.submitRequest(n,null,e)}else{let r=new FormData;if(this.options.params){let t=this.options.params;"function"==typeof t&&(t=t.call(this,e,n,e[0].upload.chunked?this._getChunk(e[0],n):null));for(let e in t){let n=t[e];if(Array.isArray(n))for(let t=0;t{n[o]=i,++r===e.length&&t(n)}))}_addFormElementData(e){if("FORM"===this.element.tagName)for(let t of this.element.querySelectorAll("input, textarea, select, button")){let n=t.getAttribute("name"),r=t.getAttribute("type");if(r&&(r=r.toLowerCase()),null!=n)if("SELECT"===t.tagName&&t.hasAttribute("multiple"))for(let r of t.options)r.selected&&e.append(n,r.value);else(!r||"checkbox"!==r&&"radio"!==r||t.checked)&&e.append(n,t.value)}}_updateFilesUploadProgress(e,t,n){if(e[0].upload.chunked){let r=e[0],o=this._getChunk(r,t);n?(o.progress=100*n.loaded/n.total,o.total=n.total,o.bytesSent=n.loaded):(o.progress=100,o.bytesSent=o.total),r.upload.progress=0,r.upload.total=0,r.upload.bytesSent=0;for(let e=0;e(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16)))}}s.initClass(),s.options={},s.optionsForElement=function(e){return e.getAttribute("id")&&void 0!==s.options?s.options[a(e.getAttribute("id"))]:void 0},s.instances=[],s.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},s.discover=function(){let e;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else{e=[];let t=t=>(()=>{let n=[];for(let r of t)/(^| )dropzone($| )/.test(r.className)?n.push(e.push(r)):n.push(void 0);return n})();t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))}return(()=>{let t=[];for(let n of e)!1!==s.optionsForElement(n)?t.push(new s(n)):t.push(void 0);return t})()},s.isBrowserSupported=function(){return"undefined"!=typeof Promise},s.dataURItoBlob=function(e){let t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),o=new Uint8Array(r);for(let e=0,n=t.length,r=0<=n;r?e<=n:e>=n;r?e++:e--)o[e]=t.charCodeAt(e);return new Blob([r],{type:n})};const l=(e,t)=>e.filter((e=>e!==t)).map((e=>e)),a=e=>e.replace(/[\-_](\w)/g,(e=>e.charAt(1).toUpperCase()));s.createElement=function(e){let t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},s.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},s.getElement=function(e,t){let n;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector or a plain HTML element.`);return n},s.getElements=function(e,t){let n,r;if(e instanceof Array){r=[];try{for(n of e)r.push(this.getElement(n,t))}catch(e){r=null}}else if("string"==typeof e)for(n of(r=[],document.querySelectorAll(e)))r.push(n);else null!=e.nodeType&&(r=[e]);if(null==r||!r.length)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`);return r},s.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},s.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");let n=e.type,r=n.replace(/\/.*$/,"");for(let o of t)if(o=o.trim(),"."===o.charAt(0)){if(-1!==e.name.toLowerCase().indexOf(o.toLowerCase(),e.name.length-o.length))return!0}else if(/\/\*$/.test(o)){if(r===o.replace(/\/.*$/,""))return!0}else if(n===o)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each((function(){return new s(this,e)}))}),s.ADDED="added",s.QUEUED="queued",s.ACCEPTED=s.QUEUED,s.UPLOADING="uploading",s.PROCESSING=s.UPLOADING,s.CANCELED="canceled",s.ERROR="error",s.SUCCESS="success";var u=function(e,t,n,r,o,i,s,l,a,u){let d=function(e){let t=e.naturalHeight,n=document.createElement("canvas");n.width=1,n.height=t;let r=n.getContext("2d");r.drawImage(e,0,0);let{data:o}=r.getImageData(1,0,1,t),i=0,s=t,l=t;for(;l>i;)0===o[4*(l-1)+3]?s=l:i=l,l=s+i>>1;let a=l/t;return 0===a?1:a}(t);return e.drawImage(t,n,r,o,i,s,l,a,u/d)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){"use strict";n(6166),n(4639),n(2038),n(9329)}()}(); \ No newline at end of file +/******/ (function() { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ HiddenText: function() { return /* binding */ HiddenText; }, +/* harmony export */ LiveRegion: function() { return /* binding */ LiveRegion; }, +/* harmony export */ useAnnouncement: function() { return /* binding */ useAnnouncement; } +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); + + +const hiddenStyles = { + display: 'none' +}; +function HiddenText(_ref) { + let { + id, + value + } = _ref; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { + id: id, + style: hiddenStyles + }, value); +} + +function LiveRegion(_ref) { + let { + id, + announcement, + ariaLiveType = "assertive" + } = _ref; + // Hide element visually but keep it readable by screen readers + const visuallyHidden = { + position: 'fixed', + top: 0, + left: 0, + width: 1, + height: 1, + margin: -1, + border: 0, + padding: 0, + overflow: 'hidden', + clip: 'rect(0 0 0 0)', + clipPath: 'inset(100%)', + whiteSpace: 'nowrap' + }; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { + id: id, + style: visuallyHidden, + role: "status", + "aria-live": ariaLiveType, + "aria-atomic": true + }, announcement); +} + +function useAnnouncement() { + const [announcement, setAnnouncement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''); + const announce = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(value => { + if (value != null) { + setAnnouncement(value); + } + }, []); + return { + announce, + announcement + }; +} + + +//# sourceMappingURL=accessibility.esm.js.map + + +/***/ }), + +/***/ "./node_modules/@dnd-kit/core/dist/core.esm.js": +/*!*****************************************************!*\ + !*** ./node_modules/@dnd-kit/core/dist/core.esm.js ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ AutoScrollActivator: function() { return /* binding */ AutoScrollActivator; }, +/* harmony export */ DndContext: function() { return /* binding */ DndContext; }, +/* harmony export */ DragOverlay: function() { return /* binding */ DragOverlay; }, +/* harmony export */ KeyboardCode: function() { return /* binding */ KeyboardCode; }, +/* harmony export */ KeyboardSensor: function() { return /* binding */ KeyboardSensor; }, +/* harmony export */ MeasuringFrequency: function() { return /* binding */ MeasuringFrequency; }, +/* harmony export */ MeasuringStrategy: function() { return /* binding */ MeasuringStrategy; }, +/* harmony export */ MouseSensor: function() { return /* binding */ MouseSensor; }, +/* harmony export */ PointerSensor: function() { return /* binding */ PointerSensor; }, +/* harmony export */ TouchSensor: function() { return /* binding */ TouchSensor; }, +/* harmony export */ TraversalOrder: function() { return /* binding */ TraversalOrder; }, +/* harmony export */ applyModifiers: function() { return /* binding */ applyModifiers; }, +/* harmony export */ closestCenter: function() { return /* binding */ closestCenter; }, +/* harmony export */ closestCorners: function() { return /* binding */ closestCorners; }, +/* harmony export */ defaultAnnouncements: function() { return /* binding */ defaultAnnouncements; }, +/* harmony export */ defaultCoordinates: function() { return /* binding */ defaultCoordinates; }, +/* harmony export */ defaultDropAnimation: function() { return /* binding */ defaultDropAnimationConfiguration; }, +/* harmony export */ defaultDropAnimationSideEffects: function() { return /* binding */ defaultDropAnimationSideEffects; }, +/* harmony export */ defaultKeyboardCoordinateGetter: function() { return /* binding */ defaultKeyboardCoordinateGetter; }, +/* harmony export */ defaultScreenReaderInstructions: function() { return /* binding */ defaultScreenReaderInstructions; }, +/* harmony export */ getClientRect: function() { return /* binding */ getClientRect; }, +/* harmony export */ getFirstCollision: function() { return /* binding */ getFirstCollision; }, +/* harmony export */ getScrollableAncestors: function() { return /* binding */ getScrollableAncestors; }, +/* harmony export */ pointerWithin: function() { return /* binding */ pointerWithin; }, +/* harmony export */ rectIntersection: function() { return /* binding */ rectIntersection; }, +/* harmony export */ useDndContext: function() { return /* binding */ useDndContext; }, +/* harmony export */ useDndMonitor: function() { return /* binding */ useDndMonitor; }, +/* harmony export */ useDraggable: function() { return /* binding */ useDraggable; }, +/* harmony export */ useDroppable: function() { return /* binding */ useDroppable; }, +/* harmony export */ useSensor: function() { return /* binding */ useSensor; }, +/* harmony export */ useSensors: function() { return /* binding */ useSensors; } +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "react-dom"); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dnd-kit/utilities */ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js"); +/* harmony import */ var _dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @dnd-kit/accessibility */ "./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js"); + + + + + +const DndMonitorContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null); + +function useDndMonitor(listener) { + const registerListener = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(DndMonitorContext); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!registerListener) { + throw new Error('useDndMonitor must be used within a children of '); + } + + const unsubscribe = registerListener(listener); + return unsubscribe; + }, [listener, registerListener]); +} + +function useDndMonitorProvider() { + const [listeners] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => new Set()); + const registerListener = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(listener => { + listeners.add(listener); + return () => listeners.delete(listener); + }, [listeners]); + const dispatch = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(_ref => { + let { + type, + event + } = _ref; + listeners.forEach(listener => { + var _listener$type; + + return (_listener$type = listener[type]) == null ? void 0 : _listener$type.call(listener, event); + }); + }, [listeners]); + return [dispatch, registerListener]; +} + +const defaultScreenReaderInstructions = { + draggable: "\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n " +}; +const defaultAnnouncements = { + onDragStart(_ref) { + let { + active + } = _ref; + return "Picked up draggable item " + active.id + "."; + }, + + onDragOver(_ref2) { + let { + active, + over + } = _ref2; + + if (over) { + return "Draggable item " + active.id + " was moved over droppable area " + over.id + "."; + } + + return "Draggable item " + active.id + " is no longer over a droppable area."; + }, + + onDragEnd(_ref3) { + let { + active, + over + } = _ref3; + + if (over) { + return "Draggable item " + active.id + " was dropped over droppable area " + over.id; + } + + return "Draggable item " + active.id + " was dropped."; + }, + + onDragCancel(_ref4) { + let { + active + } = _ref4; + return "Dragging was cancelled. Draggable item " + active.id + " was dropped."; + } + +}; + +function Accessibility(_ref) { + let { + announcements = defaultAnnouncements, + container, + hiddenTextDescribedById, + screenReaderInstructions = defaultScreenReaderInstructions + } = _ref; + const { + announce, + announcement + } = (0,_dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__.useAnnouncement)(); + const liveRegionId = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)("DndLiveRegion"); + const [mounted, setMounted] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + setMounted(true); + }, []); + useDndMonitor((0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + onDragStart(_ref2) { + let { + active + } = _ref2; + announce(announcements.onDragStart({ + active + })); + }, + + onDragMove(_ref3) { + let { + active, + over + } = _ref3; + + if (announcements.onDragMove) { + announce(announcements.onDragMove({ + active, + over + })); + } + }, + + onDragOver(_ref4) { + let { + active, + over + } = _ref4; + announce(announcements.onDragOver({ + active, + over + })); + }, + + onDragEnd(_ref5) { + let { + active, + over + } = _ref5; + announce(announcements.onDragEnd({ + active, + over + })); + }, + + onDragCancel(_ref6) { + let { + active, + over + } = _ref6; + announce(announcements.onDragCancel({ + active, + over + })); + } + + }), [announce, announcements])); + + if (!mounted) { + return null; + } + + const markup = react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__.HiddenText, { + id: hiddenTextDescribedById, + value: screenReaderInstructions.draggable + }), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__.LiveRegion, { + id: liveRegionId, + announcement: announcement + })); + return container ? (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(markup, container) : markup; +} + +var Action; + +(function (Action) { + Action["DragStart"] = "dragStart"; + Action["DragMove"] = "dragMove"; + Action["DragEnd"] = "dragEnd"; + Action["DragCancel"] = "dragCancel"; + Action["DragOver"] = "dragOver"; + Action["RegisterDroppable"] = "registerDroppable"; + Action["SetDroppableDisabled"] = "setDroppableDisabled"; + Action["UnregisterDroppable"] = "unregisterDroppable"; +})(Action || (Action = {})); + +function noop() {} + +function useSensor(sensor, options) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + sensor, + options: options != null ? options : {} + }), // eslint-disable-next-line react-hooks/exhaustive-deps + [sensor, options]); +} + +function useSensors() { + for (var _len = arguments.length, sensors = new Array(_len), _key = 0; _key < _len; _key++) { + sensors[_key] = arguments[_key]; + } + + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => [...sensors].filter(sensor => sensor != null), // eslint-disable-next-line react-hooks/exhaustive-deps + [...sensors]); +} + +const defaultCoordinates = /*#__PURE__*/Object.freeze({ + x: 0, + y: 0 +}); + +/** + * Returns the distance between two points + */ +function distanceBetween(p1, p2) { + return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2)); +} + +function getRelativeTransformOrigin(event, rect) { + const eventCoordinates = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(event); + + if (!eventCoordinates) { + return '0 0'; + } + + const transformOrigin = { + x: (eventCoordinates.x - rect.left) / rect.width * 100, + y: (eventCoordinates.y - rect.top) / rect.height * 100 + }; + return transformOrigin.x + "% " + transformOrigin.y + "%"; +} + +/** + * Sort collisions from smallest to greatest value + */ +function sortCollisionsAsc(_ref, _ref2) { + let { + data: { + value: a + } + } = _ref; + let { + data: { + value: b + } + } = _ref2; + return a - b; +} +/** + * Sort collisions from greatest to smallest value + */ + +function sortCollisionsDesc(_ref3, _ref4) { + let { + data: { + value: a + } + } = _ref3; + let { + data: { + value: b + } + } = _ref4; + return b - a; +} +/** + * Returns the coordinates of the corners of a given rectangle: + * [TopLeft {x, y}, TopRight {x, y}, BottomLeft {x, y}, BottomRight {x, y}] + */ + +function cornersOfRectangle(_ref5) { + let { + left, + top, + height, + width + } = _ref5; + return [{ + x: left, + y: top + }, { + x: left + width, + y: top + }, { + x: left, + y: top + height + }, { + x: left + width, + y: top + height + }]; +} +function getFirstCollision(collisions, property) { + if (!collisions || collisions.length === 0) { + return null; + } + + const [firstCollision] = collisions; + return property ? firstCollision[property] : firstCollision; +} + +/** + * Returns the coordinates of the center of a given ClientRect + */ + +function centerOfRectangle(rect, left, top) { + if (left === void 0) { + left = rect.left; + } + + if (top === void 0) { + top = rect.top; + } + + return { + x: left + rect.width * 0.5, + y: top + rect.height * 0.5 + }; +} +/** + * Returns the closest rectangles from an array of rectangles to the center of a given + * rectangle. + */ + + +const closestCenter = _ref => { + let { + collisionRect, + droppableRects, + droppableContainers + } = _ref; + const centerRect = centerOfRectangle(collisionRect, collisionRect.left, collisionRect.top); + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect) { + const distBetween = distanceBetween(centerOfRectangle(rect), centerRect); + collisions.push({ + id, + data: { + droppableContainer, + value: distBetween + } + }); + } + } + + return collisions.sort(sortCollisionsAsc); +}; + +/** + * Returns the closest rectangles from an array of rectangles to the corners of + * another rectangle. + */ + +const closestCorners = _ref => { + let { + collisionRect, + droppableRects, + droppableContainers + } = _ref; + const corners = cornersOfRectangle(collisionRect); + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect) { + const rectCorners = cornersOfRectangle(rect); + const distances = corners.reduce((accumulator, corner, index) => { + return accumulator + distanceBetween(rectCorners[index], corner); + }, 0); + const effectiveDistance = Number((distances / 4).toFixed(4)); + collisions.push({ + id, + data: { + droppableContainer, + value: effectiveDistance + } + }); + } + } + + return collisions.sort(sortCollisionsAsc); +}; + +/** + * Returns the intersecting rectangle area between two rectangles + */ + +function getIntersectionRatio(entry, target) { + const top = Math.max(target.top, entry.top); + const left = Math.max(target.left, entry.left); + const right = Math.min(target.left + target.width, entry.left + entry.width); + const bottom = Math.min(target.top + target.height, entry.top + entry.height); + const width = right - left; + const height = bottom - top; + + if (left < right && top < bottom) { + const targetArea = target.width * target.height; + const entryArea = entry.width * entry.height; + const intersectionArea = width * height; + const intersectionRatio = intersectionArea / (targetArea + entryArea - intersectionArea); + return Number(intersectionRatio.toFixed(4)); + } // Rectangles do not overlap, or overlap has an area of zero (edge/corner overlap) + + + return 0; +} +/** + * Returns the rectangles that has the greatest intersection area with a given + * rectangle in an array of rectangles. + */ + +const rectIntersection = _ref => { + let { + collisionRect, + droppableRects, + droppableContainers + } = _ref; + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect) { + const intersectionRatio = getIntersectionRatio(rect, collisionRect); + + if (intersectionRatio > 0) { + collisions.push({ + id, + data: { + droppableContainer, + value: intersectionRatio + } + }); + } + } + } + + return collisions.sort(sortCollisionsDesc); +}; + +/** + * Check if a given point is contained within a bounding rectangle + */ + +function isPointWithinRect(point, rect) { + const { + top, + left, + bottom, + right + } = rect; + return top <= point.y && point.y <= bottom && left <= point.x && point.x <= right; +} +/** + * Returns the rectangles that the pointer is hovering over + */ + + +const pointerWithin = _ref => { + let { + droppableContainers, + droppableRects, + pointerCoordinates + } = _ref; + + if (!pointerCoordinates) { + return []; + } + + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect && isPointWithinRect(pointerCoordinates, rect)) { + /* There may be more than a single rectangle intersecting + * with the pointer coordinates. In order to sort the + * colliding rectangles, we measure the distance between + * the pointer and the corners of the intersecting rectangle + */ + const corners = cornersOfRectangle(rect); + const distances = corners.reduce((accumulator, corner) => { + return accumulator + distanceBetween(pointerCoordinates, corner); + }, 0); + const effectiveDistance = Number((distances / 4).toFixed(4)); + collisions.push({ + id, + data: { + droppableContainer, + value: effectiveDistance + } + }); + } + } + + return collisions.sort(sortCollisionsAsc); +}; + +function adjustScale(transform, rect1, rect2) { + return { ...transform, + scaleX: rect1 && rect2 ? rect1.width / rect2.width : 1, + scaleY: rect1 && rect2 ? rect1.height / rect2.height : 1 + }; +} + +function getRectDelta(rect1, rect2) { + return rect1 && rect2 ? { + x: rect1.left - rect2.left, + y: rect1.top - rect2.top + } : defaultCoordinates; +} + +function createRectAdjustmentFn(modifier) { + return function adjustClientRect(rect) { + for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + adjustments[_key - 1] = arguments[_key]; + } + + return adjustments.reduce((acc, adjustment) => ({ ...acc, + top: acc.top + modifier * adjustment.y, + bottom: acc.bottom + modifier * adjustment.y, + left: acc.left + modifier * adjustment.x, + right: acc.right + modifier * adjustment.x + }), { ...rect + }); + }; +} +const getAdjustedRect = /*#__PURE__*/createRectAdjustmentFn(1); + +function parseTransform(transform) { + if (transform.startsWith('matrix3d(')) { + const transformArray = transform.slice(9, -1).split(/, /); + return { + x: +transformArray[12], + y: +transformArray[13], + scaleX: +transformArray[0], + scaleY: +transformArray[5] + }; + } else if (transform.startsWith('matrix(')) { + const transformArray = transform.slice(7, -1).split(/, /); + return { + x: +transformArray[4], + y: +transformArray[5], + scaleX: +transformArray[0], + scaleY: +transformArray[3] + }; + } + + return null; +} + +function inverseTransform(rect, transform, transformOrigin) { + const parsedTransform = parseTransform(transform); + + if (!parsedTransform) { + return rect; + } + + const { + scaleX, + scaleY, + x: translateX, + y: translateY + } = parsedTransform; + const x = rect.left - translateX - (1 - scaleX) * parseFloat(transformOrigin); + const y = rect.top - translateY - (1 - scaleY) * parseFloat(transformOrigin.slice(transformOrigin.indexOf(' ') + 1)); + const w = scaleX ? rect.width / scaleX : rect.width; + const h = scaleY ? rect.height / scaleY : rect.height; + return { + width: w, + height: h, + top: y, + right: x + w, + bottom: y + h, + left: x + }; +} + +const defaultOptions = { + ignoreTransform: false +}; +/** + * Returns the bounding client rect of an element relative to the viewport. + */ + +function getClientRect(element, options) { + if (options === void 0) { + options = defaultOptions; + } + + let rect = element.getBoundingClientRect(); + + if (options.ignoreTransform) { + const { + transform, + transformOrigin + } = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element).getComputedStyle(element); + + if (transform) { + rect = inverseTransform(rect, transform, transformOrigin); + } + } + + const { + top, + left, + width, + height, + bottom, + right + } = rect; + return { + top, + left, + width, + height, + bottom, + right + }; +} +/** + * Returns the bounding client rect of an element relative to the viewport. + * + * @remarks + * The ClientRect returned by this method does not take into account transforms + * applied to the element it measures. + * + */ + +function getTransformAgnosticClientRect(element) { + return getClientRect(element, { + ignoreTransform: true + }); +} + +function getWindowClientRect(element) { + const width = element.innerWidth; + const height = element.innerHeight; + return { + top: 0, + left: 0, + right: width, + bottom: height, + width, + height + }; +} + +function isFixed(node, computedStyle) { + if (computedStyle === void 0) { + computedStyle = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(node).getComputedStyle(node); + } + + return computedStyle.position === 'fixed'; +} + +function isScrollable(element, computedStyle) { + if (computedStyle === void 0) { + computedStyle = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element).getComputedStyle(element); + } + + const overflowRegex = /(auto|scroll|overlay)/; + const properties = ['overflow', 'overflowX', 'overflowY']; + return properties.some(property => { + const value = computedStyle[property]; + return typeof value === 'string' ? overflowRegex.test(value) : false; + }); +} + +function getScrollableAncestors(element, limit) { + const scrollParents = []; + + function findScrollableAncestors(node) { + if (limit != null && scrollParents.length >= limit) { + return scrollParents; + } + + if (!node) { + return scrollParents; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isDocument)(node) && node.scrollingElement != null && !scrollParents.includes(node.scrollingElement)) { + scrollParents.push(node.scrollingElement); + return scrollParents; + } + + if (!(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(node) || (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isSVGElement)(node)) { + return scrollParents; + } + + if (scrollParents.includes(node)) { + return scrollParents; + } + + const computedStyle = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element).getComputedStyle(node); + + if (node !== element) { + if (isScrollable(node, computedStyle)) { + scrollParents.push(node); + } + } + + if (isFixed(node, computedStyle)) { + return scrollParents; + } + + return findScrollableAncestors(node.parentNode); + } + + if (!element) { + return scrollParents; + } + + return findScrollableAncestors(element); +} +function getFirstScrollableAncestor(node) { + const [firstScrollableAncestor] = getScrollableAncestors(node, 1); + return firstScrollableAncestor != null ? firstScrollableAncestor : null; +} + +function getScrollableElement(element) { + if (!_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.canUseDOM || !element) { + return null; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isWindow)(element)) { + return element; + } + + if (!(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isNode)(element)) { + return null; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isDocument)(element) || element === (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(element).scrollingElement) { + return window; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(element)) { + return element; + } + + return null; +} + +function getScrollXCoordinate(element) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isWindow)(element)) { + return element.scrollX; + } + + return element.scrollLeft; +} +function getScrollYCoordinate(element) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isWindow)(element)) { + return element.scrollY; + } + + return element.scrollTop; +} +function getScrollCoordinates(element) { + return { + x: getScrollXCoordinate(element), + y: getScrollYCoordinate(element) + }; +} + +var Direction; + +(function (Direction) { + Direction[Direction["Forward"] = 1] = "Forward"; + Direction[Direction["Backward"] = -1] = "Backward"; +})(Direction || (Direction = {})); + +function isDocumentScrollingElement(element) { + if (!_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.canUseDOM || !element) { + return false; + } + + return element === document.scrollingElement; +} + +function getScrollPosition(scrollingContainer) { + const minScroll = { + x: 0, + y: 0 + }; + const dimensions = isDocumentScrollingElement(scrollingContainer) ? { + height: window.innerHeight, + width: window.innerWidth + } : { + height: scrollingContainer.clientHeight, + width: scrollingContainer.clientWidth + }; + const maxScroll = { + x: scrollingContainer.scrollWidth - dimensions.width, + y: scrollingContainer.scrollHeight - dimensions.height + }; + const isTop = scrollingContainer.scrollTop <= minScroll.y; + const isLeft = scrollingContainer.scrollLeft <= minScroll.x; + const isBottom = scrollingContainer.scrollTop >= maxScroll.y; + const isRight = scrollingContainer.scrollLeft >= maxScroll.x; + return { + isTop, + isLeft, + isBottom, + isRight, + maxScroll, + minScroll + }; +} + +const defaultThreshold = { + x: 0.2, + y: 0.2 +}; +function getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, _ref, acceleration, thresholdPercentage) { + let { + top, + left, + right, + bottom + } = _ref; + + if (acceleration === void 0) { + acceleration = 10; + } + + if (thresholdPercentage === void 0) { + thresholdPercentage = defaultThreshold; + } + + const { + isTop, + isBottom, + isLeft, + isRight + } = getScrollPosition(scrollContainer); + const direction = { + x: 0, + y: 0 + }; + const speed = { + x: 0, + y: 0 + }; + const threshold = { + height: scrollContainerRect.height * thresholdPercentage.y, + width: scrollContainerRect.width * thresholdPercentage.x + }; + + if (!isTop && top <= scrollContainerRect.top + threshold.height) { + // Scroll Up + direction.y = Direction.Backward; + speed.y = acceleration * Math.abs((scrollContainerRect.top + threshold.height - top) / threshold.height); + } else if (!isBottom && bottom >= scrollContainerRect.bottom - threshold.height) { + // Scroll Down + direction.y = Direction.Forward; + speed.y = acceleration * Math.abs((scrollContainerRect.bottom - threshold.height - bottom) / threshold.height); + } + + if (!isRight && right >= scrollContainerRect.right - threshold.width) { + // Scroll Right + direction.x = Direction.Forward; + speed.x = acceleration * Math.abs((scrollContainerRect.right - threshold.width - right) / threshold.width); + } else if (!isLeft && left <= scrollContainerRect.left + threshold.width) { + // Scroll Left + direction.x = Direction.Backward; + speed.x = acceleration * Math.abs((scrollContainerRect.left + threshold.width - left) / threshold.width); + } + + return { + direction, + speed + }; +} + +function getScrollElementRect(element) { + if (element === document.scrollingElement) { + const { + innerWidth, + innerHeight + } = window; + return { + top: 0, + left: 0, + right: innerWidth, + bottom: innerHeight, + width: innerWidth, + height: innerHeight + }; + } + + const { + top, + left, + right, + bottom + } = element.getBoundingClientRect(); + return { + top, + left, + right, + bottom, + width: element.clientWidth, + height: element.clientHeight + }; +} + +function getScrollOffsets(scrollableAncestors) { + return scrollableAncestors.reduce((acc, node) => { + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(acc, getScrollCoordinates(node)); + }, defaultCoordinates); +} +function getScrollXOffset(scrollableAncestors) { + return scrollableAncestors.reduce((acc, node) => { + return acc + getScrollXCoordinate(node); + }, 0); +} +function getScrollYOffset(scrollableAncestors) { + return scrollableAncestors.reduce((acc, node) => { + return acc + getScrollYCoordinate(node); + }, 0); +} + +function scrollIntoViewIfNeeded(element, measure) { + if (measure === void 0) { + measure = getClientRect; + } + + if (!element) { + return; + } + + const { + top, + left, + bottom, + right + } = measure(element); + const firstScrollableAncestor = getFirstScrollableAncestor(element); + + if (!firstScrollableAncestor) { + return; + } + + if (bottom <= 0 || right <= 0 || top >= window.innerHeight || left >= window.innerWidth) { + element.scrollIntoView({ + block: 'center', + inline: 'center' + }); + } +} + +const properties = [['x', ['left', 'right'], getScrollXOffset], ['y', ['top', 'bottom'], getScrollYOffset]]; +class Rect { + constructor(rect, element) { + this.rect = void 0; + this.width = void 0; + this.height = void 0; + this.top = void 0; + this.bottom = void 0; + this.right = void 0; + this.left = void 0; + const scrollableAncestors = getScrollableAncestors(element); + const scrollOffsets = getScrollOffsets(scrollableAncestors); + this.rect = { ...rect + }; + this.width = rect.width; + this.height = rect.height; + + for (const [axis, keys, getScrollOffset] of properties) { + for (const key of keys) { + Object.defineProperty(this, key, { + get: () => { + const currentOffsets = getScrollOffset(scrollableAncestors); + const scrollOffsetsDeltla = scrollOffsets[axis] - currentOffsets; + return this.rect[key] + scrollOffsetsDeltla; + }, + enumerable: true + }); + } + } + + Object.defineProperty(this, 'rect', { + enumerable: false + }); + } + +} + +class Listeners { + constructor(target) { + this.target = void 0; + this.listeners = []; + + this.removeAll = () => { + this.listeners.forEach(listener => { + var _this$target; + + return (_this$target = this.target) == null ? void 0 : _this$target.removeEventListener(...listener); + }); + }; + + this.target = target; + } + + add(eventName, handler, options) { + var _this$target2; + + (_this$target2 = this.target) == null ? void 0 : _this$target2.addEventListener(eventName, handler, options); + this.listeners.push([eventName, handler, options]); + } + +} + +function getEventListenerTarget(target) { + // If the `event.target` element is removed from the document events will still be targeted + // at it, and hence won't always bubble up to the window or document anymore. + // If there is any risk of an element being removed while it is being dragged, + // the best practice is to attach the event listeners directly to the target. + // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget + const { + EventTarget + } = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(target); + return target instanceof EventTarget ? target : (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(target); +} + +function hasExceededDistance(delta, measurement) { + const dx = Math.abs(delta.x); + const dy = Math.abs(delta.y); + + if (typeof measurement === 'number') { + return Math.sqrt(dx ** 2 + dy ** 2) > measurement; + } + + if ('x' in measurement && 'y' in measurement) { + return dx > measurement.x && dy > measurement.y; + } + + if ('x' in measurement) { + return dx > measurement.x; + } + + if ('y' in measurement) { + return dy > measurement.y; + } + + return false; +} + +var EventName; + +(function (EventName) { + EventName["Click"] = "click"; + EventName["DragStart"] = "dragstart"; + EventName["Keydown"] = "keydown"; + EventName["ContextMenu"] = "contextmenu"; + EventName["Resize"] = "resize"; + EventName["SelectionChange"] = "selectionchange"; + EventName["VisibilityChange"] = "visibilitychange"; +})(EventName || (EventName = {})); + +function preventDefault(event) { + event.preventDefault(); +} +function stopPropagation(event) { + event.stopPropagation(); +} + +var KeyboardCode; + +(function (KeyboardCode) { + KeyboardCode["Space"] = "Space"; + KeyboardCode["Down"] = "ArrowDown"; + KeyboardCode["Right"] = "ArrowRight"; + KeyboardCode["Left"] = "ArrowLeft"; + KeyboardCode["Up"] = "ArrowUp"; + KeyboardCode["Esc"] = "Escape"; + KeyboardCode["Enter"] = "Enter"; + KeyboardCode["Tab"] = "Tab"; +})(KeyboardCode || (KeyboardCode = {})); + +const defaultKeyboardCodes = { + start: [KeyboardCode.Space, KeyboardCode.Enter], + cancel: [KeyboardCode.Esc], + end: [KeyboardCode.Space, KeyboardCode.Enter, KeyboardCode.Tab] +}; +const defaultKeyboardCoordinateGetter = (event, _ref) => { + let { + currentCoordinates + } = _ref; + + switch (event.code) { + case KeyboardCode.Right: + return { ...currentCoordinates, + x: currentCoordinates.x + 25 + }; + + case KeyboardCode.Left: + return { ...currentCoordinates, + x: currentCoordinates.x - 25 + }; + + case KeyboardCode.Down: + return { ...currentCoordinates, + y: currentCoordinates.y + 25 + }; + + case KeyboardCode.Up: + return { ...currentCoordinates, + y: currentCoordinates.y - 25 + }; + } + + return undefined; +}; + +class KeyboardSensor { + constructor(props) { + this.props = void 0; + this.autoScrollEnabled = false; + this.referenceCoordinates = void 0; + this.listeners = void 0; + this.windowListeners = void 0; + this.props = props; + const { + event: { + target + } + } = props; + this.props = props; + this.listeners = new Listeners((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(target)); + this.windowListeners = new Listeners((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(target)); + this.handleKeyDown = this.handleKeyDown.bind(this); + this.handleCancel = this.handleCancel.bind(this); + this.attach(); + } + + attach() { + this.handleStart(); + this.windowListeners.add(EventName.Resize, this.handleCancel); + this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); + setTimeout(() => this.listeners.add(EventName.Keydown, this.handleKeyDown)); + } + + handleStart() { + const { + activeNode, + onStart + } = this.props; + const node = activeNode.node.current; + + if (node) { + scrollIntoViewIfNeeded(node); + } + + onStart(defaultCoordinates); + } + + handleKeyDown(event) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(event)) { + const { + active, + context, + options + } = this.props; + const { + keyboardCodes = defaultKeyboardCodes, + coordinateGetter = defaultKeyboardCoordinateGetter, + scrollBehavior = 'smooth' + } = options; + const { + code + } = event; + + if (keyboardCodes.end.includes(code)) { + this.handleEnd(event); + return; + } + + if (keyboardCodes.cancel.includes(code)) { + this.handleCancel(event); + return; + } + + const { + collisionRect + } = context.current; + const currentCoordinates = collisionRect ? { + x: collisionRect.left, + y: collisionRect.top + } : defaultCoordinates; + + if (!this.referenceCoordinates) { + this.referenceCoordinates = currentCoordinates; + } + + const newCoordinates = coordinateGetter(event, { + active, + context: context.current, + currentCoordinates + }); + + if (newCoordinates) { + const coordinatesDelta = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(newCoordinates, currentCoordinates); + const scrollDelta = { + x: 0, + y: 0 + }; + const { + scrollableAncestors + } = context.current; + + for (const scrollContainer of scrollableAncestors) { + const direction = event.code; + const { + isTop, + isRight, + isLeft, + isBottom, + maxScroll, + minScroll + } = getScrollPosition(scrollContainer); + const scrollElementRect = getScrollElementRect(scrollContainer); + const clampedCoordinates = { + x: Math.min(direction === KeyboardCode.Right ? scrollElementRect.right - scrollElementRect.width / 2 : scrollElementRect.right, Math.max(direction === KeyboardCode.Right ? scrollElementRect.left : scrollElementRect.left + scrollElementRect.width / 2, newCoordinates.x)), + y: Math.min(direction === KeyboardCode.Down ? scrollElementRect.bottom - scrollElementRect.height / 2 : scrollElementRect.bottom, Math.max(direction === KeyboardCode.Down ? scrollElementRect.top : scrollElementRect.top + scrollElementRect.height / 2, newCoordinates.y)) + }; + const canScrollX = direction === KeyboardCode.Right && !isRight || direction === KeyboardCode.Left && !isLeft; + const canScrollY = direction === KeyboardCode.Down && !isBottom || direction === KeyboardCode.Up && !isTop; + + if (canScrollX && clampedCoordinates.x !== newCoordinates.x) { + const newScrollCoordinates = scrollContainer.scrollLeft + coordinatesDelta.x; + const canScrollToNewCoordinates = direction === KeyboardCode.Right && newScrollCoordinates <= maxScroll.x || direction === KeyboardCode.Left && newScrollCoordinates >= minScroll.x; + + if (canScrollToNewCoordinates && !coordinatesDelta.y) { + // We don't need to update coordinates, the scroll adjustment alone will trigger + // logic to auto-detect the new container we are over + scrollContainer.scrollTo({ + left: newScrollCoordinates, + behavior: scrollBehavior + }); + return; + } + + if (canScrollToNewCoordinates) { + scrollDelta.x = scrollContainer.scrollLeft - newScrollCoordinates; + } else { + scrollDelta.x = direction === KeyboardCode.Right ? scrollContainer.scrollLeft - maxScroll.x : scrollContainer.scrollLeft - minScroll.x; + } + + if (scrollDelta.x) { + scrollContainer.scrollBy({ + left: -scrollDelta.x, + behavior: scrollBehavior + }); + } + + break; + } else if (canScrollY && clampedCoordinates.y !== newCoordinates.y) { + const newScrollCoordinates = scrollContainer.scrollTop + coordinatesDelta.y; + const canScrollToNewCoordinates = direction === KeyboardCode.Down && newScrollCoordinates <= maxScroll.y || direction === KeyboardCode.Up && newScrollCoordinates >= minScroll.y; + + if (canScrollToNewCoordinates && !coordinatesDelta.x) { + // We don't need to update coordinates, the scroll adjustment alone will trigger + // logic to auto-detect the new container we are over + scrollContainer.scrollTo({ + top: newScrollCoordinates, + behavior: scrollBehavior + }); + return; + } + + if (canScrollToNewCoordinates) { + scrollDelta.y = scrollContainer.scrollTop - newScrollCoordinates; + } else { + scrollDelta.y = direction === KeyboardCode.Down ? scrollContainer.scrollTop - maxScroll.y : scrollContainer.scrollTop - minScroll.y; + } + + if (scrollDelta.y) { + scrollContainer.scrollBy({ + top: -scrollDelta.y, + behavior: scrollBehavior + }); + } + + break; + } + } + + this.handleMove(event, (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(newCoordinates, this.referenceCoordinates), scrollDelta)); + } + } + } + + handleMove(event, coordinates) { + const { + onMove + } = this.props; + event.preventDefault(); + onMove(coordinates); + } + + handleEnd(event) { + const { + onEnd + } = this.props; + event.preventDefault(); + this.detach(); + onEnd(); + } + + handleCancel(event) { + const { + onCancel + } = this.props; + event.preventDefault(); + this.detach(); + onCancel(); + } + + detach() { + this.listeners.removeAll(); + this.windowListeners.removeAll(); + } + +} +KeyboardSensor.activators = [{ + eventName: 'onKeyDown', + handler: (event, _ref, _ref2) => { + let { + keyboardCodes = defaultKeyboardCodes, + onActivation + } = _ref; + let { + active + } = _ref2; + const { + code + } = event.nativeEvent; + + if (keyboardCodes.start.includes(code)) { + const activator = active.activatorNode.current; + + if (activator && event.target !== activator) { + return false; + } + + event.preventDefault(); + onActivation == null ? void 0 : onActivation({ + event: event.nativeEvent + }); + return true; + } + + return false; + } +}]; + +function isDistanceConstraint(constraint) { + return Boolean(constraint && 'distance' in constraint); +} + +function isDelayConstraint(constraint) { + return Boolean(constraint && 'delay' in constraint); +} + +class AbstractPointerSensor { + constructor(props, events, listenerTarget) { + var _getEventCoordinates; + + if (listenerTarget === void 0) { + listenerTarget = getEventListenerTarget(props.event.target); + } + + this.props = void 0; + this.events = void 0; + this.autoScrollEnabled = true; + this.document = void 0; + this.activated = false; + this.initialCoordinates = void 0; + this.timeoutId = null; + this.listeners = void 0; + this.documentListeners = void 0; + this.windowListeners = void 0; + this.props = props; + this.events = events; + const { + event + } = props; + const { + target + } = event; + this.props = props; + this.events = events; + this.document = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(target); + this.documentListeners = new Listeners(this.document); + this.listeners = new Listeners(listenerTarget); + this.windowListeners = new Listeners((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(target)); + this.initialCoordinates = (_getEventCoordinates = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(event)) != null ? _getEventCoordinates : defaultCoordinates; + this.handleStart = this.handleStart.bind(this); + this.handleMove = this.handleMove.bind(this); + this.handleEnd = this.handleEnd.bind(this); + this.handleCancel = this.handleCancel.bind(this); + this.handleKeydown = this.handleKeydown.bind(this); + this.removeTextSelection = this.removeTextSelection.bind(this); + this.attach(); + } + + attach() { + const { + events, + props: { + options: { + activationConstraint, + bypassActivationConstraint + } + } + } = this; + this.listeners.add(events.move.name, this.handleMove, { + passive: false + }); + this.listeners.add(events.end.name, this.handleEnd); + + if (events.cancel) { + this.listeners.add(events.cancel.name, this.handleCancel); + } + + this.windowListeners.add(EventName.Resize, this.handleCancel); + this.windowListeners.add(EventName.DragStart, preventDefault); + this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); + this.windowListeners.add(EventName.ContextMenu, preventDefault); + this.documentListeners.add(EventName.Keydown, this.handleKeydown); + + if (activationConstraint) { + if (bypassActivationConstraint != null && bypassActivationConstraint({ + event: this.props.event, + activeNode: this.props.activeNode, + options: this.props.options + })) { + return this.handleStart(); + } + + if (isDelayConstraint(activationConstraint)) { + this.timeoutId = setTimeout(this.handleStart, activationConstraint.delay); + this.handlePending(activationConstraint); + return; + } + + if (isDistanceConstraint(activationConstraint)) { + this.handlePending(activationConstraint); + return; + } + } + + this.handleStart(); + } + + detach() { + this.listeners.removeAll(); + this.windowListeners.removeAll(); // Wait until the next event loop before removing document listeners + // This is necessary because we listen for `click` and `selection` events on the document + + setTimeout(this.documentListeners.removeAll, 50); + + if (this.timeoutId !== null) { + clearTimeout(this.timeoutId); + this.timeoutId = null; + } + } + + handlePending(constraint, offset) { + const { + active, + onPending + } = this.props; + onPending(active, constraint, this.initialCoordinates, offset); + } + + handleStart() { + const { + initialCoordinates + } = this; + const { + onStart + } = this.props; + + if (initialCoordinates) { + this.activated = true; // Stop propagation of click events once activation constraints are met + + this.documentListeners.add(EventName.Click, stopPropagation, { + capture: true + }); // Remove any text selection from the document + + this.removeTextSelection(); // Prevent further text selection while dragging + + this.documentListeners.add(EventName.SelectionChange, this.removeTextSelection); + onStart(initialCoordinates); + } + } + + handleMove(event) { + var _getEventCoordinates2; + + const { + activated, + initialCoordinates, + props + } = this; + const { + onMove, + options: { + activationConstraint + } + } = props; + + if (!initialCoordinates) { + return; + } + + const coordinates = (_getEventCoordinates2 = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(event)) != null ? _getEventCoordinates2 : defaultCoordinates; + const delta = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(initialCoordinates, coordinates); // Constraint validation + + if (!activated && activationConstraint) { + if (isDistanceConstraint(activationConstraint)) { + if (activationConstraint.tolerance != null && hasExceededDistance(delta, activationConstraint.tolerance)) { + return this.handleCancel(); + } + + if (hasExceededDistance(delta, activationConstraint.distance)) { + return this.handleStart(); + } + } + + if (isDelayConstraint(activationConstraint)) { + if (hasExceededDistance(delta, activationConstraint.tolerance)) { + return this.handleCancel(); + } + } + + this.handlePending(activationConstraint, delta); + return; + } + + if (event.cancelable) { + event.preventDefault(); + } + + onMove(coordinates); + } + + handleEnd() { + const { + onAbort, + onEnd + } = this.props; + this.detach(); + + if (!this.activated) { + onAbort(this.props.active); + } + + onEnd(); + } + + handleCancel() { + const { + onAbort, + onCancel + } = this.props; + this.detach(); + + if (!this.activated) { + onAbort(this.props.active); + } + + onCancel(); + } + + handleKeydown(event) { + if (event.code === KeyboardCode.Esc) { + this.handleCancel(); + } + } + + removeTextSelection() { + var _this$document$getSel; + + (_this$document$getSel = this.document.getSelection()) == null ? void 0 : _this$document$getSel.removeAllRanges(); + } + +} + +const events = { + cancel: { + name: 'pointercancel' + }, + move: { + name: 'pointermove' + }, + end: { + name: 'pointerup' + } +}; +class PointerSensor extends AbstractPointerSensor { + constructor(props) { + const { + event + } = props; // Pointer events stop firing if the target is unmounted while dragging + // Therefore we attach listeners to the owner document instead + + const listenerTarget = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(event.target); + super(props, events, listenerTarget); + } + +} +PointerSensor.activators = [{ + eventName: 'onPointerDown', + handler: (_ref, _ref2) => { + let { + nativeEvent: event + } = _ref; + let { + onActivation + } = _ref2; + + if (!event.isPrimary || event.button !== 0) { + return false; + } + + onActivation == null ? void 0 : onActivation({ + event + }); + return true; + } +}]; + +const events$1 = { + move: { + name: 'mousemove' + }, + end: { + name: 'mouseup' + } +}; +var MouseButton; + +(function (MouseButton) { + MouseButton[MouseButton["RightClick"] = 2] = "RightClick"; +})(MouseButton || (MouseButton = {})); + +class MouseSensor extends AbstractPointerSensor { + constructor(props) { + super(props, events$1, (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(props.event.target)); + } + +} +MouseSensor.activators = [{ + eventName: 'onMouseDown', + handler: (_ref, _ref2) => { + let { + nativeEvent: event + } = _ref; + let { + onActivation + } = _ref2; + + if (event.button === MouseButton.RightClick) { + return false; + } + + onActivation == null ? void 0 : onActivation({ + event + }); + return true; + } +}]; + +const events$2 = { + cancel: { + name: 'touchcancel' + }, + move: { + name: 'touchmove' + }, + end: { + name: 'touchend' + } +}; +class TouchSensor extends AbstractPointerSensor { + constructor(props) { + super(props, events$2); + } + + static setup() { + // Adding a non-capture and non-passive `touchmove` listener in order + // to force `event.preventDefault()` calls to work in dynamically added + // touchmove event handlers. This is required for iOS Safari. + window.addEventListener(events$2.move.name, noop, { + capture: false, + passive: false + }); + return function teardown() { + window.removeEventListener(events$2.move.name, noop); + }; // We create a new handler because the teardown function of another sensor + // could remove our event listener if we use a referentially equal listener. + + function noop() {} + } + +} +TouchSensor.activators = [{ + eventName: 'onTouchStart', + handler: (_ref, _ref2) => { + let { + nativeEvent: event + } = _ref; + let { + onActivation + } = _ref2; + const { + touches + } = event; + + if (touches.length > 1) { + return false; + } + + onActivation == null ? void 0 : onActivation({ + event + }); + return true; + } +}]; + +var AutoScrollActivator; + +(function (AutoScrollActivator) { + AutoScrollActivator[AutoScrollActivator["Pointer"] = 0] = "Pointer"; + AutoScrollActivator[AutoScrollActivator["DraggableRect"] = 1] = "DraggableRect"; +})(AutoScrollActivator || (AutoScrollActivator = {})); + +var TraversalOrder; + +(function (TraversalOrder) { + TraversalOrder[TraversalOrder["TreeOrder"] = 0] = "TreeOrder"; + TraversalOrder[TraversalOrder["ReversedTreeOrder"] = 1] = "ReversedTreeOrder"; +})(TraversalOrder || (TraversalOrder = {})); + +function useAutoScroller(_ref) { + let { + acceleration, + activator = AutoScrollActivator.Pointer, + canScroll, + draggingRect, + enabled, + interval = 5, + order = TraversalOrder.TreeOrder, + pointerCoordinates, + scrollableAncestors, + scrollableAncestorRects, + delta, + threshold + } = _ref; + const scrollIntent = useScrollIntent({ + delta, + disabled: !enabled + }); + const [setAutoScrollInterval, clearAutoScrollInterval] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useInterval)(); + const scrollSpeed = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + x: 0, + y: 0 + }); + const scrollDirection = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + x: 0, + y: 0 + }); + const rect = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + switch (activator) { + case AutoScrollActivator.Pointer: + return pointerCoordinates ? { + top: pointerCoordinates.y, + bottom: pointerCoordinates.y, + left: pointerCoordinates.x, + right: pointerCoordinates.x + } : null; + + case AutoScrollActivator.DraggableRect: + return draggingRect; + } + }, [activator, draggingRect, pointerCoordinates]); + const scrollContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const autoScroll = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => { + const scrollContainer = scrollContainerRef.current; + + if (!scrollContainer) { + return; + } + + const scrollLeft = scrollSpeed.current.x * scrollDirection.current.x; + const scrollTop = scrollSpeed.current.y * scrollDirection.current.y; + scrollContainer.scrollBy(scrollLeft, scrollTop); + }, []); + const sortedScrollableAncestors = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => order === TraversalOrder.TreeOrder ? [...scrollableAncestors].reverse() : scrollableAncestors, [order, scrollableAncestors]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!enabled || !scrollableAncestors.length || !rect) { + clearAutoScrollInterval(); + return; + } + + for (const scrollContainer of sortedScrollableAncestors) { + if ((canScroll == null ? void 0 : canScroll(scrollContainer)) === false) { + continue; + } + + const index = scrollableAncestors.indexOf(scrollContainer); + const scrollContainerRect = scrollableAncestorRects[index]; + + if (!scrollContainerRect) { + continue; + } + + const { + direction, + speed + } = getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, rect, acceleration, threshold); + + for (const axis of ['x', 'y']) { + if (!scrollIntent[axis][direction[axis]]) { + speed[axis] = 0; + direction[axis] = 0; + } + } + + if (speed.x > 0 || speed.y > 0) { + clearAutoScrollInterval(); + scrollContainerRef.current = scrollContainer; + setAutoScrollInterval(autoScroll, interval); + scrollSpeed.current = speed; + scrollDirection.current = direction; + return; + } + } + + scrollSpeed.current = { + x: 0, + y: 0 + }; + scrollDirection.current = { + x: 0, + y: 0 + }; + clearAutoScrollInterval(); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [acceleration, autoScroll, canScroll, clearAutoScrollInterval, enabled, interval, // eslint-disable-next-line react-hooks/exhaustive-deps + JSON.stringify(rect), // eslint-disable-next-line react-hooks/exhaustive-deps + JSON.stringify(scrollIntent), setAutoScrollInterval, scrollableAncestors, sortedScrollableAncestors, scrollableAncestorRects, // eslint-disable-next-line react-hooks/exhaustive-deps + JSON.stringify(threshold)]); +} +const defaultScrollIntent = { + x: { + [Direction.Backward]: false, + [Direction.Forward]: false + }, + y: { + [Direction.Backward]: false, + [Direction.Forward]: false + } +}; + +function useScrollIntent(_ref2) { + let { + delta, + disabled + } = _ref2; + const previousDelta = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(delta); + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousIntent => { + if (disabled || !previousDelta || !previousIntent) { + // Reset scroll intent tracking when auto-scrolling is disabled + return defaultScrollIntent; + } + + const direction = { + x: Math.sign(delta.x - previousDelta.x), + y: Math.sign(delta.y - previousDelta.y) + }; // Keep track of the user intent to scroll in each direction for both axis + + return { + x: { + [Direction.Backward]: previousIntent.x[Direction.Backward] || direction.x === -1, + [Direction.Forward]: previousIntent.x[Direction.Forward] || direction.x === 1 + }, + y: { + [Direction.Backward]: previousIntent.y[Direction.Backward] || direction.y === -1, + [Direction.Forward]: previousIntent.y[Direction.Forward] || direction.y === 1 + } + }; + }, [disabled, delta, previousDelta]); +} + +function useCachedNode(draggableNodes, id) { + const draggableNode = id != null ? draggableNodes.get(id) : undefined; + const node = draggableNode ? draggableNode.node.current : null; + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(cachedNode => { + var _ref; + + if (id == null) { + return null; + } // In some cases, the draggable node can unmount while dragging + // This is the case for virtualized lists. In those situations, + // we fall back to the last known value for that node. + + + return (_ref = node != null ? node : cachedNode) != null ? _ref : null; + }, [node, id]); +} + +function useCombineActivators(sensors, getSyntheticHandler) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => sensors.reduce((accumulator, sensor) => { + const { + sensor: Sensor + } = sensor; + const sensorActivators = Sensor.activators.map(activator => ({ + eventName: activator.eventName, + handler: getSyntheticHandler(activator.handler, sensor) + })); + return [...accumulator, ...sensorActivators]; + }, []), [sensors, getSyntheticHandler]); +} + +var MeasuringStrategy; + +(function (MeasuringStrategy) { + MeasuringStrategy[MeasuringStrategy["Always"] = 0] = "Always"; + MeasuringStrategy[MeasuringStrategy["BeforeDragging"] = 1] = "BeforeDragging"; + MeasuringStrategy[MeasuringStrategy["WhileDragging"] = 2] = "WhileDragging"; +})(MeasuringStrategy || (MeasuringStrategy = {})); + +var MeasuringFrequency; + +(function (MeasuringFrequency) { + MeasuringFrequency["Optimized"] = "optimized"; +})(MeasuringFrequency || (MeasuringFrequency = {})); + +const defaultValue = /*#__PURE__*/new Map(); +function useDroppableMeasuring(containers, _ref) { + let { + dragging, + dependencies, + config + } = _ref; + const [queue, setQueue] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const { + frequency, + measure, + strategy + } = config; + const containersRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(containers); + const disabled = isDisabled(); + const disabledRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(disabled); + const measureDroppableContainers = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (ids) { + if (ids === void 0) { + ids = []; + } + + if (disabledRef.current) { + return; + } + + setQueue(value => { + if (value === null) { + return ids; + } + + return value.concat(ids.filter(id => !value.includes(id))); + }); + }, [disabledRef]); + const timeoutId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const droppableRects = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousValue => { + if (disabled && !dragging) { + return defaultValue; + } + + if (!previousValue || previousValue === defaultValue || containersRef.current !== containers || queue != null) { + const map = new Map(); + + for (let container of containers) { + if (!container) { + continue; + } + + if (queue && queue.length > 0 && !queue.includes(container.id) && container.rect.current) { + // This container does not need to be re-measured + map.set(container.id, container.rect.current); + continue; + } + + const node = container.node.current; + const rect = node ? new Rect(measure(node), node) : null; + container.rect.current = rect; + + if (rect) { + map.set(container.id, rect); + } + } + + return map; + } + + return previousValue; + }, [containers, queue, dragging, disabled, measure]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + containersRef.current = containers; + }, [containers]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled) { + return; + } + + measureDroppableContainers(); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [dragging, disabled]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (queue && queue.length > 0) { + setQueue(null); + } + }, //eslint-disable-next-line react-hooks/exhaustive-deps + [JSON.stringify(queue)]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled || typeof frequency !== 'number' || timeoutId.current !== null) { + return; + } + + timeoutId.current = setTimeout(() => { + measureDroppableContainers(); + timeoutId.current = null; + }, frequency); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [frequency, disabled, measureDroppableContainers, ...dependencies]); + return { + droppableRects, + measureDroppableContainers, + measuringScheduled: queue != null + }; + + function isDisabled() { + switch (strategy) { + case MeasuringStrategy.Always: + return false; + + case MeasuringStrategy.BeforeDragging: + return dragging; + + default: + return !dragging; + } + } +} + +function useInitialValue(value, computeFn) { + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousValue => { + if (!value) { + return null; + } + + if (previousValue) { + return previousValue; + } + + return typeof computeFn === 'function' ? computeFn(value) : value; + }, [computeFn, value]); +} + +function useInitialRect(node, measure) { + return useInitialValue(node, measure); +} + +/** + * Returns a new MutationObserver instance. + * If `MutationObserver` is undefined in the execution environment, returns `undefined`. + */ + +function useMutationObserver(_ref) { + let { + callback, + disabled + } = _ref; + const handleMutations = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useEvent)(callback); + const mutationObserver = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (disabled || typeof window === 'undefined' || typeof window.MutationObserver === 'undefined') { + return undefined; + } + + const { + MutationObserver + } = window; + return new MutationObserver(handleMutations); + }, [handleMutations, disabled]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + return () => mutationObserver == null ? void 0 : mutationObserver.disconnect(); + }, [mutationObserver]); + return mutationObserver; +} + +/** + * Returns a new ResizeObserver instance bound to the `onResize` callback. + * If `ResizeObserver` is undefined in the execution environment, returns `undefined`. + */ + +function useResizeObserver(_ref) { + let { + callback, + disabled + } = _ref; + const handleResize = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useEvent)(callback); + const resizeObserver = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (disabled || typeof window === 'undefined' || typeof window.ResizeObserver === 'undefined') { + return undefined; + } + + const { + ResizeObserver + } = window; + return new ResizeObserver(handleResize); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [disabled]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + return () => resizeObserver == null ? void 0 : resizeObserver.disconnect(); + }, [resizeObserver]); + return resizeObserver; +} + +function defaultMeasure(element) { + return new Rect(getClientRect(element), element); +} + +function useRect(element, measure, fallbackRect) { + if (measure === void 0) { + measure = defaultMeasure; + } + + const [rect, setRect] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + + function measureRect() { + setRect(currentRect => { + if (!element) { + return null; + } + + if (element.isConnected === false) { + var _ref; + + // Fall back to last rect we measured if the element is + // no longer connected to the DOM. + return (_ref = currentRect != null ? currentRect : fallbackRect) != null ? _ref : null; + } + + const newRect = measure(element); + + if (JSON.stringify(currentRect) === JSON.stringify(newRect)) { + return currentRect; + } + + return newRect; + }); + } + + const mutationObserver = useMutationObserver({ + callback(records) { + if (!element) { + return; + } + + for (const record of records) { + const { + type, + target + } = record; + + if (type === 'childList' && target instanceof HTMLElement && target.contains(element)) { + measureRect(); + break; + } + } + } + + }); + const resizeObserver = useResizeObserver({ + callback: measureRect + }); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + measureRect(); + + if (element) { + resizeObserver == null ? void 0 : resizeObserver.observe(element); + mutationObserver == null ? void 0 : mutationObserver.observe(document.body, { + childList: true, + subtree: true + }); + } else { + resizeObserver == null ? void 0 : resizeObserver.disconnect(); + mutationObserver == null ? void 0 : mutationObserver.disconnect(); + } + }, [element]); + return rect; +} + +function useRectDelta(rect) { + const initialRect = useInitialValue(rect); + return getRectDelta(rect, initialRect); +} + +const defaultValue$1 = []; +function useScrollableAncestors(node) { + const previousNode = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(node); + const ancestors = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousValue => { + if (!node) { + return defaultValue$1; + } + + if (previousValue && previousValue !== defaultValue$1 && node && previousNode.current && node.parentNode === previousNode.current.parentNode) { + return previousValue; + } + + return getScrollableAncestors(node); + }, [node]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + previousNode.current = node; + }, [node]); + return ancestors; +} + +function useScrollOffsets(elements) { + const [scrollCoordinates, setScrollCoordinates] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const prevElements = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(elements); // To-do: Throttle the handleScroll callback + + const handleScroll = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(event => { + const scrollingElement = getScrollableElement(event.target); + + if (!scrollingElement) { + return; + } + + setScrollCoordinates(scrollCoordinates => { + if (!scrollCoordinates) { + return null; + } + + scrollCoordinates.set(scrollingElement, getScrollCoordinates(scrollingElement)); + return new Map(scrollCoordinates); + }); + }, []); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const previousElements = prevElements.current; + + if (elements !== previousElements) { + cleanup(previousElements); + const entries = elements.map(element => { + const scrollableElement = getScrollableElement(element); + + if (scrollableElement) { + scrollableElement.addEventListener('scroll', handleScroll, { + passive: true + }); + return [scrollableElement, getScrollCoordinates(scrollableElement)]; + } + + return null; + }).filter(entry => entry != null); + setScrollCoordinates(entries.length ? new Map(entries) : null); + prevElements.current = elements; + } + + return () => { + cleanup(elements); + cleanup(previousElements); + }; + + function cleanup(elements) { + elements.forEach(element => { + const scrollableElement = getScrollableElement(element); + scrollableElement == null ? void 0 : scrollableElement.removeEventListener('scroll', handleScroll); + }); + } + }, [handleScroll, elements]); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (elements.length) { + return scrollCoordinates ? Array.from(scrollCoordinates.values()).reduce((acc, coordinates) => (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(acc, coordinates), defaultCoordinates) : getScrollOffsets(elements); + } + + return defaultCoordinates; + }, [elements, scrollCoordinates]); +} + +function useScrollOffsetsDelta(scrollOffsets, dependencies) { + if (dependencies === void 0) { + dependencies = []; + } + + const initialScrollOffsets = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + initialScrollOffsets.current = null; + }, // eslint-disable-next-line react-hooks/exhaustive-deps + dependencies); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const hasScrollOffsets = scrollOffsets !== defaultCoordinates; + + if (hasScrollOffsets && !initialScrollOffsets.current) { + initialScrollOffsets.current = scrollOffsets; + } + + if (!hasScrollOffsets && initialScrollOffsets.current) { + initialScrollOffsets.current = null; + } + }, [scrollOffsets]); + return initialScrollOffsets.current ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(scrollOffsets, initialScrollOffsets.current) : defaultCoordinates; +} + +function useSensorSetup(sensors) { + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.canUseDOM) { + return; + } + + const teardownFns = sensors.map(_ref => { + let { + sensor + } = _ref; + return sensor.setup == null ? void 0 : sensor.setup(); + }); + return () => { + for (const teardown of teardownFns) { + teardown == null ? void 0 : teardown(); + } + }; + }, // TO-DO: Sensors length could theoretically change which would not be a valid dependency + // eslint-disable-next-line react-hooks/exhaustive-deps + sensors.map(_ref2 => { + let { + sensor + } = _ref2; + return sensor; + })); +} + +function useSyntheticListeners(listeners, id) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + return listeners.reduce((acc, _ref) => { + let { + eventName, + handler + } = _ref; + + acc[eventName] = event => { + handler(event, id); + }; + + return acc; + }, {}); + }, [listeners, id]); +} + +function useWindowRect(element) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => element ? getWindowClientRect(element) : null, [element]); +} + +const defaultValue$2 = []; +function useRects(elements, measure) { + if (measure === void 0) { + measure = getClientRect; + } + + const [firstElement] = elements; + const windowRect = useWindowRect(firstElement ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(firstElement) : null); + const [rects, setRects] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(defaultValue$2); + + function measureRects() { + setRects(() => { + if (!elements.length) { + return defaultValue$2; + } + + return elements.map(element => isDocumentScrollingElement(element) ? windowRect : new Rect(measure(element), element)); + }); + } + + const resizeObserver = useResizeObserver({ + callback: measureRects + }); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + resizeObserver == null ? void 0 : resizeObserver.disconnect(); + measureRects(); + elements.forEach(element => resizeObserver == null ? void 0 : resizeObserver.observe(element)); + }, [elements]); + return rects; +} + +function getMeasurableNode(node) { + if (!node) { + return null; + } + + if (node.children.length > 1) { + return node; + } + + const firstChild = node.children[0]; + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(firstChild) ? firstChild : node; +} + +function useDragOverlayMeasuring(_ref) { + let { + measure + } = _ref; + const [rect, setRect] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const handleResize = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(entries => { + for (const { + target + } of entries) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(target)) { + setRect(rect => { + const newRect = measure(target); + return rect ? { ...rect, + width: newRect.width, + height: newRect.height + } : newRect; + }); + break; + } + } + }, [measure]); + const resizeObserver = useResizeObserver({ + callback: handleResize + }); + const handleNodeChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(element => { + const node = getMeasurableNode(element); + resizeObserver == null ? void 0 : resizeObserver.disconnect(); + + if (node) { + resizeObserver == null ? void 0 : resizeObserver.observe(node); + } + + setRect(node ? measure(node) : null); + }, [measure, resizeObserver]); + const [nodeRef, setRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(handleNodeChange); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + nodeRef, + rect, + setRef + }), [rect, nodeRef, setRef]); +} + +const defaultSensors = [{ + sensor: PointerSensor, + options: {} +}, { + sensor: KeyboardSensor, + options: {} +}]; +const defaultData = { + current: {} +}; +const defaultMeasuringConfiguration = { + draggable: { + measure: getTransformAgnosticClientRect + }, + droppable: { + measure: getTransformAgnosticClientRect, + strategy: MeasuringStrategy.WhileDragging, + frequency: MeasuringFrequency.Optimized + }, + dragOverlay: { + measure: getClientRect + } +}; + +class DroppableContainersMap extends Map { + get(id) { + var _super$get; + + return id != null ? (_super$get = super.get(id)) != null ? _super$get : undefined : undefined; + } + + toArray() { + return Array.from(this.values()); + } + + getEnabled() { + return this.toArray().filter(_ref => { + let { + disabled + } = _ref; + return !disabled; + }); + } + + getNodeFor(id) { + var _this$get$node$curren, _this$get; + + return (_this$get$node$curren = (_this$get = this.get(id)) == null ? void 0 : _this$get.node.current) != null ? _this$get$node$curren : undefined; + } + +} + +const defaultPublicContext = { + activatorEvent: null, + active: null, + activeNode: null, + activeNodeRect: null, + collisions: null, + containerNodeRect: null, + draggableNodes: /*#__PURE__*/new Map(), + droppableRects: /*#__PURE__*/new Map(), + droppableContainers: /*#__PURE__*/new DroppableContainersMap(), + over: null, + dragOverlay: { + nodeRef: { + current: null + }, + rect: null, + setRef: noop + }, + scrollableAncestors: [], + scrollableAncestorRects: [], + measuringConfiguration: defaultMeasuringConfiguration, + measureDroppableContainers: noop, + windowRect: null, + measuringScheduled: false +}; +const defaultInternalContext = { + activatorEvent: null, + activators: [], + active: null, + activeNodeRect: null, + ariaDescribedById: { + draggable: '' + }, + dispatch: noop, + draggableNodes: /*#__PURE__*/new Map(), + over: null, + measureDroppableContainers: noop +}; +const InternalContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(defaultInternalContext); +const PublicContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(defaultPublicContext); + +function getInitialState() { + return { + draggable: { + active: null, + initialCoordinates: { + x: 0, + y: 0 + }, + nodes: new Map(), + translate: { + x: 0, + y: 0 + } + }, + droppable: { + containers: new DroppableContainersMap() + } + }; +} +function reducer(state, action) { + switch (action.type) { + case Action.DragStart: + return { ...state, + draggable: { ...state.draggable, + initialCoordinates: action.initialCoordinates, + active: action.active + } + }; + + case Action.DragMove: + if (state.draggable.active == null) { + return state; + } + + return { ...state, + draggable: { ...state.draggable, + translate: { + x: action.coordinates.x - state.draggable.initialCoordinates.x, + y: action.coordinates.y - state.draggable.initialCoordinates.y + } + } + }; + + case Action.DragEnd: + case Action.DragCancel: + return { ...state, + draggable: { ...state.draggable, + active: null, + initialCoordinates: { + x: 0, + y: 0 + }, + translate: { + x: 0, + y: 0 + } + } + }; + + case Action.RegisterDroppable: + { + const { + element + } = action; + const { + id + } = element; + const containers = new DroppableContainersMap(state.droppable.containers); + containers.set(id, element); + return { ...state, + droppable: { ...state.droppable, + containers + } + }; + } + + case Action.SetDroppableDisabled: + { + const { + id, + key, + disabled + } = action; + const element = state.droppable.containers.get(id); + + if (!element || key !== element.key) { + return state; + } + + const containers = new DroppableContainersMap(state.droppable.containers); + containers.set(id, { ...element, + disabled + }); + return { ...state, + droppable: { ...state.droppable, + containers + } + }; + } + + case Action.UnregisterDroppable: + { + const { + id, + key + } = action; + const element = state.droppable.containers.get(id); + + if (!element || key !== element.key) { + return state; + } + + const containers = new DroppableContainersMap(state.droppable.containers); + containers.delete(id); + return { ...state, + droppable: { ...state.droppable, + containers + } + }; + } + + default: + { + return state; + } + } +} + +function RestoreFocus(_ref) { + let { + disabled + } = _ref; + const { + active, + activatorEvent, + draggableNodes + } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(InternalContext); + const previousActivatorEvent = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(activatorEvent); + const previousActiveId = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(active == null ? void 0 : active.id); // Restore keyboard focus on the activator node + + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled) { + return; + } + + if (!activatorEvent && previousActivatorEvent && previousActiveId != null) { + if (!(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(previousActivatorEvent)) { + return; + } + + if (document.activeElement === previousActivatorEvent.target) { + // No need to restore focus + return; + } + + const draggableNode = draggableNodes.get(previousActiveId); + + if (!draggableNode) { + return; + } + + const { + activatorNode, + node + } = draggableNode; + + if (!activatorNode.current && !node.current) { + return; + } + + requestAnimationFrame(() => { + for (const element of [activatorNode.current, node.current]) { + if (!element) { + continue; + } + + const focusableNode = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.findFirstFocusableNode)(element); + + if (focusableNode) { + focusableNode.focus(); + break; + } + } + }); + } + }, [activatorEvent, disabled, draggableNodes, previousActiveId, previousActivatorEvent]); + return null; +} + +function applyModifiers(modifiers, _ref) { + let { + transform, + ...args + } = _ref; + return modifiers != null && modifiers.length ? modifiers.reduce((accumulator, modifier) => { + return modifier({ + transform: accumulator, + ...args + }); + }, transform) : transform; +} + +function useMeasuringConfiguration(config) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + draggable: { ...defaultMeasuringConfiguration.draggable, + ...(config == null ? void 0 : config.draggable) + }, + droppable: { ...defaultMeasuringConfiguration.droppable, + ...(config == null ? void 0 : config.droppable) + }, + dragOverlay: { ...defaultMeasuringConfiguration.dragOverlay, + ...(config == null ? void 0 : config.dragOverlay) + } + }), // eslint-disable-next-line react-hooks/exhaustive-deps + [config == null ? void 0 : config.draggable, config == null ? void 0 : config.droppable, config == null ? void 0 : config.dragOverlay]); +} + +function useLayoutShiftScrollCompensation(_ref) { + let { + activeNode, + measure, + initialRect, + config = true + } = _ref; + const initialized = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false); + const { + x, + y + } = typeof config === 'boolean' ? { + x: config, + y: config + } : config; + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + const disabled = !x && !y; + + if (disabled || !activeNode) { + initialized.current = false; + return; + } + + if (initialized.current || !initialRect) { + // Return early if layout shift scroll compensation was already attempted + // or if there is no initialRect to compare to. + return; + } // Get the most up to date node ref for the active draggable + + + const node = activeNode == null ? void 0 : activeNode.node.current; + + if (!node || node.isConnected === false) { + // Return early if there is no attached node ref or if the node is + // disconnected from the document. + return; + } + + const rect = measure(node); + const rectDelta = getRectDelta(rect, initialRect); + + if (!x) { + rectDelta.x = 0; + } + + if (!y) { + rectDelta.y = 0; + } // Only perform layout shift scroll compensation once + + + initialized.current = true; + + if (Math.abs(rectDelta.x) > 0 || Math.abs(rectDelta.y) > 0) { + const firstScrollableAncestor = getFirstScrollableAncestor(node); + + if (firstScrollableAncestor) { + firstScrollableAncestor.scrollBy({ + top: rectDelta.y, + left: rectDelta.x + }); + } + } + }, [activeNode, x, y, initialRect, measure]); +} + +const ActiveDraggableContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({ ...defaultCoordinates, + scaleX: 1, + scaleY: 1 +}); +var Status; + +(function (Status) { + Status[Status["Uninitialized"] = 0] = "Uninitialized"; + Status[Status["Initializing"] = 1] = "Initializing"; + Status[Status["Initialized"] = 2] = "Initialized"; +})(Status || (Status = {})); + +const DndContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(function DndContext(_ref) { + var _sensorContext$curren, _dragOverlay$nodeRef$, _dragOverlay$rect, _over$rect; + + let { + id, + accessibility, + autoScroll = true, + children, + sensors = defaultSensors, + collisionDetection = rectIntersection, + measuring, + modifiers, + ...props + } = _ref; + const store = (0,react__WEBPACK_IMPORTED_MODULE_0__.useReducer)(reducer, undefined, getInitialState); + const [state, dispatch] = store; + const [dispatchMonitorEvent, registerMonitorListener] = useDndMonitorProvider(); + const [status, setStatus] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(Status.Uninitialized); + const isInitialized = status === Status.Initialized; + const { + draggable: { + active: activeId, + nodes: draggableNodes, + translate + }, + droppable: { + containers: droppableContainers + } + } = state; + const node = activeId != null ? draggableNodes.get(activeId) : null; + const activeRects = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + initial: null, + translated: null + }); + const active = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + var _node$data; + + return activeId != null ? { + id: activeId, + // It's possible for the active node to unmount while dragging + data: (_node$data = node == null ? void 0 : node.data) != null ? _node$data : defaultData, + rect: activeRects + } : null; + }, [activeId, node]); + const activeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const [activeSensor, setActiveSensor] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const [activatorEvent, setActivatorEvent] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const latestProps = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(props, Object.values(props)); + const draggableDescribedById = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)("DndDescribedBy", id); + const enabledDroppableContainers = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => droppableContainers.getEnabled(), [droppableContainers]); + const measuringConfiguration = useMeasuringConfiguration(measuring); + const { + droppableRects, + measureDroppableContainers, + measuringScheduled + } = useDroppableMeasuring(enabledDroppableContainers, { + dragging: isInitialized, + dependencies: [translate.x, translate.y], + config: measuringConfiguration.droppable + }); + const activeNode = useCachedNode(draggableNodes, activeId); + const activationCoordinates = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => activatorEvent ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(activatorEvent) : null, [activatorEvent]); + const autoScrollOptions = getAutoScrollerOptions(); + const initialActiveNodeRect = useInitialRect(activeNode, measuringConfiguration.draggable.measure); + useLayoutShiftScrollCompensation({ + activeNode: activeId != null ? draggableNodes.get(activeId) : null, + config: autoScrollOptions.layoutShiftCompensation, + initialRect: initialActiveNodeRect, + measure: measuringConfiguration.draggable.measure + }); + const activeNodeRect = useRect(activeNode, measuringConfiguration.draggable.measure, initialActiveNodeRect); + const containerNodeRect = useRect(activeNode ? activeNode.parentElement : null); + const sensorContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + activatorEvent: null, + active: null, + activeNode, + collisionRect: null, + collisions: null, + droppableRects, + draggableNodes, + draggingNode: null, + draggingNodeRect: null, + droppableContainers, + over: null, + scrollableAncestors: [], + scrollAdjustedTranslate: null + }); + const overNode = droppableContainers.getNodeFor((_sensorContext$curren = sensorContext.current.over) == null ? void 0 : _sensorContext$curren.id); + const dragOverlay = useDragOverlayMeasuring({ + measure: measuringConfiguration.dragOverlay.measure + }); // Use the rect of the drag overlay if it is mounted + + const draggingNode = (_dragOverlay$nodeRef$ = dragOverlay.nodeRef.current) != null ? _dragOverlay$nodeRef$ : activeNode; + const draggingNodeRect = isInitialized ? (_dragOverlay$rect = dragOverlay.rect) != null ? _dragOverlay$rect : activeNodeRect : null; + const usesDragOverlay = Boolean(dragOverlay.nodeRef.current && dragOverlay.rect); // The delta between the previous and new position of the draggable node + // is only relevant when there is no drag overlay + + const nodeRectDelta = useRectDelta(usesDragOverlay ? null : activeNodeRect); // Get the window rect of the dragging node + + const windowRect = useWindowRect(draggingNode ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(draggingNode) : null); // Get scrollable ancestors of the dragging node + + const scrollableAncestors = useScrollableAncestors(isInitialized ? overNode != null ? overNode : activeNode : null); + const scrollableAncestorRects = useRects(scrollableAncestors); // Apply modifiers + + const modifiedTranslate = applyModifiers(modifiers, { + transform: { + x: translate.x - nodeRectDelta.x, + y: translate.y - nodeRectDelta.y, + scaleX: 1, + scaleY: 1 + }, + activatorEvent, + active, + activeNodeRect, + containerNodeRect, + draggingNodeRect, + over: sensorContext.current.over, + overlayNodeRect: dragOverlay.rect, + scrollableAncestors, + scrollableAncestorRects, + windowRect + }); + const pointerCoordinates = activationCoordinates ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(activationCoordinates, translate) : null; + const scrollOffsets = useScrollOffsets(scrollableAncestors); // Represents the scroll delta since dragging was initiated + + const scrollAdjustment = useScrollOffsetsDelta(scrollOffsets); // Represents the scroll delta since the last time the active node rect was measured + + const activeNodeScrollDelta = useScrollOffsetsDelta(scrollOffsets, [activeNodeRect]); + const scrollAdjustedTranslate = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(modifiedTranslate, scrollAdjustment); + const collisionRect = draggingNodeRect ? getAdjustedRect(draggingNodeRect, modifiedTranslate) : null; + const collisions = active && collisionRect ? collisionDetection({ + active, + collisionRect, + droppableRects, + droppableContainers: enabledDroppableContainers, + pointerCoordinates + }) : null; + const overId = getFirstCollision(collisions, 'id'); + const [over, setOver] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); // When there is no drag overlay used, we need to account for the + // window scroll delta + + const appliedTranslate = usesDragOverlay ? modifiedTranslate : (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(modifiedTranslate, activeNodeScrollDelta); + const transform = adjustScale(appliedTranslate, (_over$rect = over == null ? void 0 : over.rect) != null ? _over$rect : null, activeNodeRect); + const activeSensorRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const instantiateSensor = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((event, _ref2) => { + let { + sensor: Sensor, + options + } = _ref2; + + if (activeRef.current == null) { + return; + } + + const activeNode = draggableNodes.get(activeRef.current); + + if (!activeNode) { + return; + } + + const activatorEvent = event.nativeEvent; + const sensorInstance = new Sensor({ + active: activeRef.current, + activeNode, + event: activatorEvent, + options, + // Sensors need to be instantiated with refs for arguments that change over time + // otherwise they are frozen in time with the stale arguments + context: sensorContext, + + onAbort(id) { + const draggableNode = draggableNodes.get(id); + + if (!draggableNode) { + return; + } + + const { + onDragAbort + } = latestProps.current; + const event = { + id + }; + onDragAbort == null ? void 0 : onDragAbort(event); + dispatchMonitorEvent({ + type: 'onDragAbort', + event + }); + }, + + onPending(id, constraint, initialCoordinates, offset) { + const draggableNode = draggableNodes.get(id); + + if (!draggableNode) { + return; + } + + const { + onDragPending + } = latestProps.current; + const event = { + id, + constraint, + initialCoordinates, + offset + }; + onDragPending == null ? void 0 : onDragPending(event); + dispatchMonitorEvent({ + type: 'onDragPending', + event + }); + }, + + onStart(initialCoordinates) { + const id = activeRef.current; + + if (id == null) { + return; + } + + const draggableNode = draggableNodes.get(id); + + if (!draggableNode) { + return; + } + + const { + onDragStart + } = latestProps.current; + const event = { + activatorEvent, + active: { + id, + data: draggableNode.data, + rect: activeRects + } + }; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + onDragStart == null ? void 0 : onDragStart(event); + setStatus(Status.Initializing); + dispatch({ + type: Action.DragStart, + initialCoordinates, + active: id + }); + dispatchMonitorEvent({ + type: 'onDragStart', + event + }); + setActiveSensor(activeSensorRef.current); + setActivatorEvent(activatorEvent); + }); + }, + + onMove(coordinates) { + dispatch({ + type: Action.DragMove, + coordinates + }); + }, + + onEnd: createHandler(Action.DragEnd), + onCancel: createHandler(Action.DragCancel) + }); + activeSensorRef.current = sensorInstance; + + function createHandler(type) { + return async function handler() { + const { + active, + collisions, + over, + scrollAdjustedTranslate + } = sensorContext.current; + let event = null; + + if (active && scrollAdjustedTranslate) { + const { + cancelDrop + } = latestProps.current; + event = { + activatorEvent, + active: active, + collisions, + delta: scrollAdjustedTranslate, + over + }; + + if (type === Action.DragEnd && typeof cancelDrop === 'function') { + const shouldCancel = await Promise.resolve(cancelDrop(event)); + + if (shouldCancel) { + type = Action.DragCancel; + } + } + } + + activeRef.current = null; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + dispatch({ + type + }); + setStatus(Status.Uninitialized); + setOver(null); + setActiveSensor(null); + setActivatorEvent(null); + activeSensorRef.current = null; + const eventName = type === Action.DragEnd ? 'onDragEnd' : 'onDragCancel'; + + if (event) { + const handler = latestProps.current[eventName]; + handler == null ? void 0 : handler(event); + dispatchMonitorEvent({ + type: eventName, + event + }); + } + }); + }; + } + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [draggableNodes]); + const bindActivatorToSensorInstantiator = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((handler, sensor) => { + return (event, active) => { + const nativeEvent = event.nativeEvent; + const activeDraggableNode = draggableNodes.get(active); + + if ( // Another sensor is already instantiating + activeRef.current !== null || // No active draggable + !activeDraggableNode || // Event has already been captured + nativeEvent.dndKit || nativeEvent.defaultPrevented) { + return; + } + + const activationContext = { + active: activeDraggableNode + }; + const shouldActivate = handler(event, sensor.options, activationContext); + + if (shouldActivate === true) { + nativeEvent.dndKit = { + capturedBy: sensor.sensor + }; + activeRef.current = active; + instantiateSensor(event, sensor); + } + }; + }, [draggableNodes, instantiateSensor]); + const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator); + useSensorSetup(sensors); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + if (activeNodeRect && status === Status.Initializing) { + setStatus(Status.Initialized); + } + }, [activeNodeRect, status]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const { + onDragMove + } = latestProps.current; + const { + active, + activatorEvent, + collisions, + over + } = sensorContext.current; + + if (!active || !activatorEvent) { + return; + } + + const event = { + active, + activatorEvent, + collisions, + delta: { + x: scrollAdjustedTranslate.x, + y: scrollAdjustedTranslate.y + }, + over + }; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + onDragMove == null ? void 0 : onDragMove(event); + dispatchMonitorEvent({ + type: 'onDragMove', + event + }); + }); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [scrollAdjustedTranslate.x, scrollAdjustedTranslate.y]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const { + active, + activatorEvent, + collisions, + droppableContainers, + scrollAdjustedTranslate + } = sensorContext.current; + + if (!active || activeRef.current == null || !activatorEvent || !scrollAdjustedTranslate) { + return; + } + + const { + onDragOver + } = latestProps.current; + const overContainer = droppableContainers.get(overId); + const over = overContainer && overContainer.rect.current ? { + id: overContainer.id, + rect: overContainer.rect.current, + data: overContainer.data, + disabled: overContainer.disabled + } : null; + const event = { + active, + activatorEvent, + collisions, + delta: { + x: scrollAdjustedTranslate.x, + y: scrollAdjustedTranslate.y + }, + over + }; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + setOver(over); + onDragOver == null ? void 0 : onDragOver(event); + dispatchMonitorEvent({ + type: 'onDragOver', + event + }); + }); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [overId]); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + sensorContext.current = { + activatorEvent, + active, + activeNode, + collisionRect, + collisions, + droppableRects, + draggableNodes, + draggingNode, + draggingNodeRect, + droppableContainers, + over, + scrollableAncestors, + scrollAdjustedTranslate + }; + activeRects.current = { + initial: draggingNodeRect, + translated: collisionRect + }; + }, [active, activeNode, collisions, collisionRect, draggableNodes, draggingNode, draggingNodeRect, droppableRects, droppableContainers, over, scrollableAncestors, scrollAdjustedTranslate]); + useAutoScroller({ ...autoScrollOptions, + delta: translate, + draggingRect: collisionRect, + pointerCoordinates, + scrollableAncestors, + scrollableAncestorRects + }); + const publicContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + const context = { + active, + activeNode, + activeNodeRect, + activatorEvent, + collisions, + containerNodeRect, + dragOverlay, + draggableNodes, + droppableContainers, + droppableRects, + over, + measureDroppableContainers, + scrollableAncestors, + scrollableAncestorRects, + measuringConfiguration, + measuringScheduled, + windowRect + }; + return context; + }, [active, activeNode, activeNodeRect, activatorEvent, collisions, containerNodeRect, dragOverlay, draggableNodes, droppableContainers, droppableRects, over, measureDroppableContainers, scrollableAncestors, scrollableAncestorRects, measuringConfiguration, measuringScheduled, windowRect]); + const internalContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + const context = { + activatorEvent, + activators, + active, + activeNodeRect, + ariaDescribedById: { + draggable: draggableDescribedById + }, + dispatch, + draggableNodes, + over, + measureDroppableContainers + }; + return context; + }, [activatorEvent, activators, active, activeNodeRect, dispatch, draggableDescribedById, draggableNodes, over, measureDroppableContainers]); + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(DndMonitorContext.Provider, { + value: registerMonitorListener + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(InternalContext.Provider, { + value: internalContext + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PublicContext.Provider, { + value: publicContext + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ActiveDraggableContext.Provider, { + value: transform + }, children)), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RestoreFocus, { + disabled: (accessibility == null ? void 0 : accessibility.restoreFocus) === false + })), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Accessibility, { ...accessibility, + hiddenTextDescribedById: draggableDescribedById + })); + + function getAutoScrollerOptions() { + const activeSensorDisablesAutoscroll = (activeSensor == null ? void 0 : activeSensor.autoScrollEnabled) === false; + const autoScrollGloballyDisabled = typeof autoScroll === 'object' ? autoScroll.enabled === false : autoScroll === false; + const enabled = isInitialized && !activeSensorDisablesAutoscroll && !autoScrollGloballyDisabled; + + if (typeof autoScroll === 'object') { + return { ...autoScroll, + enabled + }; + } + + return { + enabled + }; + } +}); + +const NullContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null); +const defaultRole = 'button'; +const ID_PREFIX = 'Draggable'; +function useDraggable(_ref) { + let { + id, + data, + disabled = false, + attributes + } = _ref; + const key = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)(ID_PREFIX); + const { + activators, + activatorEvent, + active, + activeNodeRect, + ariaDescribedById, + draggableNodes, + over + } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(InternalContext); + const { + role = defaultRole, + roleDescription = 'draggable', + tabIndex = 0 + } = attributes != null ? attributes : {}; + const isDragging = (active == null ? void 0 : active.id) === id; + const transform = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(isDragging ? ActiveDraggableContext : NullContext); + const [node, setNodeRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(); + const [activatorNode, setActivatorNodeRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(); + const listeners = useSyntheticListeners(activators, id); + const dataRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(data); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + draggableNodes.set(id, { + id, + key, + node, + activatorNode, + data: dataRef + }); + return () => { + const node = draggableNodes.get(id); + + if (node && node.key === key) { + draggableNodes.delete(id); + } + }; + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [draggableNodes, id]); + const memoizedAttributes = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + role, + tabIndex, + 'aria-disabled': disabled, + 'aria-pressed': isDragging && role === defaultRole ? true : undefined, + 'aria-roledescription': roleDescription, + 'aria-describedby': ariaDescribedById.draggable + }), [disabled, role, tabIndex, isDragging, roleDescription, ariaDescribedById.draggable]); + return { + active, + activatorEvent, + activeNodeRect, + attributes: memoizedAttributes, + isDragging, + listeners: disabled ? undefined : listeners, + node, + over, + setNodeRef, + setActivatorNodeRef, + transform + }; +} + +function useDndContext() { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(PublicContext); +} + +const ID_PREFIX$1 = 'Droppable'; +const defaultResizeObserverConfig = { + timeout: 25 +}; +function useDroppable(_ref) { + let { + data, + disabled = false, + id, + resizeObserverConfig + } = _ref; + const key = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)(ID_PREFIX$1); + const { + active, + dispatch, + over, + measureDroppableContainers + } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(InternalContext); + const previous = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + disabled + }); + const resizeObserverConnected = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false); + const rect = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const callbackId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const { + disabled: resizeObserverDisabled, + updateMeasurementsFor, + timeout: resizeObserverTimeout + } = { ...defaultResizeObserverConfig, + ...resizeObserverConfig + }; + const ids = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(updateMeasurementsFor != null ? updateMeasurementsFor : id); + const handleResize = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => { + if (!resizeObserverConnected.current) { + // ResizeObserver invokes the `handleResize` callback as soon as `observe` is called, + // assuming the element is rendered and displayed. + resizeObserverConnected.current = true; + return; + } + + if (callbackId.current != null) { + clearTimeout(callbackId.current); + } + + callbackId.current = setTimeout(() => { + measureDroppableContainers(Array.isArray(ids.current) ? ids.current : [ids.current]); + callbackId.current = null; + }, resizeObserverTimeout); + }, //eslint-disable-next-line react-hooks/exhaustive-deps + [resizeObserverTimeout]); + const resizeObserver = useResizeObserver({ + callback: handleResize, + disabled: resizeObserverDisabled || !active + }); + const handleNodeChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((newElement, previousElement) => { + if (!resizeObserver) { + return; + } + + if (previousElement) { + resizeObserver.unobserve(previousElement); + resizeObserverConnected.current = false; + } + + if (newElement) { + resizeObserver.observe(newElement); + } + }, [resizeObserver]); + const [nodeRef, setNodeRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(handleNodeChange); + const dataRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(data); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!resizeObserver || !nodeRef.current) { + return; + } + + resizeObserver.disconnect(); + resizeObserverConnected.current = false; + resizeObserver.observe(nodeRef.current); + }, [nodeRef, resizeObserver]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + dispatch({ + type: Action.RegisterDroppable, + element: { + id, + key, + disabled, + node: nodeRef, + rect, + data: dataRef + } + }); + return () => dispatch({ + type: Action.UnregisterDroppable, + key, + id + }); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [id]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled !== previous.current.disabled) { + dispatch({ + type: Action.SetDroppableDisabled, + id, + key, + disabled + }); + previous.current.disabled = disabled; + } + }, [id, key, disabled, dispatch]); + return { + active, + rect, + isOver: (over == null ? void 0 : over.id) === id, + node: nodeRef, + over, + setNodeRef + }; +} + +function AnimationManager(_ref) { + let { + animation, + children + } = _ref; + const [clonedChildren, setClonedChildren] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const [element, setElement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const previousChildren = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(children); + + if (!children && !clonedChildren && previousChildren) { + setClonedChildren(previousChildren); + } + + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + if (!element) { + return; + } + + const key = clonedChildren == null ? void 0 : clonedChildren.key; + const id = clonedChildren == null ? void 0 : clonedChildren.props.id; + + if (key == null || id == null) { + setClonedChildren(null); + return; + } + + Promise.resolve(animation(id, element)).then(() => { + setClonedChildren(null); + }); + }, [animation, clonedChildren, element]); + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, children, clonedChildren ? (0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(clonedChildren, { + ref: setElement + }) : null); +} + +const defaultTransform = { + x: 0, + y: 0, + scaleX: 1, + scaleY: 1 +}; +function NullifiedContextProvider(_ref) { + let { + children + } = _ref; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(InternalContext.Provider, { + value: defaultInternalContext + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ActiveDraggableContext.Provider, { + value: defaultTransform + }, children)); +} + +const baseStyles = { + position: 'fixed', + touchAction: 'none' +}; + +const defaultTransition = activatorEvent => { + const isKeyboardActivator = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(activatorEvent); + return isKeyboardActivator ? 'transform 250ms ease' : undefined; +}; + +const PositionedOverlay = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((_ref, ref) => { + let { + as, + activatorEvent, + adjustScale, + children, + className, + rect, + style, + transform, + transition = defaultTransition + } = _ref; + + if (!rect) { + return null; + } + + const scaleAdjustedTransform = adjustScale ? transform : { ...transform, + scaleX: 1, + scaleY: 1 + }; + const styles = { ...baseStyles, + width: rect.width, + height: rect.height, + top: rect.top, + left: rect.left, + transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(scaleAdjustedTransform), + transformOrigin: adjustScale && activatorEvent ? getRelativeTransformOrigin(activatorEvent, rect) : undefined, + transition: typeof transition === 'function' ? transition(activatorEvent) : transition, + ...style + }; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(as, { + className, + style: styles, + ref + }, children); +}); + +const defaultDropAnimationSideEffects = options => _ref => { + let { + active, + dragOverlay + } = _ref; + const originalStyles = {}; + const { + styles, + className + } = options; + + if (styles != null && styles.active) { + for (const [key, value] of Object.entries(styles.active)) { + if (value === undefined) { + continue; + } + + originalStyles[key] = active.node.style.getPropertyValue(key); + active.node.style.setProperty(key, value); + } + } + + if (styles != null && styles.dragOverlay) { + for (const [key, value] of Object.entries(styles.dragOverlay)) { + if (value === undefined) { + continue; + } + + dragOverlay.node.style.setProperty(key, value); + } + } + + if (className != null && className.active) { + active.node.classList.add(className.active); + } + + if (className != null && className.dragOverlay) { + dragOverlay.node.classList.add(className.dragOverlay); + } + + return function cleanup() { + for (const [key, value] of Object.entries(originalStyles)) { + active.node.style.setProperty(key, value); + } + + if (className != null && className.active) { + active.node.classList.remove(className.active); + } + }; +}; + +const defaultKeyframeResolver = _ref2 => { + let { + transform: { + initial, + final + } + } = _ref2; + return [{ + transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(initial) + }, { + transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(final) + }]; +}; + +const defaultDropAnimationConfiguration = { + duration: 250, + easing: 'ease', + keyframes: defaultKeyframeResolver, + sideEffects: /*#__PURE__*/defaultDropAnimationSideEffects({ + styles: { + active: { + opacity: '0' + } + } + }) +}; +function useDropAnimation(_ref3) { + let { + config, + draggableNodes, + droppableContainers, + measuringConfiguration + } = _ref3; + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useEvent)((id, node) => { + if (config === null) { + return; + } + + const activeDraggable = draggableNodes.get(id); + + if (!activeDraggable) { + return; + } + + const activeNode = activeDraggable.node.current; + + if (!activeNode) { + return; + } + + const measurableNode = getMeasurableNode(node); + + if (!measurableNode) { + return; + } + + const { + transform + } = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(node).getComputedStyle(node); + const parsedTransform = parseTransform(transform); + + if (!parsedTransform) { + return; + } + + const animation = typeof config === 'function' ? config : createDefaultDropAnimation(config); + scrollIntoViewIfNeeded(activeNode, measuringConfiguration.draggable.measure); + return animation({ + active: { + id, + data: activeDraggable.data, + node: activeNode, + rect: measuringConfiguration.draggable.measure(activeNode) + }, + draggableNodes, + dragOverlay: { + node, + rect: measuringConfiguration.dragOverlay.measure(measurableNode) + }, + droppableContainers, + measuringConfiguration, + transform: parsedTransform + }); + }); +} + +function createDefaultDropAnimation(options) { + const { + duration, + easing, + sideEffects, + keyframes + } = { ...defaultDropAnimationConfiguration, + ...options + }; + return _ref4 => { + let { + active, + dragOverlay, + transform, + ...rest + } = _ref4; + + if (!duration) { + // Do not animate if animation duration is zero. + return; + } + + const delta = { + x: dragOverlay.rect.left - active.rect.left, + y: dragOverlay.rect.top - active.rect.top + }; + const scale = { + scaleX: transform.scaleX !== 1 ? active.rect.width * transform.scaleX / dragOverlay.rect.width : 1, + scaleY: transform.scaleY !== 1 ? active.rect.height * transform.scaleY / dragOverlay.rect.height : 1 + }; + const finalTransform = { + x: transform.x - delta.x, + y: transform.y - delta.y, + ...scale + }; + const animationKeyframes = keyframes({ ...rest, + active, + dragOverlay, + transform: { + initial: transform, + final: finalTransform + } + }); + const [firstKeyframe] = animationKeyframes; + const lastKeyframe = animationKeyframes[animationKeyframes.length - 1]; + + if (JSON.stringify(firstKeyframe) === JSON.stringify(lastKeyframe)) { + // The start and end keyframes are the same, infer that there is no animation needed. + return; + } + + const cleanup = sideEffects == null ? void 0 : sideEffects({ + active, + dragOverlay, + ...rest + }); + const animation = dragOverlay.node.animate(animationKeyframes, { + duration, + easing, + fill: 'forwards' + }); + return new Promise(resolve => { + animation.onfinish = () => { + cleanup == null ? void 0 : cleanup(); + resolve(); + }; + }); + }; +} + +let key = 0; +function useKey(id) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (id == null) { + return; + } + + key++; + return key; + }, [id]); +} + +const DragOverlay = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(_ref => { + let { + adjustScale = false, + children, + dropAnimation: dropAnimationConfig, + style, + transition, + modifiers, + wrapperElement = 'div', + className, + zIndex = 999 + } = _ref; + const { + activatorEvent, + active, + activeNodeRect, + containerNodeRect, + draggableNodes, + droppableContainers, + dragOverlay, + over, + measuringConfiguration, + scrollableAncestors, + scrollableAncestorRects, + windowRect + } = useDndContext(); + const transform = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(ActiveDraggableContext); + const key = useKey(active == null ? void 0 : active.id); + const modifiedTransform = applyModifiers(modifiers, { + activatorEvent, + active, + activeNodeRect, + containerNodeRect, + draggingNodeRect: dragOverlay.rect, + over, + overlayNodeRect: dragOverlay.rect, + scrollableAncestors, + scrollableAncestorRects, + transform, + windowRect + }); + const initialRect = useInitialValue(activeNodeRect); + const dropAnimation = useDropAnimation({ + config: dropAnimationConfig, + draggableNodes, + droppableContainers, + measuringConfiguration + }); // We need to wait for the active node to be measured before connecting the drag overlay ref + // otherwise collisions can be computed against a mispositioned drag overlay + + const ref = initialRect ? dragOverlay.setRef : undefined; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(NullifiedContextProvider, null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AnimationManager, { + animation: dropAnimation + }, active && key ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PositionedOverlay, { + key: key, + id: active.id, + ref: ref, + as: wrapperElement, + activatorEvent: activatorEvent, + adjustScale: adjustScale, + className: className, + transition: transition, + rect: initialRect, + style: { + zIndex, + ...style + }, + transform: modifiedTransform + }, children) : null)); +}); + + +//# sourceMappingURL=core.esm.js.map + + +/***/ }), + +/***/ "./node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js": +/*!***************************************************************!*\ + !*** ./node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createSnapModifier: function() { return /* binding */ createSnapModifier; }, +/* harmony export */ restrictToFirstScrollableAncestor: function() { return /* binding */ restrictToFirstScrollableAncestor; }, +/* harmony export */ restrictToHorizontalAxis: function() { return /* binding */ restrictToHorizontalAxis; }, +/* harmony export */ restrictToParentElement: function() { return /* binding */ restrictToParentElement; }, +/* harmony export */ restrictToVerticalAxis: function() { return /* binding */ restrictToVerticalAxis; }, +/* harmony export */ restrictToWindowEdges: function() { return /* binding */ restrictToWindowEdges; }, +/* harmony export */ snapCenterToCursor: function() { return /* binding */ snapCenterToCursor; } +/* harmony export */ }); +/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dnd-kit/utilities */ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js"); + + +function createSnapModifier(gridSize) { + return _ref => { + let { + transform + } = _ref; + return { ...transform, + x: Math.ceil(transform.x / gridSize) * gridSize, + y: Math.ceil(transform.y / gridSize) * gridSize + }; + }; +} + +const restrictToHorizontalAxis = _ref => { + let { + transform + } = _ref; + return { ...transform, + y: 0 + }; +}; + +function restrictToBoundingRect(transform, rect, boundingRect) { + const value = { ...transform + }; + + if (rect.top + transform.y <= boundingRect.top) { + value.y = boundingRect.top - rect.top; + } else if (rect.bottom + transform.y >= boundingRect.top + boundingRect.height) { + value.y = boundingRect.top + boundingRect.height - rect.bottom; + } + + if (rect.left + transform.x <= boundingRect.left) { + value.x = boundingRect.left - rect.left; + } else if (rect.right + transform.x >= boundingRect.left + boundingRect.width) { + value.x = boundingRect.left + boundingRect.width - rect.right; + } + + return value; +} + +const restrictToParentElement = _ref => { + let { + containerNodeRect, + draggingNodeRect, + transform + } = _ref; + + if (!draggingNodeRect || !containerNodeRect) { + return transform; + } + + return restrictToBoundingRect(transform, draggingNodeRect, containerNodeRect); +}; + +const restrictToFirstScrollableAncestor = _ref => { + let { + draggingNodeRect, + transform, + scrollableAncestorRects + } = _ref; + const firstScrollableAncestorRect = scrollableAncestorRects[0]; + + if (!draggingNodeRect || !firstScrollableAncestorRect) { + return transform; + } + + return restrictToBoundingRect(transform, draggingNodeRect, firstScrollableAncestorRect); +}; + +const restrictToVerticalAxis = _ref => { + let { + transform + } = _ref; + return { ...transform, + x: 0 + }; +}; + +const restrictToWindowEdges = _ref => { + let { + transform, + draggingNodeRect, + windowRect + } = _ref; + + if (!draggingNodeRect || !windowRect) { + return transform; + } + + return restrictToBoundingRect(transform, draggingNodeRect, windowRect); +}; + +const snapCenterToCursor = _ref => { + let { + activatorEvent, + draggingNodeRect, + transform + } = _ref; + + if (draggingNodeRect && activatorEvent) { + const activatorCoordinates = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_0__.getEventCoordinates)(activatorEvent); + + if (!activatorCoordinates) { + return transform; + } + + const offsetX = activatorCoordinates.x - draggingNodeRect.left; + const offsetY = activatorCoordinates.y - draggingNodeRect.top; + return { ...transform, + x: transform.x + offsetX - draggingNodeRect.width / 2, + y: transform.y + offsetY - draggingNodeRect.height / 2 + }; + } + + return transform; +}; + + +//# sourceMappingURL=modifiers.esm.js.map + + +/***/ }), + +/***/ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js": +/*!***************************************************************!*\ + !*** ./node_modules/@dnd-kit/utilities/dist/utilities.esm.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ CSS: function() { return /* binding */ CSS; }, +/* harmony export */ add: function() { return /* binding */ add; }, +/* harmony export */ canUseDOM: function() { return /* binding */ canUseDOM; }, +/* harmony export */ findFirstFocusableNode: function() { return /* binding */ findFirstFocusableNode; }, +/* harmony export */ getEventCoordinates: function() { return /* binding */ getEventCoordinates; }, +/* harmony export */ getOwnerDocument: function() { return /* binding */ getOwnerDocument; }, +/* harmony export */ getWindow: function() { return /* binding */ getWindow; }, +/* harmony export */ hasViewportRelativeCoordinates: function() { return /* binding */ hasViewportRelativeCoordinates; }, +/* harmony export */ isDocument: function() { return /* binding */ isDocument; }, +/* harmony export */ isHTMLElement: function() { return /* binding */ isHTMLElement; }, +/* harmony export */ isKeyboardEvent: function() { return /* binding */ isKeyboardEvent; }, +/* harmony export */ isNode: function() { return /* binding */ isNode; }, +/* harmony export */ isSVGElement: function() { return /* binding */ isSVGElement; }, +/* harmony export */ isTouchEvent: function() { return /* binding */ isTouchEvent; }, +/* harmony export */ isWindow: function() { return /* binding */ isWindow; }, +/* harmony export */ subtract: function() { return /* binding */ subtract; }, +/* harmony export */ useCombinedRefs: function() { return /* binding */ useCombinedRefs; }, +/* harmony export */ useEvent: function() { return /* binding */ useEvent; }, +/* harmony export */ useInterval: function() { return /* binding */ useInterval; }, +/* harmony export */ useIsomorphicLayoutEffect: function() { return /* binding */ useIsomorphicLayoutEffect; }, +/* harmony export */ useLatestValue: function() { return /* binding */ useLatestValue; }, +/* harmony export */ useLazyMemo: function() { return /* binding */ useLazyMemo; }, +/* harmony export */ useNodeRef: function() { return /* binding */ useNodeRef; }, +/* harmony export */ usePrevious: function() { return /* binding */ usePrevious; }, +/* harmony export */ useUniqueId: function() { return /* binding */ useUniqueId; } +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); + + +function useCombinedRefs() { + for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { + refs[_key] = arguments[_key]; + } + + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => node => { + refs.forEach(ref => ref(node)); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + refs); +} + +// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js +const canUseDOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'; + +function isWindow(element) { + const elementString = Object.prototype.toString.call(element); + return elementString === '[object Window]' || // In Electron context the Window object serializes to [object global] + elementString === '[object global]'; +} + +function isNode(node) { + return 'nodeType' in node; +} + +function getWindow(target) { + var _target$ownerDocument, _target$ownerDocument2; + + if (!target) { + return window; + } + + if (isWindow(target)) { + return target; + } + + if (!isNode(target)) { + return window; + } + + return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window; +} + +function isDocument(node) { + const { + Document + } = getWindow(node); + return node instanceof Document; +} + +function isHTMLElement(node) { + if (isWindow(node)) { + return false; + } + + return node instanceof getWindow(node).HTMLElement; +} + +function isSVGElement(node) { + return node instanceof getWindow(node).SVGElement; +} + +function getOwnerDocument(target) { + if (!target) { + return document; + } + + if (isWindow(target)) { + return target.document; + } + + if (!isNode(target)) { + return document; + } + + if (isDocument(target)) { + return target; + } + + if (isHTMLElement(target) || isSVGElement(target)) { + return target.ownerDocument; + } + + return document; +} + +/** + * A hook that resolves to useEffect on the server and useLayoutEffect on the client + * @param callback {function} Callback function that is invoked when the dependencies of the hook change + */ + +const useIsomorphicLayoutEffect = canUseDOM ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect; + +function useEvent(handler) { + const handlerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(handler); + useIsomorphicLayoutEffect(() => { + handlerRef.current = handler; + }); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return handlerRef.current == null ? void 0 : handlerRef.current(...args); + }, []); +} + +function useInterval() { + const intervalRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const set = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((listener, duration) => { + intervalRef.current = setInterval(listener, duration); + }, []); + const clear = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => { + if (intervalRef.current !== null) { + clearInterval(intervalRef.current); + intervalRef.current = null; + } + }, []); + return [set, clear]; +} + +function useLatestValue(value, dependencies) { + if (dependencies === void 0) { + dependencies = [value]; + } + + const valueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(value); + useIsomorphicLayoutEffect(() => { + if (valueRef.current !== value) { + valueRef.current = value; + } + }, dependencies); + return valueRef; +} + +function useLazyMemo(callback, dependencies) { + const valueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + const newValue = callback(valueRef.current); + valueRef.current = newValue; + return newValue; + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [...dependencies]); +} + +function useNodeRef(onChange) { + const onChangeHandler = useEvent(onChange); + const node = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const setNodeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(element => { + if (element !== node.current) { + onChangeHandler == null ? void 0 : onChangeHandler(element, node.current); + } + + node.current = element; + }, //eslint-disable-next-line + []); + return [node, setNodeRef]; +} + +function usePrevious(value) { + const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + ref.current = value; + }, [value]); + return ref.current; +} + +let ids = {}; +function useUniqueId(prefix, value) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (value) { + return value; + } + + const id = ids[prefix] == null ? 0 : ids[prefix] + 1; + ids[prefix] = id; + return prefix + "-" + id; + }, [prefix, value]); +} + +function createAdjustmentFn(modifier) { + return function (object) { + for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + adjustments[_key - 1] = arguments[_key]; + } + + return adjustments.reduce((accumulator, adjustment) => { + const entries = Object.entries(adjustment); + + for (const [key, valueAdjustment] of entries) { + const value = accumulator[key]; + + if (value != null) { + accumulator[key] = value + modifier * valueAdjustment; + } + } + + return accumulator; + }, { ...object + }); + }; +} + +const add = /*#__PURE__*/createAdjustmentFn(1); +const subtract = /*#__PURE__*/createAdjustmentFn(-1); + +function hasViewportRelativeCoordinates(event) { + return 'clientX' in event && 'clientY' in event; +} + +function isKeyboardEvent(event) { + if (!event) { + return false; + } + + const { + KeyboardEvent + } = getWindow(event.target); + return KeyboardEvent && event instanceof KeyboardEvent; +} + +function isTouchEvent(event) { + if (!event) { + return false; + } + + const { + TouchEvent + } = getWindow(event.target); + return TouchEvent && event instanceof TouchEvent; +} + +/** + * Returns the normalized x and y coordinates for mouse and touch events. + */ + +function getEventCoordinates(event) { + if (isTouchEvent(event)) { + if (event.touches && event.touches.length) { + const { + clientX: x, + clientY: y + } = event.touches[0]; + return { + x, + y + }; + } else if (event.changedTouches && event.changedTouches.length) { + const { + clientX: x, + clientY: y + } = event.changedTouches[0]; + return { + x, + y + }; + } + } + + if (hasViewportRelativeCoordinates(event)) { + return { + x: event.clientX, + y: event.clientY + }; + } + + return null; +} + +const CSS = /*#__PURE__*/Object.freeze({ + Translate: { + toString(transform) { + if (!transform) { + return; + } + + const { + x, + y + } = transform; + return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)"; + } + + }, + Scale: { + toString(transform) { + if (!transform) { + return; + } + + const { + scaleX, + scaleY + } = transform; + return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")"; + } + + }, + Transform: { + toString(transform) { + if (!transform) { + return; + } + + return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(' '); + } + + }, + Transition: { + toString(_ref) { + let { + property, + duration, + easing + } = _ref; + return property + " " + duration + "ms " + easing; + } + + } +}); + +const SELECTOR = 'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]'; +function findFirstFocusableNode(element) { + if (element.matches(SELECTOR)) { + return element; + } + + return element.querySelector(SELECTOR); +} + + +//# sourceMappingURL=utilities.esm.js.map + + +/***/ }), + +/***/ "./client/src/boot/applyTransform.js": +/*!*******************************************!*\ + !*** ./client/src/boot/applyTransform.js ***! + \*******************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _Injector = _interopRequireDefault(__webpack_require__(/*! lib/Injector */ "lib/Injector")); +var _ownerAwareUnpublish = _interopRequireDefault(__webpack_require__(/*! transforms/FormAction/ownerAwareUnpublish */ "./client/src/transforms/FormAction/ownerAwareUnpublish.js")); +var _moveTreeDropdownField = _interopRequireDefault(__webpack_require__(/*! transforms/TreeDropdownField/moveTreeDropdownField */ "./client/src/transforms/TreeDropdownField/moveTreeDropdownField.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const applyTransform = () => { + _Injector.default.transform('move-form-disabled', updater => { + updater.component('TreeDropdownField.AssetAdmin.MoveForm', _moveTreeDropdownField.default); + }); + _Injector.default.transform('owner-unpublishing', updater => { + updater.component('FormAction.AssetAdmin.EditForm.action_unpublish', _ownerAwareUnpublish.default); + }); +}; +var _default = exports["default"] = applyTransform; + +/***/ }), + +/***/ "./client/src/boot/index.js": +/*!**********************************!*\ + !*** ./client/src/boot/index.js ***! + \**********************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var _ReactRouteRegister = _interopRequireDefault(__webpack_require__(/*! lib/ReactRouteRegister */ "lib/ReactRouteRegister")); +var _AssetAdminRouter = _interopRequireDefault(__webpack_require__(/*! containers/AssetAdmin/AssetAdminRouter */ "./client/src/containers/AssetAdmin/AssetAdminRouter.js")); +var _applyTransform = _interopRequireDefault(__webpack_require__(/*! boot/applyTransform */ "./client/src/boot/applyTransform.js")); +var _registerReducers = _interopRequireDefault(__webpack_require__(/*! boot/registerReducers */ "./client/src/boot/registerReducers.js")); +var _registerComponents = _interopRequireDefault(__webpack_require__(/*! boot/registerComponents */ "./client/src/boot/registerComponents.js")); +var _urls = __webpack_require__(/*! lib/urls */ "lib/urls"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +document.addEventListener('DOMContentLoaded', () => { + (0, _registerComponents.default)(); + (0, _applyTransform.default)(); + const baseURL = _Config.default.getSection('SilverStripe\\AssetAdmin\\Controller\\AssetAdmin').reactRoutePath; + _ReactRouteRegister.default.add({ + path: '/', + routes: [{ + path: (0, _urls.joinUrlPaths)(baseURL, 'show/:folderId/:viewAction/:fileId'), + component: _AssetAdminRouter.default + }, { + path: (0, _urls.joinUrlPaths)(baseURL, 'show/:folderId/:viewAction'), + component: _AssetAdminRouter.default + }, { + path: (0, _urls.joinUrlPaths)(baseURL, 'show/:folderId'), + component: _AssetAdminRouter.default + }, { + path: baseURL, + component: _AssetAdminRouter.default + }] + }); + (0, _registerReducers.default)(); +}); + +/***/ }), + +/***/ "./client/src/boot/registerComponents.js": +/*!***********************************************!*\ + !*** ./client/src/boot/registerComponents.js ***! + \***********************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _Injector = _interopRequireDefault(__webpack_require__(/*! lib/Injector */ "lib/Injector")); +var _UploadField = _interopRequireDefault(__webpack_require__(/*! components/UploadField/UploadField */ "./client/src/components/UploadField/UploadField.js")); +var _UploadFieldItem = _interopRequireDefault(__webpack_require__(/*! components/UploadField/UploadFieldItem */ "./client/src/components/UploadField/UploadFieldItem.js")); +var _AssetDropzone = _interopRequireDefault(__webpack_require__(/*! components/AssetDropzone/AssetDropzone */ "./client/src/components/AssetDropzone/AssetDropzone.js")); +var _InsertMediaModal = _interopRequireDefault(__webpack_require__(/*! containers/InsertMediaModal/InsertMediaModal */ "./client/src/containers/InsertMediaModal/InsertMediaModal.js")); +var _PreviewImageField = _interopRequireDefault(__webpack_require__(/*! components/PreviewImageField/PreviewImageField */ "./client/src/components/PreviewImageField/PreviewImageField.js")); +var _ProportionConstraintField = _interopRequireDefault(__webpack_require__(/*! components/ProportionConstraintField/ProportionConstraintField */ "./client/src/components/ProportionConstraintField/ProportionConstraintField.js")); +var _HistoryList = _interopRequireDefault(__webpack_require__(/*! containers/HistoryList/HistoryList */ "./client/src/containers/HistoryList/HistoryList.js")); +var _GalleryToolbar = _interopRequireDefault(__webpack_require__(/*! components/GalleryToolbar/GalleryToolbar */ "./client/src/components/GalleryToolbar/GalleryToolbar.js")); +var _GalleryItem = __webpack_require__(/*! components/GalleryItem/GalleryItem */ "./client/src/components/GalleryItem/GalleryItem.js"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const registerComponents = () => { + _Injector.default.component.registerMany({ + UploadField: _UploadField.default, + UploadFieldItem: _UploadFieldItem.default, + PreviewImageField: _PreviewImageField.default, + HistoryList: _HistoryList.default, + ProportionConstraintField: _ProportionConstraintField.default, + AssetDropzone: _AssetDropzone.default, + InsertMediaModal: _InsertMediaModal.default, + GalleryToolbar: _GalleryToolbar.default, + GalleryItemFile: _GalleryItem.File, + GalleryItemFolder: _GalleryItem.Folder + }); +}; +var _default = exports["default"] = registerComponents; + +/***/ }), + +/***/ "./client/src/boot/registerReducers.js": +/*!*********************************************!*\ + !*** ./client/src/boot/registerReducers.js ***! + \*********************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _Injector = _interopRequireDefault(__webpack_require__(/*! lib/Injector */ "lib/Injector")); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _GalleryReducer = _interopRequireDefault(__webpack_require__(/*! state/gallery/GalleryReducer */ "./client/src/state/gallery/GalleryReducer.js")); +var _QueuedFilesReducer = _interopRequireDefault(__webpack_require__(/*! state/queuedFiles/QueuedFilesReducer */ "./client/src/state/queuedFiles/QueuedFilesReducer.js")); +var _UploadFieldReducer = _interopRequireDefault(__webpack_require__(/*! state/uploadField/UploadFieldReducer */ "./client/src/state/uploadField/UploadFieldReducer.js")); +var _PreviewFieldReducer = _interopRequireDefault(__webpack_require__(/*! state/previewField/PreviewFieldReducer */ "./client/src/state/previewField/PreviewFieldReducer.js")); +var _ImageLoadReducer = _interopRequireDefault(__webpack_require__(/*! state/imageLoad/ImageLoadReducer */ "./client/src/state/imageLoad/ImageLoadReducer.js")); +var _DisplaySearchReducer = _interopRequireDefault(__webpack_require__(/*! state/displaySearch/DisplaySearchReducer */ "./client/src/state/displaySearch/DisplaySearchReducer.js")); +var _ConfirmDeletionReducer = _interopRequireDefault(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionReducer */ "./client/src/state/confirmDeletion/ConfirmDeletionReducer.js")); +var _ModalReducer = _interopRequireDefault(__webpack_require__(/*! state/modal/ModalReducer */ "./client/src/state/modal/ModalReducer.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const registerReducers = () => { + _Injector.default.reducer.register('assetAdmin', (0, _redux.combineReducers)({ + gallery: _GalleryReducer.default, + queuedFiles: _QueuedFilesReducer.default, + uploadField: _UploadFieldReducer.default, + previewField: _PreviewFieldReducer.default, + imageLoad: _ImageLoadReducer.default, + displaySearch: _DisplaySearchReducer.default, + confirmDeletion: _ConfirmDeletionReducer.default, + modal: _ModalReducer.default + })); +}; +var _default = exports["default"] = registerReducers; + +/***/ }), + +/***/ "./client/src/components/AssetDropzone/AssetDropzone.js": +/*!**************************************************************!*\ + !*** ./client/src/components/AssetDropzone/AssetDropzone.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _dropzone = _interopRequireDefault(__webpack_require__(/*! @deltablot/dropzone */ "./node_modules/@deltablot/dropzone/dist/dropzone.mjs")); +var _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ "jquery")); +var _DataFormat = __webpack_require__(/*! lib/DataFormat */ "lib/DataFormat"); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +let idCounter = 0; +class AssetDropzone extends _react.Component { + constructor(props) { + super(props); + this.dropzone = null; + this.dragging = false; + this.handleAccept = this.handleAccept.bind(this); + this.handleAddedFile = this.handleAddedFile.bind(this); + this.handleDragEnter = this.handleDragEnter.bind(this); + this.handleDragLeave = this.handleDragLeave.bind(this); + this.handleDrop = this.handleDrop.bind(this); + this.handleUploadProgress = this.handleUploadProgress.bind(this); + this.handleUploadComplete = this.handleUploadComplete.bind(this); + this.handleError = this.handleError.bind(this); + this.handleSending = this.handleSending.bind(this); + this.handleSuccess = this.handleSuccess.bind(this); + this.handleQueueComplete = this.handleQueueComplete.bind(this); + this.loadImage = this.loadImage.bind(this); + this.handleMaxFilesExceeded = this.handleMaxFilesExceeded.bind(this); + } + componentDidMount() { + this.dropzone = new _dropzone.default(this.dropzoneRef, Object.assign({}, this.getDefaultOptions(), this.props.options)); + const { + name + } = this.props; + if (name && this.dropzone.hiddenFileInput) { + this.dropzone.hiddenFileInput.classList.add(`dz-input-${name}`); + } + if (typeof this.props.promptOnRemove !== 'undefined') { + this.setPromptOnRemove(this.props.promptOnRemove); + } + } + componentDidUpdate(prevProps) { + const { + name + } = this.props; + if (name && this.dropzone.hiddenFileInput) { + this.dropzone.hiddenFileInput.classList.add(`dz-input-${name}`); + } + if (this.props.canUpload && prevProps.options !== this.props.options) { + if (this.dropzone) { + this.dropzone.enable(); + this.dropzone.options = Object.assign({}, this.getDefaultOptions(), this.dropzone.options, this.props.options); + } + } + } + componentWillUnmount() { + this.dropzone.files = []; + this.dropzone.destroy(); + } + getDefaultOptions() { + let clickable = null; + let uploadSelector = this.props.uploadSelector; + if (!uploadSelector && this.props.uploadButton) { + uploadSelector = '.asset-dropzone__upload-button'; + } + if (uploadSelector) { + const found = (0, _jquery.default)(this.dropzoneRef).find(uploadSelector); + if (found && found.length) { + clickable = found.toArray(); + } + } + return { + accept: this.handleAccept, + addedfile: this.handleAddedFile, + dragenter: this.handleDragEnter, + dragleave: this.handleDragLeave, + drop: this.handleDrop, + maxfilesexceeded: this.handleMaxFilesExceeded, + uploadprogress: this.handleUploadProgress, + complete: this.handleUploadComplete, + dictDefaultMessage: _i18n.default._t('AssetAdmin.DROPZONE_DEFAULT_MESSAGE', 'Drop files here to upload'), + dictFallbackMessage: _i18n.default._t('AssetAdmin.DROPZONE_FALLBACK_MESSAGE', 'Your browser does not support drag\'n\'drop file uploads.'), + dictFallbackText: _i18n.default._t('AssetAdmin.DROPZONE_FALLBACK_TEXT', 'Please use the fallback form below to upload your files like in the olden days.'), + dictInvalidFileType: _i18n.default._t('AssetAdmin.DROPZONE_INVALID_FILE_TYPE', 'You can\'t upload files of this type.'), + dictResponseError: _i18n.default._t('AssetAdmin.DROPZONE_RESPONSE_ERROR', 'Server responded with an error.'), + dictCancelUpload: _i18n.default._t('AssetAdmin.DROPZONE_CANCEL_UPLOAD', 'Cancel upload'), + dictCancelUploadConfirmation: _i18n.default._t('AssetAdmin.DROPZONE_CANCEL_UPLOAD_CONFIRMATION', 'Are you sure you want to cancel this upload?'), + dictRemoveFile: _i18n.default._t('AssetAdmin.DROPZONE_REMOVE_FILE', 'Remove file'), + dictMaxFilesExceeded: _i18n.default._t('AssetAdmin.DROPZONE_MAX_FILES_EXCEEDED', 'You can not upload any more files.'), + error: this.handleError, + sending: this.handleSending, + success: this.handleSuccess, + queuecomplete: this.handleQueueComplete, + thumbnailHeight: 150, + thumbnailWidth: 200, + timeout: 0, + clickable + }; + } + getFileCategory(fileType) { + return fileType.split('/')[0]; + } + getLoadPreview(file) { + return new Promise(resolve => { + const reader = new FileReader(); + reader.onload = event => { + if (this.getFileCategory(file.type) === 'image') { + const img = new Image(); + resolve(this.loadImage(img, event.target.result)); + } else { + resolve({}); + } + }; + reader.readAsDataURL(file); + }); + } + getFileTitle(filename) { + return filename.replace(/[.][^.]+$/, '').replace(/-_/, ' '); + } + setPromptOnRemove(userPrompt) { + this.dropzone.options.dictRemoveFileConfirmation = userPrompt; + } + handleDragEnter(event) { + if (!this.props.canUpload) { + return; + } + this.dragging = true; + this.forceUpdate(); + if (typeof this.props.onDragEnter === 'function') { + this.props.onDragEnter(event); + } + } + handleDragLeave(event) { + const componentNode = this.dropzoneRef; + if (!this.props.canUpload) { + return; + } + if (event.target !== componentNode) { + return; + } + this.dragging = false; + this.forceUpdate(); + if (typeof this.props.onDragLeave === 'function') { + this.props.onDragLeave(event, componentNode); + } + } + handleUploadProgress(file, progress, bytesSent) { + if (typeof this.props.onUploadProgress === 'function') { + this.props.onUploadProgress(file, progress, bytesSent); + } + } + handleUploadComplete(file) { + if (typeof this.props.onUploadComplete === 'function') { + this.props.onUploadComplete(file.status); + } + } + handleDrop(event) { + this.dragging = false; + this.forceUpdate(); + if (typeof this.props.onDrop === 'function') { + this.props.onDrop(event); + } + } + handleSending(file, xhr, formData) { + if (typeof this.props.updateFormData === 'function') { + this.props.updateFormData(formData); + } + formData.append('SecurityID', this.props.securityID); + formData.append('ParentID', this.props.folderId); + const newXhr = Object.assign({}, xhr, { + abort: () => { + this.dropzone.cancelUpload(file); + xhr.abort(); + } + }); + if (typeof this.props.onSending === 'function') { + this.props.onSending(file, newXhr, formData); + } + } + handleMaxFilesExceeded(file) { + if (typeof this.props.onMaxFilesExceeded === 'function') { + return this.props.onMaxFilesExceeded(file); + } + return true; + } + generateQueuedId() { + idCounter += 1; + return idCounter; + } + handleAccept(file, done) { + if (typeof this.props.canFileUpload === 'function' && !this.props.canFileUpload(file)) { + return done(_i18n.default._t('AssetAdmin.DROPZONE_CANNOT_UPLOAD', 'Uploading not permitted.')); + } + if (!this.props.canUpload) { + return done(_i18n.default._t('AssetAdmin.DROPZONE_CANNOT_UPLOAD', 'Uploading not permitted.')); + } + return done(); + } + handleAddedFile(file) { + file._queuedId = this.generateQueuedId(); + const details = { + category: this.getFileCategory(file.type), + filename: file.name, + queuedId: file._queuedId, + size: file.size, + title: this.getFileTitle(file.name), + extension: (0, _DataFormat.getFileExtension)(file.name), + type: file.type, + uploadedToFolderId: this.props.folderId + }; + this.props.onAddedFile(details); + const loadPreview = this.getLoadPreview(file); + return loadPreview.then(preview => { + const previewDetails = { + height: preview.height, + width: preview.width, + url: preview.thumbnailURL, + thumbnail: preview.thumbnailURL, + smallThumbnail: preview.thumbnailURL + }; + if (typeof this.props.onPreviewLoaded === 'function') { + this.props.onPreviewLoaded(details, previewDetails); + } + return { + ...details, + ...previewDetails + }; + }); + } + loadImage(img, newSource) { + return new Promise(resolve => { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + img.onload = () => { + const previewWidth = this.props.preview.width * 2; + const previewHeight = this.props.preview.height * 2; + const ratio = img.naturalWidth / img.naturalHeight; + if (img.naturalWidth < previewWidth || img.naturalHeight < previewHeight) { + canvas.width = img.naturalWidth; + canvas.height = img.naturalHeight; + } else if (ratio < 1) { + canvas.width = previewWidth; + canvas.height = previewWidth / ratio; + } else { + canvas.width = previewHeight * ratio; + canvas.height = previewHeight; + } + ctx.drawImage(img, 0, 0, canvas.width, canvas.height); + const thumbnailURL = canvas.toDataURL('image/png'); + resolve({ + width: img.naturalWidth, + height: img.naturalHeight, + thumbnailURL + }); + }; + img.src = newSource; + }); + } + handleError(file, message) { + this.dropzone.removeFile(file); + this.props.onError(file, message); + } + handleSuccess(file) { + this.dropzone.removeFile(file); + this.props.onSuccess(file); + } + handleQueueComplete() { + if (this.props.onQueueComplete) { + this.props.onQueueComplete(); + } + } + render() { + const className = ['asset-dropzone']; + if (this.props.className) { + className.push(this.props.className); + } + const buttonProps = { + className: 'asset-dropzone__upload-button ss-ui-button font-icon-upload', + type: 'button' + }; + if (!this.props.canUpload) { + buttonProps.disabled = true; + } + if (this.dragging === true) { + className.push('dragging'); + } + return _react.default.createElement("div", { + className: className.join(' '), + ref: node => { + this.dropzoneRef = node; + } + }, this.props.uploadButton && _react.default.createElement("button", buttonProps, _i18n.default._t('AssetAdmin.DROPZONE_UPLOAD')), this.props.children); + } +} +AssetDropzone.propTypes = { + folderId: _propTypes.default.number.isRequired, + onAccept: _propTypes.default.func, + onAddedFile: _propTypes.default.func.isRequired, + onDragEnter: _propTypes.default.func, + onDragLeave: _propTypes.default.func, + onDrop: _propTypes.default.func, + onError: _propTypes.default.func.isRequired, + onPreviewLoaded: _propTypes.default.func, + onSending: _propTypes.default.func, + onSuccess: _propTypes.default.func.isRequired, + onMaxFilesExceeded: _propTypes.default.func, + updateFormData: _propTypes.default.func, + canFileUpload: _propTypes.default.func, + onQueueComplete: _propTypes.default.func, + options: _propTypes.default.shape({ + url: _propTypes.default.string.isRequired + }), + promptOnRemove: _propTypes.default.string, + securityID: _propTypes.default.string.isRequired, + uploadButton: _propTypes.default.bool, + uploadSelector: _propTypes.default.string, + canUpload: _propTypes.default.bool.isRequired, + preview: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }), + className: _propTypes.default.string +}; +AssetDropzone.defaultProps = { + uploadButton: true +}; +var _default = exports["default"] = AssetDropzone; + +/***/ }), + +/***/ "./client/src/components/BackButton/BackButton.js": +/*!********************************************************!*\ + !*** ./client/src/components/BackButton/BackButton.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _droppable = _interopRequireDefault(__webpack_require__(/*! components/GalleryItem/droppable */ "./client/src/components/GalleryItem/droppable.js")); +var _Badge = _interopRequireDefault(__webpack_require__(/*! components/Badge/Badge */ "components/Badge/Badge")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +class BackButton extends _react.Component { + render() { + const { + isDropping, + badge, + onClick + } = this.props; + const classList = ['btn', 'btn-secondary', 'btn--no-text', 'font-icon-level-up', 'btn--icon-large', 'gallery__back']; + if (isDropping) { + classList.push('z-depth-1'); + classList.push('gallery__back--droppable-hover'); + } + const backBadge = badge ? _react.default.createElement(_Badge.default, { + className: "gallery__back-badge", + status: badge.status, + message: badge.message + }) : null; + const button = _react.default.createElement("button", { + className: classList.join(' '), + title: _i18n.default._t('AssetAdmin.BACK_DESCRIPTION', 'Navigate up a level'), + onClick: onClick + }, backBadge); + return button; + } +} +exports.Component = BackButton; +BackButton.propTypes = { + onClick: _propTypes.default.func, + isDropping: _propTypes.default.bool, + badge: _propTypes.default.shape(_Badge.default.propTypes) +}; +var _default = exports["default"] = (0, _droppable.default)(BackButton, 'back-button'); + +/***/ }), + +/***/ "./client/src/components/BulkActions/BulkActions.js": +/*!**********************************************************!*\ + !*** ./client/src/components/BulkActions/BulkActions.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _reactstrap = __webpack_require__(/*! reactstrap */ "reactstrap"); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +class BulkActions extends _react.Component { + constructor(props) { + super(props); + this.handleChangeValue = this.handleChangeValue.bind(this); + this.renderChild = this.renderChild.bind(this); + } + getOptionByValue(value) { + return this.props.actions.find(action => action.value === value); + } + handleChangeValue(event) { + let promise = null; + const option = this.getOptionByValue(event.target.value); + if (option === null) { + return null; + } + if (typeof option.confirm === 'function') { + promise = option.confirm(this.props.items).then(() => option.callback(event, this.props.items)).catch(reason => { + if (reason !== 'cancelled') { + throw reason; + } + }); + } else { + promise = option.callback(event, this.props.items) || Promise.resolve(); + } + return promise; + } + renderChild(action, i) { + const className = (0, _classnames.default)('bulk-actions__action', action.className || 'font-icon-info-circled', { + btn: i < 2, + 'bulk-actions__action--more': i > 2 + }); + if (i < 2) { + return _react.default.createElement(_reactstrap.Button, { + className: className, + key: action.value, + onClick: this.handleChangeValue, + value: action.value, + color: action.color + }, action.label); + } + return _react.default.createElement(_reactstrap.DropdownItem, { + type: "button", + className: className, + key: action.value, + onClick: this.handleChangeValue, + value: action.value + }, action.label); + } + render() { + if (!this.props.items.length) { + return null; + } + let children = this.props.actions.filter(action => !action.canApply || action.canApply(this.props.items)); + children = children.map(this.renderChild); + if (!children.length) { + return null; + } + const { + ActionMenu, + showCount + } = this.props; + const selectAll = _i18n.default._t('AssetAdmin.BULK_ACTIONS_SELECT_ALL', 'Select all'); + const selected = _i18n.default.sprintf(_i18n.default._t('AssetAdmin.BULK_ACTIONS_SELECTED', '%s selected'), this.props.items.length); + const title = _i18n.default._t('AssetAdmin.BULK_ACTIONS_CLEAR_SELECTION', 'Clear selection'); + return _react.default.createElement("div", { + className: "bulk-actions fieldholder-small" + }, showCount && _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_reactstrap.Button, { + className: "bulk-actions-counter font-icon-cross-mark", + onClick: this.props.onClearSelection, + title: title + }, selected), _react.default.createElement("div", { + className: "bulk-actions-select-all" + }, _react.default.createElement(_reactstrap.Button, { + onClick: this.props.onSelectAll + }, selectAll))), children.slice(0, 2), children.length > 2 && ActionMenu ? _react.default.createElement(ActionMenu, { + id: "BulkActions", + className: "bulk-actions__more-actions-menu" + }, children.slice(2)) : children.slice(2)); + } +} +exports.Component = BulkActions; +BulkActions.propTypes = { + items: _propTypes.default.array, + actions: _propTypes.default.arrayOf(_propTypes.default.shape({ + value: _propTypes.default.string.isRequired, + label: _propTypes.default.string.isRequired, + className: _propTypes.default.string, + destructive: _propTypes.default.bool, + callback: _propTypes.default.func, + canApply: _propTypes.default.func, + confirm: _propTypes.default.func + })), + ActionMenu: _propTypes.default.elementType, + showCount: _propTypes.default.bool, + onClearSelection: _propTypes.default.func.isRequired, + onSelectAll: _propTypes.default.func.isRequired +}; +BulkActions.defaultProps = { + items: [], + actions: [], + ActionMenu: null, + total: null, + showCount: true, + totalReachedMessage: _i18n.default._t('') +}; +function mapStateToProps(state) { + return { + gallery: state.assetAdmin.gallery + }; +} +const BulkActionsWithState = (0, _reactRedux.connect)(mapStateToProps)(BulkActions); +var _default = exports["default"] = (0, _Injector.inject)(['ActionMenu'], ActionMenu => ({ + ActionMenu +}), () => 'BulkActions')(BulkActionsWithState); + +/***/ }), + +/***/ "./client/src/components/GalleryItem/GalleryItem.js": +/*!**********************************************************!*\ + !*** ./client/src/components/GalleryItem/GalleryItem.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Folder = exports.File = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _fileShape = _interopRequireDefault(__webpack_require__(/*! lib/fileShape */ "./client/src/lib/fileShape.js")); +var _draggable = _interopRequireDefault(__webpack_require__(/*! components/GalleryItem/draggable */ "./client/src/components/GalleryItem/draggable.js")); +var _droppable = _interopRequireDefault(__webpack_require__(/*! components/GalleryItem/droppable */ "./client/src/components/GalleryItem/droppable.js")); +var _Badge = _interopRequireDefault(__webpack_require__(/*! components/Badge/Badge */ "components/Badge/Badge")); +var _FileStatusIcon = _interopRequireDefault(__webpack_require__(/*! components/FileStatusIcon/FileStatusIcon */ "components/FileStatusIcon/FileStatusIcon")); +var _configShape = _interopRequireDefault(__webpack_require__(/*! lib/configShape */ "./client/src/lib/configShape.js")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _reactSelectable = __webpack_require__(/*! react-selectable */ "./node_modules/react-selectable/dist/react-selectable.js"); +var imageLoadActions = _interopRequireWildcard(__webpack_require__(/*! state/imageLoad/ImageLoadActions */ "./client/src/state/imageLoad/ImageLoadActions.js")); +var _ImageLoadStatus = _interopRequireDefault(__webpack_require__(/*! state/imageLoad/ImageLoadStatus */ "./client/src/state/imageLoad/ImageLoadStatus.js")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +function shouldLoadImage(props) { + return props.item.thumbnail && props.item.category === 'image' && props.item.exists && !props.item.queuedId && props.sectionConfig.imageRetry.minRetry && props.sectionConfig.imageRetry.maxRetry; +} +const preventFocus = event => { + event.preventDefault(); +}; +class GalleryItem extends _react.Component { + constructor(props) { + super(props); + this.handleSelect = this.handleSelect.bind(this); + this.handleActivate = this.handleActivate.bind(this); + this.handleKeyDown = this.handleKeyDown.bind(this); + this.handleCancelUpload = this.handleCancelUpload.bind(this); + } + componentDidUpdate() { + if (shouldLoadImage(this.props)) { + this.props.actions.imageLoad.loadImage(this.props.item.thumbnail, this.props.sectionConfig.imageRetry); + } + } + getThumbnailStyles() { + const { + item: { + thumbnail, + version + }, + bustCache + } = this.props; + if (!this.isImage() || !thumbnail || this.missing()) { + return {}; + } + const url = bustCache === false || !version || thumbnail.startsWith('data:image/') ? thumbnail : `${thumbnail}?vid=${version}`; + switch (this.props.loadState) { + case _ImageLoadStatus.default.SUCCESS: + case _ImageLoadStatus.default.DISABLED: + return { + backgroundImage: `url(${url})` + }; + default: + return {}; + } + } + getErrorMessage() { + let message = null; + const { + item, + loadState + } = this.props; + if (this.hasError()) { + message = item.message.value; + } else if (this.missing()) { + message = _i18n.default._t('AssetAdmin.FILE_MISSING', 'File cannot be found'); + } else if (loadState === _ImageLoadStatus.default.FAILED) { + message = _i18n.default._t('AssetAdmin.FILE_LOAD_ERROR', 'Thumbnail not available'); + } + if (message !== null) { + const updateErrorMessage = this.getItemFunction('updateErrorMessage'); + message = updateErrorMessage(message, this.props); + return _react.default.createElement("span", { + className: "gallery-item__error-message" + }, message); + } + return null; + } + getThumbnailClassNames() { + const thumbnailClassNames = ['gallery-item__thumbnail']; + if (this.isImageSmallerThanThumbnail()) { + thumbnailClassNames.push('gallery-item__thumbnail--small'); + } + if (!this.props.item.thumbnail && this.isImage()) { + thumbnailClassNames.push('gallery-item__thumbnail--no-preview'); + } + switch (this.props.loadState) { + case _ImageLoadStatus.default.LOADING: + case _ImageLoadStatus.default.WAITING: + thumbnailClassNames.push('gallery-item__thumbnail--loading'); + break; + case _ImageLoadStatus.default.FAILED: + thumbnailClassNames.push('gallery-item__thumbnail--error'); + break; + default: + break; + } + return thumbnailClassNames.join(' '); + } + getItemClassNames() { + const category = this.props.item.category || 'false'; + const selected = this.props.selectable && (this.props.item.selected || this.props.isDragging); + return (0, _classnames.default)({ + 'gallery-item': true, + [`gallery-item--${category}`]: true, + 'gallery-item--max-selected': this.props.maxSelected && !selected, + 'gallery-item--missing': this.missing(), + 'gallery-item--selectable': this.props.selectable, + 'gallery-item--selected': selected, + 'gallery-item--dropping': this.props.isDropping, + 'gallery-item--highlighted': this.props.item.highlighted, + 'gallery-item--error': this.hasError(), + 'gallery-item--dragging': this.props.isDragging + }); + } + getItemFunction(functionName) { + const { + item + } = this.props; + return typeof item[functionName] === 'function' ? item[functionName] : this.props[functionName]; + } + getStatusFlags() { + let flags = []; + const { + item + } = this.props; + if (item.type !== 'folder') { + if (item.draft) { + flags.push({ + key: 'status-draft', + title: _i18n.default._t('File.DRAFT', 'Draft'), + className: 'gallery-item--draft' + }); + } else if (item.modified) { + flags.push({ + key: 'status-modified', + title: _i18n.default._t('File.MODIFIED', 'Modified'), + className: 'gallery-item--modified' + }); + } + } + const updateStatusFlags = this.getItemFunction('updateStatusFlags'); + flags = updateStatusFlags(flags, this.props); + return _react.default.createElement("div", { + className: "gallery-item__status-flags" + }, flags.map(attrs => _react.default.createElement("span", attrs))); + } + getStatusIcons() { + const { + item + } = this.props; + const icons = []; + if (item.hasRestrictedAccess) { + icons.push({ + key: 'status-restricted', + fileID: item.id, + hasRestrictedAccess: true, + placement: 'top', + disableTooltip: item.type === 'folder', + includeBackground: item.type !== 'folder' + }); + } + if (item.isTrackedFormUpload && item.type !== 'folder') { + icons.push({ + key: 'status-tracked-form-upload', + fileID: item.id, + isTrackedFormUpload: true, + hasRestrictedAccess: item.hasRestrictedAccess, + placement: 'top', + includeBackground: true + }); + } + return _react.default.createElement("div", { + className: "gallery-item__status-icons" + }, icons.map(attrs => _react.default.createElement(_FileStatusIcon.default, attrs))); + } + getProgressBar() { + let progressBar = null; + const { + item + } = this.props; + const progressBarProps = { + className: 'gallery-item__progress-bar', + style: { + width: `${item.progress}%` + } + }; + if (!this.hasError() && this.uploading() && !this.complete()) { + progressBar = _react.default.createElement("div", { + className: "gallery-item__upload-progress" + }, _react.default.createElement("div", progressBarProps)); + } + const updateProgressBar = this.getItemFunction('updateProgressBar'); + progressBar = updateProgressBar(progressBar, this.props); + return progressBar; + } + isImageSmallerThanThumbnail() { + if (!this.isImage() || this.missing()) { + return false; + } + const width = this.props.item.width; + const height = this.props.item.height; + return height && width && height < _index.default.THUMBNAIL_HEIGHT && width < _index.default.THUMBNAIL_WIDTH; + } + complete() { + return this.props.item.queuedId && this.saved(); + } + saved() { + return this.props.item.id > 0; + } + missing() { + return !this.exists() && this.saved(); + } + uploading() { + return this.props.item.queuedId && !this.saved(); + } + exists() { + return this.props.item.exists; + } + isImage() { + return this.props.item.category === 'image'; + } + canBatchSelect() { + return this.props.selectable && this.props.item.canEdit; + } + hasError() { + let hasError = false; + if (this.props.item.message) { + hasError = this.props.item.message.type === 'error'; + } + return hasError; + } + handleActivate(event) { + event.stopPropagation(); + if (typeof this.props.onActivate === 'function' && this.saved()) { + this.props.onActivate(event, this.props.item); + } + } + handleSelect(event) { + event.stopPropagation(); + event.preventDefault(); + if (typeof this.props.onSelect === 'function') { + this.props.onSelect(event, this.props.item); + } + } + handleKeyDown(event) { + if (_index.default.SPACE_KEY_CODE === event.keyCode) { + event.preventDefault(); + if (this.canBatchSelect()) { + this.handleSelect(event); + } + } + if (_index.default.RETURN_KEY_CODE === event.keyCode) { + this.handleActivate(event); + } + } + handleCancelUpload(event) { + event.stopPropagation(); + event.preventDefault(); + if (this.hasError()) { + this.props.onRemoveErroredUpload(this.props.item); + } else if (this.props.onCancelUpload) { + this.props.onCancelUpload(this.props.item); + } + } + render() { + let action = null; + let actionIcon = null; + let overlay = null; + const { + id, + queuedId + } = this.props.item; + const htmlID = id ? `item-${id}` : `queued-${queuedId}`; + if (this.props.selectable) { + if (this.canBatchSelect()) { + action = this.handleSelect; + } + actionIcon = 'font-icon-tick'; + } + if (this.uploading()) { + action = this.handleCancelUpload; + actionIcon = 'font-icon-cancel'; + } else if (this.exists()) { + const label = _i18n.default._t('AssetAdmin.VIEW', 'View'); + overlay = _react.default.createElement("div", { + className: "gallery-item--overlay font-icon-eye" + }, label); + } + const badge = this.props.badge; + const inputProps = { + className: 'gallery-item__checkbox', + type: 'checkbox', + title: _i18n.default._t('AssetAdmin.SELECT', 'Select'), + tabIndex: -1, + onMouseDown: preventFocus, + id: htmlID + }; + const inputLabelClasses = ['gallery-item__checkbox-label', actionIcon]; + if (!this.canBatchSelect()) { + inputProps.disabled = true; + inputLabelClasses.push('gallery-item__checkbox-label--disabled'); + } + const inputLabelProps = { + className: inputLabelClasses.join(' '), + onClick: action + }; + return _react.default.createElement("div", { + className: this.getItemClassNames(), + "data-id": this.props.item.id, + tabIndex: 0, + role: "button", + onKeyDown: this.handleKeyDown, + onClick: this.handleActivate + }, !!badge && _react.default.createElement(_Badge.default, { + className: "gallery-item__badge", + status: badge.status, + message: badge.message + }), _react.default.createElement("div", { + ref: thumbnail => { + this.thumbnail = thumbnail; + }, + className: this.getThumbnailClassNames(), + style: this.getThumbnailStyles() + }, overlay, this.getStatusFlags(), this.getStatusIcons()), this.getProgressBar(), this.getErrorMessage(), this.props.children, _react.default.createElement("div", { + className: "gallery-item__title", + ref: title => { + this.title = title; + } + }, _react.default.createElement("label", _extends({}, inputLabelProps, { + htmlFor: htmlID + }), _react.default.createElement("input", inputProps)), this.props.item.title)); + } +} +exports.Component = GalleryItem; +GalleryItem.propTypes = { + sectionConfig: _configShape.default, + item: _fileShape.default, + loadState: _propTypes.default.oneOf(Object.values(_ImageLoadStatus.default)), + bustCache: _propTypes.default.bool, + highlighted: _propTypes.default.bool, + selected: _propTypes.default.bool, + isDropping: _propTypes.default.bool, + isDragging: _propTypes.default.bool, + message: _propTypes.default.shape({ + value: _propTypes.default.string, + type: _propTypes.default.string + }), + selectable: _propTypes.default.bool, + onActivate: _propTypes.default.func, + onSelect: _propTypes.default.func, + onCancelUpload: _propTypes.default.func, + onRemoveErroredUpload: _propTypes.default.func, + badge: _propTypes.default.shape({ + status: _propTypes.default.string, + message: _propTypes.default.string + }), + updateStatusFlags: _propTypes.default.func, + updateProgressBar: _propTypes.default.func, + updateErrorMessage: _propTypes.default.func +}; +GalleryItem.defaultProps = { + item: {}, + sectionConfig: { + imageRetry: {} + }, + updateStatusFlags: flags => flags, + updateProgressBar: progressBar => progressBar, + updateErrorMessage: message => message, + bustCache: true +}; +function mapStateToProps(state, ownprops) { + const sectionConfigKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; + const { + bustCache + } = state.config.sections.find(section => section.name === sectionConfigKey); + let loadState = _ImageLoadStatus.default.DISABLED; + if (shouldLoadImage(ownprops)) { + const imageLoad = state.assetAdmin.imageLoad; + const file = imageLoad.files.find(next => ownprops.item.thumbnail === next.url); + loadState = file && file.status || _ImageLoadStatus.default.NONE; + } + return { + bustCache, + loadState + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + imageLoad: (0, _redux.bindActionCreators)(imageLoadActions, dispatch) + } + }; +} +const ConnectedGalleryItem = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(GalleryItem); +const File = exports.File = (0, _reactSelectable.createSelectable)((0, _draggable.default)(ConnectedGalleryItem)); +const Folder = exports.Folder = (0, _reactSelectable.createSelectable)((0, _droppable.default)(File)); +var _default = exports["default"] = ConnectedGalleryItem; + +/***/ }), + +/***/ "./client/src/components/GalleryItem/GalleryItemDragLayer.js": +/*!*******************************************************************!*\ + !*** ./client/src/components/GalleryItem/GalleryItemDragLayer.js ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _Badge = _interopRequireDefault(__webpack_require__(/*! components/Badge/Badge */ "components/Badge/Badge")); +var _GalleryItem = _interopRequireDefault(__webpack_require__(/*! ./GalleryItem */ "./client/src/components/GalleryItem/GalleryItem.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +function GalleryItemDragLayer(props) { + const { + draggingItems, + draggingItemProps + } = props; + const selectionCount = draggingItems.length; + const shadows = [selectionCount > 1 ? _react.default.createElement("div", { + key: "1", + className: "gallery-item__drag-shadow" + }) : null, selectionCount > 2 ? _react.default.createElement("div", { + key: "2", + className: "gallery-item__drag-shadow gallery-item__drag-shadow--second" + }) : null]; + const isFolder = draggingItemProps.item.type === 'folder'; + let badge = null; + if (selectionCount > 1) { + badge = _react.default.createElement(_Badge.default, { + className: "gallery-item__drag-layer-count", + status: "info", + message: `${selectionCount}` + }); + } + return _react.default.createElement("div", { + className: "gallery-item__drag-layer" + }, _react.default.createElement("div", { + className: "gallery-item__drag-layer-item" + }, _react.default.createElement("div", { + className: "gallery-item__drag-layer-preview" + }, shadows, _react.default.createElement(_GalleryItem.default, _extends({}, draggingItemProps, { + isDragging: true + })), isFolder && badge), !isFolder && badge)); +} +GalleryItemDragLayer.propTypes = { + draggingItems: _propTypes.default.arrayOf(_propTypes.default.number), + draggingItemProps: _propTypes.default.object +}; +var _default = exports["default"] = GalleryItemDragLayer; + +/***/ }), + +/***/ "./client/src/components/GalleryItem/draggable.js": +/*!********************************************************!*\ + !*** ./client/src/components/GalleryItem/draggable.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = draggable; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _core = __webpack_require__(/*! @dnd-kit/core */ "./node_modules/@dnd-kit/core/dist/core.esm.js"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +function draggable(Item) { + let uniqueID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + function DraggableItem(props) { + let id = uniqueID; + if (id === null) { + id = props.item.id; + } + const canDrag = typeof props.canDrag === 'boolean' ? props.canDrag : true; + const { + attributes, + listeners, + setNodeRef + } = (0, _core.useDraggable)({ + disabled: !canDrag, + id, + data: { + props + } + }); + const item = _react.default.createElement(Item, props); + return _react.default.createElement("div", _extends({ + className: "gallery-item__draggable", + draggable: true, + ref: setNodeRef + }, listeners, attributes), item); + } + DraggableItem.propTypes = { + item: _propTypes.default.shape({ + id: _propTypes.default.number.isRequired + }).isRequired, + onDrag: _propTypes.default.func, + canDrag: _propTypes.default.bool, + selectedFiles: _propTypes.default.arrayOf(_propTypes.default.number) + }; + return DraggableItem; +} + +/***/ }), + +/***/ "./client/src/components/GalleryItem/droppable.js": +/*!********************************************************!*\ + !*** ./client/src/components/GalleryItem/droppable.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = droppable; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _core = __webpack_require__(/*! @dnd-kit/core */ "./node_modules/@dnd-kit/core/dist/core.esm.js"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +function droppable(Item) { + let uniqueID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + function DroppableItem(props) { + let id = uniqueID; + if (id === null) { + id = props.item.id; + } + const { + setNodeRef, + isOver + } = (0, _core.useDroppable)({ + id + }); + const item = _react.default.createElement(Item, _extends({ + isDropping: isOver + }, props)); + return _react.default.createElement("div", { + ref: setNodeRef, + className: "gallery-item__droppable" + }, item); + } + DroppableItem.propTypes = { + connectDropTarget: _propTypes.default.func.isRequired, + item: _propTypes.default.shape({ + id: _propTypes.default.number.isRequired + }).isRequired + }; + return DroppableItem; +} + +/***/ }), + +/***/ "./client/src/components/GalleryToolbar/Buttons/AddFolderButton.js": +/*!*************************************************************************!*\ + !*** ./client/src/components/GalleryToolbar/Buttons/AddFolderButton.js ***! + \*************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +class AddFolderButton extends _react.Component { + constructor() { + super(); + this.handleCreateFolder = this.handleCreateFolder.bind(this); + } + handleCreateFolder(event) { + const { + onCreateFolder + } = this.props; + event.preventDefault(); + if (typeof onCreateFolder === 'function') { + onCreateFolder(); + } + } + render() { + const { + canEdit + } = this.props; + return _react.default.createElement("button", { + id: "add-folder-button", + className: "btn btn-secondary font-icon-folder-add btn--icon-xl", + type: "button", + onClick: this.handleCreateFolder, + disabled: !canEdit + }, _react.default.createElement("span", { + className: "btn__text btn__title" + }, _i18n.default._t('AssetAdmin.ADD_FOLDER_BUTTON'))); + } +} +AddFolderButton.propTypes = { + canEdit: _propTypes.default.bool.isRequired, + onCreateFolder: _propTypes.default.func.isRequired +}; +var _default = exports["default"] = AddFolderButton; + +/***/ }), + +/***/ "./client/src/components/GalleryToolbar/Buttons/BackButton.js": +/*!********************************************************************!*\ + !*** ./client/src/components/GalleryToolbar/Buttons/BackButton.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _BackButton = _interopRequireDefault(__webpack_require__(/*! components/BackButton/BackButton */ "./client/src/components/BackButton/BackButton.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +class BackButton extends _react.Component { + constructor(props) { + super(props); + this.handleBackClick = this.handleBackClick.bind(this); + } + handleBackClick(event) { + const { + onOpenFolder, + folder + } = this.props; + event.preventDefault(); + if (typeof onOpenFolder === 'function') { + onOpenFolder(folder.parentId); + } + } + render() { + const { + folder, + badges, + onMoveFiles, + BackComponent + } = this.props; + const { + parentId: itemId + } = folder; + if (itemId === null) { + return null; + } + const badge = badges.find(item => item.id === itemId); + return _react.default.createElement("div", { + className: "gallery__back-container" + }, _react.default.createElement(BackComponent, { + item: { + id: itemId + }, + onClick: this.handleBackClick, + onDropFiles: onMoveFiles, + badge: badge + })); + } +} +BackButton.propTypes = { + folder: _propTypes.default.shape({ + id: _propTypes.default.number, + title: _propTypes.default.string, + parentId: _propTypes.default.number, + canView: _propTypes.default.bool, + canEdit: _propTypes.default.bool + }).isRequired, + badges: _propTypes.default.arrayOf(_propTypes.default.shape({ + id: _propTypes.default.number, + message: _propTypes.default.node, + status: _propTypes.default.string + })).isRequired, + onOpenFolder: _propTypes.default.func.isRequired, + onMoveFiles: _propTypes.default.func.isRequired, + BackComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +BackButton.defaultProps = { + BackComponent: _BackButton.default +}; +var _default = exports["default"] = BackButton; + +/***/ }), + +/***/ "./client/src/components/GalleryToolbar/Buttons/UploadButton.js": +/*!**********************************************************************!*\ + !*** ./client/src/components/GalleryToolbar/Buttons/UploadButton.js ***! + \**********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +class UploadButton extends _react.Component { + render() { + const { + canEdit + } = this.props; + return _react.default.createElement("button", { + id: "upload-button", + className: "btn btn-secondary font-icon-upload btn--icon-xl", + type: "button", + disabled: !canEdit + }, _react.default.createElement("span", { + className: "btn__text btn__title" + }, _i18n.default._t('AssetAdmin.DROPZONE_UPLOAD'))); + } +} +UploadButton.defaultProps = { + canEdit: _propTypes.default.func.isRequired +}; +var _default = exports["default"] = UploadButton; + +/***/ }), + +/***/ "./client/src/components/GalleryToolbar/GalleryToolbar.js": +/*!****************************************************************!*\ + !*** ./client/src/components/GalleryToolbar/GalleryToolbar.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _BackButton = _interopRequireDefault(__webpack_require__(/*! ./Buttons/BackButton */ "./client/src/components/GalleryToolbar/Buttons/BackButton.js")); +var _UploadButton = _interopRequireDefault(__webpack_require__(/*! ./Buttons/UploadButton */ "./client/src/components/GalleryToolbar/Buttons/UploadButton.js")); +var _AddFolderButton = _interopRequireDefault(__webpack_require__(/*! ./Buttons/AddFolderButton */ "./client/src/components/GalleryToolbar/Buttons/AddFolderButton.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +class GalleryToolbar extends _react.Component { + constructor(props) { + super(props); + this.handleSelectSort = this.handleSelectSort.bind(this); + this.handleViewChange = this.handleViewChange.bind(this); + } + handleSelectSort(event) { + this.props.onSort(event.currentTarget.value); + } + handleViewChange(event) { + const view = event.currentTarget.value; + this.props.onViewChange(view); + } + renderSort() { + if (this.props.view !== 'tile') { + return null; + } + return _react.default.createElement("div", { + className: "gallery__sort fieldholder-small" + }, _react.default.createElement("select", { + className: "dropdown no-change-track no-chzn", + tabIndex: "0", + style: { + width: '160px' + }, + defaultValue: this.props.sort + }, this.props.sorters.map(sorter => { + const label = sorter.label.replace(/^\w|[\s\-]+\w/g, c => c.toUpperCase()); + return _react.default.createElement("option", { + key: `${sorter.field}-${sorter.direction}`, + onClick: this.handleSelectSort, + "data-field": sorter.field, + "data-direction": sorter.direction, + value: `${sorter.field},${sorter.direction}` + }, label); + }))); + } + renderViewChangeButtons() { + const views = ['tile', 'table']; + return views.map(view => { + const icon = view === 'table' ? 'list' : 'thumbnails'; + const classNames = ['gallery__view-change-button', 'btn btn-secondary', 'btn--icon-sm', 'btn--no-text']; + if (view === this.props.view) { + return null; + } + classNames.push(`font-icon-${icon}`); + return _react.default.createElement("button", { + id: `button-view-${view}`, + key: view, + className: classNames.join(' '), + type: "button", + title: "Change view gallery/list", + onClick: this.handleViewChange, + value: view + }); + }); + } + render() { + const { + badges, + children, + folder, + onMoveFiles, + onOpenFolder, + onCreateFolder, + BackButton, + UploadButton, + AddFolderButton + } = this.props; + const { + canEdit + } = folder; + return _react.default.createElement("div", { + className: "toolbar--content toolbar--space-save" + }, _react.default.createElement("div", { + className: "fill-width" + }, _react.default.createElement("div", { + className: "gallery__btn-toolbar flexbox-area-grow" + }, _react.default.createElement("div", { + className: "btn-toolbar" + }, _react.default.createElement(BackButton, { + folder: folder, + badges: badges, + onOpenFolder: onOpenFolder, + onMoveFiles: onMoveFiles + }), _react.default.createElement(UploadButton, { + canEdit: canEdit + }), _react.default.createElement(AddFolderButton, { + canEdit: canEdit, + onCreateFolder: onCreateFolder + }), children)), _react.default.createElement("div", { + className: "gallery__state-buttons" + }, this.renderSort(), _react.default.createElement("div", { + className: "btn-group", + role: "group", + "aria-label": "View mode" + }, this.renderViewChangeButtons())))); + } +} +exports.Component = GalleryToolbar; +GalleryToolbar.propTypes = { + onMoveFiles: _propTypes.default.func.isRequired, + onCreateFolder: _propTypes.default.func.isRequired, + onViewChange: _propTypes.default.func.isRequired, + onOpenFolder: _propTypes.default.func.isRequired, + onSort: _propTypes.default.func.isRequired, + folder: _propTypes.default.shape({ + id: _propTypes.default.number, + title: _propTypes.default.string, + parentId: _propTypes.default.number, + canView: _propTypes.default.bool, + canEdit: _propTypes.default.bool + }).isRequired, + view: _propTypes.default.oneOf(['tile', 'table']), + sort: _propTypes.default.string, + badges: _propTypes.default.arrayOf(_propTypes.default.shape({ + id: _propTypes.default.number, + message: _propTypes.default.node, + status: _propTypes.default.string + })), + BackButton: _propTypes.default.elementType, + UploadButton: _propTypes.default.elementType, + AddFolderButton: _propTypes.default.elementType +}; +GalleryToolbar.defaultProps = { + view: 'tile', + BackButton: _BackButton.default, + UploadButton: _UploadButton.default, + AddFolderButton: _AddFolderButton.default +}; +function mapStateToProps(state, ownProps) { + let { + sort + } = ownProps; + const { + badges, + sorters + } = state.assetAdmin.gallery; + if (sort === '') { + sort = `${sorters[0].field},${sorters[0].direction}`; + } + return { + badges, + sorters, + sort + }; +} +var _default = exports["default"] = (0, _reactRedux.connect)(mapStateToProps)(GalleryToolbar); + +/***/ }), + +/***/ "./client/src/components/InsertEmbedModal/InsertEmbedModal.js": +/*!********************************************************************!*\ + !*** ./client/src/components/InsertEmbedModal/InsertEmbedModal.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _FormBuilderModal = _interopRequireDefault(__webpack_require__(/*! components/FormBuilderModal/FormBuilderModal */ "components/FormBuilderModal/FormBuilderModal")); +var schemaActions = _interopRequireWildcard(__webpack_require__(/*! state/schema/SchemaActions */ "state/schema/SchemaActions")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _urls = __webpack_require__(/*! lib/urls */ "lib/urls"); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const sectionConfigKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; +class InsertEmbedModal extends _react.Component { + constructor(props) { + super(props); + this.handleSubmit = this.handleSubmit.bind(this); + } + componentDidMount() { + this.setOverrides(this.props); + } + componentDidUpdate(prevProps) { + if (this.props.isOpen && !prevProps.isOpen) { + this.setOverrides(this.props); + } + } + componentWillUnmount() { + this.clearOverrides(); + } + setOverrides(props) { + if (this.props.schemaUrl !== props.schemaUrl) { + this.clearOverrides(); + } + if (props.schemaUrl) { + const attrs = Object.assign({}, props.fileAttributes); + delete attrs.ID; + const overrides = { + fields: Object.entries(attrs).map(field => { + const [name, value] = field; + return { + name, + value + }; + }) + }; + this.props.actions.schema.setSchemaStateOverrides(props.schemaUrl, overrides); + } + } + getModalProps() { + const props = Object.assign({ + onSubmit: this.handleSubmit, + onLoadingError: this.handleLoadingError, + showErrorMessage: true, + responseClassBad: 'alert alert-danger', + identifier: 'AssetAdmin.InsertEmbedModal' + }, this.props, { + className: `insert-embed-modal ${this.props.className}`, + size: 'lg', + onClosed: this.props.onClosed, + title: this.props.targetUrl ? _i18n.default._t('AssetAdmin.EditTitle', 'Media from the web') : _i18n.default._t('AssetAdmin.CreateTitle', 'Insert new media from the web') + }); + delete props.sectionConfig; + delete props.onInsert; + delete props.fileAttributes; + return props; + } + clearOverrides() { + this.props.actions.schema.setSchemaStateOverrides(this.props.schemaUrl, null); + } + handleLoadingError(error) { + if (typeof this.props.onLoadingError === 'function') { + this.props.onLoadingError(error); + } + } + handleSubmit(data, action) { + switch (action) { + case 'action_addmedia': + { + this.props.onCreate(data); + break; + } + case 'action_insertmedia': + { + this.props.onInsert(data); + break; + } + case 'action_cancel': + { + this.props.onClosed(); + break; + } + default: + {} + } + return Promise.resolve(); + } + render() { + const { + FormBuilderModalComponent + } = this.props; + return _react.default.createElement(FormBuilderModalComponent, this.getModalProps()); + } +} +exports.Component = InsertEmbedModal; +InsertEmbedModal.propTypes = { + sectionConfig: _propTypes.default.shape({ + url: _propTypes.default.string, + form: _propTypes.default.object + }), + isOpen: _propTypes.default.bool, + onInsert: _propTypes.default.func.isRequired, + onCreate: _propTypes.default.func.isRequired, + fileAttributes: _propTypes.default.shape({ + Url: _propTypes.default.string, + CaptionText: _propTypes.default.string, + PreviewUrl: _propTypes.default.string, + Placement: _propTypes.default.string, + Width: _propTypes.default.number, + Height: _propTypes.default.number + }), + onClosed: _propTypes.default.func.isRequired, + className: _propTypes.default.string, + actions: _propTypes.default.object, + schemaUrl: _propTypes.default.string.isRequired, + targetUrl: _propTypes.default.string, + onLoadingError: _propTypes.default.func, + FormBuilderModalComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +InsertEmbedModal.defaultProps = { + className: '', + fileAttributes: {}, + FormBuilderModalComponent: _FormBuilderModal.default +}; +function mapStateToProps(state, ownProps) { + const sectionConfig = state.config.sections.find(section => section.name === sectionConfigKey); + const targetUrl = ownProps.fileAttributes ? ownProps.fileAttributes.Url : ''; + const baseEditUrl = sectionConfig.form.remoteEditForm.schemaUrl; + const editUrl = targetUrl && (0, _urls.joinUrlPaths)(baseEditUrl, `/?embedurl=${encodeURIComponent(targetUrl)}`); + const createUrl = sectionConfig.form.remoteCreateForm.schemaUrl; + const schemaUrl = editUrl || createUrl; + return { + sectionConfig, + schemaUrl, + targetUrl + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + schema: (0, _redux.bindActionCreators)(schemaActions, dispatch) + } + }; +} +var _default = exports["default"] = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(InsertEmbedModal); + +/***/ }), + +/***/ "./client/src/components/PreviewImageField/PreviewImageField.js": +/*!**********************************************************************!*\ + !*** ./client/src/components/PreviewImageField/PreviewImageField.js ***! + \**********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _AssetDropzone = _interopRequireDefault(__webpack_require__(/*! components/AssetDropzone/AssetDropzone */ "./client/src/components/AssetDropzone/AssetDropzone.js")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _reduxForm = __webpack_require__(/*! redux-form */ "redux-form"); +var previewFieldActions = _interopRequireWildcard(__webpack_require__(/*! state/previewField/PreviewFieldActions */ "./client/src/state/previewField/PreviewFieldActions.js")); +var _DataFormat = __webpack_require__(/*! lib/DataFormat */ "lib/DataFormat"); +var _getFormState = _interopRequireDefault(__webpack_require__(/*! lib/getFormState */ "lib/getFormState")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _url = _interopRequireDefault(__webpack_require__(/*! url */ "url")); +var _qs = _interopRequireDefault(__webpack_require__(/*! qs */ "qs")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +class PreviewImageField extends _react.Component { + constructor(props) { + super(props); + this.handleAddedFile = this.handleAddedFile.bind(this); + this.handleFailedUpload = this.handleFailedUpload.bind(this); + this.handleSuccessfulUpload = this.handleSuccessfulUpload.bind(this); + this.handleSending = this.handleSending.bind(this); + this.handleUploadProgress = this.handleUploadProgress.bind(this); + this.handleUploadComplete = this.handleUploadComplete.bind(this); + this.handleCancelUpload = this.handleCancelUpload.bind(this); + this.handleRemoveErroredUpload = this.handleRemoveErroredUpload.bind(this); + this.canFileUpload = this.canFileUpload.bind(this); + this.updateFormData = this.updateFormData.bind(this); + this.cacheBustUrl = this.cacheBustUrl.bind(this); + } + componentDidUpdate(prevProps) { + if (prevProps.data.url && this.props.data.url !== prevProps.data.url || prevProps.data.version && this.props.data.version !== prevProps.data.version) { + this.props.actions.previewField.removeFile(prevProps.id); + } + } + componentWillUnmount() { + this.props.actions.previewField.removeFile(this.props.id); + } + getDropzoneProps() { + const endpoint = this.props.data.uploadFileEndpoint; + const name = this.props.name; + const options = { + url: endpoint && endpoint.url, + method: endpoint && endpoint.method, + paramName: 'Upload', + clickable: true, + maxFiles: 1 + }; + const preview = { + height: _index.default.THUMBNAIL_HEIGHT, + width: _index.default.THUMBNAIL_WIDTH + }; + const securityID = this.props.securityID; + const classNames = ['asset-dropzone--button', 'preview-image-field__container', this.props.className, this.props.extraClass]; + return { + name, + className: classNames.join(' '), + canUpload: endpoint && this.canEdit(), + preview, + folderId: this.props.data.parentid, + options, + securityID, + uploadButton: false, + onAddedFile: this.handleAddedFile, + onError: this.handleFailedUpload, + onSuccess: this.handleSuccessfulUpload, + onSending: this.handleSending, + onUploadProgress: this.handleUploadProgress, + onUploadComplete: this.handleUploadComplete, + canFileUpload: this.canFileUpload, + updateFormData: this.updateFormData + }; + } + getButtonClasses(type) { + return (0, _classnames.default)([`preview-image-field__toolbar-button--${type}`, 'preview-image-field__toolbar-button']); + } + updateFormData(formData) { + formData.append('ID', this.props.data.id); + formData.append('Name', this.props.nameValue); + } + handleSending(file, xhr) { + this.props.actions.previewField.updateFile(this.props.id, { + xhr + }); + } + handleSuccessfulUpload(fileXhr) { + const json = JSON.parse(fileXhr.xhr.response); + if (typeof this.props.onAutofill === 'function') { + this.props.onAutofill('FileFilename', json.Filename); + this.props.onAutofill('FileHash', json.Hash); + this.props.onAutofill('FileVariant', json.Variant); + if (json.Name) { + this.props.onAutofill(this.props.data.nameField, json.Name); + } + } + } + handleFailedUpload(file, response) { + this.props.actions.previewField.failUpload(this.props.id, response); + } + handleAddedFile(data) { + this.props.actions.previewField.addFile(this.props.id, data); + } + handleRemoveErroredUpload() { + if (typeof this.props.onAutofill === 'function') { + const initial = this.props.data.initialValues; + this.props.onAutofill('FileFilename', initial.FileFilename); + this.props.onAutofill('FileHash', initial.FileHash); + this.props.onAutofill('FileVariant', initial.FileVariant); + } + this.props.actions.previewField.removeFile(this.props.id); + } + handleCancelUpload() { + if (this.props.upload.xhr) { + this.props.upload.xhr.abort(); + } + this.handleRemoveErroredUpload(); + } + canFileUpload(file) { + const prevName = this.props.data.initialValues.FileFilename; + const prevExt = (0, _DataFormat.getFileExtension)(prevName); + const nextExt = (0, _DataFormat.getFileExtension)(file.name); + if (!prevExt || prevExt === nextExt) { + return true; + } + const message = _i18n.default._t('AssetAdmin.CONFIRM_CHANGE_EXTENSION', 'Are you sure you want upload a file with a different extension?'); + return this.props.confirm(message); + } + preventDefault(e) { + e.preventDefault(); + } + canEdit() { + return !this.props.readOnly && !this.props.disabled && this.props.data.category !== 'folder'; + } + handleUploadProgress(file, progress) { + this.props.actions.previewField.updateFile(this.props.id, { + progress + }); + } + handleUploadComplete(status) { + this.props.actions.previewField.updateStatus(this.props.id, { + status + }); + } + preview(category, upload, data) { + if (category && category !== 'image') { + return _index.default.DEFAULT_PREVIEW; + } + const url = upload.url || data.preview || data.url; + if (url) { + const plainUrl = url.startsWith('data:image/'); + return plainUrl ? url : this.cacheBustUrl(url, data.version); + } + return null; + } + cacheBustUrl(url) { + let versionId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + const vid = versionId || this.props.data.version; + if (this.props.bustCache === false || !vid) { + return url; + } + const parsedUrl = _url.default.parse(url); + const parsedQs = { + ..._qs.default.parse(parsedUrl.query), + vid + }; + return _url.default.format({ + ...parsedUrl, + search: _qs.default.stringify(parsedQs) + }); + } + renderImage() { + const { + data, + upload + } = this.props; + if (!data.mock && !data.exists && !upload.url) { + return _react.default.createElement("div", { + className: "editor__file-preview-message--file-missing" + }, _i18n.default._t('AssetAdmin.FILE_MISSING', 'File cannot be found')); + } + const { + category, + progress, + message + } = upload; + const errors = upload.errors ? upload.errors[0] : null; + const status = upload.status ? upload.status : null; + const preview = this.preview(category, upload, data); + const image = _react.default.createElement("img", { + alt: "preview", + src: preview, + className: "editor__thumbnail" + }); + const linkedImage = data.url && !progress ? _react.default.createElement("a", { + className: "editor__file-preview-link", + href: this.cacheBustUrl(data.url), + target: "_blank", + rel: "noopener noreferrer" + }, image) : null; + const progressBar = progress > 0 && progress < 100 ? _react.default.createElement("div", { + className: "preview-image-field__progress" + }, _react.default.createElement("div", { + className: "preview-image-field__progress-bar", + style: { + width: `${progress}%` + } + })) : null; + let messageBox = null; + if (errors || status === 'error') { + const errorMessage = errors && errors.value ? errors.value : _i18n.default._t('AssetAdmin.DROPZONE_RESPONSE_ERROR', 'Server responded with an error.'); + const errorType = errors && errors.type ? errors.type : 'error'; + messageBox = _react.default.createElement("div", { + className: `preview-image-field__message preview-image-field__message--${errorType}` + }, errorMessage); + } else if (message) { + messageBox = _react.default.createElement("div", { + className: `preview-image-field__message preview-image-field__message--${message.type}` + }, message.value); + } else if (progress === 100 && status === 'success') { + messageBox = _react.default.createElement("div", { + className: "preview-image-field__message preview-image-field__message--success" + }, _i18n.default._t('AssetAdmin.REPlACE_FILE_SUCCESS', 'Upload successful, the file will be replaced when you Save.'), (progress || message) && _react.default.createElement("button", { + onClick: this.handleCancelUpload, + className: "preview-image-field__message-button btn btn-outline-light", + type: "button" + }, _i18n.default._t('AssetAdmin.REPLACE_FILE_UNDO', 'Undo'))); + } + return _react.default.createElement("div", { + className: "editor__thumbnail-container" + }, linkedImage || image, progressBar, messageBox); + } + render() { + const { + AssetDropzoneComponent + } = this.props; + const dropzoneProps = this.getDropzoneProps(); + if (this.canEdit()) { + return _react.default.createElement(AssetDropzoneComponent, dropzoneProps, this.renderImage()); + } + const classNames = ['preview-image-field__container', this.props.className, this.props.extraClass]; + return _react.default.createElement("div", { + className: classNames.join(' ') + }, this.renderImage()); + } +} +exports.Component = PreviewImageField; +PreviewImageField.propTypes = { + id: _propTypes.default.string.isRequired, + name: _propTypes.default.string, + className: _propTypes.default.string, + extraClass: _propTypes.default.string, + readOnly: _propTypes.default.bool, + disabled: _propTypes.default.bool, + bustCache: _propTypes.default.bool, + onAutofill: _propTypes.default.func, + formid: _propTypes.default.string, + nameValue: _propTypes.default.string, + data: _propTypes.default.shape({ + id: _propTypes.default.number, + parentid: _propTypes.default.number, + version: _propTypes.default.number, + url: _propTypes.default.string, + mock: _propTypes.default.bool, + exists: _propTypes.default.bool, + preview: _propTypes.default.string, + category: _propTypes.default.string, + nameField: _propTypes.default.string, + uploadFileEndpoint: _propTypes.default.shape({ + url: _propTypes.default.string.isRequired, + method: _propTypes.default.string.isRequired, + payloadFormat: _propTypes.default.string + }), + initialValues: _propTypes.default.object + }).isRequired, + upload: _propTypes.default.shape({ + url: _propTypes.default.string, + progress: _propTypes.default.number, + xhr: _propTypes.default.object, + category: _propTypes.default.string, + message: _propTypes.default.shape({ + type: _propTypes.default.string.isRequired, + value: _propTypes.default.string.isRequired + }), + status: _propTypes.default.string + }), + actions: _propTypes.default.object, + securityID: _propTypes.default.string, + confirm: _propTypes.default.func, + AssetDropzoneComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +PreviewImageField.defaultProps = { + extraClass: '', + className: '', + data: {}, + upload: {}, + confirm: msg => window.confirm(msg), + bustCache: true, + AssetDropzoneComponent: _AssetDropzone.default +}; +function mapStateToProps(state, ownProps) { + const securityID = state.config.SecurityID; + const id = ownProps.id; + const upload = state.assetAdmin.previewField[id] || {}; + const selector = (0, _reduxForm.formValueSelector)(ownProps.formid, _getFormState.default); + const sectionConfigKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; + const { + bustCache + } = state.config.sections.find(section => section.name === sectionConfigKey); + return { + securityID, + upload, + nameValue: selector(state, 'Name'), + bustCache + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + previewField: (0, _redux.bindActionCreators)(previewFieldActions, dispatch) + } + }; +} +var _default = exports["default"] = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(PreviewImageField); + +/***/ }), + +/***/ "./client/src/components/ProportionConstraintField/ImageSizePresetList.js": +/*!********************************************************************************!*\ + !*** ./client/src/components/ProportionConstraintField/ImageSizePresetList.js ***! + \********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _reactstrap = __webpack_require__(/*! reactstrap */ "reactstrap"); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +const srText = text => _i18n.default.inject(_i18n.default._t('AssetAdmin.SET_IMAGE_SIZE_TO', 'Set image size to "{preset}"'), { + preset: text +}); +const PresetButton = _ref => { + let { + onSelect, + currentWidth, + originalWidth, + width, + text + } = _ref; + return _react.default.createElement(_reactstrap.Button, { + color: "link", + size: "sm", + onClick: () => onSelect(width || originalWidth), + disabled: originalWidth < width || currentWidth === (width || originalWidth) + }, _react.default.createElement("span", { + className: "sr-only" + }, srText(text)), _react.default.createElement("span", { + "aria-hidden": "true" + }, text)); +}; +const ImageSizePresetList = _ref2 => { + let { + imageSizePresets, + ...btnProps + } = _ref2; + return imageSizePresets ? _react.default.createElement("ul", { + className: "image-size-preset-list" + }, imageSizePresets.map(presetProps => _react.default.createElement("li", { + key: presetProps.text, + className: "image-size-preset-list__list-item" + }, _react.default.createElement(PresetButton, _extends({}, presetProps, btnProps))))) : null; +}; +ImageSizePresetList.propTypes = { + onSelect: _propTypes.default.func, + imageSizePresets: _propTypes.default.arrayOf(_propTypes.default.shape({ + text: _propTypes.default.string, + width: _propTypes.default.number + })), + currentWidth: _propTypes.default.number, + originalWidth: _propTypes.default.number.isRequired +}; +var _default = exports["default"] = ImageSizePresetList; + +/***/ }), + +/***/ "./client/src/components/ProportionConstraintField/ProportionConstraintField.js": +/*!**************************************************************************************!*\ + !*** ./client/src/components/ProportionConstraintField/ProportionConstraintField.js ***! + \**************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _reduxForm = __webpack_require__(/*! redux-form */ "redux-form"); +var _getFormState = _interopRequireDefault(__webpack_require__(/*! lib/getFormState */ "lib/getFormState")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _ImageSizePresetList = _interopRequireDefault(__webpack_require__(/*! ./ImageSizePresetList */ "./client/src/components/ProportionConstraintField/ImageSizePresetList.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +class ProportionConstraintField extends _react.Component { + constructor(props) { + super(props); + const childrenArray = _react.Children.toArray(props.children); + if (childrenArray.length !== 2) { + throw new Error('ProportionConstraintField must be passed two children -- one field for each value'); + } + this.handlePresetSelect = this.handlePresetSelect.bind(this); + this.handleBlur = this.handleBlur.bind(this); + this.handleFocus = this.handleFocus.bind(this); + this.state = { + hasFocus: false + }; + } + componentDidMount() { + this.componentDidUpdate(this.props); + } + componentDidUpdate(newProps) { + if (!this.state.hasFocus) { + const { + current: { + width + } + } = newProps; + const value = parseInt(width, 10); + if (!value || value <= 0) { + this.resetDimensions(); + } + } + } + handleChange(childIndex, e, newValue) { + const value = parseInt(newValue || e.target && e.target.value, 10); + if (value && value > 0) { + this.syncFields(childIndex, value); + } + } + syncFields(childIndex, newValue) { + const { + children, + active, + onAutofill, + data: { + ratio + } + } = this.props; + const peerIndex = childIndex === 0 ? 1 : 0; + const currentName = children[childIndex].props.name; + const peerName = children[peerIndex].props.name; + const multiplier = childIndex === 0 ? 1 / ratio : ratio; + onAutofill(currentName, newValue); + if (active) { + onAutofill(peerName, Math.round(newValue * multiplier)); + } + } + handlePresetSelect(newWidth) { + this.syncFields(0, newWidth); + const { + key + } = this.props.children[0]; + const fieldEl = document.getElementById(key); + if (fieldEl) { + fieldEl.focus(); + } + } + handleBlur(key, e) { + this.setState({ + hasFocus: false + }); + const newValue = parseInt(e && e.target && e.target.value, 10); + if (!newValue || newValue <= 0) { + e.preventDefault(); + this.resetDimensions(); + } + } + handleFocus() { + this.setState({ + hasFocus: true + }); + } + defaultWidth() { + const { + imageSizePresets, + data: { + originalWidth + } + } = this.props; + const defaultPreset = imageSizePresets && imageSizePresets.find(preset => preset.default); + const defaultWidth = defaultPreset && defaultPreset.width || originalWidth || 600; + return originalWidth && originalWidth < defaultWidth ? originalWidth : defaultWidth; + } + resetDimensions() { + const defaultValue = this.defaultWidth(); + this.syncFields(0, defaultValue); + } + render() { + const { + FieldGroup, + data: { + originalWidth, + isRemoteFile + }, + current: { + width: currentWidth + }, + imageSizePresets + } = this.props; + return _react.default.createElement(FieldGroup, _extends({ + smallholder: false + }, this.props), this.props.children.map((child, key) => ((0, _react.cloneElement)(child, { + onChange: (e, newValue) => this.handleChange(key, e, newValue), + onBlur: e => this.handleBlur(key, e), + onFocus: () => this.handleFocus(), + key + }, child.props.children))), !isRemoteFile && _react.default.createElement(_ImageSizePresetList.default, { + originalWidth: parseInt(originalWidth, 10), + currentWidth: currentWidth, + imageSizePresets: imageSizePresets, + onSelect: this.handlePresetSelect + })); + } +} +exports.Component = ProportionConstraintField; +ProportionConstraintField.propTypes = { + children: _propTypes.default.array, + onAutofill: _propTypes.default.func, + active: _propTypes.default.bool, + data: _propTypes.default.shape({ + ratio: _propTypes.default.number.isRequired, + isRemoteFile: _propTypes.default.bool, + originalWidth: _propTypes.default.number, + originalHeight: _propTypes.default.number + }), + current: _propTypes.default.shape({ + width: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), + height: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]) + }).isRequired, + FieldGroup: _propTypes.default.elementType.isRequired, + imageSizePresets: _propTypes.default.arrayOf(_propTypes.default.shape({ + width: _propTypes.default.number, + text: _propTypes.default.string, + default: _propTypes.default.bool + })) +}; +ProportionConstraintField.defaultProps = { + active: true +}; +function mapStateToProps(state, _ref) { + let { + formid + } = _ref; + const selector = (0, _reduxForm.formValueSelector)(formid, _getFormState.default); + const currentWidth = selector(state, 'Width'); + const currentHeight = selector(state, 'Height'); + return { + current: { + width: currentWidth ? parseInt(currentWidth, 10) : undefined, + heigth: currentHeight ? parseInt(currentHeight, 10) : undefined + }, + imageSizePresets: state.assetAdmin.modal.imageSizePresets + }; +} +var _default = exports["default"] = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps), (0, _Injector.inject)(['FieldGroup']))(ProportionConstraintField); + +/***/ }), + +/***/ "./client/src/components/UploadField/UploadField.js": +/*!**********************************************************!*\ + !*** ./client/src/components/UploadField/UploadField.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.ConnectedUploadField = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _FieldHolder = _interopRequireDefault(__webpack_require__(/*! components/FieldHolder/FieldHolder */ "components/FieldHolder/FieldHolder")); +var _fileShape = _interopRequireDefault(__webpack_require__(/*! lib/fileShape */ "./client/src/lib/fileShape.js")); +var _getStatusCodeMessage = _interopRequireDefault(__webpack_require__(/*! lib/getStatusCodeMessage */ "./client/src/lib/getStatusCodeMessage.js")); +var uploadFieldActions = _interopRequireWildcard(__webpack_require__(/*! state/uploadField/UploadFieldActions */ "./client/src/state/uploadField/UploadFieldActions.js")); +var modalActions = _interopRequireWildcard(__webpack_require__(/*! state/modal/ModalActions */ "./client/src/state/modal/ModalActions.js")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _md = _interopRequireDefault(__webpack_require__(/*! crypto-js/md5 */ "./node_modules/crypto-js/md5.js")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function compareValues(left, right) { + if (left.length !== right.length) { + return true; + } + for (let i = 0; i < left.length; i++) { + if (left[i].id !== right[i].id) { + return true; + } + } + return false; +} +class UploadField extends _react.Component { + constructor(props) { + super(props); + this.getMaxFiles = this.getMaxFiles.bind(this); + this.getFolderId = this.getFolderId.bind(this); + this.renderChild = this.renderChild.bind(this); + this.handleAddShow = this.handleAddShow.bind(this); + this.handleHide = this.handleHide.bind(this); + this.handleAddInsert = this.handleAddInsert.bind(this); + this.handleInsertMany = this.handleInsertMany.bind(this); + this.handleAddedFile = this.handleAddedFile.bind(this); + this.handleSending = this.handleSending.bind(this); + this.handleUploadProgress = this.handleUploadProgress.bind(this); + this.handleFailedUpload = this.handleFailedUpload.bind(this); + this.handleSuccessfulUpload = this.handleSuccessfulUpload.bind(this); + this.handleItemRemove = this.handleItemRemove.bind(this); + this.handleReplaceShow = this.handleReplaceShow.bind(this); + this.handleChange = this.handleChange.bind(this); + this.handleReplace = this.handleReplace.bind(this); + this.canEdit = this.canEdit.bind(this); + this.canAttach = this.canAttach.bind(this); + this.canUpload = this.canUpload.bind(this); + this.state = { + selecting: false, + selectingItem: null + }; + } + componentDidMount() { + const { + id, + formSchemaFilesHash, + data, + value, + actions, + files + } = this.props; + const newFormSchemaFilesHash = (0, _md.default)(JSON.stringify(value.Files)).toString(); + if (formSchemaFilesHash !== newFormSchemaFilesHash) { + actions.uploadField.setFormSchemaFilesHash(id, newFormSchemaFilesHash); + actions.uploadField.setFiles(id, data.files); + return; + } + actions.uploadField.setFiles(id, files); + } + componentDidUpdate(prevProps) { + const { + id, + formSchemaFilesHash, + data, + files, + value: { + Files: value + }, + actions: { + uploadField: { + setFormSchemaFilesHash, + setFiles + } + } + } = this.props; + const existingFiles = prevProps.files || []; + const newFiles = files || []; + const filesChanged = compareValues(existingFiles, newFiles); + if (filesChanged) { + this.handleChange(null, this.props); + } + const newFormSchemaFilesHash = (0, _md.default)(JSON.stringify(value.Files)).toString(); + if (formSchemaFilesHash !== newFormSchemaFilesHash) { + setFormSchemaFilesHash(id, newFormSchemaFilesHash); + setFiles(id, data.files); + return; + } + const { + value: { + Files: prevValue + } + } = prevProps; + if (value.length === prevValue.length && value.filter(item => !prevValue.includes(item)).length === 0) { + return; + } + const fileIds = files.map(file => file.id); + if (fileIds.length === value.length && fileIds.filter(fileId => !value.includes(fileId)).length === 0) { + return; + } + setFiles(id, data.files); + } + getMaxFiles() { + const maxFiles = this.props.data.multi ? this.props.data.maxFiles : 1; + if (maxFiles === null || typeof maxFiles === 'undefined') { + return null; + } + const filesCount = this.props.files.filter(file => file.id > 0 && (!file.message || file.message.type !== 'error')).length; + const allowed = Math.max(maxFiles - filesCount, 0); + return allowed; + } + getMaxFilesize() { + return this.props.data.maxFilesize || null; + } + getFolderId() { + const { + selectingItem + } = this.state; + if (selectingItem && typeof selectingItem === 'object') { + return selectingItem.parent.id; + } + return this.props.data.parentid || 0; + } + handleAddedFile(data) { + const file = { + ...data, + uploaded: true + }; + this.props.actions.uploadField.addFile(this.props.id, file); + } + handleSending(file, xhr) { + this.props.actions.uploadField.updateQueuedFile(this.props.id, file._queuedId, { + xhr + }); + } + handleUploadProgress(file, progress) { + this.props.actions.uploadField.updateQueuedFile(this.props.id, file._queuedId, { + progress + }); + } + handleSuccessfulUpload(file) { + const json = JSON.parse(file.xhr.response); + if (typeof json[0].error !== 'undefined') { + this.handleFailedUpload(file); + return; + } + this.props.actions.uploadField.succeedUpload(this.props.id, file._queuedId, json[0]); + } + handleFailedUpload(file, response) { + const statusCodeMessage = file.xhr && file.xhr.status ? (0, _getStatusCodeMessage.default)(file.xhr.status, file.xhr) : ''; + this.props.actions.uploadField.failUpload(this.props.id, file._queuedId, response, statusCodeMessage); + } + handleItemRemove(event, item) { + this.props.actions.uploadField.removeFile(this.props.id, item); + } + handleReplaceShow(event, selectingItem) { + this.props.actions.modal.initFormStack('select', 'admin'); + this.setState({ + selecting: true, + selectingItem + }); + } + handleChange(event) { + let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.props; + if (typeof props.onChange === 'function') { + const fileIds = props.files.filter(file => file.id).map(file => file.id); + const newValue = { + Files: fileIds + }; + props.onChange(event, { + id: props.id, + value: newValue + }); + } + } + handleUploadButton(event) { + event.preventDefault(); + } + handleAddShow(event) { + event.preventDefault(); + this.props.actions.modal.initFormStack('select', 'admin'); + this.setState({ + selecting: true, + selectingItem: null + }); + } + handleHide() { + this.props.actions.modal.reset(); + this.setState({ + selecting: false, + selectingItem: null + }); + } + handleAddInsert(event, data, file) { + this.props.actions.uploadField.addFile(this.props.id, file); + this.handleHide(); + return Promise.resolve({}); + } + handleInsertMany(event, files) { + const { + selectingItem + } = this.state; + if (selectingItem) { + this.handleReplace(event, null, files[0]); + return; + } + files.forEach(file => { + this.handleAddInsert(event, null, file); + }); + } + handleReplace(event, data, file) { + const { + selectingItem + } = this.state; + const { + id, + actions: { + uploadField: { + addFile, + removeFile + } + } + } = this.props; + if (!selectingItem) { + throw new Error('Tried to replace a file when none was selected.'); + } + removeFile(id, selectingItem); + addFile(id, file); + this.handleHide(); + return Promise.resolve({}); + } + canEdit() { + return !this.props.disabled && !this.props.readOnly && (this.props.data.canUpload || this.props.data.canAttach); + } + canUpload() { + return this.canEdit() && this.props.data.canUpload; + } + canAttach() { + return this.canEdit() && this.props.data.canAttach; + } + renderDropzone() { + const { + AssetDropzone + } = this.props; + if (!this.props.data.endpoints.createFile) { + return null; + } + const dimensions = { + height: _index.default.SMALL_THUMBNAIL_HEIGHT, + width: _index.default.SMALL_THUMBNAIL_WIDTH + }; + const maxFiles = this.getMaxFiles(); + const maxFilesize = this.getMaxFilesize(); + const dropzoneOptions = { + url: this.props.data.endpoints.createFile.url, + method: this.props.data.endpoints.createFile.method, + paramName: 'Upload', + maxFiles, + maxFilesize, + thumbnailWidth: _index.default.SMALL_THUMBNAIL_WIDTH, + thumbnailHeight: _index.default.SMALL_THUMBNAIL_HEIGHT + }; + const classNames = ['uploadfield__dropzone']; + if (maxFiles === 0) { + classNames.push('uploadfield__dropzone--hidden'); + } + if (!this.canEdit()) { + if (this.props.files.length) { + return null; + } + return _react.default.createElement("p", null, _i18n.default._t('AssetAdmin.EMPTY', 'No files')); + } + const securityID = this.props.securityId; + const options = []; + if (this.canUpload()) { + options.push(_react.default.createElement("button", { + key: "uploadbutton", + type: "button", + onClick: this.handleUploadButton, + className: "uploadfield__upload-button" + }, _i18n.default._t('AssetAdmin.UPLOADFIELD_UPLOAD_NEW', 'Upload new'))); + } + if (this.canAttach()) { + if (options.length) { + options.push(_react.default.createElement("span", { + key: "uploadjoin", + className: "uploadfield__join" + }, _i18n.default._t('AssetAdmin.OR', 'or'))); + } + options.push(_react.default.createElement("button", { + key: "attachbutton", + type: "button", + onClick: this.handleAddShow, + className: "uploadfield__add-button" + }, _i18n.default._t('AssetAdmin.UPLOADFIELD_CHOOSE_EXISTING', 'Choose existing'))); + } + return _react.default.createElement(AssetDropzone, { + name: this.props.name, + canUpload: this.canUpload(), + uploadButton: false, + uploadSelector: ".uploadfield__upload-button, .uploadfield__backdrop", + folderId: this.props.data.parentid, + onAddedFile: this.handleAddedFile, + onError: this.handleFailedUpload, + onSuccess: this.handleSuccessfulUpload, + onSending: this.handleSending, + onUploadProgress: this.handleUploadProgress, + preview: dimensions, + options: dropzoneOptions, + securityID: securityID, + className: classNames.join(' ') + }, _react.default.createElement("div", { + className: "uploadfield__backdrop" + }), _react.default.createElement("span", { + className: "uploadfield__droptext" + }, options)); + } + renderModal() { + const { + InsertMediaModal + } = this.props; + const { + selecting, + selectingItem + } = this.state; + const maxFiles = this.getMaxFiles(); + const folderId = this.getFolderId(); + return _react.default.createElement(InsertMediaModal, { + title: false, + isOpen: selecting, + onInsert: selectingItem ? this.handleReplace : this.handleAddInsert, + onClosed: this.handleHide, + onInsertMany: this.handleInsertMany, + maxFiles: selectingItem ? 1 : maxFiles, + type: "select", + bodyClassName: "modal__dialog", + className: "insert-media-react__dialog-wrapper", + fileAttributes: selectingItem ? { + ID: selectingItem.id + } : null, + folderId: folderId + }); + } + renderChild(item, index) { + const { + UploadFieldItem + } = this.props; + const draftProps = { + key: item.id ? `file-${item.id}` : `queued-${item.queuedId}`, + item, + name: this.props.name, + onRemove: this.handleItemRemove, + canEdit: this.canEdit(), + onView: this.handleReplaceShow + }; + const itemProps = this.props.getItemProps(draftProps, index, this.props); + return _react.default.createElement(UploadFieldItem, itemProps); + } + render() { + return _react.default.createElement("div", { + className: "uploadfield" + }, this.renderDropzone(), this.props.files.map(this.renderChild), this.renderModal()); + } +} +exports.Component = UploadField; +UploadField.propTypes = { + id: _propTypes.default.string.isRequired, + name: _propTypes.default.string.isRequired, + onChange: _propTypes.default.func, + value: _propTypes.default.shape({ + Files: _propTypes.default.arrayOf(_propTypes.default.number) + }), + files: _propTypes.default.arrayOf(_fileShape.default), + formSchemaFilesHash: _propTypes.default.string, + readOnly: _propTypes.default.bool, + disabled: _propTypes.default.bool, + data: _propTypes.default.shape({ + files: _propTypes.default.arrayOf(_fileShape.default), + multi: _propTypes.default.bool, + parentid: _propTypes.default.number, + canUpload: _propTypes.default.bool, + canAttach: _propTypes.default.bool, + maxFiles: _propTypes.default.number, + endpoints: _propTypes.default.object + }), + UploadFieldItem: _propTypes.default.elementType, + AssetDropzone: _propTypes.default.elementType, + InsertMediaModal: _propTypes.default.elementType, + getItemProps: _propTypes.default.func +}; +UploadField.defaultProps = { + value: { + Files: [] + }, + className: '', + getItemProps: props => props +}; +function mapStateToProps(state, ownprops) { + const id = ownprops.id; + let files = []; + let formSchemaFilesHash = null; + if (state.assetAdmin && state.assetAdmin.uploadField && state.assetAdmin.uploadField.fields && state.assetAdmin.uploadField.fields[id]) { + files = state.assetAdmin.uploadField.fields[id].files || []; + formSchemaFilesHash = state.assetAdmin.uploadField.fields[id].formSchemaFilesHash || null; + } + const securityId = state.config.SecurityID; + return { + files, + securityId, + formSchemaFilesHash + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + uploadField: (0, _redux.bindActionCreators)(uploadFieldActions, dispatch), + modal: (0, _redux.bindActionCreators)(modalActions, dispatch) + } + }; +} +const ConnectedUploadField = exports.ConnectedUploadField = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(UploadField); +var _default = exports["default"] = (0, _redux.compose)((0, _Injector.inject)(['UploadFieldItem', 'AssetDropzone', 'InsertMediaModal']), _FieldHolder.default)(ConnectedUploadField); + +/***/ }), + +/***/ "./client/src/components/UploadField/UploadFieldItem.js": +/*!**************************************************************!*\ + !*** ./client/src/components/UploadField/UploadFieldItem.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _constants = _interopRequireDefault(__webpack_require__(/*! constants */ "./client/src/constants/index.js")); +var _fileShape = _interopRequireDefault(__webpack_require__(/*! lib/fileShape */ "./client/src/lib/fileShape.js")); +var _DataFormat = __webpack_require__(/*! lib/DataFormat */ "lib/DataFormat"); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _FileStatusIcon = _interopRequireDefault(__webpack_require__(/*! components/FileStatusIcon/FileStatusIcon */ "components/FileStatusIcon/FileStatusIcon")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +class UploadFieldItem extends _react.Component { + constructor(props) { + super(props); + this.handleRemove = this.handleRemove.bind(this); + this.handleItemClick = this.handleItemClick.bind(this); + this.handleView = this.handleView.bind(this); + } + getThumbnailStyles() { + if (this.isImage() && (this.exists() || this.uploading())) { + const thumbnail = this.props.item.smallThumbnail || this.props.item.url || ''; + return { + backgroundImage: `url(${thumbnail})` + }; + } + return {}; + } + getThumbnailClassNames() { + const thumbnailClassNames = ['uploadfield-item__thumbnail']; + if (this.isImageSmallerThanThumbnail()) { + thumbnailClassNames.push('uploadfield-item__thumbnail--small'); + } + return thumbnailClassNames.join(' '); + } + getItemClassNames() { + const category = this.props.item.category || 'none'; + const itemClassNames = ['fill-width', 'uploadfield-item', `uploadfield-item--${category}`]; + if (this.missing()) { + itemClassNames.push('uploadfield-item--missing'); + } + if (this.hasError()) { + itemClassNames.push('uploadfield-item--error'); + } + return itemClassNames.join(' '); + } + hasError() { + if (this.props.item.message) { + return this.props.item.message.type === 'error'; + } + return false; + } + isImage() { + return this.props.item.category === 'image'; + } + exists() { + return this.props.item.exists; + } + uploading() { + return this.props.item.queuedId && !this.saved(); + } + complete() { + return this.props.item.queuedId && this.saved(); + } + saved() { + return this.props.item.id > 0; + } + missing() { + return !this.exists() && this.saved(); + } + isImageSmallerThanThumbnail() { + if (!this.isImage() || this.missing()) { + return false; + } + const width = this.props.item.width; + const height = this.props.item.height; + return height && width && height < _constants.default.SMALL_THUMBNAIL_HEIGHT && width < _constants.default.SMALL_THUMBNAIL_WIDTH; + } + handleRemove(event) { + event.preventDefault(); + if (this.props.onRemove) { + this.props.onRemove(event, this.props.item); + } + } + handleView(event) { + event.preventDefault(); + if (this.props.onView) { + this.props.onView(event, this.props.item); + } + } + handleItemClick(event) { + event.preventDefault(); + if (this.props.onItemClick) { + this.props.onItemClick(event, this.props.item); + } + } + renderStatus() { + if (this.props.item.draft) { + return _react.default.createElement("span", { + className: "uploadfield-item__status" + }, _i18n.default._t('File.DRAFT', 'Draft')); + } else if (this.props.item.modified) { + return _react.default.createElement("span", { + className: "uploadfield-item__status" + }, _i18n.default._t('File.MODIFIED', 'Modified')); + } + return null; + } + renderErrorMessage() { + let message = null; + if (this.hasError()) { + message = this.props.item.message.value; + } else if (this.missing()) { + message = _i18n.default._t('AssetAdmin.FILE_MISSING', 'File cannot be found'); + } + if (message !== null) { + return _react.default.createElement("div", { + className: "uploadfield-item__error-message", + title: message + }, message); + } + return null; + } + renderProgressBar() { + const progressBarProps = { + className: 'uploadfield-item__progress-bar', + style: { + width: `${this.props.item.progress}%` + } + }; + if (!this.hasError() && this.props.item.queuedId) { + if (this.complete()) { + return _react.default.createElement("div", { + className: "uploadfield-item__complete-icon" + }); + } + return _react.default.createElement("div", { + className: "uploadfield-item__upload-progress" + }, _react.default.createElement("div", progressBarProps)); + } + return null; + } + renderRemoveButton() { + if (!this.props.canEdit) { + return null; + } + const classes = ['btn', 'uploadfield-item__remove-btn', 'btn-secondary', 'btn--no-text', 'font-icon-cancel', 'btn--icon-md'].join(' '); + return _react.default.createElement("button", { + className: classes, + onClick: this.handleRemove + }); + } + renderViewButton() { + if (!this.props.canEdit || !this.props.item.id) { + return null; + } + const classes = ['btn', 'uploadfield-item__view-btn', 'btn-secondary', 'btn--no-text', 'font-icon-eye', 'btn--icon-md'].join(' '); + return _react.default.createElement("button", { + className: classes, + onClick: this.handleView + }); + } + renderRestrictedAccess(item) { + const { + id, + hasRestrictedAccess + } = item; + const attrs = { + fileID: id, + placement: 'top', + hasRestrictedAccess + }; + return _react.default.createElement(_FileStatusIcon.default, attrs); + } + renderTrackedFormUpload(item) { + const { + id, + isTrackedFormUpload, + hasRestrictedAccess + } = item; + const attrs = { + fileID: id, + placement: 'top', + isTrackedFormUpload, + hasRestrictedAccess + }; + return _react.default.createElement(_FileStatusIcon.default, attrs); + } + renderFileDetails() { + const item = this.props.item; + let size = ''; + if (item.size) { + size = `, ${(0, _DataFormat.fileSize)(item.size)}`; + } + return _react.default.createElement("div", { + className: "uploadfield-item__details fill-height flexbox-area-grow" + }, _react.default.createElement("div", { + className: "fill-width" + }, _react.default.createElement("span", { + className: "uploadfield-item__title flexbox-area-grow" + }, item.title)), _react.default.createElement("div", { + className: "fill-width uploadfield-item__meta" + }, _react.default.createElement("span", { + className: "uploadfield-item__specs" + }, item.extension, size), this.renderStatus(), item.hasRestrictedAccess && this.renderRestrictedAccess(item), item.isTrackedFormUpload && this.renderTrackedFormUpload(item))); + } + renderThumbnail() { + return _react.default.createElement("div", { + className: this.getThumbnailClassNames(), + style: this.getThumbnailStyles(), + onClick: this.handleItemClick, + role: "button", + tabIndex: this.props.onItemClick ? 0 : -1 + }); + } + render() { + const fieldName = `${this.props.name}[Files][]`; + return _react.default.createElement("div", { + className: this.getItemClassNames() + }, _react.default.createElement("input", { + type: "hidden", + value: this.props.item.id, + name: fieldName + }), this.renderThumbnail(), this.renderFileDetails(), this.renderProgressBar(), this.renderErrorMessage(), this.renderViewButton(), this.renderRemoveButton()); + } +} +UploadFieldItem.propTypes = { + canEdit: _propTypes.default.bool, + name: _propTypes.default.string.isRequired, + item: _fileShape.default, + onRemove: _propTypes.default.func, + onItemClick: _propTypes.default.func, + onView: _propTypes.default.func +}; +var _default = exports["default"] = UploadFieldItem; + +/***/ }), + +/***/ "./client/src/constants/index.js": +/*!***************************************!*\ + !*** ./client/src/constants/index.js ***! + \***************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +var _default = exports["default"] = { + ACTIONS: { + CREATE_FOLDER: 'create-folder', + EDIT_FILE: 'edit' + }, + MOVE_SUCCESS_DURATION: 3000, + CSS_TRANSITION_TIME: 300, + SMALL_THUMBNAIL_HEIGHT: 60, + SMALL_THUMBNAIL_WIDTH: 60, + THUMBNAIL_HEIGHT: 150, + THUMBNAIL_WIDTH: 200, + BULK_ACTIONS: [{ + value: 'delete', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_DELETE', 'Delete'), + className: 'font-icon-trash', + destructive: true, + callback: null, + canApply: items => items.every(item => item && item.canDelete) + }, { + value: 'archive', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_ARCHIVE', 'Archive'), + className: 'font-icon-box', + destructive: true, + callback: null, + canApply: items => items.every(item => item && item.canDelete) + }, { + value: 'edit', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_EDIT', 'Edit'), + className: 'font-icon-edit', + destructive: false, + canApply: items => items.length === 1, + callback: null + }, { + value: 'move', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_MOVE', 'Move'), + className: 'font-icon-folder-move', + canApply: items => items.every(item => item && item.canEdit), + destructive: false, + callback: null + }, { + value: 'publish', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_PUBLISH', 'Publish'), + className: 'font-icon-rocket', + destructive: false, + callback: null, + canApply: items => items.some(item => item && item.modified) && items.every(item => item.canEdit && item.type !== 'folder'), + confirm: null + }, { + value: 'unpublish', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_UNPUBLISH', 'Unpublish'), + className: 'font-icon-cancel-circled', + destructive: false, + callback: null, + canApply: items => items.some(item => item.published) && items.every(item => item.canEdit && item.type !== 'folder'), + confirm: null + }, { + value: 'insert', + label: _i18n.default._t('AssetAdmin.BULK_ACTIONS_INSERT', 'Insert'), + className: 'font-icon-plus-circled btn-primary', + destructive: false, + callback: null, + canApply: items => items.length, + confirm: null + }], + BULK_ACTIONS_PLACEHOLDER: _i18n.default._t('AssetAdmin.BULK_ACTIONS_PLACEHOLDER'), + SPACE_KEY_CODE: 32, + RETURN_KEY_CODE: 13, + DEFAULT_PREVIEW: 'framework/client/dist/images/app_icons/generic_92.png', + MODAL_MOVE: 'MODAL_MOVE' +}; + +/***/ }), + +/***/ "./client/src/containers/AssetAdmin/AssetAdmin.js": +/*!********************************************************!*\ + !*** ./client/src/containers/AssetAdmin/AssetAdmin.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var galleryActions = _interopRequireWildcard(__webpack_require__(/*! state/gallery/GalleryActions */ "./client/src/state/gallery/GalleryActions.js")); +var toastsActions = _interopRequireWildcard(__webpack_require__(/*! state/toasts/ToastsActions */ "state/toasts/ToastsActions")); +var queuedFilesActions = _interopRequireWildcard(__webpack_require__(/*! state/queuedFiles/QueuedFilesActions */ "./client/src/state/queuedFiles/QueuedFilesActions.js")); +var displaySearchActions = _interopRequireWildcard(__webpack_require__(/*! state/displaySearch/DisplaySearchActions */ "./client/src/state/displaySearch/DisplaySearchActions.js")); +var _Editor = _interopRequireDefault(__webpack_require__(/*! containers/Editor/Editor */ "./client/src/containers/Editor/Editor.js")); +var _Gallery = _interopRequireDefault(__webpack_require__(/*! containers/Gallery/Gallery */ "./client/src/containers/Gallery/Gallery.js")); +var _Toolbar = _interopRequireDefault(__webpack_require__(/*! components/Toolbar/Toolbar */ "components/Toolbar/Toolbar")); +var _Search = _interopRequireWildcard(__webpack_require__(/*! components/Search/Search */ "components/Search/Search")); +var _SearchToggle = _interopRequireDefault(__webpack_require__(/*! components/Search/SearchToggle */ "components/Search/SearchToggle")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _configShape = _interopRequireDefault(__webpack_require__(/*! lib/configShape */ "./client/src/lib/configShape.js")); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var confirmDeletionActions = _interopRequireWildcard(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionActions */ "./client/src/state/confirmDeletion/ConfirmDeletionActions.js")); +var _getFormSchema = _interopRequireDefault(__webpack_require__(/*! lib/getFormSchema */ "./client/src/lib/getFormSchema.js")); +var _getJsonErrorMessage = _interopRequireDefault(__webpack_require__(/*! lib/getJsonErrorMessage */ "lib/getJsonErrorMessage")); +var _BulkDeleteConfirmation = _interopRequireDefault(__webpack_require__(/*! ../BulkDeleteConfirmation/BulkDeleteConfirmation */ "./client/src/containers/BulkDeleteConfirmation/BulkDeleteConfirmation.js")); +var _AssetAdminBreadcrumb = _interopRequireDefault(__webpack_require__(/*! ./AssetAdminBreadcrumb */ "./client/src/containers/AssetAdmin/AssetAdminBreadcrumb.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +class AssetAdmin extends _react.Component { + constructor(props) { + super(props); + this.handleOpenFile = this.handleOpenFile.bind(this); + this.handleCloseFile = this.handleCloseFile.bind(this); + this.handleDelete = this.handleDelete.bind(this); + this.doPublish = this.doPublish.bind(this); + this.doUnpublish = this.doUnpublish.bind(this); + this.handleUnpublish = this.handleUnpublish.bind(this); + this.handleDoSearch = this.handleDoSearch.bind(this); + this.handleClearSearch = this.handleClearSearch.bind(this); + this.handleSubmitEditor = this.handleSubmitEditor.bind(this); + this.handleOpenFolder = this.handleOpenFolder.bind(this); + this.handleSort = this.handleSort.bind(this); + this.handleSetPage = this.handleSetPage.bind(this); + this.createEndpoint = this.createEndpoint.bind(this); + this.handleBackButtonClick = this.handleBackButtonClick.bind(this); + this.handleFolderIcon = this.handleFolderIcon.bind(this); + this.handleBrowse = this.handleBrowse.bind(this); + this.handleViewChange = this.handleViewChange.bind(this); + this.handleUpload = this.handleUpload.bind(this); + this.handleUploadQueue = this.handleUploadQueue.bind(this); + this.handleCreateFolder = this.handleCreateFolder.bind(this); + this.handleMoveFilesSuccess = this.handleMoveFilesSuccess.bind(this); + this.refetchFolder = this.refetchFolder.bind(this); + this.state = { + loading: false, + folder: null, + files: [], + totalCount: 0, + forceRefetch: false + }; + } + componentDidMount() { + this.refetchFolder(); + } + componentDidUpdate(prevProps) { + if (this.props.folderId !== prevProps.folderId || this.props.fileId !== prevProps.fileId && this.props.fileId !== 0 || this.state.forceRefetch) { + this.refetchFolder(); + } + if (this.state.forceRefetch) { + this.setState({ + forceRefetch: false + }); + } + } + getFolderId() { + if (this.props.folderId !== null) { + return this.props.folderId; + } + if (this.state.folder) { + return this.state.folder.id; + } + return 0; + } + refetchFolder() { + const folderId = this.getFolderId(); + const urlParams = new URLSearchParams(window.location.search); + const qsParams = []; + urlParams.forEach((value, key) => { + if (key === 'page' || key.substring(0, 6) === 'filter' || key.substring(0, 4) === 'sort') { + qsParams.push(`${key}=${value}`); + } + }); + let qs = ''; + if (qsParams.length) { + qs = `?${qsParams.join('&')}`; + } + const sectionConfig = _Config.default.getSection('SilverStripe\\AssetAdmin\\Controller\\AssetAdminOpen'); + const url = `${sectionConfig.endpoints.read.url}/${folderId}${qs}`; + _Backend.default.get(url).then(async response => { + const responseJson = await response.json(); + this.setState({ + loading: false, + folder: responseJson, + files: responseJson.children.nodes, + totalCount: responseJson.children.pageInfo.totalCount + }); + }).catch(async err => { + this.setState({ + loading: false, + folder: null, + files: [], + totalCount: 0 + }); + const message = await (0, _getJsonErrorMessage.default)(err); + this.props.actions.toasts.error(message); + }); + } + getFiles() { + const { + queuedFiles, + folderId + } = this.props; + const files = this.state.files; + const combinedFilesList = [...queuedFiles.items.filter(item => (!item.id || !files.find(file => file.id === item.id)) && (!item.hasOwnProperty('uploadedToFolderId') || item.uploadedToFolderId === folderId)), ...files]; + const foldersList = combinedFilesList.filter(file => file.type === 'folder'); + const filesList = combinedFilesList.filter(file => file.type !== 'folder'); + return foldersList.concat(filesList); + } + handleBrowse(folderId, fileId, query) { + if (typeof this.props.onBrowse === 'function') { + this.props.onBrowse(folderId, fileId, query); + this.setState({ + forceRefetch: true + }); + } + if (folderId !== this.getFolderId()) { + this.props.actions.gallery.deselectFiles(); + } + } + handleSetPage(page) { + this.handleBrowse(this.getFolderId(), this.props.fileId, Object.assign({}, this.props.query, { + page + })); + this.setState({ + forceRefetch: true + }); + } + handleDoSearch(data) { + this.props.actions.gallery.deselectFiles(); + this.props.actions.queuedFiles.purgeUploadQueue(); + this.handleBrowse(data.currentFolderOnly ? this.getFolderId() : 0, null, { + filter: data, + view: this.props.query.view + }); + } + handleClearSearch(event) { + this.props.actions.displaySearch.closeSearch(); + this.props.actions.gallery.deselectFiles(); + this.props.actions.queuedFiles.purgeUploadQueue(); + this.refetchFolder(); + const folder = this.state.folder; + this.handleOpenFolder(event, folder); + } + handleSort(sort) { + this.handleBrowse(this.getFolderId(), this.props.fileId, { + ...this.props.query, + sort, + limit: undefined, + page: undefined + }); + this.setState({ + forceRefetch: true + }); + } + handleViewChange(view) { + this.handleBrowse(this.getFolderId(), this.props.fileId, Object.assign({}, this.props.query, { + view + })); + } + createEndpoint(endpointConfig) { + let includeToken = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + return _Backend.default.createEndpointFetcher(Object.assign({}, endpointConfig, includeToken ? { + defaultData: { + SecurityID: this.props.securityId + } + } : {})); + } + handleBackButtonClick(event) { + event.preventDefault(); + this.props.actions.gallery.deselectFiles(); + const folder = this.state.folder; + if (folder) { + this.handleOpenFolder(folder.parentId || 0); + } else { + this.handleOpenFolder(0); + } + } + resetFile(file) { + if (file.queuedId) { + this.props.actions.queuedFiles.removeQueuedFile(file.queuedId); + } + if (this.props.fileId === file.id) { + this.props.resetFileDetails(this.getFolderId(), file.id, this.props.query); + } + } + handleFolderIcon() { + this.handleOpenFile(this.getFolderId()); + } + handleOpenFile(fileId) { + this.handleBrowse(this.getFolderId(), fileId, this.props.query); + } + handleSubmitEditor(data, action, submitFn) { + let promise = null; + if (action === 'action_insert' && this.props.type === 'select') { + const files = this.getFiles(); + const file = files.find(item => item.id === parseInt(data.ID, 10)); + this.props.onInsertMany(null, [file]); + this.setState({ + forceRefetch: true + }); + return Promise.resolve(); + } + if (typeof this.props.onSubmitEditor === 'function') { + const file = this.findFile(this.props.fileId); + promise = this.props.onSubmitEditor(data, action, submitFn, file); + } else { + promise = submitFn(); + } + if (!promise) { + throw new Error('Promise was not returned for submitting'); + } + this.setState({ + forceRefetch: true + }); + return promise.then(response => { + if (action === 'action_createfolder') { + if (this.props.type === 'admin') { + this.handleOpenFile(response.record.id); + } else { + this.handleOpenFolder(this.getFolderId()); + } + } else if ((action === 'action_save' || action === 'action_publish') && this.getFolderId() !== response.record.parent.id) { + this.handleBrowse(response.record.parent.id, response.record.id, null); + } + return response; + }); + } + handleCloseFile() { + this.handleBrowse(this.getFolderId(), null, this.props.query); + } + handleOpenFolder(folderId) { + const { + page, + filter, + ...query + } = this.props.query; + this.handleBrowse(folderId, null, query); + } + handleDelete(ids) { + this.props.actions.confirmDeletion.deleting(); + const files = ids.map(id => { + const result = this.findFile(id); + if (!result) { + throw new Error(`File selected for deletion cannot be found: ${id}`); + } + if (result.queuedId) { + this.props.actions.queuedFiles.removeQueuedFile(result.queuedId); + } + return result; + }); + const fileIDs = files.map(file => file.id); + const folder = this.state.folder; + const parentId = folder ? folder.id : 0; + const url = this.props.sectionConfig.endpoints.delete.url; + return _Backend.default.post(url, { + ids: fileIDs + }, { + 'X-SecurityID': _Config.default.get('SecurityID') + }).then(() => { + this.handleBrowse(parentId, null, this.props.query); + const queuedFiles = this.props.queuedFiles.items.filter(file => fileIDs.includes(file.id)); + queuedFiles.forEach(file => { + if (file.queuedId) { + this.props.actions.queuedFiles.removeQueuedFile(file.queuedId); + } + }); + let transKey = 'AssetAdmin.BULK_ACTIONS_DELETE_SUCCESS_02'; + let transDefault = '%s folders/files were successfully deleted.'; + if (this.props.sectionConfig.filesAreVersioned && this.props.sectionConfig.archiveFiles) { + transKey = 'AssetAdmin.BULK_ACTIONS_ARCHIVE_SUCCESS_02'; + transDefault = '%s folders/files were successfully archived.'; + } + this.props.actions.toasts.success(_i18n.default.sprintf(_i18n.default._t(transKey, transDefault), fileIDs.length)); + this.props.actions.gallery.deselectFiles(); + this.refetchFolder(); + }).catch(async err => { + const message = await (0, _getJsonErrorMessage.default)(err); + this.props.actions.toasts.error(message); + }).finally(() => this.props.actions.confirmDeletion.reset()); + } + doUnpublish(ids) { + const files = ids.map(id => { + const result = this.findFile(id); + if (!result) { + throw new Error(`File selected for unpublishing cannot be found: ${id}`); + } else if (result.type === 'folder') { + throw new Error('Cannot unpublish folders'); + } + return result; + }); + const fileIDs = files.map(file => file.id); + const qs = fileIDs.map(id => `ids[]=${id}`).join('&'); + let url = `${this.props.sectionConfig.endpoints.readLiveOwnerCounts.url}?${qs}`; + return _Backend.default.get(url).then(async response => { + const responseJson = await response.json(); + const filesWithLiveUsage = responseJson.filter(fileObj => fileObj.count > 0); + const displayedMessages = filesWithLiveUsage.slice(0, 4).map(fileObj => fileObj.message); + const theRestLength = filesWithLiveUsage.slice(5).length; + let theRestMessage = ''; + if (theRestLength > 0) { + theRestMessage = _i18n.default.inject(_i18n.default._t('AssetAdmin.BULK_OWNED_WARNING_REMAINING', 'And {count} other file(s)'), { + count: theRestLength + }); + } + if (displayedMessages.length) { + const confirmationMessage = [_i18n.default.inject(_i18n.default._t('AssetAdmin.BULK_OWNED_WARNING_HEADING', '{count} file(s) are being used by other published content.'), { + count: displayedMessages.length + }), ...displayedMessages, theRestMessage, _i18n.default._t('AssetAdmin.BULK_OWNED_WARNING_FOOTER', 'Unpublishing will only remove files from the published version of the content. They will remain on the draft version. Unpublish anyway?')].filter(s => s).join('\n\n'); + if (!confirm(confirmationMessage)) { + return Promise.reject(); + } + } + return Promise.resolve(); + }).then(() => { + url = this.props.sectionConfig.endpoints.unpublish.url; + return _Backend.default.post(url, { + ids: fileIDs + }, { + 'X-SecurityID': _Config.default.get('SecurityID') + }).catch(async err => { + const message = await (0, _getJsonErrorMessage.default)(err); + this.props.actions.toasts.error(message); + }); + }).then(() => { + this.refetchFolder(); + return files; + }).catch(async err => { + const message = await (0, _getJsonErrorMessage.default)(err); + this.props.actions.toasts.error(message); + return []; + }); + } + handleUnpublish(fileIds) { + return this.doUnpublish(fileIds).then(files => { + const { + fileId + } = this.props; + this.refetchFolder().then(() => { + if (fileId && files.find(file => file.id === fileId)) { + this.props.resetFileDetails(this.getFolderId(), fileId, this.props.query); + } + }); + }); + } + doPublish(ids) { + const files = ids.map(id => { + const result = this.findFile(id); + if (!result) { + throw new Error(`File selected for publishing cannot be found: ${id}`); + } else if (result.type === 'folder') { + throw new Error('Cannot publish folders'); + } + return result; + }); + const fileIDs = files.map(file => file.id); + const url = this.props.sectionConfig.endpoints.publish.url; + return _Backend.default.post(url, { + ids: fileIDs + }, { + 'X-SecurityID': _Config.default.get('SecurityID') + }).then(() => { + files.forEach(file => this.resetFile(file)); + this.refetchFolder(); + return files; + }).catch(async err => { + const message = await (0, _getJsonErrorMessage.default)(err); + this.props.actions.toasts.error(message); + }); + } + findFile(fileId) { + const allFiles = this.getFiles(); + return allFiles.find(item => item.id === parseInt(fileId, 10)); + } + handleUpload() {} + handleUploadQueue() { + if (this.props.fileId) { + this.refetchFolder(); + } + } + handleCreateFolder() { + this.props.onBrowse(this.getFolderId(), null, this.props.query, _index.default.ACTIONS.CREATE_FOLDER); + } + handleMoveFilesSuccess(folderId, fileIds) { + const files = this.props.queuedFiles.items.filter(file => fileIds.includes(file.id)); + files.forEach(file => { + if (file.queuedId) { + this.props.actions.queuedFiles.removeQueuedFile(file.queuedId); + } + }); + this.props.actions.gallery.deselectFiles(); + this.refetchFolder(); + } + renderGallery() { + const { + GalleryComponent + } = this.props; + const config = this.props.sectionConfig; + const createFileApiUrl = config.endpoints.createFile.url; + const createFileApiMethod = config.endpoints.createFile.method; + const limit = this.props.query && parseInt(this.props.query.limit || config.limit, 10); + const page = this.props.query && parseInt(this.props.query.page || 1, 10); + const sort = this.props.query && this.props.query.sort; + const view = this.props.query && this.props.query.view; + const filters = this.props.query.filter || {}; + const folder = this.state.folder; + const loading = this.state.loading; + return _react.default.createElement(GalleryComponent, { + files: this.getFiles(), + fileId: this.props.fileId, + folderId: this.getFolderId(), + folder: folder, + type: this.props.type, + limit: limit, + page: page, + totalCount: this.state.totalCount, + view: view, + filters: filters, + createFileApiUrl: createFileApiUrl, + createFileApiMethod: createFileApiMethod, + onInsertMany: this.props.onInsertMany, + onPublish: this.doPublish, + onUnpublish: this.doUnpublish, + onOpenFile: this.handleOpenFile, + onOpenFolder: this.handleOpenFolder, + onSuccessfulUpload: this.handleUpload, + onSuccessfulUploadQueue: this.handleUploadQueue, + onCreateFolder: this.handleCreateFolder, + onMoveFilesSuccess: this.handleMoveFilesSuccess, + onClearSearch: this.handleClearSearch, + onSort: this.handleSort, + onSetPage: this.handleSetPage, + onViewChange: this.handleViewChange, + sort: sort, + sectionConfig: config, + loading: loading, + maxFilesSelect: this.props.maxFiles, + dialog: this.props.dialog + }); + } + renderEditor() { + const { + sectionConfig: config, + viewAction, + type, + fileId, + dialog, + requireLinkText, + fileSelected, + EditorComponent + } = this.props; + const { + schemaUrl, + targetId + } = (0, _getFormSchema.default)({ + config, + viewAction, + folderId: this.getFolderId(), + type, + fileId + }); + if (!schemaUrl) { + return null; + } + const schemaUrlQueries = []; + if (requireLinkText) { + schemaUrlQueries.push({ + name: 'requireLinkText', + value: true + }); + } + if (fileSelected) { + schemaUrlQueries.push({ + name: 'fileSelected', + value: true + }); + } + const editorProps = { + dialog, + fileId: targetId, + schemaUrl, + schemaUrlQueries, + onClose: this.handleCloseFile, + onSubmit: this.handleSubmitEditor, + onUnpublish: this.handleUnpublish + }; + return _react.default.createElement(EditorComponent, editorProps); + } + render() { + const { + folderId, + query, + getUrl, + type, + maxFiles, + toolbarChildren, + SearchComponent, + BulkDeleteConfirmationComponent + } = this.props; + if (this.state.folder === null) { + return null; + } + const showBackButton = Boolean(folderId || (0, _Search.hasFilters)(query.filter)); + const searchFormSchemaUrl = this.props.sectionConfig.form.fileSearchForm.schemaUrl; + const filters = query.filter || {}; + const classNames = (0, _classnames.default)('fill-height asset-admin', type === 'select' && { + 'asset-admin--single-select': maxFiles === 1, + 'asset-admin--multi-select': maxFiles !== 1 + }); + const showSearch = (0, _Search.hasFilters)(query.filter) || this.props.showSearch; + const onSearchToggle = this.props.actions.displaySearch ? this.props.actions.displaySearch.toggleSearch : undefined; + const folder = this.state.folder; + const breadcrumbProps = { + folder, + query, + getUrl, + onBrowse: this.handleBrowse, + onFolderIcon: this.handleFolderIcon + }; + return _react.default.createElement("div", { + className: classNames + }, _react.default.createElement(_Toolbar.default, { + showBackButton: showBackButton, + onBackButtonClick: this.handleBackButtonClick + }, folder && _react.default.createElement(_AssetAdminBreadcrumb.default, breadcrumbProps), _react.default.createElement("div", { + className: "asset-admin__toolbar-extra pull-xs-right fill-width vertical-align-items" + }, _react.default.createElement(_SearchToggle.default, { + toggled: showSearch, + onToggle: onSearchToggle + }), toolbarChildren)), showSearch && _react.default.createElement(SearchComponent, { + onSearch: this.handleDoSearch, + id: "AssetSearchForm", + formSchemaUrl: searchFormSchemaUrl, + onHide: this.handleClearSearch, + displayBehavior: "HIDEABLE", + filters: filters, + name: "name" + }), _react.default.createElement("div", { + className: "flexbox-area-grow fill-width fill-height gallery" + }, this.renderGallery(), this.renderEditor()), _react.default.createElement(BulkDeleteConfirmationComponent, { + onConfirm: this.handleDelete, + filesAreVersioned: this.props.sectionConfig.filesAreVersioned, + archiveFiles: this.props.sectionConfig.archiveFiles + })); + } +} +exports.Component = AssetAdmin; +AssetAdmin.propTypes = { + dialog: _propTypes.default.bool, + sectionConfig: _configShape.default, + fileId: _propTypes.default.number, + folderId: _propTypes.default.number, + resetFileDetails: _propTypes.default.func, + onBrowse: _propTypes.default.func, + onReplaceUrl: _propTypes.default.func, + onInsertMany: _propTypes.default.func, + getUrl: _propTypes.default.func, + query: _propTypes.default.shape({ + sort: _propTypes.default.string, + limit: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), + page: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), + filter: _propTypes.default.object + }), + onSubmitEditor: _propTypes.default.func, + type: _propTypes.default.oneOf(['insert-media', 'insert-link', 'select', 'admin']), + queuedFiles: _propTypes.default.shape({ + items: _propTypes.default.array.isRequired + }), + filesTotalCount: _propTypes.default.number, + loading: _propTypes.default.bool, + actions: _propTypes.default.object, + maxFiles: _propTypes.default.number, + fileSelected: _propTypes.default.bool, + EditorComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]), + GalleryComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]), + SearchComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]), + BulkDeleteConfirmationComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +AssetAdmin.defaultProps = { + type: 'admin', + query: { + sort: '', + limit: null, + page: 0, + filter: {} + }, + maxFiles: null, + EditorComponent: _Editor.default, + GalleryComponent: _Gallery.default, + SearchComponent: _Search.default, + BulkDeleteConfirmationComponent: _BulkDeleteConfirmation.default +}; +function mapStateToProps(state, ownProps) { + const { + formSchema + } = state.assetAdmin.modal; + return { + securityId: state.config.SecurityID, + queuedFiles: state.assetAdmin.queuedFiles, + showSearch: state.assetAdmin.displaySearch.isOpen, + type: formSchema && formSchema.type || ownProps.type + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + gallery: (0, _redux.bindActionCreators)(galleryActions, dispatch), + toasts: (0, _redux.bindActionCreators)(toastsActions, dispatch), + displaySearch: (0, _redux.bindActionCreators)(displaySearchActions, dispatch), + queuedFiles: (0, _redux.bindActionCreators)(queuedFilesActions, dispatch), + confirmDeletion: (0, _redux.bindActionCreators)(confirmDeletionActions, dispatch) + } + }; +} +var _default = exports["default"] = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(AssetAdmin); + +/***/ }), + +/***/ "./client/src/containers/AssetAdmin/AssetAdminBreadcrumb.js": +/*!******************************************************************!*\ + !*** ./client/src/containers/AssetAdmin/AssetAdminBreadcrumb.js ***! + \******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _Breadcrumb = __webpack_require__(/*! components/Breadcrumb/Breadcrumb */ "components/Breadcrumb/Breadcrumb"); +var _Search = __webpack_require__(/*! components/Search/Search */ "components/Search/Search"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const AssetAdminBreadcrumb = _ref => { + let { + folder, + query, + getUrl, + onBrowse, + onFolderIcon, + PlainBreadcrumbComponent + } = _ref; + const handleClick = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return event => { + event.preventDefault(); + onBrowse(...args); + }; + }; + const hrefBuilder = function () { + return getUrl && getUrl(...arguments); + }; + const breadcrumbs = [{ + text: _i18n.default._t('AssetAdmin.FILES', 'Files'), + href: hrefBuilder(0, null, query), + onClick: handleClick(0, null, query) + }]; + if (folder && folder.id) { + if (folder.ancestors) { + folder.ancestors.forEach(parent => { + breadcrumbs.push({ + text: parent.title, + href: hrefBuilder(parent.id, null, query), + onClick: handleClick(parent.id, null, query) + }); + }); + } + const icons = [{ + className: 'icon font-icon-edit-list', + onClick: e => { + e.preventDefault(); + onFolderIcon(); + } + }]; + if (folder.hasRestrictedAccess) { + icons.push({ + nodeName: 'FileStatusIcon', + hasRestrictedAccess: true + }); + } + breadcrumbs.push({ + text: folder.title, + href: hrefBuilder(folder.id, null, query), + onClick: handleClick(folder.id, null, query), + icons + }); + } + if ((0, _Search.hasFilters)(query.filter)) { + breadcrumbs.push({ + text: _i18n.default._t('LeftAndMain.SEARCHRESULTS', 'Search results') + }); + } + return _react.default.createElement(PlainBreadcrumbComponent, { + multiline: true, + crumbs: breadcrumbs + }); +}; +AssetAdminBreadcrumb.propTypes = { + onBrowse: _propTypes.default.func, + onFolderIcon: _propTypes.default.func, + getUrl: _propTypes.default.func, + query: _propTypes.default.shape({ + sort: _propTypes.default.string, + limit: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), + page: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), + filter: _propTypes.default.object, + view: _propTypes.default.string + }), + folder: _propTypes.default.shape({ + id: _propTypes.default.number, + title: _propTypes.default.string, + ancestors: _propTypes.default.array, + parentId: _propTypes.default.number, + canView: _propTypes.default.bool, + canEdit: _propTypes.default.bool + }), + PlainBreadcrumbComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +AssetAdminBreadcrumb.defaultProps = { + PlainBreadcrumbComponent: _Breadcrumb.Component +}; +var _default = exports["default"] = AssetAdminBreadcrumb; + +/***/ }), + +/***/ "./client/src/containers/AssetAdmin/AssetAdminRouter.js": +/*!**************************************************************!*\ + !*** ./client/src/containers/AssetAdmin/AssetAdminRouter.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Component = void 0; +exports.buildUrl = buildUrl; +exports["default"] = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _reactRouterDom = __webpack_require__(/*! react-router-dom */ "react-router-dom"); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _withRouter = _interopRequireWildcard(__webpack_require__(/*! lib/withRouter */ "lib/withRouter")); +var _AssetAdmin = _interopRequireDefault(__webpack_require__(/*! containers/AssetAdmin/AssetAdmin */ "./client/src/containers/AssetAdmin/AssetAdmin.js")); +var _DataFormat = __webpack_require__(/*! lib/DataFormat */ "lib/DataFormat"); +var _qs = _interopRequireDefault(__webpack_require__(/*! qs */ "qs")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _configShape = _interopRequireDefault(__webpack_require__(/*! lib/configShape */ "./client/src/lib/configShape.js")); +var _urls = __webpack_require__(/*! lib/urls */ "lib/urls"); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const sectionConfigKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; +const actions = Object.keys(_index.default.ACTIONS).map(key => _index.default.ACTIONS[key]); +function buildUrl(_ref) { + let { + base, + folderId, + fileId, + query, + action + } = _ref; + if (action && actions.indexOf(action) === -1) { + throw new Error(`Invalid action provided: ${action}`); + } + let url = null; + if (fileId) { + url = (0, _urls.joinUrlPaths)(base, `show/${folderId}/${_index.default.ACTIONS.EDIT_FILE}/${fileId}`); + } else if (folderId) { + url = (0, _urls.joinUrlPaths)(base, `show/${folderId}`); + } else { + url = base; + } + if (action === _index.default.ACTIONS.CREATE_FOLDER) { + url = (0, _urls.joinUrlPaths)(base, `show/${folderId || 0}/${action}`); + } + const hasQuery = query && Object.keys(query).length > 0; + if (hasQuery) { + url = `${url}?${_qs.default.stringify(query)}`; + } + return url; +} +class AssetAdminRouter extends _react.Component { + constructor(props) { + super(props); + this.handleBrowse = this.handleBrowse.bind(this); + this.handleReplaceUrl = this.handleReplaceUrl.bind(this); + this.handleResetDetails = this.handleResetDetails.bind(this); + this.getUrl = this.getUrl.bind(this); + } + getUrl() { + let folderId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + let fileId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + let action = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _index.default.ACTIONS.EDIT_FILE; + const newFolderId = parseInt(folderId || 0, 10); + const newFileId = parseInt(fileId || 0, 10); + const hasFolderChanged = newFolderId !== this.getFolderId(); + const newQuery = Object.assign({}, query); + if (hasFolderChanged || newQuery.page <= 1) { + delete newQuery.page; + } + return buildUrl({ + base: `/${this.props.sectionConfig.reactRoutePath}`, + folderId: newFolderId, + fileId: newFileId, + query: newQuery, + action + }); + } + getFolderId() { + if (this.props.router.params && this.props.router.params.folderId) { + return parseInt(this.props.router.params.folderId, 10); + } + return 0; + } + getFileId() { + if (this.props.router.params && this.props.router.params.fileId) { + return parseInt(this.props.router.params.fileId, 10); + } + return 0; + } + getViewAction() { + if (this.props.router.params && this.props.router.params.viewAction) { + return this.props.router.params.viewAction; + } + return _index.default.ACTIONS.EDIT_FILE; + } + getSectionProps() { + return { + sectionConfig: this.props.sectionConfig, + type: 'admin', + folderId: this.getFolderId(), + viewAction: this.getViewAction(), + fileId: this.getFileId(), + query: this.getQuery(), + getUrl: this.getUrl, + onBrowse: this.handleBrowse, + onReplaceUrl: this.handleReplaceUrl, + resetFileDetails: this.handleResetDetails + }; + } + getQuery() { + return (0, _DataFormat.decodeQuery)(this.props.router.location.search); + } + handleBrowse(folderId, fileId, query, action) { + const pathname = this.getUrl(folderId, fileId, query, action); + this.props.router.navigate(pathname); + } + handleReplaceUrl(folderId, fileId, query, action) { + const pathname = this.getUrl(folderId, fileId, query, action); + this.props.router.navigate(pathname, { + replace: true + }); + } + handleResetDetails(folderId, fileId, query) { + const currentPathname = this.getUrl(folderId, fileId, query); + const clearPathname = this.getUrl(folderId, null, query); + this.props.router.navigate(clearPathname, { + replace: true, + state: { + reset: true, + resetPath: currentPathname + } + }); + } + render() { + const { + AssetAdminComponent + } = this.props; + const locationState = this.props.router.location.state; + if (locationState && locationState && locationState.reset) { + return _react.default.createElement(_reactRouterDom.Navigate, { + to: locationState.resetPath, + replace: true + }); + } + if (!this.props.sectionConfig) { + return null; + } + return _react.default.createElement(AssetAdminComponent, this.getSectionProps()); + } +} +exports.Component = AssetAdminRouter; +AssetAdminRouter.propTypes = { + sectionConfig: _configShape.default, + router: _withRouter.routerPropTypes, + AssetAdminComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +AssetAdminRouter.defaultProps = { + AssetAdminComponent: _AssetAdmin.default +}; +function mapStateToProps(state) { + const sectionConfig = state.config.sections.find(section => section.name === sectionConfigKey); + return { + sectionConfig + }; +} +var _default = exports["default"] = (0, _withRouter.default)((0, _reactRedux.connect)(mapStateToProps)(AssetAdminRouter)); + +/***/ }), + +/***/ "./client/src/containers/AssetAdmin/stateRouter.js": +/*!*********************************************************!*\ + !*** ./client/src/containers/AssetAdmin/stateRouter.js ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.AssetAdminStateRouter = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _AssetAdminRouter = __webpack_require__(/*! containers/AssetAdmin/AssetAdminRouter */ "./client/src/containers/AssetAdmin/AssetAdminRouter.js"); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _ModalActions = __webpack_require__(/*! state/modal/ModalActions */ "./client/src/state/modal/ModalActions.js"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const sectionConfigKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; +const initialState = { + folderId: null, + fileId: null, + query: {}, + action: _index.default.ACTIONS.EDIT_FILE +}; +class AssetAdminStateRouter extends _react.Component { + constructor(props) { + super(props); + this.handleBrowse = this.handleBrowse.bind(this); + this.getUrl = this.getUrl.bind(this); + this.state = Object.assign({}, initialState, { + folderId: props.folderId + }); + } + getUrl() { + let folderId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + let fileId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + let action = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _index.default.ACTIONS.EDIT_FILE; + const newFolderId = parseInt(folderId || 0, 10); + const newFileId = parseInt(fileId || 0, 10); + const oldFolderId = this.getFolderId(); + const hasFolderChanged = newFolderId !== oldFolderId && oldFolderId !== null; + const newQuery = Object.assign({}, query); + if (hasFolderChanged || newQuery.page <= 1) { + delete newQuery.page; + } + return (0, _AssetAdminRouter.buildUrl)({ + base: this.props.sectionConfig.reactRoutePath, + folderId: newFolderId, + fileId: newFileId, + query: newQuery, + action + }); + } + getFolderId() { + if (this.state.folderId === null) { + return null; + } + return parseInt(this.state.folderId || 0, 10); + } + getFileId() { + return parseInt(this.state.fileId || this.props.fileId || 0, 10); + } + getViewAction() { + return this.state.action || _index.default.ACTIONS.EDIT_FILE; + } + getSectionProps() { + const props = Object.assign({}, this.props, { + folderId: this.getFolderId(), + fileId: this.getFileId(), + viewAction: this.getViewAction(), + query: this.state.query, + getUrl: this.getUrl, + onBrowse: this.handleBrowse + }); + delete props.Component; + return props; + } + handleBrowse(folderId, fileId) { + let query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + let action = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _index.default.ACTIONS.EDIT_FILE; + if (action && Object.values(_index.default.ACTIONS).indexOf(action) === -1) { + throw new Error(`Invalid action provided: ${action}`); + } + if (this.state.fileId !== fileId) { + this.props.actions.resetFormStack(); + } + this.setState({ + folderId, + fileId, + query, + action + }); + } + render() { + const sectionProps = this.getSectionProps(); + const AssetAdmin = this.props.Component; + return _react.default.createElement(AssetAdmin, sectionProps); + } +} +exports.AssetAdminStateRouter = AssetAdminStateRouter; +AssetAdminStateRouter.propTypes = { + Component: _propTypes.default.elementType, + sectionConfig: _propTypes.default.shape({ + url: _propTypes.default.string.isRequired + }).isRequired, + fileId: _propTypes.default.number +}; +function mapDispatchToProps(dispatch) { + return { + actions: { + resetFormStack: () => dispatch((0, _ModalActions.resetFormStack)()) + } + }; +} +function stateRouter(AssetAdmin) { + function mapStateToProps(state) { + const sectionConfig = state.config.sections.find(section => section.name === sectionConfigKey); + return { + Component: AssetAdmin, + sectionConfig + }; + } + return (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(AssetAdminStateRouter); +} +var _default = exports["default"] = stateRouter; + +/***/ }), + +/***/ "./client/src/containers/BulkDeleteConfirmation/BulkDeleteConfirmation.js": +/*!********************************************************************************!*\ + !*** ./client/src/containers/BulkDeleteConfirmation/BulkDeleteConfirmation.js ***! + \********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var confirmDeletionActions = _interopRequireWildcard(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionActions */ "./client/src/state/confirmDeletion/ConfirmDeletionActions.js")); +var TRANSITIONS = _interopRequireWildcard(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionTransitions */ "./client/src/state/confirmDeletion/ConfirmDeletionTransitions.js")); +var toastsActions = _interopRequireWildcard(__webpack_require__(/*! state/toasts/ToastsActions */ "state/toasts/ToastsActions")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _fileShape = _interopRequireDefault(__webpack_require__(/*! lib/fileShape */ "./client/src/lib/fileShape.js")); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var _getJsonErrorMessage = _interopRequireDefault(__webpack_require__(/*! lib/getJsonErrorMessage */ "lib/getJsonErrorMessage")); +var _DeletionModal = _interopRequireDefault(__webpack_require__(/*! ./DeletionModal */ "./client/src/containers/BulkDeleteConfirmation/DeletionModal.js")); +var _BulkDeleteMessage = _interopRequireDefault(__webpack_require__(/*! ./BulkDeleteMessage */ "./client/src/containers/BulkDeleteConfirmation/BulkDeleteMessage.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +const BulkDeleteConfirmation = _ref => { + let { + LoadingComponent, + transition, + files, + onModalClose, + onCancel, + onConfirm, + filesAreVersioned, + archiveFiles, + actions + } = _ref; + const [isLoading, setIsLoading] = (0, _react.useState)(true); + const [fileCounts, setFileCounts] = (0, _react.useState)({}); + (0, _react.useEffect)(() => { + const sectionKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; + const config = _Config.default.getSection(sectionKey); + const fileIDs = files.map(fild => fild.id); + const qs = fileIDs.map(id => `ids[]=${id}`).join('&'); + const url = `${config.endpoints.readDescendantCounts.url}?${qs}`; + setIsLoading(true); + _Backend.default.get(url).then(async response => { + const responseJson = await response.json(); + setIsLoading(false); + setFileCounts(responseJson); + }).catch(async err => { + const message = await (0, _getJsonErrorMessage.default)(err); + actions.toasts.error(message); + }); + }, [files]); + let body = null; + const transKey = filesAreVersioned && archiveFiles ? 'AssetAdmin.ARCHIVE' : 'AssetAdmin.DELETE'; + const transDefault = filesAreVersioned && archiveFiles ? 'Archive' : 'Delete'; + let deleteModalActions = [{ + label: _i18n.default._t(transKey, transDefault), + handler: () => onConfirm(files.map(_ref2 => { + let { + id + } = _ref2; + return id; + })), + color: 'danger' + }, { + label: _i18n.default._t('AssetAdmin.CANCEL', 'Cancel'), + handler: onCancel + }]; + if (isLoading) { + body = _react.default.createElement(LoadingComponent, null); + } else { + const topLevelFolderCount = fileCounts.filter(r => r.type === 'folder').length; + const topLevelFileCount = fileCounts.filter(r => r.type === 'file').length; + const descendantFileCount = fileCounts.reduce((t, r) => t + r.count, 0); + const bodyProps = { + topLevelFolderCount, + topLevelFileCount, + descendantFileCount, + filesAreVersioned, + archiveFiles + }; + body = _react.default.createElement(_BulkDeleteMessage.default, bodyProps); + if (topLevelFileCount + descendantFileCount > 0) { + deleteModalActions = [{ + label: _i18n.default._t('AssetAdmin.CANCEL', 'Cancel'), + handler: onCancel, + color: 'primary' + }, { + label: _i18n.default._t(transKey, transDefault), + handler: () => onConfirm(files.map(_ref3 => { + let { + id + } = _ref3; + return id; + })), + color: 'danger' + }]; + } + } + const isOpen = ![TRANSITIONS.CANCELING, TRANSITIONS.DELETING].includes(transition); + return _react.default.createElement(_DeletionModal.default, { + body: body, + isOpen: isOpen, + actions: deleteModalActions, + onCancel: onCancel, + onClosed: onModalClose, + filesAreVersioned: filesAreVersioned, + archiveFiles: archiveFiles + }); +}; +exports.Component = BulkDeleteConfirmation; +BulkDeleteConfirmation.propTypes = { + LoadingComponent: _propTypes.default.elementType, + transition: _propTypes.default.oneOf(['canceling', 'deleting', false]), + files: _propTypes.default.arrayOf(_fileShape.default), + descendantFileCounts: _propTypes.default.object, + onCancel: _propTypes.default.func.isRequired, + onModalClose: _propTypes.default.func.isRequired, + onConfirm: _propTypes.default.func.isRequired, + filesAreVersioned: _propTypes.default.bool.isRequired, + archiveFiles: _propTypes.default.bool.isRequired, + actions: _propTypes.default.object.isRequired +}; +const ConnectedModal = (0, _redux.compose)((0, _Injector.inject)(['Loading'], Loading => ({ + LoadingComponent: Loading +})))(BulkDeleteConfirmation); +const ConditionalModal = _ref4 => { + let { + showConfirmation, + files, + ...props + } = _ref4; + return showConfirmation && files.length > 0 ? _react.default.createElement(ConnectedModal, _extends({}, props, { + files: files + })) : null; +}; +const mapStateToProps = _ref5 => { + let { + assetAdmin: { + confirmDeletion + } + } = _ref5; + return confirmDeletion; +}; +const mapDispatchToProps = dispatch => ({ + onCancel: () => dispatch(confirmDeletionActions.cancel()), + onModalClose: () => dispatch(confirmDeletionActions.modalClose()), + actions: { + toasts: (0, _redux.bindActionCreators)(toastsActions, dispatch), + confirmation: (0, _redux.bindActionCreators)(confirmDeletionActions, dispatch) + } +}); +var _default = exports["default"] = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(ConditionalModal); + +/***/ }), + +/***/ "./client/src/containers/BulkDeleteConfirmation/BulkDeleteMessage.js": +/*!***************************************************************************!*\ + !*** ./client/src/containers/BulkDeleteConfirmation/BulkDeleteMessage.js ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const confirmationMessage = (topLevelFolderCount, topLevelFileCount, descendantFileCount, filesAreVersioned, archiveFiles) => { + const fileCount = topLevelFileCount + descendantFileCount; + if (fileCount > 0) { + let transKey = 'AssetAdmin.BULK_ACTIONS_DELETE_ITEMS_CONFIRM'; + let transDefault = ["You're about to delete %s file(s) which may be used in your site's content.", 'Carefully check the file usage on the files before deleting the file(s).'].join(' '); + if (filesAreVersioned && archiveFiles) { + transKey = 'AssetAdmin.BULK_ACTIONS_ARCHIVE_ITEMS_CONFIRM'; + transDefault = ["You're about to archive %s file(s) which may be used in your site's content.", 'Carefully check the file usage on the files before archiving the file(s).'].join(' '); + } + return _i18n.default.sprintf(_i18n.default._t(transKey, transDefault), fileCount); + } else if (topLevelFolderCount === 1) { + let transKey = 'AssetAdmin.BULK_ACTIONS_DELETE_FOLDER_CONFIRM'; + let transDefault = 'Are you sure you want to delete this folder?'; + if (filesAreVersioned && archiveFiles) { + transKey = 'AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDER_CONFIRM'; + transDefault = 'Are you sure you want to archive this folder?'; + } + return _i18n.default._t(transKey, transDefault); + } + let transKey = 'AssetAdmin.BULK_ACTIONS_DELETE_FOLDERS_CONFIRM'; + let transDefault = 'Are you sure you want to delete these folders?'; + if (filesAreVersioned && archiveFiles) { + transKey = 'AssetAdmin.BULK_ACTIONS_ARCHIVE_FOLDERS_CONFIRM'; + transDefault = 'Are you sure you want to archive these folders?'; + } + return _i18n.default._t(transKey, transDefault); +}; +const BulkDeleteMessage = _ref => { + let { + topLevelFolderCount, + topLevelFileCount, + descendantFileCount, + filesAreVersioned, + archiveFiles + } = _ref; + let transKey = 'AssetAdmin.BULK_ACTIONS_DELETE_WARNING'; + let transDefault = 'Ensure files are removed from content areas prior to deleting them, otherwise they will ' + 'appear as broken links.'; + if (filesAreVersioned && archiveFiles) { + transKey = 'AssetAdmin.BULK_ACTIONS_ARCHIVE_WARNING'; + transDefault = 'Ensure files are removed from content areas prior to archiving them, otherwise they will ' + 'appear as broken links.'; + } + const message = confirmationMessage(topLevelFolderCount, topLevelFileCount, descendantFileCount, filesAreVersioned, archiveFiles); + return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("p", null, message), topLevelFileCount + descendantFileCount > 0 && _react.default.createElement("p", null, _i18n.default._t(transKey, transDefault))); +}; +BulkDeleteMessage.propTypes = { + topLevelFolderCount: _propTypes.default.number, + topLevelFileCount: _propTypes.default.number, + descendantFileCount: _propTypes.default.number +}; +BulkDeleteMessage.defaultProps = { + topLevelFolderCount: 0, + topLevelFileCount: 0, + descendantFileCount: 0 +}; +var _default = exports["default"] = BulkDeleteMessage; + +/***/ }), + +/***/ "./client/src/containers/BulkDeleteConfirmation/DeletionModal.js": +/*!***********************************************************************!*\ + !*** ./client/src/containers/BulkDeleteConfirmation/DeletionModal.js ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _reactstrap = __webpack_require__(/*! reactstrap */ "reactstrap"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const DeletionModal = _ref => { + let { + isOpen, + body, + onCancel, + actions, + filesAreVersioned, + archiveFiles + } = _ref; + let transKey = 'AssetAdmin.CONFIRM_FILE_DELETION'; + let transDefault = 'Confirm deletion'; + if (filesAreVersioned && archiveFiles) { + transKey = 'AssetAdmin.CONFIRM_FILE_ARCHIVE'; + transDefault = 'Confirm archive'; + } + return _react.default.createElement(_reactstrap.Modal, { + isOpen: isOpen, + toggle: onCancel + }, _react.default.createElement(_reactstrap.ModalHeader, { + toggle: onCancel + }, _i18n.default._t(transKey, transDefault)), _react.default.createElement(_reactstrap.ModalBody, null, body), _react.default.createElement(_reactstrap.ModalFooter, null, actions.map(_ref2 => { + let { + label, + handler, + color + } = _ref2; + return _react.default.createElement(_reactstrap.Button, { + key: label, + color: color, + onClick: handler + }, label); + }))); +}; +DeletionModal.propTypes = { + isOpen: _propTypes.default.bool.isRequired, + body: _propTypes.default.node.isRequired, + onCancel: _propTypes.default.func.isRequired, + actions: _propTypes.default.arrayOf(_propTypes.default.shape({ + label: _propTypes.default.string.isRequired, + handler: _propTypes.default.func, + color: _propTypes.default.string + })), + filesAreVersioned: _propTypes.default.bool.isRequired, + archiveFiles: _propTypes.default.bool.isRequired +}; +var _default = exports["default"] = DeletionModal; + +/***/ }), + +/***/ "./client/src/containers/Editor/Editor.js": +/*!************************************************!*\ + !*** ./client/src/containers/Editor/Editor.js ***! + \************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _FormBuilderLoader = _interopRequireDefault(__webpack_require__(/*! containers/FormBuilderLoader/FormBuilderLoader */ "containers/FormBuilderLoader/FormBuilderLoader")); +var UnsavedFormsActions = _interopRequireWildcard(__webpack_require__(/*! state/unsavedForms/UnsavedFormsActions */ "state/unsavedForms/UnsavedFormsActions")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +var confirmDeletionActions = _interopRequireWildcard(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionActions */ "./client/src/state/confirmDeletion/ConfirmDeletionActions.js")); +var modalActions = _interopRequireWildcard(__webpack_require__(/*! state/modal/ModalActions */ "./client/src/state/modal/ModalActions.js")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _url = _interopRequireDefault(__webpack_require__(/*! url */ "url")); +var _qs = _interopRequireDefault(__webpack_require__(/*! qs */ "qs")); +var _EditorHeader = _interopRequireWildcard(__webpack_require__(/*! ./EditorHeader */ "./client/src/containers/Editor/EditorHeader.js")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +const formIdentifier = 'AssetAdmin.EditForm'; +class Editor extends _react.Component { + constructor(props) { + super(props); + this.getFormSchemaUrl = this.getFormSchemaUrl.bind(this); + this.handleCancelKeyDown = this.handleCancelKeyDown.bind(this); + this.handleClose = this.handleClose.bind(this); + this.handleSubmit = this.handleSubmit.bind(this); + this.handleAction = this.handleAction.bind(this); + this.handleLoadingSuccess = this.handleLoadingSuccess.bind(this); + this.handleLoadingError = this.handleLoadingError.bind(this); + this.handleFetchingSchema = this.handleFetchingSchema.bind(this); + this.createFn = this.createFn.bind(this); + this.editorHeader = this.editorHeader.bind(this); + this.state = { + loadingForm: false, + loadingError: null, + file: null + }; + } + componentDidMount() { + this.refetchFile(); + } + componentDidUpdate(prevProps) { + if (prevProps.fileId !== this.props.fileId && prevProps.fileId !== null) { + this.refetchFile(); + } + } + refetchFile() { + const sectionConfig = _Config.default.getSection('SilverStripe\\AssetAdmin\\Controller\\AssetAdminOpen'); + const endpointUrl = `${sectionConfig.endpoints.read.url}/${this.props.fileId}`; + _Backend.default.get(endpointUrl).then(response => response.json()).then(responseJson => { + this.setState({ + file: responseJson + }); + }); + } + getFormSchemaUrl() { + const { + schemaUrlQueries, + schemaUrl, + fileId + } = this.props; + const parsedURL = _url.default.parse(schemaUrl); + const parsedQs = schemaUrlQueries.reduce((accumulator, _ref) => { + let { + name, + value + } = _ref; + return { + ...accumulator, + [name]: value + }; + }, {}); + return _url.default.format({ + ...parsedURL, + pathname: `${parsedURL.path}/${fileId}`, + search: _qs.default.stringify(parsedQs) + }); + } + handleAction(event) { + const file = this.state.file; + switch (event.currentTarget.name) { + case 'action_replacefile': + this.replaceFile(); + event.preventDefault(); + break; + case 'action_downloadfile': + this.downloadFile(); + event.preventDefault(); + break; + case 'action_delete': + this.props.actions.confirmDeletion.confirm([file]); + event.preventDefault(); + break; + default: + break; + } + } + handleCancelKeyDown(event) { + if (event.keyCode === _index.default.SPACE_KEY_CODE || event.keyCode === _index.default.RETURN_KEY_CODE) { + this.handleClose(event); + } + } + handleSubmit(data, action, submitFn) { + const { + showingSubForm, + actions + } = this.props; + if (typeof this.props.onSubmit === 'function') { + return this.props.onSubmit(data, action, submitFn).finally(() => { + if (showingSubForm && ['action_save', 'action_publish'].indexOf(action) !== -1) { + actions.modal.popFormStackEntry(); + } + }); + } + return submitFn(); + } + handleClose(event) { + const { + showingSubForm, + onClose, + actions + } = this.props; + if (showingSubForm) { + actions.modal.popFormStackEntry(); + } else { + onClose(); + } + if (event) { + event.preventDefault(); + } + } + replaceFile() { + const hiddenFileInput = document.querySelector('.dz-input-PreviewImage'); + if (hiddenFileInput) { + hiddenFileInput.click(); + } + } + downloadFile() { + function downloadURI(uri, name) { + const link = document.createElement('a'); + link.download = name; + link.href = uri; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } + const file = this.state.file; + downloadURI(file.url, file.name); + document.getElementById('Form_fileEditForm_PopoverActions').focus(); + } + handleLoadingError(exception) { + this.setState({ + loadingForm: false, + loadingError: exception.errors[0] + }); + } + handleLoadingSuccess() { + this.setState({ + loadingForm: false, + loadingError: null + }); + } + handleFetchingSchema() { + this.setState({ + loadingForm: true + }); + } + editorHeader(_ref2) { + let { + SchemaComponent, + ...fieldProps + } = _ref2; + const { + dialog, + nextType, + showingSubForm, + actions, + EditorHeaderComponent + } = this.props; + const schemaUrl = this.getFormSchemaUrl(); + const file = this.state.file; + let showButton = _EditorHeader.buttonStates.SWITCH; + if (dialog && file && file.type !== 'folder') { + showButton = showingSubForm ? _EditorHeader.buttonStates.ALWAYS_BACK : _EditorHeader.buttonStates.ONLY_BACK; + } + const { + formid + } = fieldProps; + const onDetails = nextType && file && file.type !== 'folder' ? () => { + actions.modal.stashFormValues(formid, schemaUrl); + actions.modal.pushFormStackEntry(nextType); + } : undefined; + const props = { + onCancel: this.handleClose, + showButton, + onDetails + }; + return _react.default.createElement(EditorHeaderComponent, props, _react.default.createElement(SchemaComponent, fieldProps)); + } + createFn(SchemaComponent, componentProps) { + if (componentProps.name === 'AssetEditorHeaderFieldGroup') { + const CreatedEditorHeader = this.editorHeader; + const editorHeaderProps = { + key: componentProps.id, + SchemaComponent, + ...componentProps + }; + return _react.default.createElement(CreatedEditorHeader, editorHeaderProps); + } + return _react.default.createElement(SchemaComponent, _extends({ + key: componentProps.id + }, componentProps)); + } + render() { + if (!this.state.file) { + return null; + } + const { + FormBuilderLoaderComponent + } = this.props; + const formSchemaUrl = this.getFormSchemaUrl(); + const editorClasses = (0, _classnames.default)('panel', 'form--no-dividers', 'editor', { + 'editor--asset-dropzone--disable': !this.props.enableDropzone + }, this.props.className); + let error = null; + if (this.state.loadingError) { + let message = this.state.loadingError.value; + if (this.state.loadingError.code === 404) { + message = _i18n.default._t('AssetAdmin.FILE_MISSING', 'File cannot be found'); + } + if (!message) { + message = _i18n.default._t('Admin.UNKNOWN_ERROR', 'An unknown error has occurred'); + } + error = _react.default.createElement("div", { + className: "editor__file-preview-message--file-missing" + }, message); + } + const Loading = this.props.loadingComponent; + return _react.default.createElement("div", { + className: editorClasses + }, _react.default.createElement("div", { + className: "editor__details fill-height" + }, _react.default.createElement(FormBuilderLoaderComponent, { + identifier: formIdentifier, + schemaUrl: formSchemaUrl, + onSubmit: this.handleSubmit, + onAction: this.handleAction, + onLoadingSuccess: this.handleLoadingSuccess, + onLoadingError: this.handleLoadingError, + onFetchingSchema: this.handleFetchingSchema, + createFn: this.createFn, + file: this.state.file + }), error, this.state.loadingForm && _react.default.createElement(Loading, null))); + } +} +exports.Component = Editor; +Editor.propTypes = { + className: _propTypes.default.string, + fileId: _propTypes.default.number.isRequired, + enableDropzone: _propTypes.default.bool, + dialog: _propTypes.default.bool, + onClose: _propTypes.default.func.isRequired, + onSubmit: _propTypes.default.func.isRequired, + schemaUrl: _propTypes.default.string.isRequired, + schemaUrlQueries: _propTypes.default.arrayOf(_propTypes.default.shape({ + name: _propTypes.default.string, + value: _propTypes.default.any + })), + actions: _propTypes.default.object, + showingSubForm: _propTypes.default.bool, + nextType: _propTypes.default.string, + EditorHeaderComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]), + FormBuilderLoaderComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}; +Editor.defaultProps = { + EditorHeaderComponent: _EditorHeader.default, + FormBuilderLoaderComponent: _FormBuilderLoader.default +}; +function mapDispatchToProps(dispatch) { + return { + actions: { + unsavedForms: (0, _redux.bindActionCreators)(UnsavedFormsActions, dispatch), + confirmDeletion: (0, _redux.bindActionCreators)(confirmDeletionActions, dispatch), + modal: (0, _redux.bindActionCreators)(modalActions, dispatch) + } + }; +} +function mapStateToProps(_ref3) { + let { + assetAdmin: { + gallery, + modal + } + } = _ref3; + return { + enableDropzone: gallery.enableDropzone, + nextType: modal.formSchema && modal.formSchema.nextType, + showingSubForm: modal.formSchemaStack && modal.formSchemaStack.length > 1 + }; +} +var _default = exports["default"] = (0, _redux.compose)((0, _Injector.inject)(['Loading'], Loading => ({ + loadingComponent: Loading +}), () => 'AssetAdmin.Editor'), (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(Editor); + +/***/ }), + +/***/ "./client/src/containers/Editor/EditorHeader.js": +/*!******************************************************!*\ + !*** ./client/src/containers/Editor/EditorHeader.js ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.buttonStates = void 0; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _Button = _interopRequireDefault(__webpack_require__(/*! components/Button/Button */ "components/Button/Button")); +var _BackButton = _interopRequireDefault(__webpack_require__(/*! components/Button/BackButton */ "components/Button/BackButton")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const handle = handler => e => { + e.preventDefault(); + if (handler) { + handler(); + } +}; +const ALWAYS_BACK = 'ALWAYS_BACK'; +const ALWAYS_CANCEL = 'ALWAYS_CANCEL'; +const SWITCH = 'SWITCH'; +const ONLY_BACK = 'ONLY_BACK'; +const ONLY_CANCEL = 'ONLY_CANCEL'; +const NONE = 'NONE'; +const buttonStates = exports.buttonStates = { + ALWAYS_BACK, + ALWAYS_CANCEL, + SWITCH, + ONLY_BACK, + ONLY_CANCEL, + NONE +}; +const EditorHeader = _ref => { + let { + onCancel, + onDetails, + showButton, + children + } = _ref; + const cancelHandler = handle(onCancel); + const showBack = [ALWAYS_BACK, SWITCH, ONLY_BACK].indexOf(showButton) >= 0; + const showCancel = [ALWAYS_CANCEL, SWITCH, ONLY_CANCEL].indexOf(showButton) >= 0; + const backClassName = (0, _classnames.default)('editor-header__back-button', 'btn--icon-xl', { + 'editor-header__back-button--md-below': [SWITCH, ONLY_BACK].indexOf(showButton) >= 0 + }); + const cancelClassName = (0, _classnames.default)('editor-header__cancel-button', 'btn--icon-xl', { + 'editor-header__cancel-button--lg-above': [SWITCH, ONLY_CANCEL].indexOf(showButton) >= 0 + }); + return _react.default.createElement("div", { + className: "editor-header" + }, showBack && _react.default.createElement(_BackButton.default, { + className: backClassName, + onClick: cancelHandler + }), _react.default.createElement("div", { + className: "editor-header__field" + }, children), onDetails && _react.default.createElement(_Button.default, { + onClick: handle(onDetails), + icon: "edit-list", + className: "editor-header__edit", + outline: true + }, _i18n.default._t('AssetAdmin.DETAILS', 'Details')), showCancel && _react.default.createElement("div", null, _react.default.createElement(_Button.default, { + icon: "cancel", + className: cancelClassName, + noText: true, + onClick: cancelHandler + }, _i18n.default._t('AssetAdmin.CANCEL')))); +}; +EditorHeader.propTypes = { + onCancel: _propTypes.default.func, + onDetails: _propTypes.default.func, + showButton: _propTypes.default.oneOf(Object.keys(buttonStates).map(state => buttonStates[state])), + children: _propTypes.default.node +}; +var _default = exports["default"] = EditorHeader; + +/***/ }), + +/***/ "./client/src/containers/Gallery/Gallery.js": +/*!**************************************************!*\ + !*** ./client/src/containers/Gallery/Gallery.js ***! + \**************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.galleryViewPropTypes = exports.galleryViewDefaultProps = exports["default"] = exports.Component = void 0; +var _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ "jquery")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _AssetDropzone = _interopRequireDefault(__webpack_require__(/*! components/AssetDropzone/AssetDropzone */ "./client/src/components/AssetDropzone/AssetDropzone.js")); +var _BulkActions = _interopRequireDefault(__webpack_require__(/*! components/BulkActions/BulkActions */ "./client/src/components/BulkActions/BulkActions.js")); +var _ThumbnailView = _interopRequireDefault(__webpack_require__(/*! containers/ThumbnailView/ThumbnailView */ "./client/src/containers/ThumbnailView/ThumbnailView.js")); +var _TableView = _interopRequireDefault(__webpack_require__(/*! containers/TableView/TableView */ "./client/src/containers/TableView/TableView.js")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _FormAlert = _interopRequireDefault(__webpack_require__(/*! components/FormAlert/FormAlert */ "components/FormAlert/FormAlert")); +var galleryActions = _interopRequireWildcard(__webpack_require__(/*! state/gallery/GalleryActions */ "./client/src/state/gallery/GalleryActions.js")); +var toastsActions = _interopRequireWildcard(__webpack_require__(/*! state/toasts/ToastsActions */ "state/toasts/ToastsActions")); +var queuedFilesActions = _interopRequireWildcard(__webpack_require__(/*! state/queuedFiles/QueuedFilesActions */ "./client/src/state/queuedFiles/QueuedFilesActions.js")); +var confirmDeletionActions = _interopRequireWildcard(__webpack_require__(/*! state/confirmDeletion/ConfirmDeletionActions */ "./client/src/state/confirmDeletion/ConfirmDeletionActions.js")); +var _reactSelectable = __webpack_require__(/*! react-selectable */ "./node_modules/react-selectable/dist/react-selectable.js"); +var _configShape = _interopRequireDefault(__webpack_require__(/*! lib/configShape */ "./client/src/lib/configShape.js")); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var _getStatusCodeMessage = _interopRequireDefault(__webpack_require__(/*! lib/getStatusCodeMessage */ "./client/src/lib/getStatusCodeMessage.js")); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +var _MoveModal = _interopRequireDefault(__webpack_require__(/*! ../MoveModal/MoveModal */ "./client/src/containers/MoveModal/MoveModal.js")); +var _GalleryDND = _interopRequireDefault(__webpack_require__(/*! ./GalleryDND */ "./client/src/containers/Gallery/GalleryDND.js")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const ACTION_TYPES = { + DELETE: 'delete', + ARCHIVE: 'archive', + EDIT: 'edit', + MOVE: 'move', + PUBLISH: 'publish', + UNPUBLISH: 'unpublish', + INSERT: 'insert', + ADMIN: 'admin', + SELECT: 'select' +}; +class Gallery extends _react.Component { + constructor(props) { + super(props); + this.handleOpenFolder = this.handleOpenFolder.bind(this); + this.handleOpenFile = this.handleOpenFile.bind(this); + this.handleSelect = this.handleSelect.bind(this); + this.handleAddedFile = this.handleAddedFile.bind(this); + this.handlePreviewLoaded = this.handlePreviewLoaded.bind(this); + this.handleCancelUpload = this.handleCancelUpload.bind(this); + this.handleRemoveErroredUpload = this.handleRemoveErroredUpload.bind(this); + this.handleUploadProgress = this.handleUploadProgress.bind(this); + this.handleSending = this.handleSending.bind(this); + this.handleSort = this.handleSort.bind(this); + this.handleSetPage = this.handleSetPage.bind(this); + this.handleSuccessfulUpload = this.handleSuccessfulUpload.bind(this); + this.handleQueueComplete = this.handleQueueComplete.bind(this); + this.handleFailedUpload = this.handleFailedUpload.bind(this); + this.handleClearSearch = this.handleClearSearch.bind(this); + this.handleEnableDropzone = this.handleEnableDropzone.bind(this); + this.handleMoveFiles = this.handleMoveFiles.bind(this); + this.handleBulkEdit = this.handleBulkEdit.bind(this); + this.handleBulkPublish = this.handleBulkPublish.bind(this); + this.handleBulkUnpublish = this.handleBulkUnpublish.bind(this); + this.handleBulkMove = this.handleBulkMove.bind(this); + this.handleBulkInsert = this.handleBulkInsert.bind(this); + this.handleBeginSelection = this.handleBeginSelection.bind(this); + this.handleGroupSelect = this.handleGroupSelect.bind(this); + this.handleClearSelection = this.handleClearSelection.bind(this); + this.handleSelectAll = this.handleSelectAll.bind(this); + this.toggleSelectConcat = this.toggleSelectConcat.bind(this); + this.getSelectableFiles = this.getSelectableFiles.bind(this); + } + componentDidMount() { + this.initSortDropdown(); + window.addEventListener('keydown', this.toggleSelectConcat); + window.addEventListener('keyup', this.toggleSelectConcat); + } + componentDidUpdate(prevProps) { + this.initSortDropdown(); + this.initFlushUploadFiles(prevProps); + } + componentWillUnmount() { + window.removeEventListener('keydown', this.toggleSelectConcat); + window.removeEventListener('keyup', this.toggleSelectConcat); + } + initFlushUploadFiles(prevProps) { + if (this.props.view !== 'tile') { + const $select = this.getSortElement(); + $select.off('change'); + } + if (prevProps.folderId !== this.props.folderId) { + this.props.actions.queuedFiles.purgeUploadQueue(); + } + } + getSortElement() { + return (0, _jquery.default)(this.gallery).find('.gallery__sort .dropdown'); + } + getSearchMessage(filters) { + const messages = []; + if (filters.name) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGEKEYWORDS', 'with keywords \'{name}\'')); + } + if (filters.lastEditedFrom && filters.lastEditedTo) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGEEDITEDBETWEEN', 'last edited between \'{lastEditedFrom}\' and \'{lastEditedTo}\'')); + } else if (filters.lastEditedFrom) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGEEDITEDFROM', 'last edited after \'{lastEditedFrom}\'')); + } else if (filters.lastEditedTo) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGEEDITEDTO', 'last edited before \'{lastEditedTo}\'')); + } + if (filters.appCategory) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGECATEGORY', 'categorised as \'{appCategory}\'')); + } + if (filters.currentFolderOnly && this.props.folder.title) { + messages.push(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGELIMIT', 'limited to the folder \'{folder}\'')); + } + const parts = [messages.slice(0, -1).join(`${_i18n.default._t('AssetAdmin.JOIN', ',')} `), messages.slice(-1)].filter(part => part).join(` ${_i18n.default._t('AssetAdmin.JOINLAST', 'and')} `); + if (parts === '') { + return ''; + } + const searchResults = { + parts: _i18n.default.inject(parts, Object.assign({ + folder: this.props.folder.title + }, filters, { + appCategory: filters.appCategory ? filters.appCategory.toLowerCase() : undefined + })) + }; + return _i18n.default.inject(_i18n.default._t('AssetAdmin.SEARCHRESULTSMESSAGE', 'Search results {parts}'), searchResults); + } + getSelection(firstId, lastId) { + const selectable = this.getSelectableFiles(); + const indexes = [firstId, lastId].map(id => selectable.findIndex(file => file.id === id)).filter(index => index !== -1).sort((a, b) => a - b); + if (indexes.length !== 2) { + return indexes.map(index => selectable[index].id); + } + const [firstIndex, lastIndex] = indexes; + return selectable.filter((file, index) => index >= firstIndex && index <= lastIndex).map(file => file.id); + } + getSelectableFiles() { + const selectable = this.props.files.filter(file => file.id); + if (this.props.type === ACTION_TYPES.SELECT) { + return selectable.filter(item => item.type !== 'folder'); + } + return selectable; + } + handleBulkInsert(event, items) { + this.props.onInsertMany(event, items); + } + handleBulkPublish(event, items) { + const publishItems = items.map(item => item.id); + if (!publishItems.length) { + this.props.actions.gallery.deselectFiles(); + return Promise.resolve(true); + } + this.props.actions.gallery.setLoading(true); + return this.props.onPublish(publishItems).then(resultItems => { + this.props.actions.gallery.setLoading(false); + this.props.actions.toasts.success(_i18n.default.sprintf(_i18n.default._t('AssetAdmin.BULK_ACTIONS_PUBLISH_SUCCESS', '%s folders/files were successfully published.'), resultItems.length)); + this.props.actions.gallery.deselectFiles(); + }); + } + handleBulkUnpublish(event, items) { + const unpublishItems = items.filter(item => item.published).map(item => item.id); + if (!unpublishItems.length) { + this.props.actions.gallery.deselectFiles(); + return Promise.resolve(true); + } + this.props.actions.gallery.setLoading(true); + return this.props.onUnpublish(unpublishItems).then(resultItems => { + this.props.actions.gallery.setLoading(false); + this.props.actions.toasts.success(_i18n.default.sprintf(_i18n.default._t('AssetAdmin.BULK_ACTIONS_UNPUBLISH_SUCCESS', '%s folders/files were successfully unpublished.'), resultItems.length)); + this.props.actions.gallery.deselectFiles(); + }); + } + initSortDropdown() { + if (this.props.view === 'tile') { + const $select = this.getSortElement(); + $select.chosen({ + allow_single_deselect: true, + disable_search_threshold: 20 + }); + $select.off('change'); + $select.on('change', () => $select.find(':selected')[0].click()); + } + } + handleSort(value) { + this.props.actions.queuedFiles.purgeUploadQueue(); + this.props.onSort(value); + } + handleSetPage(page) { + this.props.onSetPage(page); + } + handleCancelUpload(fileData) { + fileData.xhr.abort(); + this.props.actions.queuedFiles.removeQueuedFile(fileData.queuedId); + } + handleRemoveErroredUpload(fileData) { + this.props.actions.queuedFiles.removeQueuedFile(fileData.queuedId); + } + handleAddedFile(fileData) { + this.props.actions.queuedFiles.addQueuedFile(fileData); + } + handlePreviewLoaded(fileData, previewData) { + this.props.actions.queuedFiles.updateQueuedFile(fileData.queuedId, previewData); + } + handleSending(file, xhr) { + this.props.actions.queuedFiles.updateQueuedFile(file._queuedId, { + xhr + }); + } + handleUploadProgress(file, progress) { + this.props.actions.queuedFiles.updateQueuedFile(file._queuedId, { + progress + }); + } + handleSuccessfulUpload(fileXhr) { + const json = JSON.parse(fileXhr.xhr.response); + if (typeof json[0].error !== 'undefined') { + this.handleFailedUpload(fileXhr); + return; + } + this.props.actions.queuedFiles.succeedUpload(fileXhr._queuedId, json[0]); + if (this.props.onSuccessfulUpload) { + this.props.onSuccessfulUpload(json); + } + const filesInProgress = this.props.queuedFiles.items.reduce((inProgress, file) => { + if (file.progress !== 100) { + return inProgress + 1; + } + return inProgress; + }, 0); + if (!this.props.fileId && !this.props.selectedFiles.length && filesInProgress === 0) { + const lastFile = json.pop(); + this.props.onOpenFile(lastFile.id); + } + } + handleQueueComplete() { + if (this.props.onSuccessfulUploadQueue) { + this.props.onSuccessfulUploadQueue(); + } + } + handleFailedUpload(fileXhr, response) { + const statusCodeMessage = fileXhr.xhr && fileXhr.xhr.status ? (0, _getStatusCodeMessage.default)(fileXhr.xhr.status, fileXhr.xhr) : ''; + this.props.actions.queuedFiles.failUpload(fileXhr._queuedId, response, statusCodeMessage); + } + itemIsSelected(id) { + return this.props.selectedFiles.indexOf(id) > -1; + } + toggleSelectConcat(event) { + this.props.actions.gallery.setConcatenateSelect(this.isConcat(event)); + } + isConcat(event) { + return event.metaKey || event.ctrlKey || event.shiftKey; + } + itemIsHighlighted(id) { + return this.props.fileId === id; + } + hasOpenedItem() { + return !!this.props.fileId; + } + handleClearSearch(event) { + this.props.onClearSearch(event); + } + handleGroupSelect(items, event) { + const { + setSelectedFiles, + selectFiles + } = this.props.actions.gallery; + const selectableFiles = this.getSelectableFiles(); + const selectItems = items.filter((id, index) => { + if (items.indexOf(id) !== index) { + return false; + } + return selectableFiles.find(file => file.id === id); + }); + const concat = this.props.concatenateSelect || this.isConcat(event); + if (this.props.maxFilesSelect !== null) { + let totalFiles = selectItems.length; + if (concat) { + const totalSelected = this.props.selectedFiles.filter(id => !this.props.selectedFiles.includes(id)).concat(this.props.selectedFiles); + totalFiles = totalSelected.length; + } + if (totalFiles >= this.props.maxFilesSelect) { + return; + } + } + if (!concat) { + setSelectedFiles(selectItems); + } else { + selectFiles(selectItems); + } + } + handleClearSelection() { + this.props.actions.gallery.deselectFiles(); + } + handleSelectAll() { + const ids = this.props.files.map(file => file.id); + this.handleGroupSelect(ids, new Event('na')); + } + handleBeginSelection(e) { + let node = e.target; + while (node) { + if (node.classList.contains('griddle-footer')) { + return false; + } + if (node.classList.contains('gallery__main--selectable')) { + break; + } + node = node.parentNode; + } + return true; + } + handleOpenFolder(event, folder) { + event.preventDefault(); + this.props.onOpenFolder(folder.id); + } + handleOpenFile(event, file) { + event.preventDefault(); + if (file.created === null) { + return; + } + if ((!this.props.selectedFiles.length || this.props.maxFilesSelect === 1) && this.props.type === ACTION_TYPES.SELECT) { + this.handleSelect(event, file); + } + this.props.onOpenFile(file.id, file); + } + handleSelect(event, item) { + const maxFiles = this.props.maxFilesSelect; + const selectable = this.getSelectableFiles(); + let selectedItemIDs = selectable.filter(file => file.id === item.id).map(file => file.id); + if (maxFiles === 1) { + this.props.actions.gallery.setSelectedFiles(selectedItemIDs); + return; + } + if (this.props.selectedFiles.indexOf(item.id) === -1) { + if (event.shiftKey) { + selectedItemIDs = this.getSelection(this.props.lastSelected, item.id); + } + const totalSelected = this.props.selectedFiles.filter(id => !selectedItemIDs.includes(id)).concat(selectedItemIDs); + if (totalSelected.length > maxFiles && maxFiles !== null) { + return; + } + this.props.actions.gallery.selectFiles(selectedItemIDs); + this.props.actions.gallery.setLastSelected(item.id); + } else { + this.props.actions.gallery.deselectFiles([item.id]); + if (event.shiftKey) { + this.props.actions.gallery.setLastSelected(null); + } + } + } + handleEnableDropzone(enabled) { + this.props.actions.gallery.setEnableDropzone(enabled); + } + handleMoveFiles(folderId, fileIds) { + const url = this.props.sectionConfig.endpoints.move.url; + return _Backend.default.post(url, { + ids: fileIds, + folderID: folderId + }, { + 'X-SecurityID': _Config.default.get('SecurityID') + }).then(() => { + const duration = _index.default.MOVE_SUCCESS_DURATION; + const message = `+${fileIds.length}`; + this.props.actions.gallery.setFileBadge(folderId, message, 'success', duration); + if (typeof this.props.onMoveFilesSuccess === 'function') { + this.props.onMoveFilesSuccess(folderId, fileIds); + } + }).catch(() => { + this.props.actions.toasts.error(_i18n.default._t('AssetAdmin.FAILED_MOVE', 'There was an error moving the selected items.')); + }); + } + handleBulkEdit(event, items) { + this.handleOpenFile(event, items[0]); + } + handleBulkMove() { + this.props.actions.gallery.activateModal(_index.default.MODAL_MOVE); + } + renderTransitionBulkActions() { + return this.renderBulkActions(); + } + renderBulkActions() { + const { + type, + dialog, + maxFilesSelect, + files, + selectedFiles, + BulkActionsComponent, + sectionConfig + } = this.props; + const actionFilter = type === ACTION_TYPES.SELECT || dialog ? action => action.value === ACTION_TYPES.INSERT : action => action.value !== ACTION_TYPES.INSERT; + const deleteButtonFilter = sectionConfig.filesAreVersioned && sectionConfig.archiveFiles ? action => action.value !== ACTION_TYPES.DELETE : action => action.value !== ACTION_TYPES.ARCHIVE; + const actions = _index.default.BULK_ACTIONS.filter(actionFilter).filter(deleteButtonFilter).map(action => { + if (action.callback) { + return action; + } + switch (action.value) { + case ACTION_TYPES.DELETE: + case ACTION_TYPES.ARCHIVE: + { + return { + ...action, + callback: (event, items) => { + this.props.actions.confirmDeletion.confirm(items); + }, + confirm: undefined + }; + } + case ACTION_TYPES.EDIT: + { + return { + ...action, + callback: this.handleBulkEdit + }; + } + case ACTION_TYPES.MOVE: + { + return { + ...action, + callback: this.handleBulkMove + }; + } + case ACTION_TYPES.PUBLISH: + { + return { + ...action, + callback: this.handleBulkPublish + }; + } + case ACTION_TYPES.UNPUBLISH: + { + return { + ...action, + callback: this.handleBulkUnpublish + }; + } + case ACTION_TYPES.INSERT: + { + return { + ...action, + callback: this.handleBulkInsert, + color: 'primary' + }; + } + default: + { + return action; + } + } + }); + const selected = selectedFiles.map(id => files.find(file => file && id === file.id)).filter(item => item); + if (selected.length > 0 && [ACTION_TYPES.ADMIN, ACTION_TYPES.SELECT].includes(type)) { + return _react.default.createElement(BulkActionsComponent, { + actions: actions, + items: selected, + total: maxFilesSelect, + key: selected.length > 0, + container: this.gallery, + showCount: maxFilesSelect !== 1, + onClearSelection: this.handleClearSelection, + onSelectAll: this.handleSelectAll + }); + } + return null; + } + renderGalleryView() { + const GalleryView = this.props.view === 'table' ? _TableView.default : _ThumbnailView.default; + const files = this.props.files.map(file => { + const selected = this.itemIsSelected(file.id); + const highlighted = this.itemIsHighlighted(file.id); + const key = (file.queuedId ? `queueId${file.queuedId}` : `id${file.id}`) + (selected ? '--selected' : ''); + return { + ...file, + selected, + highlighted, + key + }; + }); + const { + type, + loading, + dialog, + page, + totalCount, + limit, + sort, + selectedFiles, + badges, + maxFilesSelect, + sectionConfig + } = this.props; + const selectableItems = type === ACTION_TYPES.SELECT || type === ACTION_TYPES.ADMIN && (!maxFilesSelect || maxFilesSelect > 1); + const props = { + selectableItems, + selectableFolders: type !== ACTION_TYPES.SELECT && !dialog, + files, + loading, + page, + totalCount, + limit, + sort, + selectedFiles, + badges, + onSort: this.handleSort, + onSetPage: this.handleSetPage, + onOpenFile: this.handleOpenFile, + onOpenFolder: this.handleOpenFolder, + onSelect: this.handleSelect, + onCancelUpload: this.handleCancelUpload, + onDropFiles: this.handleMoveFiles, + onRemoveErroredUpload: this.handleRemoveErroredUpload, + onEnableDropzone: this.handleEnableDropzone, + sectionConfig, + canDrag: type === ACTION_TYPES.ADMIN, + maxFilesSelect + }; + return _react.default.createElement(GalleryView, props); + } + renderToolbar() { + const { + GalleryToolbar, + sort, + view, + folder, + onCreateFolder, + onOpenFolder, + onViewChange + } = this.props; + const props = { + onMoveFiles: this.handleMoveFiles, + onSort: this.handleSort, + onCreateFolder, + onOpenFolder, + onViewChange, + view, + sort, + folder + }; + return _react.default.createElement(GalleryToolbar, props); + } + render() { + const { + folder, + loading, + errorMessage, + noticeMessage + } = this.props; + const Loading = this.props.LoadingComponent; + if (!folder) { + if (errorMessage) { + return _react.default.createElement("div", { + className: "gallery__error flexbox-area-grow" + }, _react.default.createElement("div", { + className: "gallery__error-message" + }, _react.default.createElement("h3", null, _i18n.default._t('AssetAdmin.DROPZONE_RESPONSE_ERROR', 'Server responded with an error.')), errorMessage && _react.default.createElement("p", null, errorMessage))); + } + if (loading) { + return _react.default.createElement("div", { + className: "flexbox-area-grow" + }, _react.default.createElement(Loading, null)); + } + return _react.default.createElement("div", { + className: "flexbox-area-grow" + }, _react.default.createElement("div", { + className: "editor__file-preview-message--file-missing m-t-3" + }, _i18n.default._t('Admin.UNKNOWN_ERROR', 'An unknown error has occurred'))); + } + const messages = _react.default.createElement("div", { + className: "gallery_messages" + }, errorMessage && _react.default.createElement(_FormAlert.default, { + value: errorMessage, + type: "danger" + }), noticeMessage && _react.default.createElement(_FormAlert.default, { + value: noticeMessage, + type: "success" + })); + const dimensions = { + height: _index.default.THUMBNAIL_HEIGHT, + width: _index.default.THUMBNAIL_WIDTH + }; + const dropzoneOptions = { + url: this.props.createFileApiUrl, + method: this.props.createFileApiMethod, + paramName: 'Upload', + clickable: '#upload-button', + ...this.props.sectionConfig.dropzoneOptions + }; + const securityID = this.props.securityId; + const canEdit = this.props.folder.canEdit && this.props.enableDropzone; + const galleryClasses = ['panel', 'panel--padded', 'panel--scrollable', 'gallery__main', 'fill-height']; + if (this.props.type === ACTION_TYPES.INSERT) { + galleryClasses.push('insert-media-modal__main'); + } + const cssClasses = galleryClasses; + if (this.hasOpenedItem()) { + cssClasses.push('gallery__main--has-opened-item'); + } + return _react.default.createElement("div", { + className: "flexbox-area-grow gallery__outer", + ref: gallery => { + this.gallery = gallery; + } + }, this.renderTransitionBulkActions(), _react.default.createElement(_GalleryDND.default, { + selectedFiles: this.props.selectedFiles, + className: galleryClasses.join(' ') + }, this.renderToolbar(), _react.default.createElement(_reactSelectable.SelectableGroup, { + enabled: this.props.view === 'tile' && this.props.type === ACTION_TYPES.ADMIN, + className: "flexbox-area-grow fill-height gallery__main--selectable", + onSelection: this.handleGroupSelect, + onNonItemClick: this.handleClearSelection, + onBeginSelection: this.handleBeginSelection, + preventDefault: false, + fixedPosition: true + }, _react.default.createElement(_AssetDropzone.default, { + name: "gallery-container", + className: "flexbox-area-grow", + canUpload: canEdit, + onAddedFile: this.handleAddedFile, + onPreviewLoaded: this.handlePreviewLoaded, + onError: this.handleFailedUpload, + onSuccess: this.handleSuccessfulUpload, + onQueueComplete: this.handleQueueComplete, + onSending: this.handleSending, + onUploadProgress: this.handleUploadProgress, + preview: dimensions, + folderId: this.props.folderId, + options: dropzoneOptions, + securityID: securityID, + uploadButton: false + }, messages, this.renderGalleryView()))), this.props.loading && _react.default.createElement(Loading, null), _react.default.createElement(_MoveModal.default, { + sectionConfig: this.props.sectionConfig, + folderId: this.props.folderId, + onSuccess: this.props.onMoveFilesSuccess, + onOpenFolder: this.props.onOpenFolder + })); + } +} +exports.Component = Gallery; +const sharedDefaultProps = { + page: 1, + limit: 15 +}; +const sharedPropTypes = { + sectionConfig: _configShape.default, + loading: _propTypes.default.bool, + sort: _propTypes.default.string, + files: _propTypes.default.arrayOf(_propTypes.default.shape({ + id: _propTypes.default.number, + parent: _propTypes.default.shape({ + id: _propTypes.default.number + }) + })).isRequired, + selectedFiles: _propTypes.default.arrayOf(_propTypes.default.number), + totalCount: _propTypes.default.number, + page: _propTypes.default.number, + limit: _propTypes.default.number, + badges: _propTypes.default.arrayOf(_propTypes.default.shape({ + id: _propTypes.default.number, + message: _propTypes.default.node, + status: _propTypes.default.string + })), + onOpenFile: _propTypes.default.func.isRequired, + onOpenFolder: _propTypes.default.func.isRequired, + onSort: _propTypes.default.func.isRequired, + onSetPage: _propTypes.default.func.isRequired, + maxFilesSelect: _propTypes.default.number +}; +const galleryViewDefaultProps = exports.galleryViewDefaultProps = Object.assign({}, sharedDefaultProps, { + selectableItems: false +}); +const galleryViewPropTypes = exports.galleryViewPropTypes = Object.assign({}, sharedPropTypes, { + selectableItems: _propTypes.default.bool, + selectableFolders: _propTypes.default.bool, + onSelect: _propTypes.default.func, + onCancelUpload: _propTypes.default.func, + onRemoveErroredUpload: _propTypes.default.func, + onEnableDropzone: _propTypes.default.func +}); +Gallery.defaultProps = Object.assign({}, sharedDefaultProps, { + type: ACTION_TYPES.ADMIN, + view: 'tile', + enableDropzone: true, + dialog: false, + BulkActionsComponent: _BulkActions.default +}); +Gallery.propTypes = Object.assign({}, sharedPropTypes, { + onSuccessfulUpload: _propTypes.default.func, + onSuccessfulUploadQueue: _propTypes.default.func, + onCreateFolder: _propTypes.default.func, + onMoveFilesSuccess: _propTypes.default.func, + onPublish: _propTypes.default.func, + onUnpublish: _propTypes.default.func, + type: _propTypes.default.oneOf(['insert-media', 'insert-link', ACTION_TYPES.SELECT, ACTION_TYPES.ADMIN]), + view: _propTypes.default.oneOf(['tile', 'table']), + lastSelected: _propTypes.default.number, + dialog: _propTypes.default.bool, + fileId: _propTypes.default.number, + folderId: _propTypes.default.number.isRequired, + folder: _propTypes.default.shape({ + id: _propTypes.default.number, + title: _propTypes.default.string, + parentId: _propTypes.default.number, + canView: _propTypes.default.bool, + canEdit: _propTypes.default.bool + }), + files: _propTypes.default.array, + errorMessage: _propTypes.default.string, + actions: _propTypes.default.object, + securityId: _propTypes.default.string, + onViewChange: _propTypes.default.func.isRequired, + createFileApiUrl: _propTypes.default.string, + createFileApiMethod: _propTypes.default.string, + search: _propTypes.default.object, + enableDropzone: _propTypes.default.bool, + concatenateSelect: _propTypes.default.bool, + GalleryToolbar: _propTypes.default.elementType, + sorters: _propTypes.default.arrayOf(_propTypes.default.shape({ + field: _propTypes.default.string.isRequired, + direction: _propTypes.default.oneOf(['asc', 'desc']).isRequired, + label: _propTypes.default.string.isRequired + })).isRequired, + BulkActionsComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]) +}); +function mapStateToProps(state, ownProps) { + let { + sort + } = ownProps; + const { + selectedFiles, + errorMessage, + noticeMessage, + enableDropzone, + badges, + concatenateSelect, + loading, + sorters, + lastSelected + } = state.assetAdmin.gallery; + if (!sort && sorters && sorters[0]) { + sort = `${sorters[0].field},${sorters[0].direction}`; + } + return { + lastSelected, + selectedFiles, + errorMessage, + noticeMessage, + enableDropzone, + badges, + concatenateSelect, + loading: ownProps.loading || loading, + queuedFiles: state.assetAdmin.queuedFiles, + securityId: state.config.SecurityID, + sorters, + sort + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + gallery: (0, _redux.bindActionCreators)(galleryActions, dispatch), + toasts: (0, _redux.bindActionCreators)(toastsActions, dispatch), + queuedFiles: (0, _redux.bindActionCreators)(queuedFilesActions, dispatch), + confirmDeletion: (0, _redux.bindActionCreators)(confirmDeletionActions, dispatch) + } + }; +} +var _default = exports["default"] = (0, _redux.compose)((0, _Injector.inject)(['GalleryToolbar', 'Loading'], (GalleryToolbar, Loading) => ({ + GalleryToolbar, + LoadingComponent: Loading +}), () => 'AssetAdmin.Gallery'), (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(Gallery); + +/***/ }), + +/***/ "./client/src/containers/Gallery/GalleryDND.js": +/*!*****************************************************!*\ + !*** ./client/src/containers/Gallery/GalleryDND.js ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _GalleryItemDragLayer = _interopRequireDefault(__webpack_require__(/*! components/GalleryItem/GalleryItemDragLayer */ "./client/src/components/GalleryItem/GalleryItemDragLayer.js")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _core = __webpack_require__(/*! @dnd-kit/core */ "./node_modules/@dnd-kit/core/dist/core.esm.js"); +var _modifiers = __webpack_require__(/*! @dnd-kit/modifiers */ "./node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function GalleryDND(_ref) { + let { + className, + selectedFiles, + children, + ...props + } = _ref; + const [dragging, setDragging] = (0, _react.useState)(false); + const [draggingItemID, setDraggingItemID] = (0, _react.useState)(null); + const [draggingItemProps, setDraggingItemProps] = (0, _react.useState)(null); + const handleDragStart = (0, _react.useCallback)(event => { + setDragging(true); + setDraggingItemID(event.active.id); + setDraggingItemProps(event.active.data.current.props); + }); + const handleDragEnd = (0, _react.useCallback)(event => { + setDragging(false); + setDraggingItemID(null); + setDraggingItemProps(null); + }); + const sensors = (0, _core.useSensors)((0, _core.useSensor)(_core.PointerSensor, { + activationConstraint: { + distance: 10 + } + })); + const draggingItems = [...selectedFiles]; + if (!draggingItems.includes(draggingItemID)) { + draggingItems.push(draggingItemID); + } + return _react.default.createElement("div", { + className: (0, _classnames.default)(className, { + 'gallery__main--dragging': dragging + }) + }, _react.default.createElement(_core.DndContext, { + sensors: sensors, + onDragStart: handleDragStart, + onDragEnd: handleDragEnd, + modifiers: [_modifiers.restrictToWindowEdges] + }, children, _react.default.createElement(_core.DragOverlay, null, dragging && _react.default.createElement(_GalleryItemDragLayer.default, { + draggingItemProps: draggingItemProps, + draggingItems: draggingItems + })))); +} +GalleryDND.contextTypes = { + dragDropManager: _propTypes.default.object +}; +GalleryDND.propTypes = { + selectedFiles: _propTypes.default.arrayOf(_propTypes.default.number), + className: _propTypes.default.string, + children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]) +}; +var _default = exports["default"] = GalleryDND; + +/***/ }), + +/***/ "./client/src/containers/HistoryList/HistoryItem.js": +/*!**********************************************************!*\ + !*** ./client/src/containers/HistoryList/HistoryItem.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +class HistoryItem extends _react.Component { + constructor(props) { + super(props); + this.handleClick = this.handleClick.bind(this); + } + handleClick(e) { + e.preventDefault(); + if (typeof this.props.onClick === 'function') { + this.props.onClick(this.props.versionid); + } + } + render() { + let publishedLine = null; + if (this.props.status === 'Published') { + publishedLine = _react.default.createElement("p", null, _react.default.createElement("span", { + className: "history-item__status-flag" + }, this.props.status), " at ", this.props.date_formatted); + } + return (_react.default.createElement("li", { + className: "list-group-item history-item", + onClick: this.handleClick + }, _react.default.createElement("p", null, _react.default.createElement("span", { + className: "history-item__version" + }, "v.", this.props.versionid), _react.default.createElement("span", { + className: "history-item__date" + }, this.props.date_ago, " ", this.props.author), this.props.summary), publishedLine) + ); + } +} +HistoryItem.propTypes = { + versionid: _propTypes.default.number.isRequired, + summary: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string]).isRequired, + status: _propTypes.default.string, + author: _propTypes.default.string, + date_formatted: _propTypes.default.string, + date_ago: _propTypes.default.string, + onClick: _propTypes.default.func +}; +var _default = exports["default"] = HistoryItem; + +/***/ }), + +/***/ "./client/src/containers/HistoryList/HistoryList.js": +/*!**********************************************************!*\ + !*** ./client/src/containers/HistoryList/HistoryList.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var _HistoryItem = _interopRequireDefault(__webpack_require__(/*! containers/HistoryList/HistoryItem */ "./client/src/containers/HistoryList/HistoryItem.js")); +var _FormBuilderLoader = _interopRequireDefault(__webpack_require__(/*! containers/FormBuilderLoader/FormBuilderLoader */ "containers/FormBuilderLoader/FormBuilderLoader")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +const sectionConfigKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; +const createEndpoint = function (endpointConfig) { + let includeToken = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + return _Backend.default.createEndpointFetcher(Object.assign({}, endpointConfig, includeToken ? { + defaultData: { + SecurityID: _Config.default.get('SecurityID') + } + } : {})); +}; +class HistoryList extends _react.Component { + constructor(props) { + super(props); + this.state = { + history: [], + loadedDetails: false + }; + this.handleClick = this.handleClick.bind(this); + this.handleBack = this.handleBack.bind(this); + this.timer = null; + this.api = createEndpoint(props.sectionConfig.endpoints.history); + } + componentDidMount() { + this.refreshHistoryIfNeeded(); + } + componentDidUpdate(prevProps) { + this.refreshHistoryIfNeeded(prevProps); + } + componentWillUnmount() { + clearTimeout(this.timer); + this.timer = null; + } + refreshHistoryIfNeeded(prevProps) { + if (!prevProps && !this.state.loadedDetails || this.props.data.fileId !== prevProps.data.fileId || this.props.data.latestVersionId !== prevProps.data.latestVersionId) { + this.setState({ + loadedDetails: false + }); + const fileId = this.props ? this.props.data.fileId : prevProps.data.fileId; + clearTimeout(this.timer); + this.timer = setTimeout(() => { + this.api({ + fileId + }).then(history => { + if (this.timer) { + this.setState({ + history, + loadedDetails: true + }); + } + }); + }, 250); + } + } + handleClick(versionId) { + this.setState({ + viewDetails: versionId + }); + } + handleBack(event) { + event.preventDefault(); + this.setState({ + viewDetails: null + }); + } + render() { + if (!this.state.loadedDetails) { + return _react.default.createElement("div", { + className: "history-list history-list--loading" + }, "Loading..."); + } + if (this.state.viewDetails) { + const schemaUrl = [this.props.historySchemaUrl, this.props.data.fileId, this.state.viewDetails].join('/'); + const backButtonClasses = ['btn', 'btn-secondary', 'btn--icon-xl', 'btn--no-text', 'font-icon-left-open-big', 'history-list__back'].join(' '); + return _react.default.createElement("div", { + className: "history-list" + }, _react.default.createElement("a", { + href: "#", + className: backButtonClasses, + onClick: this.handleBack + }), _react.default.createElement(_FormBuilderLoader.default, { + identifier: "AssetAdmin.HistoryList", + schemaUrl: schemaUrl, + formTag: "div" + })); + } + const historyList = this.state.history || []; + return _react.default.createElement("div", { + className: "history-list" + }, _react.default.createElement("ul", { + className: "list-group list-group-flush history-list__list" + }, historyList.map(history => _react.default.createElement(_HistoryItem.default, _extends({ + key: history.versionid + }, history, { + onClick: this.handleClick + }))))); + } +} +exports.Component = HistoryList; +HistoryList.propTypes = { + sectionConfig: _propTypes.default.shape({ + form: _propTypes.default.object, + historyEndpoint: _propTypes.default.shape({ + url: _propTypes.default.string, + method: _propTypes.default.string, + responseFormat: _propTypes.default.string + }) + }), + historySchemaUrl: _propTypes.default.string, + data: _propTypes.default.object +}; +HistoryList.defaultProps = { + data: { + fieldId: 0 + } +}; +function mapStateToProps(state) { + const sectionConfig = state.config.sections.find(section => section.name === sectionConfigKey); + return { + sectionConfig, + historySchemaUrl: sectionConfig.form.fileHistoryForm.schemaUrl + }; +} +var _default = exports["default"] = (0, _reactRedux.connect)(mapStateToProps)(HistoryList); + +/***/ }), + +/***/ "./client/src/containers/InsertMediaModal/InsertMediaModal.js": +/*!********************************************************************!*\ + !*** ./client/src/containers/InsertMediaModal/InsertMediaModal.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _AssetAdmin = _interopRequireDefault(__webpack_require__(/*! containers/AssetAdmin/AssetAdmin */ "./client/src/containers/AssetAdmin/AssetAdmin.js")); +var _stateRouter = _interopRequireDefault(__webpack_require__(/*! containers/AssetAdmin/stateRouter */ "./client/src/containers/AssetAdmin/stateRouter.js")); +var _fileSchemaModalHandler = _interopRequireDefault(__webpack_require__(/*! containers/InsertLinkModal/fileSchemaModalHandler */ "containers/InsertLinkModal/fileSchemaModalHandler")); +var galleryActions = _interopRequireWildcard(__webpack_require__(/*! state/gallery/GalleryActions */ "./client/src/state/gallery/GalleryActions.js")); +var modalActions = _interopRequireWildcard(__webpack_require__(/*! state/modal/ModalActions */ "./client/src/state/modal/ModalActions.js")); +var _FormBuilderModal = _interopRequireDefault(__webpack_require__(/*! components/FormBuilderModal/FormBuilderModal */ "components/FormBuilderModal/FormBuilderModal")); +var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "classnames")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _getFormSchema = _interopRequireDefault(__webpack_require__(/*! lib/getFormSchema */ "./client/src/lib/getFormSchema.js")); +var _qs = _interopRequireDefault(__webpack_require__(/*! qs */ "qs")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +class InsertMediaModal extends _react.Component { + constructor(props) { + super(props); + this.handleSubmit = this.handleSubmit.bind(this); + } + componentDidMount() { + const { + isOpen, + onBrowse, + setOverrides, + fileAttributes, + folderId + } = this.props; + if (!isOpen) { + onBrowse(folderId || 0); + } else if (typeof setOverrides === 'function' && fileAttributes.ID) { + setOverrides(this.props); + onBrowse(folderId, fileAttributes.ID); + } + } + componentDidUpdate(prevProps) { + if (!this.props.isOpen && prevProps.isOpen) { + this.props.onBrowse(this.props.folderId); + this.props.actions.gallery.deselectFiles(); + } + if (typeof prevProps.setOverrides === 'function' && this.props.isOpen && !prevProps.isOpen) { + prevProps.setOverrides(this.props); + this.props.onBrowse(this.props.folderId, this.props.fileAttributes ? this.props.fileAttributes.ID : null); + } + } + getSectionProps() { + return { + ...this.props, + dialog: true, + toolbarChildren: this.renderToolbarChildren(), + onSubmitEditor: this.handleSubmit, + onReplaceUrl: this.props.onBrowse + }; + } + getModalProps() { + const { + onHide, + onInsert, + sectionConfig, + schemaUrl, + className, + ...props + } = this.props; + return { + ...props, + className: (0, _classnames.default)('insert-media-modal', className), + size: 'lg', + showCloseButton: false + }; + } + handleSubmit(data, action, submitFn, file) { + if (action === 'action_insert') { + return this.props.onInsert(data, file); + } + return submitFn(); + } + renderToolbarChildren() { + return _react.default.createElement("button", { + type: "button", + className: "close modal__close-button insert-media-modal__close-button", + onClick: this.props.onClosed, + "aria-label": _i18n.default._t('FormBuilderModal.CLOSE', 'Close') + }, _react.default.createElement("span", { + "aria-hidden": "true" + }, "\xD7")); + } + render() { + const modalProps = this.getModalProps(); + const sectionProps = this.getSectionProps(); + const assetAdmin = this.props.isOpen ? _react.default.createElement(_AssetAdmin.default, sectionProps) : null; + return _react.default.createElement(_FormBuilderModal.default, modalProps, assetAdmin); + } +} +exports.Component = InsertMediaModal; +InsertMediaModal.propTypes = { + sectionConfig: _propTypes.default.shape({ + url: _propTypes.default.string, + form: _propTypes.default.object + }), + type: _propTypes.default.oneOf(['insert-media', 'insert-link', 'select', 'admin']), + schemaUrl: _propTypes.default.string, + isOpen: _propTypes.default.bool, + setOverrides: _propTypes.default.func, + onInsert: _propTypes.default.func.isRequired, + fileAttributes: _propTypes.default.shape({ + ID: _propTypes.default.number, + AltText: _propTypes.default.string, + Width: _propTypes.default.number, + Height: _propTypes.default.number, + Loading: _propTypes.default.string, + TitleTooltip: _propTypes.default.string, + Alignment: _propTypes.default.string, + Description: _propTypes.default.string, + TargetBlank: _propTypes.default.bool + }), + requireLinkText: _propTypes.default.bool, + folderId: _propTypes.default.number, + fileId: _propTypes.default.number, + viewAction: _propTypes.default.string, + query: _propTypes.default.object, + getUrl: _propTypes.default.func, + onBrowse: _propTypes.default.func.isRequired, + onClosed: _propTypes.default.func, + className: _propTypes.default.string, + actions: _propTypes.default.object, + maxFiles: _propTypes.default.number, + fileSelected: _propTypes.default.bool +}; +InsertMediaModal.defaultProps = { + className: '', + fileAttributes: {}, + type: 'insert-media', + folderId: 0, + maxFiles: 1 +}; +function mapStateToProps(state, ownProps) { + const config = ownProps.sectionConfig; + if (!config) { + return {}; + } + let folderId = 0; + if (ownProps.folderId !== null) { + folderId = ownProps.folderId; + } else if (ownProps.folder) { + folderId = ownProps.folder.id; + } + const fileId = ownProps.fileAttributes ? ownProps.fileAttributes.ID : ownProps.fileId; + const formSchema = state.assetAdmin.modal.formSchema; + const props = { + config, + viewAction: ownProps.viewAction, + folderId, + type: formSchema && formSchema.type, + fileId + }; + const { + schemaUrl, + targetId + } = (0, _getFormSchema.default)(props); + if (!schemaUrl) { + return {}; + } + const queryMap = {}; + if (ownProps.requireLinkText) { + queryMap.requireLinkText = true; + } + if (ownProps.fileSelected) { + queryMap.fileSelected = true; + } + let query = _qs.default.stringify(queryMap); + query = query ? `?${query}` : ''; + return { + schemaUrl: `${schemaUrl}/${targetId}${query}`, + type: formSchema && formSchema.type + }; +} +function mapDispatchToProps(dispatch) { + return { + actions: { + gallery: (0, _redux.bindActionCreators)(galleryActions, dispatch), + modal: (0, _redux.bindActionCreators)(modalActions, dispatch) + } + }; +} +var _default = exports["default"] = (0, _redux.compose)(_stateRouter.default, (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), _fileSchemaModalHandler.default)(InsertMediaModal); + +/***/ }), + +/***/ "./client/src/containers/MoveModal/MoveModal.js": +/*!******************************************************!*\ + !*** ./client/src/containers/MoveModal/MoveModal.js ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _GalleryActions = __webpack_require__(/*! state/gallery/GalleryActions */ "./client/src/state/gallery/GalleryActions.js"); +var _ToastsActions = __webpack_require__(/*! state/toasts/ToastsActions */ "state/toasts/ToastsActions"); +var _FormBuilderModal = _interopRequireDefault(__webpack_require__(/*! components/FormBuilderModal/FormBuilderModal */ "components/FormBuilderModal/FormBuilderModal")); +var _configShape = _interopRequireDefault(__webpack_require__(/*! lib/configShape */ "./client/src/lib/configShape.js")); +var _Config = _interopRequireDefault(__webpack_require__(/*! lib/Config */ "lib/Config")); +var _Backend = _interopRequireDefault(__webpack_require__(/*! lib/Backend */ "lib/Backend")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +class MoveModal extends _react.default.Component { + constructor(props) { + super(props); + this.handleSubmit = this.handleSubmit.bind(this); + this.timeout = null; + } + handleSubmit(_ref) { + let { + FolderID + } = _ref; + const { + selectedFiles, + onSuccess, + onClosed, + setNotice, + setError, + setBadge + } = this.props; + let url = this.props.sectionConfig.endpoints.move.url; + return _Backend.default.post(url, { + ids: selectedFiles, + folderID: FolderID + }, { + 'X-SecurityID': _Config.default.get('SecurityID') + }).then(() => { + url = `${this.props.sectionConfig.endpoints.read.url}/${FolderID}`; + return _Backend.default.get(url); + }).then(response => response.json()).then(responseJson => { + if (typeof onSuccess === 'function') { + onSuccess(responseJson.id, selectedFiles); + } + setBadge(responseJson.id, `${selectedFiles.length}`, 'success', _index.default.MOVE_SUCCESS_DURATION); + setNotice(_i18n.default.sprintf(_i18n.default._t('AssetAdmin.MOVED_ITEMS_TO', 'Moved %s item(s) to %s'), selectedFiles.length, responseJson.name), [{ + label: _i18n.default._t('AssetAdmin.GO_TO_FOLDER', 'Go to folder'), + onClick: () => this.props.onOpenFolder(responseJson.id) + }]); + onClosed(); + }).catch(() => { + setError(_i18n.default._t('AssetAdmin.FAILED_MOVE', 'There was an error moving the selected items.')); + }); + } + render() { + const { + isOpen, + onClosed, + title, + folderId, + sectionConfig + } = this.props; + const { + schemaUrl + } = sectionConfig.form.moveForm; + return _react.default.createElement(_FormBuilderModal.default, { + title: title, + isOpen: isOpen, + onClosed: onClosed, + onSubmit: this.handleSubmit, + identifier: "AssetAdmin.MoveForm", + schemaUrl: `${schemaUrl}/${folderId}` + }); + } +} +MoveModal.propTypes = { + sectionConfig: _configShape.default, + folderId: _propTypes.default.number.isRequired, + isOpen: _propTypes.default.bool, + onClosed: _propTypes.default.func, + setNotice: _propTypes.default.func, + setBadge: _propTypes.default.func, + setError: _propTypes.default.func, + title: _propTypes.default.string, + onSuccess: _propTypes.default.func, + onOpenFolder: _propTypes.default.func.isRequired, + selectedFiles: _propTypes.default.array.isRequired +}; +MoveModal.defaultProps = { + isOpen: false +}; +function mapStateToProps(state) { + const { + modal, + selectedFiles + } = state.assetAdmin.gallery; + return { + isOpen: modal === _index.default.MODAL_MOVE, + selectedFiles, + title: _i18n.default.sprintf(_i18n.default._t('AssetAdmin.MOVE_ITEMS_TO', 'Move %s item(s) to...'), selectedFiles.length) + }; +} +function mapDispatchToProps(dispatch) { + return { + onClosed() { + dispatch((0, _GalleryActions.deactivateModal)()); + }, + setNotice(msg) { + let actions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + dispatch((0, _ToastsActions.display)({ + text: msg, + type: 'success', + actions + })); + }, + setError(msg) { + dispatch((0, _ToastsActions.display)({ + text: msg, + type: 'error' + })); + }, + setBadge() { + dispatch((0, _GalleryActions.setFileBadge)(...arguments)); + } + }; +} +var _default = exports["default"] = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(MoveModal); + +/***/ }), + +/***/ "./client/src/containers/TableView/TableView.js": +/*!******************************************************!*\ + !*** ./client/src/containers/TableView/TableView.js ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +var _griddleReact = _interopRequireDefault(__webpack_require__(/*! griddle-react */ "./node_modules/griddle-react/modules/griddle.jsx.js")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _FileStatusIcon = _interopRequireDefault(__webpack_require__(/*! components/FileStatusIcon/FileStatusIcon */ "components/FileStatusIcon/FileStatusIcon")); +var _Gallery = __webpack_require__(/*! containers/Gallery/Gallery */ "./client/src/containers/Gallery/Gallery.js"); +var _DataFormat = __webpack_require__(/*! lib/DataFormat */ "lib/DataFormat"); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _redux = __webpack_require__(/*! redux */ "redux"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +class TableView extends _react.Component { + constructor(props) { + super(props); + this.getColumns = this.getColumns.bind(this); + this.handleSort = this.handleSort.bind(this); + this.handleSetPage = this.handleSetPage.bind(this); + this.handleRowClick = this.handleRowClick.bind(this); + this.renderSelect = this.renderSelect.bind(this); + this.renderTitle = this.renderTitle.bind(this); + this.renderStatus = this.renderStatus.bind(this); + this.renderNoItemsNotice = this.renderNoItemsNotice.bind(this); + } + getColumns() { + const columns = ['thumbnail', 'title', 'status', 'size', 'lastEdited']; + if (this.props.selectableItems) { + columns.unshift('selected'); + } + return columns; + } + getColumnConfig() { + return [{ + columnName: 'selected', + sortable: false, + displayName: '', + cssClassName: 'gallery__table-column--select', + customComponent: this.renderSelect + }, { + columnName: 'thumbnail', + sortable: false, + displayName: '', + cssClassName: 'gallery__table-column--image', + customComponent: this.renderThumbnail + }, { + columnName: 'title', + customCompareFn: () => 0, + displayName: _i18n.default._t('File.TITLE', 'Title'), + cssClassName: 'gallery__table-column--title', + customComponent: this.renderTitle + }, { + columnName: 'status', + sortable: false, + cssClassName: 'sort--disabled', + customComponent: this.renderStatus, + displayName: _i18n.default._t('File.STATUS', 'Status') + }, { + columnName: 'lastEdited', + displayName: _i18n.default._t('File.MODIFIED', 'Modified'), + customComponent: this.renderDate + }, { + columnName: 'size', + sortable: false, + displayName: _i18n.default._t('File.SIZE', 'Size'), + cssClassName: 'sort--disabled', + customComponent: this.renderSize + }]; + } + getRowMetadata(rowData) { + return `gallery__table-row ${rowData.highlighted ? 'gallery__table-row--highlighted' : ''}`; + } + getTableProps() { + const [sortColumn, sortDirection] = this.props.sort.split(','); + return { + tableClassName: 'gallery__table table table-hover', + gridClassName: 'gallery__main-view--table', + rowMetadata: { + bodyCssClassName: this.getRowMetadata, + key: 'key' + }, + sortAscendingComponent: '', + sortDescendingComponent: '', + useExternal: true, + externalSetPage: this.handleSetPage, + externalChangeSort: this.handleSort, + externalSetFilter: () => null, + externalSetPageSize: () => null, + externalCurrentPage: this.props.page - 1, + externalMaxPage: Math.ceil(this.props.totalCount / this.props.limit), + externalSortColumn: sortColumn, + externalSortAscending: sortDirection === 'asc', + initialSort: sortColumn, + columns: this.getColumns(), + columnMetadata: this.getColumnConfig(), + useGriddleStyles: false, + onRowClick: this.handleRowClick, + results: this.props.files, + customNoDataComponent: this.renderNoItemsNotice + }; + } + handleActivate(event, item) { + if (item.type === 'folder') { + this.props.onOpenFolder(event, item); + } else { + this.props.onOpenFile(event, item); + } + } + handleRowClick(row, event) { + const item = row.props.data; + if (event.currentTarget.classList.contains('gallery__table-column--select')) { + event.stopPropagation(); + event.preventDefault(); + if (typeof this.props.onSelect === 'function') { + this.props.onSelect(event, item); + return; + } + } + this.handleActivate(event, item); + } + handleSort(column, ascending) { + const direction = ascending ? 'asc' : 'desc'; + this.props.onSort(`${column},${direction}`); + } + handleSetPage(page) { + this.props.onSetPage(page + 1); + } + preventFocus(event) { + event.preventDefault(); + } + renderNoItemsNotice() { + if (this.props.files.length === 0 && !this.props.loading) { + return _react.default.createElement("p", { + className: "gallery__no-item-notice" + }, _i18n.default._t('AssetAdmin.NOITEMSFOUND')); + } + return null; + } + renderSize(props) { + if (props.rowData.type === 'folder') { + return null; + } + const description = (0, _DataFormat.fileSize)(props.data); + return _react.default.createElement("span", null, description); + } + renderStatus(props) { + let flags = []; + const item = props.rowData; + const { + VersionedBadge + } = this.props; + if (item.type !== 'folder') { + if (item.draft) { + flags.push({ + key: 'status-draft', + status: 'draft' + }); + } else if (item.modified) { + flags.push({ + key: 'status-modified', + status: 'modified' + }); + } + } + flags = flags.map(_ref => { + let { + ...attributes + } = _ref; + return _react.default.createElement(VersionedBadge, attributes); + }); + return flags ? _react.default.createElement("span", null, flags) : null; + } + renderProgressBar(rowData) { + if (!rowData.queuedId || rowData.message && rowData.message.type === 'error') { + return null; + } + if (rowData.id > 0) { + return _react.default.createElement("div", { + className: "gallery__progress-bar--complete" + }); + } + const progressBarProps = { + className: 'gallery__progress-bar-progress', + style: { + width: `${rowData.progress}%` + } + }; + return _react.default.createElement("div", { + className: "gallery__progress-bar" + }, _react.default.createElement("div", progressBarProps)); + } + renderRestrictedAccess(rowData) { + const { + hasRestrictedAccess + } = rowData; + const attrs = { + fileID: rowData.id, + placement: 'top', + hasRestrictedAccess + }; + return _react.default.createElement(_FileStatusIcon.default, attrs); + } + renderTrackedFormUpload(rowData) { + const { + isTrackedFormUpload, + hasRestrictedAccess + } = rowData; + const attrs = { + fileID: rowData.id, + placement: 'top', + isTrackedFormUpload, + hasRestrictedAccess + }; + return _react.default.createElement(_FileStatusIcon.default, attrs); + } + renderTitle(props) { + const progress = this.renderProgressBar(props.rowData); + return _react.default.createElement("div", { + className: "fill-width" + }, _react.default.createElement("div", { + className: "flexbox-area-grow" + }, _react.default.createElement("span", null, props.data), props.rowData.hasRestrictedAccess && this.renderRestrictedAccess(props.rowData), props.rowData.isTrackedFormUpload && this.renderTrackedFormUpload(props.rowData)), progress); + } + renderSelect(props) { + if (this.props.selectableItems && (this.props.selectableFolders || props.rowData.type !== 'folder')) { + const checkboxProps = { + type: 'checkbox', + title: _i18n.default._t('AssetAdmin.SELECT'), + defaultChecked: props.data, + tabIndex: -1, + onMouseDown: this.preventFocus + }; + const maxSelected = ![null, 1].includes(this.props.maxFilesSelect) && this.props.selectedFiles.length >= this.props.maxFilesSelect; + if (maxSelected && !props.data) { + checkboxProps.disabled = true; + } + return _react.default.createElement("input", checkboxProps); + } + return null; + } + renderDate(props) { + if (props.rowData.type === 'folder') { + return null; + } + moment.locale(_i18n.default.detectLocale()); + return _react.default.createElement("span", null, moment(props.data).format('L LT')); + } + renderThumbnail(props) { + const url = props.data || props.rowData.url; + const uploading = props.rowData.queuedId && !props.rowData.id; + const category = props.rowData.category || 'false'; + const baseClass = 'gallery__table-image'; + const classNames = [baseClass]; + const styles = {}; + classNames.push(`${baseClass}--${category}`); + if (category === 'image' && url) { + styles.backgroundImage = `url("${url}")`; + } + if (!uploading && !url && category !== 'folder') { + classNames.push(`${baseClass}--error`); + } + return _react.default.createElement("div", { + className: classNames.join(' '), + style: styles + }); + } + render() { + return _react.default.createElement(_griddleReact.default, this.getTableProps()); + } +} +exports.Component = TableView; +TableView.defaultProps = _Gallery.galleryViewDefaultProps; +TableView.propTypes = { + ..._Gallery.galleryViewPropTypes, + sort: _propTypes.default.string.isRequired, + VersionedBadge: _propTypes.default.elementType +}; +var _default = exports["default"] = (0, _redux.compose)((0, _Injector.inject)(['VersionedBadge'], VersionedBadge => ({ + VersionedBadge +})))(TableView); + +/***/ }), + +/***/ "./client/src/containers/ThumbnailView/ThumbnailView.js": +/*!**************************************************************!*\ + !*** ./client/src/containers/ThumbnailView/ThumbnailView.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +var _Gallery = __webpack_require__(/*! containers/Gallery/Gallery */ "./client/src/containers/Gallery/Gallery.js"); +var _griddleReact = _interopRequireDefault(__webpack_require__(/*! griddle-react */ "./node_modules/griddle-react/modules/griddle.jsx.js")); +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +class ThumbnailView extends _react.Component { + constructor(props) { + super(props); + this.renderItem = this.renderItem.bind(this); + this.handleSetPage = this.handleSetPage.bind(this); + this.handlePrevPage = this.handlePrevPage.bind(this); + this.handleNextPage = this.handleNextPage.bind(this); + this.handleDrag = this.handleDrag.bind(this); + } + handleDrag(dragging) { + this.props.onEnableDropzone(!dragging); + } + handleSetPage(page) { + this.props.onSetPage(page + 1); + } + handleNextPage() { + const currentPage = this.props.page - 1; + this.handleSetPage(currentPage + 1); + } + handlePrevPage() { + const currentPage = this.props.page - 1; + if (currentPage === 0) { + this.handleSetPage(currentPage); + return; + } + this.handleSetPage(currentPage - 1); + } + folderFilter(file) { + return file.type === 'folder'; + } + fileFilter(file) { + return file.type !== 'folder'; + } + renderPagination() { + if (this.props.totalCount <= this.props.limit) { + return null; + } + const props = { + setPage: this.handleSetPage, + maxPage: Math.ceil(this.props.totalCount / this.props.limit), + next: this.handleNextPage, + nextText: _i18n.default._t('AssetAdmin.NEXT', 'Next'), + previous: this.handlePrevPage, + previousText: _i18n.default._t('AssetAdmin.PREVIOUS', 'Previous'), + currentPage: this.props.page - 1, + useGriddleStyles: false + }; + return _react.default.createElement("div", { + className: "griddle-footer" + }, _react.default.createElement(_griddleReact.default.GridPagination, props)); + } + renderItem(item) { + const { + File, + Folder, + badges, + sectionConfig, + selectedFiles, + selectableItems, + selectableFolders + } = this.props; + const badge = badges.find(badgeItem => badgeItem.id === item.id); + let props = { + sectionConfig, + key: item.key, + selectableKey: item.id, + item, + selectedFiles, + onDrag: this.handleDrag, + badge, + canDrag: this.props.canDrag + }; + if (item.queuedId && !item.id) { + const { + onCancelUpload, + onRemoveErroredUpload + } = this.props; + props = { + ...props, + onCancelUpload, + onRemoveErroredUpload + }; + } else { + const { + onOpenFolder, + onOpenFile + } = this.props; + props = { + ...props, + onActivate: item.type === 'folder' ? onOpenFolder : onOpenFile + }; + } + if (selectableItems && (selectableFolders || item.type !== 'folder')) { + const maxSelected = ![null, 1].includes(this.props.maxFilesSelect) && this.props.selectedFiles.length >= this.props.maxFilesSelect; + const onSelect = this.props.maxFilesSelect === 1 ? props.onActivate : this.props.onSelect; + props = { + ...props, + selectable: true, + onSelect, + maxSelected + }; + } + if (item.type === 'folder') { + const { + onDropFiles + } = this.props; + props = { + ...props, + onDropFiles + }; + return _react.default.createElement(Folder, props); + } + return _react.default.createElement(File, props); + } + render() { + const className = 'gallery__main-view--tile'; + return _react.default.createElement("div", { + className: className + }, _react.default.createElement("div", { + className: "gallery__folders" + }, this.props.files.filter(this.folderFilter).map(this.renderItem)), _react.default.createElement("div", { + className: "gallery__files" + }, this.props.files.filter(this.fileFilter).map(this.renderItem)), this.props.files.length === 0 && !this.props.loading && _react.default.createElement("p", { + className: "gallery__no-item-notice" + }, _i18n.default._t('AssetAdmin.NOITEMSFOUND')), _react.default.createElement("div", { + className: "gallery__load" + }, this.renderPagination())); + } +} +exports.Component = ThumbnailView; +ThumbnailView.defaultProps = _Gallery.galleryViewDefaultProps; +ThumbnailView.propTypes = { + ..._Gallery.galleryViewPropTypes, + File: _propTypes.default.elementType.isRequired, + Folder: _propTypes.default.elementType.isRequired +}; +const injector = (0, _Injector.inject)(['GalleryItemFile', 'GalleryItemFolder'], (GalleryItemFile, GalleryItemFolder) => ({ + File: GalleryItemFile, + Folder: GalleryItemFolder +}), () => 'AssetAdmin.Gallery.ThumbnailView'); +var _default = exports["default"] = injector(ThumbnailView); + +/***/ }), + +/***/ "./client/src/entwine/UploadField/UploadFieldEntwine.js": +/*!**************************************************************!*\ + !*** ./client/src/entwine/UploadField/UploadFieldEntwine.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ "jquery")); +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _client = __webpack_require__(/*! react-dom/client */ "react-dom/client"); +var _schemaFieldValues = __webpack_require__(/*! lib/schemaFieldValues */ "lib/schemaFieldValues"); +var _Injector = __webpack_require__(/*! lib/Injector */ "lib/Injector"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +_jquery.default.entwine('ss', $ => { + $('.js-injector-boot input.entwine-uploadfield').entwine({ + Component: null, + ReactRoot: null, + getContainer() { + let container = this.siblings('.uploadfield-holder')[0]; + if (!container) { + const newContainer = $('
'); + this.before(newContainer); + container = newContainer[0]; + } + return container; + }, + onunmatch() { + this._super(); + const root = this.getReactRoot(); + if (root) { + root.unmount(); + this.setReactRoot(null); + } + }, + onmatch() { + const cmsContent = this.closest('.cms-content').attr('id'); + const context = cmsContent ? { + context: cmsContent + } : {}; + const UploadField = (0, _Injector.loadComponent)('UploadField', context); + this.setComponent(UploadField); + this._super(); + this.hide(); + this.refresh(); + }, + onclick(e) { + e.preventDefault(); + }, + refresh() { + const props = this.getAttributes(); + const form = $(this).closest('form'); + const onChange = () => { + setTimeout(() => { + form.trigger('change'); + }, 0); + }; + const UploadField = this.getComponent(); + let root = this.getReactRoot(); + if (!root) { + root = (0, _client.createRoot)(this.getContainer()); + this.setReactRoot(root); + } + root.render(_react.default.createElement(UploadField, _extends({}, props, { + onChange: onChange, + noHolder: true + }))); + }, + getAttributes() { + const state = $(this).data('state'); + const schema = $(this).data('schema'); + return (0, _schemaFieldValues.schemaMerge)(schema, state); + } + }); +}); + +/***/ }), + +/***/ "./client/src/lib/configShape.js": +/*!***************************************!*\ + !*** ./client/src/lib/configShape.js ***! + \***************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const configShape = _propTypes.default.shape({ + url: _propTypes.default.string, + limit: _propTypes.default.number, + imageRetry: _propTypes.default.shape({ + minRetry: _propTypes.default.number, + maxRetry: _propTypes.default.number, + expiry: _propTypes.default.number + }), + form: _propTypes.default.object, + dropzoneOptions: _propTypes.default.object +}); +var _default = exports["default"] = configShape; + +/***/ }), + +/***/ "./client/src/lib/fileShape.js": +/*!*************************************!*\ + !*** ./client/src/lib/fileShape.js ***! + \*************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "prop-types")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const fileShape = _propTypes.default.shape({ + canEdit: _propTypes.default.bool, + canDelete: _propTypes.default.bool, + canView: _propTypes.default.bool, + exists: _propTypes.default.bool, + type: _propTypes.default.string, + smallThumbnail: _propTypes.default.string, + thumbnail: _propTypes.default.string, + width: _propTypes.default.number, + height: _propTypes.default.number, + category: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string]), + id: _propTypes.default.number, + url: _propTypes.default.string, + title: _propTypes.default.string, + progress: _propTypes.default.number, + visibility: _propTypes.default.string, + hasRestrictedAccess: _propTypes.default.bool, + isTrackedFormUpload: _propTypes.default.bool +}); +var _default = exports["default"] = fileShape; + +/***/ }), + +/***/ "./client/src/lib/fileStructure.js": +/*!*****************************************!*\ + !*** ./client/src/lib/fileStructure.js ***! + \*****************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _deepFreezeStrict = _interopRequireDefault(__webpack_require__(/*! deep-freeze-strict */ "deep-freeze-strict")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const fileStructure = (0, _deepFreezeStrict.default)({ + name: null, + canDelete: false, + canEdit: false, + category: null, + created: null, + extension: null, + filename: null, + id: 0, + lastEdited: null, + messages: null, + owner: { + id: 0, + title: null + }, + parent: { + filename: null, + id: 0, + title: null + }, + queuedId: null, + size: null, + title: null, + type: null, + url: null, + xhr: null, + thumbnail: null, + smallThumbnail: null, + height: null, + width: null +}); +var _default = exports["default"] = fileStructure; + +/***/ }), + +/***/ "./client/src/lib/getFormSchema.js": +/*!*****************************************!*\ + !*** ./client/src/lib/getFormSchema.js ***! + \*****************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getFormSchema; +var _index = _interopRequireDefault(__webpack_require__(/*! constants/index */ "./client/src/constants/index.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const { + CREATE_FOLDER, + EDIT_FILE +} = _index.default.ACTIONS; +function getFormSchema(_ref) { + let { + config: { + form + }, + viewAction, + folderId, + fileId, + type + } = _ref; + let schemaUrl = null; + let targetId = null; + if (viewAction === CREATE_FOLDER) { + schemaUrl = form.folderCreateForm.schemaUrl; + targetId = folderId; + return { + schemaUrl, + targetId + }; + } + if (viewAction === EDIT_FILE && fileId) { + switch (type) { + case 'insert-media': + schemaUrl = form.fileInsertForm.schemaUrl; + break; + case 'insert-link': + schemaUrl = form.fileEditorLinkForm.schemaUrl; + break; + case 'select': + schemaUrl = form.fileSelectForm.schemaUrl; + break; + case 'admin': + default: + schemaUrl = form.fileEditForm.schemaUrl; + break; + } + targetId = fileId; + return { + schemaUrl, + targetId + }; + } + return {}; +} + +/***/ }), + +/***/ "./client/src/lib/getStatusCodeMessage.js": +/*!************************************************!*\ + !*** ./client/src/lib/getStatusCodeMessage.js ***! + \************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getStatusCodeMessage; +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function getStatusCodeMessage(statusCode, xhr) { + if (statusCode === 413) { + return _i18n.default._t('AssetAdmin.ERROR_FILE_SIZE', 'File size limit exceeded'); + } + if (statusCode === 403) { + if (xhr && typeof xhr.response === 'string') { + return xhr.response; + } + } + return _i18n.default._t('AssetAdmin.ERROR_DEFAULT', 'Something went wrong, please try again'); +} + +/***/ }), + +/***/ "./client/src/state/confirmDeletion/ConfirmDeletionActionTypes.js": +/*!************************************************************************!*\ + !*** ./client/src/state/confirmDeletion/ConfirmDeletionActionTypes.js ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + CONFIRM_DELETION_ASK: 'CONFIRM_DELETION_ASK', + CONFIRM_DELETION_CONFIRM: 'CONFIRM_DELETION_CONFIRM', + CONFIRM_DELETION_CANCEL: 'CONFIRM_DELETION_CANCEL', + CONFIRM_DELETION_RESET: 'CONFIRM_DELETION_RESET', + CONFIRM_DELETION_MODAL_CLOSE: 'CONFIRM_DELETION_MODAL_CLOSE' +}; + +/***/ }), + +/***/ "./client/src/state/confirmDeletion/ConfirmDeletionActions.js": +/*!********************************************************************!*\ + !*** ./client/src/state/confirmDeletion/ConfirmDeletionActions.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.cancel = cancel; +exports.confirm = confirm; +exports.deleting = deleting; +exports.modalClose = modalClose; +exports.reset = reset; +var _ConfirmDeletionActionTypes = _interopRequireDefault(__webpack_require__(/*! ./ConfirmDeletionActionTypes */ "./client/src/state/confirmDeletion/ConfirmDeletionActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function confirm(files) { + return { + type: _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_ASK, + payload: { + files + } + }; +} +function deleting() { + return { + type: _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_CONFIRM, + payload: {} + }; +} +function cancel() { + return { + type: _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_CANCEL, + payload: {} + }; +} +function reset() { + return { + type: _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_RESET, + payload: {} + }; +} +function modalClose() { + return { + type: _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_MODAL_CLOSE, + payload: {} + }; +} + +/***/ }), + +/***/ "./client/src/state/confirmDeletion/ConfirmDeletionReducer.js": +/*!********************************************************************!*\ + !*** ./client/src/state/confirmDeletion/ConfirmDeletionReducer.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.initialState = exports["default"] = void 0; +var _ConfirmDeletionActionTypes = _interopRequireDefault(__webpack_require__(/*! ./ConfirmDeletionActionTypes */ "./client/src/state/confirmDeletion/ConfirmDeletionActionTypes.js")); +var TRANSITIONS = _interopRequireWildcard(__webpack_require__(/*! ./ConfirmDeletionTransitions */ "./client/src/state/confirmDeletion/ConfirmDeletionTransitions.js")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const initialState = exports.initialState = { + showConfirmation: false, + files: [], + transition: TRANSITIONS.NO_TRANSITION +}; +function confirmDeletionReducer() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; + let action = arguments.length > 1 ? arguments[1] : undefined; + switch (action.type) { + case _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_ASK: + return { + ...initialState, + showConfirmation: true, + files: action.payload.files + }; + case _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_CANCEL: + if (state.showConfirmation) { + return { + ...state, + transition: TRANSITIONS.CANCELING + }; + } + break; + case _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_CONFIRM: + if (state.showConfirmation) { + return { + ...state, + transition: TRANSITIONS.DELETING + }; + } + break; + case _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_MODAL_CLOSE: + return { + ...state, + showConfirmation: false, + transition: TRANSITIONS.NO_TRANSITION + }; + case _ConfirmDeletionActionTypes.default.CONFIRM_DELETION_RESET: + return initialState; + default: + } + return state; +} +var _default = exports["default"] = confirmDeletionReducer; + +/***/ }), + +/***/ "./client/src/state/confirmDeletion/ConfirmDeletionTransitions.js": +/*!************************************************************************!*\ + !*** ./client/src/state/confirmDeletion/ConfirmDeletionTransitions.js ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.NO_TRANSITION = exports.DELETING = exports.CANCELING = void 0; +const NO_TRANSITION = exports.NO_TRANSITION = false; +const CANCELING = exports.CANCELING = 'canceling'; +const DELETING = exports.DELETING = 'deleting'; + +/***/ }), + +/***/ "./client/src/state/displaySearch/DisplaySearchActionTypes.js": +/*!********************************************************************!*\ + !*** ./client/src/state/displaySearch/DisplaySearchActionTypes.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + TOGGLE_SEARCH: 'TOGGLE_SEARCH', + OPEN_SEARCH: 'OPEN_SEARCH', + CLOSE_SEARCH: 'CLOSE_SEARCH' +}; + +/***/ }), + +/***/ "./client/src/state/displaySearch/DisplaySearchActions.js": +/*!****************************************************************!*\ + !*** ./client/src/state/displaySearch/DisplaySearchActions.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.closeSearch = closeSearch; +exports.openSearch = openSearch; +exports.toggleSearch = toggleSearch; +var _DisplaySearchActionTypes = _interopRequireDefault(__webpack_require__(/*! ./DisplaySearchActionTypes */ "./client/src/state/displaySearch/DisplaySearchActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function toggleSearch() { + return { + type: _DisplaySearchActionTypes.default.TOGGLE_SEARCH, + payload: null + }; +} +function openSearch() { + return { + type: _DisplaySearchActionTypes.default.OPEN_SEARCH, + payload: null + }; +} +function closeSearch() { + return { + type: _DisplaySearchActionTypes.default.CLOSE_SEARCH, + payload: null + }; +} + +/***/ }), + +/***/ "./client/src/state/displaySearch/DisplaySearchReducer.js": +/*!****************************************************************!*\ + !*** ./client/src/state/displaySearch/DisplaySearchReducer.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _deepFreezeStrict = _interopRequireDefault(__webpack_require__(/*! deep-freeze-strict */ "deep-freeze-strict")); +var _DisplaySearchActionTypes = _interopRequireDefault(__webpack_require__(/*! ./DisplaySearchActionTypes */ "./client/src/state/displaySearch/DisplaySearchActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const initialState = { + isOpen: false +}; +function reducer() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; + let action = arguments.length > 1 ? arguments[1] : undefined; + switch (action.type) { + case _DisplaySearchActionTypes.default.TOGGLE_SEARCH: + { + return (0, _deepFreezeStrict.default)({ + ...state, + isOpen: !state.isOpen + }); + } + case _DisplaySearchActionTypes.default.OPEN_SEARCH: + { + return (0, _deepFreezeStrict.default)({ + ...state, + isOpen: true + }); + } + case _DisplaySearchActionTypes.default.CLOSE_SEARCH: + { + return (0, _deepFreezeStrict.default)({ + ...state, + isOpen: false + }); + } + default: + { + return state; + } + } +} +var _default = exports["default"] = reducer; + +/***/ }), + +/***/ "./client/src/state/gallery/GalleryActionTypes.js": +/*!********************************************************!*\ + !*** ./client/src/state/gallery/GalleryActionTypes.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = ['SET_LAST_SELECTED', 'SET_SELECTED_FILES', 'DESELECT_FILES', 'SELECT_FILES', 'LOAD_FILE_REQUEST', 'LOAD_FILE_SUCCESS', 'HIGHLIGHT_FILES', 'UPDATE_BATCH_ACTIONS', 'SET_NOTICE_MESSAGE', 'SET_ERROR_MESSAGE', 'SET_ENABLE_DROPZONE', 'SET_FILE_BADGE', 'CLEAR_FILE_BADGE', 'ACTIVATE_MODAL', 'DEACTIVATE_MODAL', 'CONCATENATE_SELECT', 'SET_LOADING'].reduce((obj, item) => Object.assign(obj, { + [item]: `GALLERY.${item}` +}), {}); + +/***/ }), + +/***/ "./client/src/state/gallery/GalleryActions.js": +/*!****************************************************!*\ + !*** ./client/src/state/gallery/GalleryActions.js ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.activateModal = activateModal; +exports.clearFileBadge = clearFileBadge; +exports.deactivateModal = deactivateModal; +exports.deselectFiles = deselectFiles; +exports.loadFile = loadFile; +exports.selectFiles = selectFiles; +exports.setConcatenateSelect = setConcatenateSelect; +exports.setEnableDropzone = setEnableDropzone; +exports.setErrorMessage = setErrorMessage; +exports.setFileBadge = setFileBadge; +exports.setLastSelected = setLastSelected; +exports.setLoading = setLoading; +exports.setNoticeMessage = setNoticeMessage; +exports.setSelectedFiles = setSelectedFiles; +var _GalleryActionTypes = _interopRequireDefault(__webpack_require__(/*! ./GalleryActionTypes */ "./client/src/state/gallery/GalleryActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function setLastSelected(id) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.SET_LAST_SELECTED, + payload: { + id + } + }); + }; +} +function setSelectedFiles(files) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.SET_SELECTED_FILES, + payload: { + files + } + }); + }; +} +function loadFile(id, file) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.LOAD_FILE_SUCCESS, + payload: { + id, + file + } + }); + }; +} +function selectFiles() { + let ids = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + return dispatch => dispatch({ + type: _GalleryActionTypes.default.SELECT_FILES, + payload: { + ids + } + }); +} +function setConcatenateSelect(concat) { + return dispatch => dispatch({ + type: _GalleryActionTypes.default.CONCATENATE_SELECT, + payload: !!concat + }); +} +function deselectFiles() { + let ids = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + return dispatch => dispatch({ + type: _GalleryActionTypes.default.DESELECT_FILES, + payload: { + ids + } + }); +} +function setNoticeMessage(message) { + return dispatch => dispatch({ + type: _GalleryActionTypes.default.SET_NOTICE_MESSAGE, + payload: { + message + } + }); +} +function setErrorMessage(message) { + return dispatch => dispatch({ + type: _GalleryActionTypes.default.SET_ERROR_MESSAGE, + payload: { + message + } + }); +} +function setEnableDropzone(enableDropzone) { + return dispatch => dispatch({ + type: _GalleryActionTypes.default.SET_ENABLE_DROPZONE, + payload: { + enableDropzone + } + }); +} +function clearFileBadge(id) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.CLEAR_FILE_BADGE, + payload: { + id + } + }); + }; +} +function setFileBadge(id, message, status, duration) { + return (dispatch, getState) => { + const { + assetAdmin + } = getState(); + const badge = assetAdmin.gallery.badges.find(item => item.id === id); + if (badge && badge.timer) { + clearTimeout(badge.timer); + } + const timer = duration > 0 ? setTimeout(() => clearFileBadge(id)(dispatch), duration) : null; + dispatch({ + type: _GalleryActionTypes.default.SET_FILE_BADGE, + payload: { + id, + message, + status, + timer + } + }); + }; +} +function activateModal(name) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.ACTIVATE_MODAL, + payload: name + }); + }; +} +function deactivateModal() { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.DEACTIVATE_MODAL + }); + }; +} +function setLoading(active) { + return dispatch => { + dispatch({ + type: _GalleryActionTypes.default.SET_LOADING, + payload: !!active + }); + }; +} + +/***/ }), + +/***/ "./client/src/state/gallery/GalleryReducer.js": +/*!****************************************************!*\ + !*** ./client/src/state/gallery/GalleryReducer.js ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = galleryReducer; +var _deepFreezeStrict = _interopRequireDefault(__webpack_require__(/*! deep-freeze-strict */ "deep-freeze-strict")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _GalleryActionTypes = _interopRequireDefault(__webpack_require__(/*! ./GalleryActionTypes */ "./client/src/state/gallery/GalleryActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const initialState = { + selectedFiles: [], + errorMessage: null, + noticeMessage: null, + enableDropzone: true, + modal: null, + badges: [], + concatenateSelect: false, + loading: false, + sorters: [{ + field: 'title', + direction: 'asc', + label: _i18n.default._t('AssetAdmin.FILTER_TITLE_ASC', 'title a-z') + }, { + field: 'title', + direction: 'desc', + label: _i18n.default._t('AssetAdmin.FILTER_TITLE_DESC', 'title z-a') + }, { + field: 'lastEdited', + direction: 'desc', + label: _i18n.default._t('AssetAdmin.FILTER_DATE_DESC', 'newest') + }, { + field: 'lastEdited', + direction: 'asc', + label: _i18n.default._t('AssetAdmin.FILTER_DATE_ASC', 'oldest') + }], + lastSelected: null +}; +function galleryReducer() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; + let { + type, + payload + } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + switch (type) { + case _GalleryActionTypes.default.SET_LAST_SELECTED: + { + return { + ...state, + lastSelected: payload.id + }; + } + case _GalleryActionTypes.default.SET_FILE_BADGE: + { + return { + ...state, + badges: state.badges.filter(badge => badge.id !== payload.id).concat([payload]) + }; + } + case _GalleryActionTypes.default.CLEAR_FILE_BADGE: + { + return { + ...state, + badges: state.badges.filter(badge => badge.id !== payload.id) + }; + } + case _GalleryActionTypes.default.SET_ENABLE_DROPZONE: + { + return { + ...state, + enableDropzone: payload.enableDropzone + }; + } + case _GalleryActionTypes.default.SET_NOTICE_MESSAGE: + { + return { + ...state, + noticeMessage: payload.message + }; + } + case _GalleryActionTypes.default.SET_ERROR_MESSAGE: + { + return { + ...state, + errorMessage: payload.message + }; + } + case _GalleryActionTypes.default.LOAD_FILE_SUCCESS: + { + const oldFile = state.files.find(file => file.id === payload.id); + if (oldFile) { + const updatedFile = { + ...oldFile, + ...payload.file + }; + return (0, _deepFreezeStrict.default)({ + ...state, + files: state.files.map(file => file.id === updatedFile.id ? updatedFile : file) + }); + } else if (state.folder.id === payload.id) { + return (0, _deepFreezeStrict.default)({ + ...state, + folder: { + ...state.folder, + ...payload.file + } + }); + } + return state; + } + case _GalleryActionTypes.default.SET_SELECTED_FILES: + { + return (0, _deepFreezeStrict.default)({ + ...state, + selectedFiles: Array.isArray(payload.files) ? payload.files : [] + }); + } + case _GalleryActionTypes.default.SELECT_FILES: + { + let selectedFiles = null; + if (payload.ids === null) { + selectedFiles = state.files.map(file => file.id); + } else { + selectedFiles = state.selectedFiles.concat(payload.ids.filter(id => state.selectedFiles.indexOf(id) === -1)); + } + return (0, _deepFreezeStrict.default)({ + ...state, + selectedFiles + }); + } + case _GalleryActionTypes.default.DESELECT_FILES: + { + let selectedFiles = null; + if (payload.ids === null) { + selectedFiles = []; + } else { + selectedFiles = state.selectedFiles.filter(id => payload.ids.indexOf(id) === -1); + } + return (0, _deepFreezeStrict.default)({ + ...state, + selectedFiles + }); + } + case _GalleryActionTypes.default.ACTIVATE_MODAL: + { + return (0, _deepFreezeStrict.default)({ + ...state, + modal: payload + }); + } + case _GalleryActionTypes.default.DEACTIVATE_MODAL: + { + return (0, _deepFreezeStrict.default)({ + ...state, + modal: null + }); + } + case _GalleryActionTypes.default.CONCATENATE_SELECT: + { + return (0, _deepFreezeStrict.default)({ + ...state, + concatenateSelect: payload + }); + } + case _GalleryActionTypes.default.SET_LOADING: + { + return (0, _deepFreezeStrict.default)({ + ...state, + loading: payload + }); + } + default: + return state; + } +} + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadActionHandler.js": +/*!**************************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadActionHandler.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.defaultImageFactory = exports["default"] = void 0; +var _ImageLoadStatus = _interopRequireDefault(__webpack_require__(/*! ./ImageLoadStatus */ "./client/src/state/imageLoad/ImageLoadStatus.js")); +var _ImageLoadLocker = _interopRequireDefault(__webpack_require__(/*! ./ImageLoadLocker */ "./client/src/state/imageLoad/ImageLoadLocker.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const defaultOptions = { + minRetry: 0, + maxRetry: 0, + expiry: 0, + onStatusChange: () => null, + onRetry: () => null, + onReset: () => null, + onTimeout: () => null +}; +const defaultImageFactory = (url, resolve, reject) => { + const img = new Image(); + img.onload = resolve; + img.onerror = reject; + img.src = url; +}; +exports.defaultImageFactory = defaultImageFactory; +class ImageLoadActionHandler { + constructor(options) { + let factory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultImageFactory; + this.options = { + ...defaultOptions, + ...options + }; + this.factory = factory; + } + loadImage(url) { + if (!this.options.minRetry) { + return null; + } + if (!_ImageLoadLocker.default.lock(url)) { + return null; + } + return this.loadImageLoop(url, this.options.minRetry); + } + loadImageLoop(url, retryAfter) { + this.options.onStatusChange(url, _ImageLoadStatus.default.LOADING); + return new Promise((resolve, reject) => this.factory(url, resolve, reject)).then(() => this.handleSuccess(url)).catch(() => this.handleError(url, retryAfter)); + } + handleReset(url, resolve) { + this.options.onReset(url); + resolve(); + } + handleTimeout(callback, delay) { + const id = setTimeout(callback, delay); + this.options.onTimeout(id, delay); + return id; + } + handleSuccess(url) { + _ImageLoadLocker.default.unlock(url); + this.options.onStatusChange(url, _ImageLoadStatus.default.SUCCESS); + } + handleFailure(url) { + _ImageLoadLocker.default.unlock(url); + this.options.onStatusChange(url, _ImageLoadStatus.default.FAILED); + if (this.options.expiry) { + return new Promise(resolve => { + this.handleTimeout(() => this.handleReset(url, resolve), this.options.expiry * 1000); + }); + } + return null; + } + handleError(url, retryAfter) { + if (retryAfter > this.options.maxRetry) { + return this.handleFailure(url); + } + this.options.onStatusChange(url, _ImageLoadStatus.default.WAITING); + return this.handleRetry(url, retryAfter); + } + handleRetry(url, retryAfter) { + const promise = new Promise(resolve => { + this.handleTimeout(() => resolve(this.loadImageLoop(url, retryAfter * 2)), retryAfter * 1000); + }); + this.options.onRetry(url, retryAfter, promise); + return promise; + } + setOnRetry(callback) { + this.options.onRetry = callback; + } + setOnReset(callback) { + this.options.onReset = callback; + } + setOnStatusChange(callback) { + this.options.onStatusChange = callback; + } + setOnTimeout(callback) { + this.options.onTimeout = callback; + } +} +var _default = exports["default"] = ImageLoadActionHandler; + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadActionTypes.js": +/*!************************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadActionTypes.js ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + SET_STATUS: 'IMAGE_LOAD_SET_STATUS', + RESET: 'IMAGE_LOAD_RESET' +}; + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadActions.js": +/*!********************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadActions.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.loadImage = loadImage; +var _ImageLoadActionTypes = _interopRequireDefault(__webpack_require__(/*! ./ImageLoadActionTypes */ "./client/src/state/imageLoad/ImageLoadActionTypes.js")); +var _ImageLoadActionHandler = _interopRequireDefault(__webpack_require__(/*! ./ImageLoadActionHandler */ "./client/src/state/imageLoad/ImageLoadActionHandler.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function loadImage(url, options) { + return (dispatch, getState) => { + if (!url) { + return null; + } + const state = getState(); + const currentFile = state.assetAdmin.imageLoad.files.find(file => file.url === url); + if (currentFile) { + return null; + } + const loadOptions = { + ...options, + onStatusChange: (statusURL, status) => dispatch({ + type: _ImageLoadActionTypes.default.SET_STATUS, + payload: { + status, + url: statusURL + } + }), + onReset: statusURL => dispatch({ + type: _ImageLoadActionTypes.default.RESET, + payload: { + url: statusURL + } + }) + }; + const handler = new _ImageLoadActionHandler.default(loadOptions); + return handler.loadImage(url); + }; +} + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadLocker.js": +/*!*******************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadLocker.js ***! + \*******************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.Component = void 0; +class ImageLoadLocker { + constructor() { + this.urls = []; + } + lock(url) { + const index = this.urls.indexOf(url); + if (index >= 0) { + return false; + } + this.urls = [...this.urls, url]; + return true; + } + unlock(url) { + this.urls = this.urls.filter(next => next !== url); + } +} +exports.Component = ImageLoadLocker; +window.ss = window.ss || {}; +window.ss.imagelocker = window.ss.imagelocker || new ImageLoadLocker(); +var _default = exports["default"] = window.ss.imagelocker; + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadReducer.js": +/*!********************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadReducer.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = imageLoadReducer; +var _ImageLoadActionTypes = _interopRequireDefault(__webpack_require__(/*! ./ImageLoadActionTypes */ "./client/src/state/imageLoad/ImageLoadActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const initialState = { + files: [] +}; +function imageLoadReducer() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; + let { + type, + payload + } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + switch (type) { + case _ImageLoadActionTypes.default.SET_STATUS: + { + return { + ...state, + files: [...state.files.filter(file => file.url !== payload.url), payload] + }; + } + case _ImageLoadActionTypes.default.RESET: + { + return { + ...state, + files: [...state.files.filter(file => file.url !== payload.url)] + }; + } + default: + return state; + } +} + +/***/ }), + +/***/ "./client/src/state/imageLoad/ImageLoadStatus.js": +/*!*******************************************************!*\ + !*** ./client/src/state/imageLoad/ImageLoadStatus.js ***! + \*******************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + DISABLED: 'DISABLED', + NONE: 'NONE', + SUCCESS: 'SUCCESS', + LOADING: 'LOADING', + WAITING: 'WAITING', + FAILED: 'FAILED' +}; + +/***/ }), + +/***/ "./client/src/state/modal/ModalActionTypes.js": +/*!****************************************************!*\ + !*** ./client/src/state/modal/ModalActionTypes.js ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + DEFINE_IMAGE_SIZE_PRESETS: 'DEFINE_IMAGE_SIZE_PRESETS', + INIT_FORM_SCHEMA_STACK: 'INIT_FORM_SCHEMA_STACK', + POP_FORM_SCHEMA: 'POP_FORM_SCHEMA', + PUSH_FORM_SCHEMA: 'PUSH_FORM_SCHEMA', + RESET: 'RESET', + RESET_FORM_STACK: 'RESET_FORM_STACK' +}; + +/***/ }), + +/***/ "./client/src/state/modal/ModalActions.js": +/*!************************************************!*\ + !*** ./client/src/state/modal/ModalActions.js ***! + \************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.defineImageSizePresets = defineImageSizePresets; +exports.initFormStack = initFormStack; +exports.popFormStackEntry = popFormStackEntry; +exports.pushFormStackEntry = pushFormStackEntry; +exports.reset = reset; +exports.resetFormStack = resetFormStack; +exports.stashFormValues = stashFormValues; +var _getIn = _interopRequireDefault(__webpack_require__(/*! redux-form/lib/structure/plain/getIn */ "./node_modules/redux-form/lib/structure/plain/getIn.js")); +var _SchemaActions = __webpack_require__(/*! state/schema/SchemaActions */ "state/schema/SchemaActions"); +var _ModalActionTypes = _interopRequireDefault(__webpack_require__(/*! ./ModalActionTypes */ "./client/src/state/modal/ModalActionTypes.js")); +var _helpers = _interopRequireDefault(__webpack_require__(/*! ./helpers */ "./client/src/state/modal/helpers.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function defineImageSizePresets(imageSizePresets) { + return { + type: _ModalActionTypes.default.DEFINE_IMAGE_SIZE_PRESETS, + payload: { + imageSizePresets + } + }; +} +function stashFormValues(formIdentifier, schemaUrl) { + return (dispatch, getState) => { + const state = getState(); + const values = (0, _getIn.default)(state.form.formState, `${formIdentifier}.values`); + const fieldSchema = (0, _getIn.default)(state.form.formSchemas, `${schemaUrl}.schema.fields`); + if (values) { + const fields = Object.keys(values).filter(name => values[name] !== null && (0, _helpers.default)(name, fieldSchema)).map(name => ({ + name, + value: values[name] + })); + dispatch((0, _SchemaActions.setSchemaStateOverrides)(schemaUrl, { + fields + })); + } + }; +} +function pushFormStackEntry(type) { + let nextType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + return { + type: _ModalActionTypes.default.PUSH_FORM_SCHEMA, + payload: { + formSchema: { + type, + nextType + } + } + }; +} +function initFormStack(type) { + let nextType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + return { + type: _ModalActionTypes.default.INIT_FORM_SCHEMA_STACK, + payload: { + formSchema: { + type, + nextType + } + } + }; +} +function popFormStackEntry() { + return { + type: _ModalActionTypes.default.POP_FORM_SCHEMA + }; +} +function reset() { + return { + type: _ModalActionTypes.default.RESET + }; +} +function resetFormStack() { + return { + type: _ModalActionTypes.default.RESET_FORM_STACK + }; +} + +/***/ }), + +/***/ "./client/src/state/modal/ModalReducer.js": +/*!************************************************!*\ + !*** ./client/src/state/modal/ModalReducer.js ***! + \************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.initialState = exports["default"] = void 0; +var _ModalActionTypes = _interopRequireDefault(__webpack_require__(/*! ./ModalActionTypes */ "./client/src/state/modal/ModalActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const initialState = exports.initialState = { + imageSizePresets: [], + formSchemaStack: [], + formSchema: undefined +}; +function modalReducer() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; + let { + type, + payload + } = arguments.length > 1 ? arguments[1] : undefined; + const { + formSchemaStack: stack + } = state; + switch (type) { + case _ModalActionTypes.default.DEFINE_IMAGE_SIZE_PRESETS: + return { + ...state, + imageSizePresets: payload.imageSizePresets + }; + case _ModalActionTypes.default.PUSH_FORM_SCHEMA: + return { + ...state, + formSchemaStack: [...stack, payload.formSchema] + }; + case _ModalActionTypes.default.INIT_FORM_SCHEMA_STACK: + return { + ...state, + formSchemaStack: [payload.formSchema] + }; + case _ModalActionTypes.default.POP_FORM_SCHEMA: + return { + ...state, + formSchemaStack: stack.slice(0, -1) + }; + case _ModalActionTypes.default.RESET: + return initialState; + case _ModalActionTypes.default.RESET_FORM_STACK: + return { + ...state, + formSchemaStack: stack.slice(0, 1) + }; + default: + return state; + } +} +const popFormSchemaStackWrapper = state => ({ + ...state, + formSchema: state.formSchemaStack.slice(-1).pop() +}); +var _default = exports["default"] = function _default() { + return popFormSchemaStackWrapper(modalReducer(...arguments)); +}; + +/***/ }), + +/***/ "./client/src/state/modal/helpers.js": +/*!*******************************************!*\ + !*** ./client/src/state/modal/helpers.js ***! + \*******************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isStashableField; +exports.findField = findField; +function findField(fieldName, fieldTree) { + let i; + for (i = 0; i < fieldTree.length; i++) { + const field = fieldTree[i]; + if (field.name === fieldName) { + return field; + } + if (field.children) { + const child = findField(fieldName, field.children); + if (child) { + return child; + } + } + } + return false; +} +function isStashableField(fieldName, fieldTree) { + const field = findField(fieldName, fieldTree); + return field && field.type !== 'hidden' && field.schemaType !== 'Structural' && !field.readOnly && !field.disabled; +} + +/***/ }), + +/***/ "./client/src/state/previewField/PreviewFieldActionTypes.js": +/*!******************************************************************!*\ + !*** ./client/src/state/previewField/PreviewFieldActionTypes.js ***! + \******************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + PREVIEWFIELD_ADD_FILE: 'PREVIEWFIELD_ADD_FILE', + PREVIEWFIELD_REMOVE_FILE: 'PREVIEWFIELD_REMOVE_FILE', + PREVIEWFIELD_UPDATE_FILE: 'PREVIEWFIELD_UPDATE_FILE', + PREVIEWFIELD_FAIL_UPLOAD: 'PREVIEWFIELD_FAIL_UPLOAD', + PREVIEWFIELD_UPDATE_STATUS: 'PREVIEWFIELD_UPDATE_STATUS' +}; + +/***/ }), + +/***/ "./client/src/state/previewField/PreviewFieldActions.js": +/*!**************************************************************!*\ + !*** ./client/src/state/previewField/PreviewFieldActions.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.addFile = addFile; +exports.failUpload = failUpload; +exports.removeFile = removeFile; +exports.updateFile = updateFile; +exports.updateStatus = updateStatus; +var _PreviewFieldActionTypes = _interopRequireDefault(__webpack_require__(/*! ./PreviewFieldActionTypes */ "./client/src/state/previewField/PreviewFieldActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function removeFile(id) { + return { + type: _PreviewFieldActionTypes.default.PREVIEWFIELD_REMOVE_FILE, + payload: { + id + } + }; +} +function addFile(id, file) { + return { + type: _PreviewFieldActionTypes.default.PREVIEWFIELD_ADD_FILE, + payload: { + id, + file + } + }; +} +function failUpload(id, message) { + return { + type: _PreviewFieldActionTypes.default.PREVIEWFIELD_FAIL_UPLOAD, + payload: { + id, + message + } + }; +} +function updateFile(id, data) { + return { + type: _PreviewFieldActionTypes.default.PREVIEWFIELD_UPDATE_FILE, + payload: { + id, + data + } + }; +} +function updateStatus(id, status) { + return { + type: _PreviewFieldActionTypes.default.PREVIEWFIELD_UPDATE_STATUS, + payload: { + id, + status + } + }; +} + +/***/ }), + +/***/ "./client/src/state/previewField/PreviewFieldReducer.js": +/*!**************************************************************!*\ + !*** ./client/src/state/previewField/PreviewFieldReducer.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _deepFreezeStrict = _interopRequireDefault(__webpack_require__(/*! deep-freeze-strict */ "deep-freeze-strict")); +var _PreviewFieldActionTypes = _interopRequireDefault(__webpack_require__(/*! ./PreviewFieldActionTypes */ "./client/src/state/previewField/PreviewFieldActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const initialState = {}; +function previewFieldReducer() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; + let action = arguments.length > 1 ? arguments[1] : undefined; + switch (action.type) { + case _PreviewFieldActionTypes.default.PREVIEWFIELD_ADD_FILE: + { + return (0, _deepFreezeStrict.default)(Object.assign({}, state, { + [action.payload.id]: action.payload.file + })); + } + case _PreviewFieldActionTypes.default.PREVIEWFIELD_FAIL_UPLOAD: + { + return (0, _deepFreezeStrict.default)(Object.assign({}, state, { + [action.payload.id]: Object.assign({}, state[action.payload.id], action.payload.message) + })); + } + case _PreviewFieldActionTypes.default.PREVIEWFIELD_REMOVE_FILE: + { + return (0, _deepFreezeStrict.default)(Object.assign({}, state, { + [action.payload.id]: undefined + })); + } + case _PreviewFieldActionTypes.default.PREVIEWFIELD_UPDATE_FILE: + { + return (0, _deepFreezeStrict.default)(Object.assign({}, state, { + [action.payload.id]: Object.assign({}, state[action.payload.id], action.payload.data) + })); + } + case _PreviewFieldActionTypes.default.PREVIEWFIELD_UPDATE_STATUS: + { + return (0, _deepFreezeStrict.default)(Object.assign({}, state, { + [action.payload.id]: Object.assign({}, state[action.payload.id], action.payload.status) + })); + } + default: + return state; + } +} +var _default = exports["default"] = previewFieldReducer; + +/***/ }), + +/***/ "./client/src/state/queuedFiles/QueuedFilesActionTypes.js": +/*!****************************************************************!*\ + !*** ./client/src/state/queuedFiles/QueuedFilesActionTypes.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + ADD_QUEUED_FILE: 'ADD_QUEUED_FILE', + FAIL_UPLOAD: 'FAIL_UPLOAD', + PURGE_UPLOAD_QUEUE: 'PURGE_UPLOAD_QUEUE', + REMOVE_QUEUED_FILE: 'REMOVE_QUEUED_FILE', + SUCCEED_UPLOAD: 'SUCCEED_UPLOAD', + UPDATE_QUEUED_FILE: 'UPDATE_QUEUED_FILE' +}; + +/***/ }), + +/***/ "./client/src/state/queuedFiles/QueuedFilesActions.js": +/*!************************************************************!*\ + !*** ./client/src/state/queuedFiles/QueuedFilesActions.js ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.addQueuedFile = addQueuedFile; +exports.failUpload = failUpload; +exports.purgeUploadQueue = purgeUploadQueue; +exports.removeQueuedFile = removeQueuedFile; +exports.succeedUpload = succeedUpload; +exports.updateQueuedFile = updateQueuedFile; +var _QueuedFilesActionTypes = _interopRequireDefault(__webpack_require__(/*! ./QueuedFilesActionTypes */ "./client/src/state/queuedFiles/QueuedFilesActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function addQueuedFile(file) { + return dispatch => dispatch({ + type: _QueuedFilesActionTypes.default.ADD_QUEUED_FILE, + payload: { + file + } + }); +} +function failUpload(queuedId, response, statusCodeMessage) { + return dispatch => { + let message = response.message; + if (response.errors && response.errors.length) { + message = response.errors[0]; + } + if (typeof response === 'string') { + message = { + value: statusCodeMessage || response, + type: 'error' + }; + } + return dispatch({ + type: _QueuedFilesActionTypes.default.FAIL_UPLOAD, + payload: { + queuedId, + message + } + }); + }; +} +function purgeUploadQueue() { + return dispatch => dispatch({ + type: _QueuedFilesActionTypes.default.PURGE_UPLOAD_QUEUE, + payload: null + }); +} +function removeQueuedFile(queuedId) { + return dispatch => dispatch({ + type: _QueuedFilesActionTypes.default.REMOVE_QUEUED_FILE, + payload: { + queuedId + } + }); +} +function succeedUpload(queuedId, json) { + return dispatch => dispatch({ + type: _QueuedFilesActionTypes.default.SUCCEED_UPLOAD, + payload: { + queuedId, + json + } + }); +} +function updateQueuedFile(queuedId, updates) { + return dispatch => dispatch({ + type: _QueuedFilesActionTypes.default.UPDATE_QUEUED_FILE, + payload: { + queuedId, + updates + } + }); +} + +/***/ }), + +/***/ "./client/src/state/queuedFiles/QueuedFilesReducer.js": +/*!************************************************************!*\ + !*** ./client/src/state/queuedFiles/QueuedFilesReducer.js ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _deepFreezeStrict = _interopRequireDefault(__webpack_require__(/*! deep-freeze-strict */ "deep-freeze-strict")); +var _fileStructure = _interopRequireDefault(__webpack_require__(/*! lib/fileStructure */ "./client/src/lib/fileStructure.js")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +var _QueuedFilesActionTypes = _interopRequireDefault(__webpack_require__(/*! ./QueuedFilesActionTypes */ "./client/src/state/queuedFiles/QueuedFilesActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const initialState = { + items: [] +}; +function queuedFilesReducer() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; + let action = arguments.length > 1 ? arguments[1] : undefined; + switch (action.type) { + case _QueuedFilesActionTypes.default.ADD_QUEUED_FILE: + return (0, _deepFreezeStrict.default)({ + ...state, + items: [...state.items, { + ..._fileStructure.default, + ...action.payload.file + }] + }); + case _QueuedFilesActionTypes.default.FAIL_UPLOAD: + return (0, _deepFreezeStrict.default)({ + ...state, + items: state.items.map(file => { + if (file.queuedId === action.payload.queuedId) { + return { + ...file, + message: action.payload.message + }; + } + return file; + }) + }); + case _QueuedFilesActionTypes.default.PURGE_UPLOAD_QUEUE: + return (0, _deepFreezeStrict.default)({ + ...state, + items: state.items.filter(file => !file.id) + }); + case _QueuedFilesActionTypes.default.REMOVE_QUEUED_FILE: + return (0, _deepFreezeStrict.default)({ + ...state, + items: state.items.filter(file => file.queuedId !== action.payload.queuedId) + }); + case _QueuedFilesActionTypes.default.SUCCEED_UPLOAD: + return (0, _deepFreezeStrict.default)({ + ...state, + items: state.items.map(file => { + if (file.queuedId === action.payload.queuedId) { + return { + ...file, + ...action.payload.json, + messages: [{ + value: _i18n.default._t('AssetAdmin.DROPZONE_SUCCESS_UPLOAD'), + type: 'success', + extraClass: 'success' + }] + }; + } + return file; + }) + }); + case _QueuedFilesActionTypes.default.UPDATE_QUEUED_FILE: + return (0, _deepFreezeStrict.default)({ + ...state, + items: state.items.map(file => { + if (file.queuedId === action.payload.queuedId) { + return { + ...file, + ...action.payload.updates + }; + } + return file; + }) + }); + default: + return state; + } +} +var _default = exports["default"] = queuedFilesReducer; + +/***/ }), + +/***/ "./client/src/state/uploadField/UploadFieldActionTypes.js": +/*!****************************************************************!*\ + !*** ./client/src/state/uploadField/UploadFieldActionTypes.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = exports["default"] = { + UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH: 'UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH', + UPLOADFIELD_ADD_FILE: 'UPLOADFIELD_ADD_FILE', + UPLOADFIELD_SET_FILES: 'UPLOADFIELD_SET_FILES', + UPLOADFIELD_REMOVE_FILE: 'UPLOADFIELD_REMOVE_FILE', + UPLOADFIELD_UPLOAD_FAILURE: 'UPLOADFIELD_UPLOAD_FAILURE', + UPLOADFIELD_UPLOAD_SUCCESS: 'UPLOADFIELD_UPLOAD_SUCCESS', + UPLOADFIELD_UPDATE_QUEUED_FILE: 'UPLOADFIELD_UPDATE_QUEUED_FILE' +}; + +/***/ }), + +/***/ "./client/src/state/uploadField/UploadFieldActions.js": +/*!************************************************************!*\ + !*** ./client/src/state/uploadField/UploadFieldActions.js ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.addFile = addFile; +exports.failUpload = failUpload; +exports.removeFile = removeFile; +exports.setFiles = setFiles; +exports.setFormSchemaFilesHash = setFormSchemaFilesHash; +exports.succeedUpload = succeedUpload; +exports.updateQueuedFile = updateQueuedFile; +var _UploadFieldActionTypes = _interopRequireDefault(__webpack_require__(/*! ./UploadFieldActionTypes */ "./client/src/state/uploadField/UploadFieldActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +function setFormSchemaFilesHash(fieldId, hash) { + return dispatch => dispatch({ + type: _UploadFieldActionTypes.default.UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH, + payload: { + fieldId, + hash + } + }); +} +function addFile(fieldId, file) { + return dispatch => dispatch({ + type: _UploadFieldActionTypes.default.UPLOADFIELD_ADD_FILE, + payload: { + fieldId, + file + } + }); +} +function setFiles(fieldId, files) { + return dispatch => dispatch({ + type: _UploadFieldActionTypes.default.UPLOADFIELD_SET_FILES, + payload: { + fieldId, + files + } + }); +} +function failUpload(fieldId, queuedId, response, statusCodeMessage) { + return dispatch => { + let message = response.message; + if (typeof response === 'string') { + message = { + value: statusCodeMessage || response, + type: 'error' + }; + } + return dispatch({ + type: _UploadFieldActionTypes.default.UPLOADFIELD_UPLOAD_FAILURE, + payload: { + fieldId, + queuedId, + message + } + }); + }; +} +function removeFile(fieldId, file) { + return dispatch => dispatch({ + type: _UploadFieldActionTypes.default.UPLOADFIELD_REMOVE_FILE, + payload: { + fieldId, + file + } + }); +} +function succeedUpload(fieldId, queuedId, json) { + return dispatch => dispatch({ + type: _UploadFieldActionTypes.default.UPLOADFIELD_UPLOAD_SUCCESS, + payload: { + fieldId, + queuedId, + json + } + }); +} +function updateQueuedFile(fieldId, queuedId, updates) { + return dispatch => dispatch({ + type: _UploadFieldActionTypes.default.UPLOADFIELD_UPDATE_QUEUED_FILE, + payload: { + fieldId, + queuedId, + updates + } + }); +} + +/***/ }), + +/***/ "./client/src/state/uploadField/UploadFieldReducer.js": +/*!************************************************************!*\ + !*** ./client/src/state/uploadField/UploadFieldReducer.js ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _fileStructure = _interopRequireDefault(__webpack_require__(/*! lib/fileStructure */ "./client/src/lib/fileStructure.js")); +var _reduxFieldReducer = _interopRequireDefault(__webpack_require__(/*! lib/reduxFieldReducer */ "lib/reduxFieldReducer")); +var _UploadFieldActionTypes = _interopRequireDefault(__webpack_require__(/*! ./UploadFieldActionTypes */ "./client/src/state/uploadField/UploadFieldActionTypes.js")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const initialState = { + fields: {} +}; +const initialFieldState = { + formSchemaFilesHash: null, + files: [] +}; +function uploadFieldReducer() { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; + let action = arguments.length > 1 ? arguments[1] : undefined; + const reduceField = (0, _reduxFieldReducer.default)(state, action, initialFieldState); + switch (action.type) { + case _UploadFieldActionTypes.default.UPLOADFIELD_SET_FORM_SCHEMA_FILES_HASH: + return reduceField(() => ({ + formSchemaFilesHash: action.payload.hash + })); + case _UploadFieldActionTypes.default.UPLOADFIELD_ADD_FILE: + return reduceField(field => { + if (field.files.find(file => file.id === action.payload.file.id)) { + return field; + } + return { + ...field, + files: [...field.files, { + ..._fileStructure.default, + ...action.payload.file + }] + }; + }); + case _UploadFieldActionTypes.default.UPLOADFIELD_SET_FILES: + return reduceField(() => ({ + files: action.payload.files + })); + case _UploadFieldActionTypes.default.UPLOADFIELD_UPLOAD_FAILURE: + return reduceField(field => ({ + files: field.files.map(file => { + if (file.queuedId === action.payload.queuedId) { + return Object.assign({}, file, { + message: action.payload.message + }); + } + return file; + }) + })); + case _UploadFieldActionTypes.default.UPLOADFIELD_REMOVE_FILE: + return reduceField(field => ({ + files: field.files.filter(file => !(action.payload.file.queuedId && file.queuedId === action.payload.file.queuedId || action.payload.file.id && file.id === action.payload.file.id)) + })); + case _UploadFieldActionTypes.default.UPLOADFIELD_UPLOAD_SUCCESS: + return reduceField(field => ({ + files: field.files.map(file => { + if (file.queuedId === action.payload.queuedId) { + return Object.assign({}, file, action.payload.json); + } + return file; + }) + })); + case _UploadFieldActionTypes.default.UPLOADFIELD_UPDATE_QUEUED_FILE: + return reduceField(field => ({ + files: field.files.map(file => { + if (file.queuedId === action.payload.queuedId) { + return Object.assign({}, file, action.payload.updates); + } + return file; + }) + })); + default: + return state; + } +} +var _default = exports["default"] = uploadFieldReducer; + +/***/ }), + +/***/ "./client/src/transforms/FormAction/ownerAwareUnpublish.js": +/*!*****************************************************************!*\ + !*** ./client/src/transforms/FormAction/ownerAwareUnpublish.js ***! + \*****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _i18n = _interopRequireDefault(__webpack_require__(/*! i18n */ "i18n")); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const ownerAwareUnpublish = FormAction => props => { + const originalOnclick = props.onClick; + const newProps = { + ...props, + onClick(e, nameOrID) { + const { + owners + } = props.data; + let message = null; + if (owners && parseInt(owners, 10) > 0) { + message = [_i18n.default.inject(_i18n.default._t('AssetAdmin.SINGLE_OWNED_WARNING_1', 'This file is being used in {count} other published section(s).'), { + count: owners + }), _i18n.default._t('AssetAdmin.SINGLE_OWNED_WARNING_2', 'Ensure files are removed from content areas prior to unpublishing them. Otherwise, they will appear as broken links.'), _i18n.default._t('AssetAdmin.SINGLE_OWNED_WARNING_3', 'Do you want to unpublish this file anyway?')].join('\n\n'); + } else { + message = _i18n.default._t('AssetAdmin.CONFIRMUNPUBLISH', 'Are you sure you want to unpublish this record?'); + } + if (confirm(message)) { + originalOnclick(e, nameOrID); + } else { + e.preventDefault(); + } + } + }; + return _react.default.createElement(FormAction, newProps); +}; +var _default = exports["default"] = ownerAwareUnpublish; + +/***/ }), + +/***/ "./client/src/transforms/TreeDropdownField/moveTreeDropdownField.js": +/*!**************************************************************************!*\ + !*** ./client/src/transforms/TreeDropdownField/moveTreeDropdownField.js ***! + \**************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.disabledTreeDropdownField = exports["default"] = void 0; +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); +var _reactRedux = __webpack_require__(/*! react-redux */ "react-redux"); +var _redux = __webpack_require__(/*! redux */ "redux"); +var _TreeDropdownField = __webpack_require__(/*! components/TreeDropdownField/TreeDropdownField */ "components/TreeDropdownField/TreeDropdownField"); +function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } +const disabledTreeDropdownField = TreeDropdownField => props => { + const { + disabledIDs + } = props; + const find = props.findTreeByPath || _TreeDropdownField.findTreeByPath; + const newProps = { + ...props, + findTreeByPath(tree, visible) { + const visibleTree = find(tree, visible); + const pathDisabled = visible.some(id => disabledIDs.includes(id)); + return visibleTree ? { + ...visibleTree, + children: visibleTree.children.map(child => ({ + ...child, + disabled: pathDisabled || disabledIDs.includes(child.id) + })) + } : null; + } + }; + return _react.default.createElement(TreeDropdownField, newProps); +}; +exports.disabledTreeDropdownField = disabledTreeDropdownField; +const moveTreeDropdownField = (0, _redux.compose)((0, _reactRedux.connect)(state => ({ + disabledIDs: state.assetAdmin.gallery.selectedFiles +})), disabledTreeDropdownField); +var _default = exports["default"] = moveTreeDropdownField; + +/***/ }), + +/***/ "./node_modules/create-react-class/factory.js": +/*!****************************************************!*\ + !*** ./node_modules/create-react-class/factory.js ***! + \****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + + +var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); + +// -- Inlined from fbjs -- + +var emptyObject = {}; + +if (true) { + Object.freeze(emptyObject); +} + +var validateFormat = function validateFormat(format) {}; + +if (true) { + validateFormat = function validateFormat(format) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + }; +} + +function _invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); + + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +} + +var warning = function(){}; + +if (true) { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } + + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +// /-- Inlined from fbjs -- + +var MIXINS_KEY = 'mixins'; + +// Helper function to allow the creation of anonymous functions which do not +// have .name set to the name of the variable being assigned to. +function identity(fn) { + return fn; +} + +var ReactPropTypeLocationNames; +if (true) { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; +} else {} + +function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { + /** + * Policies that describe methods in `ReactClassInterface`. + */ + + var injectedMixins = []; + + /** + * Composite components are higher-level components that compose other composite + * or host components. + * + * To create a new type of `ReactClass`, pass a specification of + * your new class to `React.createClass`. The only requirement of your class + * specification is that you implement a `render` method. + * + * var MyComponent = React.createClass({ + * render: function() { + * return
Hello World
; + * } + * }); + * + * The class specification supports a specific protocol of methods that have + * special meaning (e.g. `render`). See `ReactClassInterface` for + * more the comprehensive protocol. Any other properties and methods in the + * class specification will be available on the prototype. + * + * @interface ReactClassInterface + * @internal + */ + var ReactClassInterface = { + /** + * An array of Mixin objects to include when defining your component. + * + * @type {array} + * @optional + */ + mixins: 'DEFINE_MANY', + + /** + * An object containing properties and methods that should be defined on + * the component's constructor instead of its prototype (static methods). + * + * @type {object} + * @optional + */ + statics: 'DEFINE_MANY', + + /** + * Definition of prop types for this component. + * + * @type {object} + * @optional + */ + propTypes: 'DEFINE_MANY', + + /** + * Definition of context types for this component. + * + * @type {object} + * @optional + */ + contextTypes: 'DEFINE_MANY', + + /** + * Definition of context types this component sets for its children. + * + * @type {object} + * @optional + */ + childContextTypes: 'DEFINE_MANY', + + // ==== Definition methods ==== + + /** + * Invoked when the component is mounted. Values in the mapping will be set on + * `this.props` if that prop is not specified (i.e. using an `in` check). + * + * This method is invoked before `getInitialState` and therefore cannot rely + * on `this.state` or use `this.setState`. + * + * @return {object} + * @optional + */ + getDefaultProps: 'DEFINE_MANY_MERGED', + + /** + * Invoked once before the component is mounted. The return value will be used + * as the initial value of `this.state`. + * + * getInitialState: function() { + * return { + * isOn: false, + * fooBaz: new BazFoo() + * } + * } + * + * @return {object} + * @optional + */ + getInitialState: 'DEFINE_MANY_MERGED', + + /** + * @return {object} + * @optional + */ + getChildContext: 'DEFINE_MANY_MERGED', + + /** + * Uses props from `this.props` and state from `this.state` to render the + * structure of the component. + * + * No guarantees are made about when or how often this method is invoked, so + * it must not have side effects. + * + * render: function() { + * var name = this.props.name; + * return
Hello, {name}!
; + * } + * + * @return {ReactComponent} + * @required + */ + render: 'DEFINE_ONCE', + + // ==== Delegate methods ==== + + /** + * Invoked when the component is initially created and about to be mounted. + * This may have side effects, but any external subscriptions or data created + * by this method must be cleaned up in `componentWillUnmount`. + * + * @optional + */ + componentWillMount: 'DEFINE_MANY', + + /** + * Invoked when the component has been mounted and has a DOM representation. + * However, there is no guarantee that the DOM node is in the document. + * + * Use this as an opportunity to operate on the DOM when the component has + * been mounted (initialized and rendered) for the first time. + * + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidMount: 'DEFINE_MANY', + + /** + * Invoked before the component receives new props. + * + * Use this as an opportunity to react to a prop transition by updating the + * state using `this.setState`. Current props are accessed via `this.props`. + * + * componentWillReceiveProps: function(nextProps, nextContext) { + * this.setState({ + * likesIncreasing: nextProps.likeCount > this.props.likeCount + * }); + * } + * + * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop + * transition may cause a state change, but the opposite is not true. If you + * need it, you are probably looking for `componentWillUpdate`. + * + * @param {object} nextProps + * @optional + */ + componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Invoked while deciding if the component should be updated as a result of + * receiving new props, state and/or context. + * + * Use this as an opportunity to `return false` when you're certain that the + * transition to the new props/state/context will not require a component + * update. + * + * shouldComponentUpdate: function(nextProps, nextState, nextContext) { + * return !equal(nextProps, this.props) || + * !equal(nextState, this.state) || + * !equal(nextContext, this.context); + * } + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @return {boolean} True if the component should update. + * @optional + */ + shouldComponentUpdate: 'DEFINE_ONCE', + + /** + * Invoked when the component is about to update due to a transition from + * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` + * and `nextContext`. + * + * Use this as an opportunity to perform preparation before an update occurs. + * + * NOTE: You **cannot** use `this.setState()` in this method. + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @param {ReactReconcileTransaction} transaction + * @optional + */ + componentWillUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component's DOM representation has been updated. + * + * Use this as an opportunity to operate on the DOM when the component has + * been updated. + * + * @param {object} prevProps + * @param {?object} prevState + * @param {?object} prevContext + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component is about to be removed from its parent and have + * its DOM representation destroyed. + * + * Use this as an opportunity to deallocate any external resources. + * + * NOTE: There is no `componentDidUnmount` since your component will have been + * destroyed by that point. + * + * @optional + */ + componentWillUnmount: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillMount`. + * + * @optional + */ + UNSAFE_componentWillMount: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillReceiveProps`. + * + * @optional + */ + UNSAFE_componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillUpdate`. + * + * @optional + */ + UNSAFE_componentWillUpdate: 'DEFINE_MANY', + + // ==== Advanced methods ==== + + /** + * Updates the component's currently mounted DOM representation. + * + * By default, this implements React's rendering and reconciliation algorithm. + * Sophisticated clients may wish to override this. + * + * @param {ReactReconcileTransaction} transaction + * @internal + * @overridable + */ + updateComponent: 'OVERRIDE_BASE' + }; + + /** + * Similar to ReactClassInterface but for static methods. + */ + var ReactClassStaticInterface = { + /** + * This method is invoked after a component is instantiated and when it + * receives new props. Return an object to update state in response to + * prop changes. Return null to indicate no change to state. + * + * If an object is returned, its keys will be merged into the existing state. + * + * @return {object || null} + * @optional + */ + getDerivedStateFromProps: 'DEFINE_MANY_MERGED' + }; + + /** + * Mapping from class specification keys to special processing functions. + * + * Although these are declared like instance properties in the specification + * when defining classes using `React.createClass`, they are actually static + * and are accessible on the constructor instead of the prototype. Despite + * being static, they must be defined outside of the "statics" key under + * which all other static methods are defined. + */ + var RESERVED_SPEC_KEYS = { + displayName: function(Constructor, displayName) { + Constructor.displayName = displayName; + }, + mixins: function(Constructor, mixins) { + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + mixSpecIntoComponent(Constructor, mixins[i]); + } + } + }, + childContextTypes: function(Constructor, childContextTypes) { + if (true) { + validateTypeDef(Constructor, childContextTypes, 'childContext'); + } + Constructor.childContextTypes = _assign( + {}, + Constructor.childContextTypes, + childContextTypes + ); + }, + contextTypes: function(Constructor, contextTypes) { + if (true) { + validateTypeDef(Constructor, contextTypes, 'context'); + } + Constructor.contextTypes = _assign( + {}, + Constructor.contextTypes, + contextTypes + ); + }, + /** + * Special case getDefaultProps which should move into statics but requires + * automatic merging. + */ + getDefaultProps: function(Constructor, getDefaultProps) { + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps = createMergedResultFunction( + Constructor.getDefaultProps, + getDefaultProps + ); + } else { + Constructor.getDefaultProps = getDefaultProps; + } + }, + propTypes: function(Constructor, propTypes) { + if (true) { + validateTypeDef(Constructor, propTypes, 'prop'); + } + Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); + }, + statics: function(Constructor, statics) { + mixStaticSpecIntoComponent(Constructor, statics); + }, + autobind: function() {} + }; + + function validateTypeDef(Constructor, typeDef, location) { + for (var propName in typeDef) { + if (typeDef.hasOwnProperty(propName)) { + // use a warning instead of an _invariant so components + // don't show up in prod but only in __DEV__ + if (true) { + warning( + typeof typeDef[propName] === 'function', + '%s: %s type `%s` is invalid; it must be a function, usually from ' + + 'React.PropTypes.', + Constructor.displayName || 'ReactClass', + ReactPropTypeLocationNames[location], + propName + ); + } + } + } + } + + function validateMethodOverride(isAlreadyDefined, name) { + var specPolicy = ReactClassInterface.hasOwnProperty(name) + ? ReactClassInterface[name] + : null; + + // Disallow overriding of base class methods unless explicitly allowed. + if (ReactClassMixin.hasOwnProperty(name)) { + _invariant( + specPolicy === 'OVERRIDE_BASE', + 'ReactClassInterface: You are attempting to override ' + + '`%s` from your class specification. Ensure that your method names ' + + 'do not overlap with React methods.', + name + ); + } + + // Disallow defining methods more than once unless explicitly allowed. + if (isAlreadyDefined) { + _invariant( + specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', + 'ReactClassInterface: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be due ' + + 'to a mixin.', + name + ); + } + } + + /** + * Mixin helper which handles policy validation and reserved + * specification keys when building React classes. + */ + function mixSpecIntoComponent(Constructor, spec) { + if (!spec) { + if (true) { + var typeofSpec = typeof spec; + var isMixinValid = typeofSpec === 'object' && spec !== null; + + if (true) { + warning( + isMixinValid, + "%s: You're attempting to include a mixin that is either null " + + 'or not an object. Check the mixins included by the component, ' + + 'as well as any mixins they include themselves. ' + + 'Expected object but got %s.', + Constructor.displayName || 'ReactClass', + spec === null ? null : typeofSpec + ); + } + } + + return; + } + + _invariant( + typeof spec !== 'function', + "ReactClass: You're attempting to " + + 'use a component class or function as a mixin. Instead, just use a ' + + 'regular object.' + ); + _invariant( + !isValidElement(spec), + "ReactClass: You're attempting to " + + 'use a component as a mixin. Instead, just use a regular object.' + ); + + var proto = Constructor.prototype; + var autoBindPairs = proto.__reactAutoBindPairs; + + // By handling mixins before any other properties, we ensure the same + // chaining order is applied to methods with DEFINE_MANY policy, whether + // mixins are listed before or after these methods in the spec. + if (spec.hasOwnProperty(MIXINS_KEY)) { + RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); + } + + for (var name in spec) { + if (!spec.hasOwnProperty(name)) { + continue; + } + + if (name === MIXINS_KEY) { + // We have already handled mixins in a special case above. + continue; + } + + var property = spec[name]; + var isAlreadyDefined = proto.hasOwnProperty(name); + validateMethodOverride(isAlreadyDefined, name); + + if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { + RESERVED_SPEC_KEYS[name](Constructor, property); + } else { + // Setup methods on prototype: + // The following member methods should not be automatically bound: + // 1. Expected ReactClass methods (in the "interface"). + // 2. Overridden methods (that were mixed in). + var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); + var isFunction = typeof property === 'function'; + var shouldAutoBind = + isFunction && + !isReactClassMethod && + !isAlreadyDefined && + spec.autobind !== false; + + if (shouldAutoBind) { + autoBindPairs.push(name, property); + proto[name] = property; + } else { + if (isAlreadyDefined) { + var specPolicy = ReactClassInterface[name]; + + // These cases should already be caught by validateMethodOverride. + _invariant( + isReactClassMethod && + (specPolicy === 'DEFINE_MANY_MERGED' || + specPolicy === 'DEFINE_MANY'), + 'ReactClass: Unexpected spec policy %s for key %s ' + + 'when mixing in component specs.', + specPolicy, + name + ); + + // For methods which are defined more than once, call the existing + // methods before calling the new property, merging if appropriate. + if (specPolicy === 'DEFINE_MANY_MERGED') { + proto[name] = createMergedResultFunction(proto[name], property); + } else if (specPolicy === 'DEFINE_MANY') { + proto[name] = createChainedFunction(proto[name], property); + } + } else { + proto[name] = property; + if (true) { + // Add verbose displayName to the function, which helps when looking + // at profiling tools. + if (typeof property === 'function' && spec.displayName) { + proto[name].displayName = spec.displayName + '_' + name; + } + } + } + } + } + } + } + + function mixStaticSpecIntoComponent(Constructor, statics) { + if (!statics) { + return; + } + + for (var name in statics) { + var property = statics[name]; + if (!statics.hasOwnProperty(name)) { + continue; + } + + var isReserved = name in RESERVED_SPEC_KEYS; + _invariant( + !isReserved, + 'ReactClass: You are attempting to define a reserved ' + + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + + 'as an instance property instead; it will still be accessible on the ' + + 'constructor.', + name + ); + + var isAlreadyDefined = name in Constructor; + if (isAlreadyDefined) { + var specPolicy = ReactClassStaticInterface.hasOwnProperty(name) + ? ReactClassStaticInterface[name] + : null; + + _invariant( + specPolicy === 'DEFINE_MANY_MERGED', + 'ReactClass: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be ' + + 'due to a mixin.', + name + ); + + Constructor[name] = createMergedResultFunction(Constructor[name], property); + + return; + } + + Constructor[name] = property; + } + } + + /** + * Merge two objects, but throw if both contain the same key. + * + * @param {object} one The first object, which is mutated. + * @param {object} two The second object + * @return {object} one after it has been mutated to contain everything in two. + */ + function mergeIntoWithNoDuplicateKeys(one, two) { + _invariant( + one && two && typeof one === 'object' && typeof two === 'object', + 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' + ); + + for (var key in two) { + if (two.hasOwnProperty(key)) { + _invariant( + one[key] === undefined, + 'mergeIntoWithNoDuplicateKeys(): ' + + 'Tried to merge two objects with the same key: `%s`. This conflict ' + + 'may be due to a mixin; in particular, this may be caused by two ' + + 'getInitialState() or getDefaultProps() methods returning objects ' + + 'with clashing keys.', + key + ); + one[key] = two[key]; + } + } + return one; + } + + /** + * Creates a function that invokes two functions and merges their return values. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createMergedResultFunction(one, two) { + return function mergedResult() { + var a = one.apply(this, arguments); + var b = two.apply(this, arguments); + if (a == null) { + return b; + } else if (b == null) { + return a; + } + var c = {}; + mergeIntoWithNoDuplicateKeys(c, a); + mergeIntoWithNoDuplicateKeys(c, b); + return c; + }; + } + + /** + * Creates a function that invokes two functions and ignores their return vales. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createChainedFunction(one, two) { + return function chainedFunction() { + one.apply(this, arguments); + two.apply(this, arguments); + }; + } + + /** + * Binds a method to the component. + * + * @param {object} component Component whose method is going to be bound. + * @param {function} method Method to be bound. + * @return {function} The bound method. + */ + function bindAutoBindMethod(component, method) { + var boundMethod = method.bind(component); + if (true) { + boundMethod.__reactBoundContext = component; + boundMethod.__reactBoundMethod = method; + boundMethod.__reactBoundArguments = null; + var componentName = component.constructor.displayName; + var _bind = boundMethod.bind; + boundMethod.bind = function(newThis) { + for ( + var _len = arguments.length, + args = Array(_len > 1 ? _len - 1 : 0), + _key = 1; + _key < _len; + _key++ + ) { + args[_key - 1] = arguments[_key]; + } + + // User is trying to bind() an autobound method; we effectively will + // ignore the value of "this" that the user is trying to use, so + // let's warn. + if (newThis !== component && newThis !== null) { + if (true) { + warning( + false, + 'bind(): React component methods may only be bound to the ' + + 'component instance. See %s', + componentName + ); + } + } else if (!args.length) { + if (true) { + warning( + false, + 'bind(): You are binding a component method to the component. ' + + 'React does this for you automatically in a high-performance ' + + 'way, so you can safely remove this call. See %s', + componentName + ); + } + return boundMethod; + } + var reboundMethod = _bind.apply(boundMethod, arguments); + reboundMethod.__reactBoundContext = component; + reboundMethod.__reactBoundMethod = method; + reboundMethod.__reactBoundArguments = args; + return reboundMethod; + }; + } + return boundMethod; + } + + /** + * Binds all auto-bound methods in a component. + * + * @param {object} component Component whose method is going to be bound. + */ + function bindAutoBindMethods(component) { + var pairs = component.__reactAutoBindPairs; + for (var i = 0; i < pairs.length; i += 2) { + var autoBindKey = pairs[i]; + var method = pairs[i + 1]; + component[autoBindKey] = bindAutoBindMethod(component, method); + } + } + + var IsMountedPreMixin = { + componentDidMount: function() { + this.__isMounted = true; + } + }; + + var IsMountedPostMixin = { + componentWillUnmount: function() { + this.__isMounted = false; + } + }; + + /** + * Add more to the ReactClass base class. These are all legacy features and + * therefore not already part of the modern ReactComponent. + */ + var ReactClassMixin = { + /** + * TODO: This will be deprecated because state should always keep a consistent + * type signature and the only use case for this, is to avoid that. + */ + replaceState: function(newState, callback) { + this.updater.enqueueReplaceState(this, newState, callback); + }, + + /** + * Checks whether or not this composite component is mounted. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function() { + if (true) { + warning( + this.__didWarnIsMounted, + '%s: isMounted is deprecated. Instead, make sure to clean up ' + + 'subscriptions and pending requests in componentWillUnmount to ' + + 'prevent memory leaks.', + (this.constructor && this.constructor.displayName) || + this.name || + 'Component' + ); + this.__didWarnIsMounted = true; + } + return !!this.__isMounted; + } + }; + + var ReactClassComponent = function() {}; + _assign( + ReactClassComponent.prototype, + ReactComponent.prototype, + ReactClassMixin + ); + + /** + * Creates a composite component class given a class specification. + * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass + * + * @param {object} spec Class specification (which must define `render`). + * @return {function} Component constructor function. + * @public + */ + function createClass(spec) { + // To keep our warnings more understandable, we'll use a little hack here to + // ensure that Constructor.name !== 'Constructor'. This makes sure we don't + // unnecessarily identify a class without displayName as 'Constructor'. + var Constructor = identity(function(props, context, updater) { + // This constructor gets overridden by mocks. The argument is used + // by mocks to assert on what gets mounted. + + if (true) { + warning( + this instanceof Constructor, + 'Something is calling a React component directly. Use a factory or ' + + 'JSX instead. See: https://fb.me/react-legacyfactory' + ); + } + + // Wire up auto-binding + if (this.__reactAutoBindPairs.length) { + bindAutoBindMethods(this); + } + + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + + this.state = null; + + // ReactClasses doesn't have constructors. Instead, they use the + // getInitialState and componentWillMount methods for initialization. + + var initialState = this.getInitialState ? this.getInitialState() : null; + if (true) { + // We allow auto-mocks to proceed as if they're returning null. + if ( + initialState === undefined && + this.getInitialState._isMockFunction + ) { + // This is probably bad practice. Consider warning here and + // deprecating this convenience. + initialState = null; + } + } + _invariant( + typeof initialState === 'object' && !Array.isArray(initialState), + '%s.getInitialState(): must return an object or null', + Constructor.displayName || 'ReactCompositeComponent' + ); + + this.state = initialState; + }); + Constructor.prototype = new ReactClassComponent(); + Constructor.prototype.constructor = Constructor; + Constructor.prototype.__reactAutoBindPairs = []; + + injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); + + mixSpecIntoComponent(Constructor, IsMountedPreMixin); + mixSpecIntoComponent(Constructor, spec); + mixSpecIntoComponent(Constructor, IsMountedPostMixin); + + // Initialize the defaultProps property after all mixins have been merged. + if (Constructor.getDefaultProps) { + Constructor.defaultProps = Constructor.getDefaultProps(); + } + + if (true) { + // This is a tag to indicate that the use of these method names is ok, + // since it's used with createClass. If it's not, then it's likely a + // mistake so we'll warn you to use the static property, property + // initializer or constructor respectively. + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps.isReactClassApproved = {}; + } + if (Constructor.prototype.getInitialState) { + Constructor.prototype.getInitialState.isReactClassApproved = {}; + } + } + + _invariant( + Constructor.prototype.render, + 'createClass(...): Class specification must implement a `render` method.' + ); + + if (true) { + warning( + !Constructor.prototype.componentShouldUpdate, + '%s has a method called ' + + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + + 'The name is phrased as a question because the function is ' + + 'expected to return a value.', + spec.displayName || 'A component' + ); + warning( + !Constructor.prototype.componentWillRecieveProps, + '%s has a method called ' + + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', + spec.displayName || 'A component' + ); + warning( + !Constructor.prototype.UNSAFE_componentWillRecieveProps, + '%s has a method called UNSAFE_componentWillRecieveProps(). ' + + 'Did you mean UNSAFE_componentWillReceiveProps()?', + spec.displayName || 'A component' + ); + } + + // Reduce time spent doing lookups by setting these on the prototype. + for (var methodName in ReactClassInterface) { + if (!Constructor.prototype[methodName]) { + Constructor.prototype[methodName] = null; + } + } + + return Constructor; + } + + return createClass; +} + +module.exports = factory; + + +/***/ }), + +/***/ "./node_modules/create-react-class/index.js": +/*!**************************************************!*\ + !*** ./node_modules/create-react-class/index.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + + +var React = __webpack_require__(/*! react */ "react"); +var factory = __webpack_require__(/*! ./factory */ "./node_modules/create-react-class/factory.js"); + +if (typeof React === 'undefined') { + throw Error( + 'create-react-class could not find the React object. If you are using script tags, ' + + 'make sure that React is being loaded before create-react-class.' + ); +} + +// Hack to grab NoopUpdateQueue from isomorphic React +var ReactNoopUpdateQueue = new React.Component().updater; + +module.exports = factory( + React.Component, + React.isValidElement, + ReactNoopUpdateQueue +); + + +/***/ }), + +/***/ "./node_modules/crypto-js/core.js": +/*!****************************************!*\ + !*** ./node_modules/crypto-js/core.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(); + } + else {} +}(this, function () { + + /*globals window, global, require*/ + + /** + * CryptoJS core components. + */ + var CryptoJS = CryptoJS || (function (Math, undefined) { + + var crypto; + + // Native crypto from window (Browser) + if (typeof window !== 'undefined' && window.crypto) { + crypto = window.crypto; + } + + // Native crypto in web worker (Browser) + if (typeof self !== 'undefined' && self.crypto) { + crypto = self.crypto; + } + + // Native crypto from worker + if (typeof globalThis !== 'undefined' && globalThis.crypto) { + crypto = globalThis.crypto; + } + + // Native (experimental IE 11) crypto from window (Browser) + if (!crypto && typeof window !== 'undefined' && window.msCrypto) { + crypto = window.msCrypto; + } + + // Native crypto from global (NodeJS) + if (!crypto && typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.crypto) { + crypto = __webpack_require__.g.crypto; + } + + // Native crypto import via require (NodeJS) + if (!crypto && "function" === 'function') { + try { + crypto = __webpack_require__(/*! crypto */ "?9157"); + } catch (err) {} + } + + /* + * Cryptographically secure pseudorandom number generator + * + * As Math.random() is cryptographically not safe to use + */ + var cryptoSecureRandomInt = function () { + if (crypto) { + // Use getRandomValues method (Browser) + if (typeof crypto.getRandomValues === 'function') { + try { + return crypto.getRandomValues(new Uint32Array(1))[0]; + } catch (err) {} + } + + // Use randomBytes method (NodeJS) + if (typeof crypto.randomBytes === 'function') { + try { + return crypto.randomBytes(4).readInt32LE(); + } catch (err) {} + } + } + + throw new Error('Native crypto module could not be used to get secure random number.'); + }; + + /* + * Local polyfill of Object.create + + */ + var create = Object.create || (function () { + function F() {} + + return function (obj) { + var subtype; + + F.prototype = obj; + + subtype = new F(); + + F.prototype = null; + + return subtype; + }; + }()); + + /** + * CryptoJS namespace. + */ + var C = {}; + + /** + * Library namespace. + */ + var C_lib = C.lib = {}; + + /** + * Base object for prototypal inheritance. + */ + var Base = C_lib.Base = (function () { + + + return { + /** + * Creates a new object that inherits from this object. + * + * @param {Object} overrides Properties to copy into the new object. + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * field: 'value', + * + * method: function () { + * } + * }); + */ + extend: function (overrides) { + // Spawn + var subtype = create(this); + + // Augment + if (overrides) { + subtype.mixIn(overrides); + } + + // Create default initializer + if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { + subtype.init = function () { + subtype.$super.init.apply(this, arguments); + }; + } + + // Initializer's prototype is the subtype object + subtype.init.prototype = subtype; + + // Reference supertype + subtype.$super = this; + + return subtype; + }, + + /** + * Extends this object and runs the init method. + * Arguments to create() will be passed to init(). + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var instance = MyType.create(); + */ + create: function () { + var instance = this.extend(); + instance.init.apply(instance, arguments); + + return instance; + }, + + /** + * Initializes a newly created object. + * Override this method to add some logic when your objects are created. + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * init: function () { + * // ... + * } + * }); + */ + init: function () { + }, + + /** + * Copies properties into this object. + * + * @param {Object} properties The properties to mix in. + * + * @example + * + * MyType.mixIn({ + * field: 'value' + * }); + */ + mixIn: function (properties) { + for (var propertyName in properties) { + if (properties.hasOwnProperty(propertyName)) { + this[propertyName] = properties[propertyName]; + } + } + + // IE won't copy toString using the loop above + if (properties.hasOwnProperty('toString')) { + this.toString = properties.toString; + } + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = instance.clone(); + */ + clone: function () { + return this.init.prototype.extend(this); + } + }; + }()); + + /** + * An array of 32-bit words. + * + * @property {Array} words The array of 32-bit words. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var WordArray = C_lib.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of 32-bit words. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.create(); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); + */ + init: function (words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 4; + } + }, + + /** + * Converts this word array to a string. + * + * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex + * + * @return {string} The stringified word array. + * + * @example + * + * var string = wordArray + ''; + * var string = wordArray.toString(); + * var string = wordArray.toString(CryptoJS.enc.Utf8); + */ + toString: function (encoder) { + return (encoder || Hex).stringify(this); + }, + + /** + * Concatenates a word array to this word array. + * + * @param {WordArray} wordArray The word array to append. + * + * @return {WordArray} This word array. + * + * @example + * + * wordArray1.concat(wordArray2); + */ + concat: function (wordArray) { + // Shortcuts + var thisWords = this.words; + var thatWords = wordArray.words; + var thisSigBytes = this.sigBytes; + var thatSigBytes = wordArray.sigBytes; + + // Clamp excess bits + this.clamp(); + + // Concat + if (thisSigBytes % 4) { + // Copy one byte at a time + for (var i = 0; i < thatSigBytes; i++) { + var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); + } + } else { + // Copy one word at a time + for (var j = 0; j < thatSigBytes; j += 4) { + thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2]; + } + } + this.sigBytes += thatSigBytes; + + // Chainable + return this; + }, + + /** + * Removes insignificant bits. + * + * @example + * + * wordArray.clamp(); + */ + clamp: function () { + // Shortcuts + var words = this.words; + var sigBytes = this.sigBytes; + + // Clamp + words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); + words.length = Math.ceil(sigBytes / 4); + }, + + /** + * Creates a copy of this word array. + * + * @return {WordArray} The clone. + * + * @example + * + * var clone = wordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone.words = this.words.slice(0); + + return clone; + }, + + /** + * Creates a word array filled with random bytes. + * + * @param {number} nBytes The number of random bytes to generate. + * + * @return {WordArray} The random word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.random(16); + */ + random: function (nBytes) { + var words = []; + + for (var i = 0; i < nBytes; i += 4) { + words.push(cryptoSecureRandomInt()); + } + + return new WordArray.init(words, nBytes); + } + }); + + /** + * Encoder namespace. + */ + var C_enc = C.enc = {}; + + /** + * Hex encoding strategy. + */ + var Hex = C_enc.Hex = { + /** + * Converts a word array to a hex string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The hex string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.enc.Hex.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var hexChars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + hexChars.push((bite >>> 4).toString(16)); + hexChars.push((bite & 0x0f).toString(16)); + } + + return hexChars.join(''); + }, + + /** + * Converts a hex string to a word array. + * + * @param {string} hexStr The hex string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Hex.parse(hexString); + */ + parse: function (hexStr) { + // Shortcut + var hexStrLength = hexStr.length; + + // Convert + var words = []; + for (var i = 0; i < hexStrLength; i += 2) { + words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); + } + + return new WordArray.init(words, hexStrLength / 2); + } + }; + + /** + * Latin1 encoding strategy. + */ + var Latin1 = C_enc.Latin1 = { + /** + * Converts a word array to a Latin1 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Latin1 string. + * + * @static + * + * @example + * + * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var latin1Chars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + latin1Chars.push(String.fromCharCode(bite)); + } + + return latin1Chars.join(''); + }, + + /** + * Converts a Latin1 string to a word array. + * + * @param {string} latin1Str The Latin1 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); + */ + parse: function (latin1Str) { + // Shortcut + var latin1StrLength = latin1Str.length; + + // Convert + var words = []; + for (var i = 0; i < latin1StrLength; i++) { + words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); + } + + return new WordArray.init(words, latin1StrLength); + } + }; + + /** + * UTF-8 encoding strategy. + */ + var Utf8 = C_enc.Utf8 = { + /** + * Converts a word array to a UTF-8 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-8 string. + * + * @static + * + * @example + * + * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); + */ + stringify: function (wordArray) { + try { + return decodeURIComponent(escape(Latin1.stringify(wordArray))); + } catch (e) { + throw new Error('Malformed UTF-8 data'); + } + }, + + /** + * Converts a UTF-8 string to a word array. + * + * @param {string} utf8Str The UTF-8 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); + */ + parse: function (utf8Str) { + return Latin1.parse(unescape(encodeURIComponent(utf8Str))); + } + }; + + /** + * Abstract buffered block algorithm template. + * + * The property blockSize must be implemented in a concrete subtype. + * + * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 + */ + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ + /** + * Resets this block algorithm's data buffer to its initial state. + * + * @example + * + * bufferedBlockAlgorithm.reset(); + */ + reset: function () { + // Initial values + this._data = new WordArray.init(); + this._nDataBytes = 0; + }, + + /** + * Adds new data to this block algorithm's buffer. + * + * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. + * + * @example + * + * bufferedBlockAlgorithm._append('data'); + * bufferedBlockAlgorithm._append(wordArray); + */ + _append: function (data) { + // Convert string to WordArray, else assume WordArray already + if (typeof data == 'string') { + data = Utf8.parse(data); + } + + // Append + this._data.concat(data); + this._nDataBytes += data.sigBytes; + }, + + /** + * Processes available data blocks. + * + * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. + * + * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. + * + * @return {WordArray} The processed data. + * + * @example + * + * var processedData = bufferedBlockAlgorithm._process(); + * var processedData = bufferedBlockAlgorithm._process(!!'flush'); + */ + _process: function (doFlush) { + var processedWords; + + // Shortcuts + var data = this._data; + var dataWords = data.words; + var dataSigBytes = data.sigBytes; + var blockSize = this.blockSize; + var blockSizeBytes = blockSize * 4; + + // Count blocks ready + var nBlocksReady = dataSigBytes / blockSizeBytes; + if (doFlush) { + // Round up to include partial blocks + nBlocksReady = Math.ceil(nBlocksReady); + } else { + // Round down to include only full blocks, + // less the number of blocks that must remain in the buffer + nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); + } + + // Count words ready + var nWordsReady = nBlocksReady * blockSize; + + // Count bytes ready + var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); + + // Process blocks + if (nWordsReady) { + for (var offset = 0; offset < nWordsReady; offset += blockSize) { + // Perform concrete-algorithm logic + this._doProcessBlock(dataWords, offset); + } + + // Remove processed words + processedWords = dataWords.splice(0, nWordsReady); + data.sigBytes -= nBytesReady; + } + + // Return processed words + return new WordArray.init(processedWords, nBytesReady); + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = bufferedBlockAlgorithm.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone._data = this._data.clone(); + + return clone; + }, + + _minBufferSize: 0 + }); + + /** + * Abstract hasher template. + * + * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) + */ + var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + */ + cfg: Base.extend(), + + /** + * Initializes a newly created hasher. + * + * @param {Object} cfg (Optional) The configuration options to use for this hash computation. + * + * @example + * + * var hasher = CryptoJS.algo.SHA256.create(); + */ + init: function (cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); + + // Set initial values + this.reset(); + }, + + /** + * Resets this hasher to its initial state. + * + * @example + * + * hasher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-hasher logic + this._doReset(); + }, + + /** + * Updates this hasher with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {Hasher} This hasher. + * + * @example + * + * hasher.update('message'); + * hasher.update(wordArray); + */ + update: function (messageUpdate) { + // Append + this._append(messageUpdate); + + // Update the hash + this._process(); + + // Chainable + return this; + }, + + /** + * Finalizes the hash computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The hash. + * + * @example + * + * var hash = hasher.finalize(); + * var hash = hasher.finalize('message'); + * var hash = hasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Final message update + if (messageUpdate) { + this._append(messageUpdate); + } + + // Perform concrete-hasher logic + var hash = this._doFinalize(); + + return hash; + }, + + blockSize: 512/32, + + /** + * Creates a shortcut function to a hasher's object interface. + * + * @param {Hasher} hasher The hasher to create a helper for. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); + */ + _createHelper: function (hasher) { + return function (message, cfg) { + return new hasher.init(cfg).finalize(message); + }; + }, + + /** + * Creates a shortcut function to the HMAC's object interface. + * + * @param {Hasher} hasher The hasher to use in this HMAC helper. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); + */ + _createHmacHelper: function (hasher) { + return function (message, key) { + return new C_algo.HMAC.init(hasher, key).finalize(message); + }; + } + }); + + /** + * Algorithm namespace. + */ + var C_algo = C.algo = {}; + + return C; + }(Math)); + + + return CryptoJS; + +})); + +/***/ }), + +/***/ "./node_modules/crypto-js/md5.js": +/*!***************************************!*\ + !*** ./node_modules/crypto-js/md5.js ***! + \***************************************/ +/***/ (function(module, exports, __webpack_require__) { + +;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); + } + else {} +}(this, function (CryptoJS) { + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Constants table + var T = []; + + // Compute constants + (function () { + for (var i = 0; i < 64; i++) { + T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; + } + }()); + + /** + * MD5 hash algorithm. + */ + var MD5 = C_algo.MD5 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476 + ]); + }, + + _doProcessBlock: function (M, offset) { + // Swap endian + for (var i = 0; i < 16; i++) { + // Shortcuts + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + + M[offset_i] = ( + (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | + (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) + ); + } + + // Shortcuts + var H = this._hash.words; + + var M_offset_0 = M[offset + 0]; + var M_offset_1 = M[offset + 1]; + var M_offset_2 = M[offset + 2]; + var M_offset_3 = M[offset + 3]; + var M_offset_4 = M[offset + 4]; + var M_offset_5 = M[offset + 5]; + var M_offset_6 = M[offset + 6]; + var M_offset_7 = M[offset + 7]; + var M_offset_8 = M[offset + 8]; + var M_offset_9 = M[offset + 9]; + var M_offset_10 = M[offset + 10]; + var M_offset_11 = M[offset + 11]; + var M_offset_12 = M[offset + 12]; + var M_offset_13 = M[offset + 13]; + var M_offset_14 = M[offset + 14]; + var M_offset_15 = M[offset + 15]; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + + // Computation + a = FF(a, b, c, d, M_offset_0, 7, T[0]); + d = FF(d, a, b, c, M_offset_1, 12, T[1]); + c = FF(c, d, a, b, M_offset_2, 17, T[2]); + b = FF(b, c, d, a, M_offset_3, 22, T[3]); + a = FF(a, b, c, d, M_offset_4, 7, T[4]); + d = FF(d, a, b, c, M_offset_5, 12, T[5]); + c = FF(c, d, a, b, M_offset_6, 17, T[6]); + b = FF(b, c, d, a, M_offset_7, 22, T[7]); + a = FF(a, b, c, d, M_offset_8, 7, T[8]); + d = FF(d, a, b, c, M_offset_9, 12, T[9]); + c = FF(c, d, a, b, M_offset_10, 17, T[10]); + b = FF(b, c, d, a, M_offset_11, 22, T[11]); + a = FF(a, b, c, d, M_offset_12, 7, T[12]); + d = FF(d, a, b, c, M_offset_13, 12, T[13]); + c = FF(c, d, a, b, M_offset_14, 17, T[14]); + b = FF(b, c, d, a, M_offset_15, 22, T[15]); + + a = GG(a, b, c, d, M_offset_1, 5, T[16]); + d = GG(d, a, b, c, M_offset_6, 9, T[17]); + c = GG(c, d, a, b, M_offset_11, 14, T[18]); + b = GG(b, c, d, a, M_offset_0, 20, T[19]); + a = GG(a, b, c, d, M_offset_5, 5, T[20]); + d = GG(d, a, b, c, M_offset_10, 9, T[21]); + c = GG(c, d, a, b, M_offset_15, 14, T[22]); + b = GG(b, c, d, a, M_offset_4, 20, T[23]); + a = GG(a, b, c, d, M_offset_9, 5, T[24]); + d = GG(d, a, b, c, M_offset_14, 9, T[25]); + c = GG(c, d, a, b, M_offset_3, 14, T[26]); + b = GG(b, c, d, a, M_offset_8, 20, T[27]); + a = GG(a, b, c, d, M_offset_13, 5, T[28]); + d = GG(d, a, b, c, M_offset_2, 9, T[29]); + c = GG(c, d, a, b, M_offset_7, 14, T[30]); + b = GG(b, c, d, a, M_offset_12, 20, T[31]); + + a = HH(a, b, c, d, M_offset_5, 4, T[32]); + d = HH(d, a, b, c, M_offset_8, 11, T[33]); + c = HH(c, d, a, b, M_offset_11, 16, T[34]); + b = HH(b, c, d, a, M_offset_14, 23, T[35]); + a = HH(a, b, c, d, M_offset_1, 4, T[36]); + d = HH(d, a, b, c, M_offset_4, 11, T[37]); + c = HH(c, d, a, b, M_offset_7, 16, T[38]); + b = HH(b, c, d, a, M_offset_10, 23, T[39]); + a = HH(a, b, c, d, M_offset_13, 4, T[40]); + d = HH(d, a, b, c, M_offset_0, 11, T[41]); + c = HH(c, d, a, b, M_offset_3, 16, T[42]); + b = HH(b, c, d, a, M_offset_6, 23, T[43]); + a = HH(a, b, c, d, M_offset_9, 4, T[44]); + d = HH(d, a, b, c, M_offset_12, 11, T[45]); + c = HH(c, d, a, b, M_offset_15, 16, T[46]); + b = HH(b, c, d, a, M_offset_2, 23, T[47]); + + a = II(a, b, c, d, M_offset_0, 6, T[48]); + d = II(d, a, b, c, M_offset_7, 10, T[49]); + c = II(c, d, a, b, M_offset_14, 15, T[50]); + b = II(b, c, d, a, M_offset_5, 21, T[51]); + a = II(a, b, c, d, M_offset_12, 6, T[52]); + d = II(d, a, b, c, M_offset_3, 10, T[53]); + c = II(c, d, a, b, M_offset_10, 15, T[54]); + b = II(b, c, d, a, M_offset_1, 21, T[55]); + a = II(a, b, c, d, M_offset_8, 6, T[56]); + d = II(d, a, b, c, M_offset_15, 10, T[57]); + c = II(c, d, a, b, M_offset_6, 15, T[58]); + b = II(b, c, d, a, M_offset_13, 21, T[59]); + a = II(a, b, c, d, M_offset_4, 6, T[60]); + d = II(d, a, b, c, M_offset_11, 10, T[61]); + c = II(c, d, a, b, M_offset_2, 15, T[62]); + b = II(b, c, d, a, M_offset_9, 21, T[63]); + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + + var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); + var nBitsTotalL = nBitsTotal; + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( + (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | + (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) + ); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( + (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | + (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) + ); + + data.sigBytes = (dataWords.length + 1) * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var hash = this._hash; + var H = hash.words; + + // Swap endian + for (var i = 0; i < 4; i++) { + // Shortcut + var H_i = H[i]; + + H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | + (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); + } + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + function FF(a, b, c, d, x, s, t) { + var n = a + ((b & c) | (~b & d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function GG(a, b, c, d, x, s, t) { + var n = a + ((b & d) | (c & ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function HH(a, b, c, d, x, s, t) { + var n = a + (b ^ c ^ d) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function II(a, b, c, d, x, s, t) { + var n = a + (c ^ (b | ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.MD5('message'); + * var hash = CryptoJS.MD5(wordArray); + */ + C.MD5 = Hasher._createHelper(MD5); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacMD5(message, key); + */ + C.HmacMD5 = Hasher._createHmacHelper(MD5); + }(Math)); + + + return CryptoJS.MD5; + +})); + +/***/ }), + +/***/ "./node_modules/expose-loader/dist/cjs.js?exposes=InsertEmbedModal!./client/src/components/InsertEmbedModal/InsertEmbedModal-exposed.js": +/*!**********************************************************************************************************************************************!*\ + !*** ./node_modules/expose-loader/dist/cjs.js?exposes=InsertEmbedModal!./client/src/components/InsertEmbedModal/InsertEmbedModal-exposed.js ***! + \**********************************************************************************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var ___EXPOSE_LOADER_IMPORT___ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0]!./InsertEmbedModal.js */ "./client/src/components/InsertEmbedModal/InsertEmbedModal.js"); +var ___EXPOSE_LOADER_GET_GLOBAL_THIS___ = __webpack_require__(/*! ../../../../node_modules/expose-loader/dist/runtime/getGlobalThis.js */ "./node_modules/expose-loader/dist/runtime/getGlobalThis.js"); +var ___EXPOSE_LOADER_GLOBAL_THIS___ = ___EXPOSE_LOADER_GET_GLOBAL_THIS___; +if (typeof ___EXPOSE_LOADER_GLOBAL_THIS___["InsertEmbedModal"] === 'undefined') ___EXPOSE_LOADER_GLOBAL_THIS___["InsertEmbedModal"] = ___EXPOSE_LOADER_IMPORT___; +else throw new Error('[exposes-loader] The "InsertEmbedModal" value exists in the global scope, it may not be safe to overwrite it, use the "override" option') +module.exports = ___EXPOSE_LOADER_IMPORT___; + + +/***/ }), + +/***/ "./node_modules/expose-loader/dist/cjs.js?exposes=InsertMediaModal!./client/src/containers/InsertMediaModal/InsertMediaModal-exposed.js": +/*!**********************************************************************************************************************************************!*\ + !*** ./node_modules/expose-loader/dist/cjs.js?exposes=InsertMediaModal!./client/src/containers/InsertMediaModal/InsertMediaModal-exposed.js ***! + \**********************************************************************************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var ___EXPOSE_LOADER_IMPORT___ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0]!./InsertMediaModal.js */ "./client/src/containers/InsertMediaModal/InsertMediaModal.js"); +var ___EXPOSE_LOADER_GET_GLOBAL_THIS___ = __webpack_require__(/*! ../../../../node_modules/expose-loader/dist/runtime/getGlobalThis.js */ "./node_modules/expose-loader/dist/runtime/getGlobalThis.js"); +var ___EXPOSE_LOADER_GLOBAL_THIS___ = ___EXPOSE_LOADER_GET_GLOBAL_THIS___; +if (typeof ___EXPOSE_LOADER_GLOBAL_THIS___["InsertMediaModal"] === 'undefined') ___EXPOSE_LOADER_GLOBAL_THIS___["InsertMediaModal"] = ___EXPOSE_LOADER_IMPORT___; +else throw new Error('[exposes-loader] The "InsertMediaModal" value exists in the global scope, it may not be safe to overwrite it, use the "override" option') +module.exports = ___EXPOSE_LOADER_IMPORT___; + + +/***/ }), + +/***/ "./node_modules/expose-loader/dist/runtime/getGlobalThis.js": +/*!******************************************************************!*\ + !*** ./node_modules/expose-loader/dist/runtime/getGlobalThis.js ***! + \******************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +// eslint-disable-next-line func-names +module.exports = function () { + if (typeof globalThis === "object") { + return globalThis; + } + var g; + try { + // This works if eval is allowed (see CSP) + // eslint-disable-next-line no-new-func + g = this || new Function("return this")(); + } catch (e) { + // This works if the window reference is available + if (typeof window === "object") { + return window; + } + + // This works if the self reference is available + if (typeof self === "object") { + return self; + } + + // This works if the global reference is available + if (typeof __webpack_require__.g !== "undefined") { + return __webpack_require__.g; + } + } + return g; +}(); + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/columnProperties.js": +/*!****************************************************************!*\ + !*** ./node_modules/griddle-react/modules/columnProperties.js ***! + \****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + +var map = __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js"); +var filter = __webpack_require__(/*! lodash/filter */ "./node_modules/lodash/filter.js"); +var find = __webpack_require__(/*! lodash/find */ "./node_modules/lodash/find.js"); +var sortBy = __webpack_require__(/*! lodash/sortBy */ "./node_modules/lodash/sortBy.js"); +var difference = __webpack_require__(/*! lodash/difference */ "./node_modules/lodash/difference.js"); + +var ColumnProperties = (function () { + function ColumnProperties() { + var allColumns = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + var filteredColumns = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1]; + var childrenColumnName = arguments.length <= 2 || arguments[2] === undefined ? "children" : arguments[2]; + var columnMetadata = arguments.length <= 3 || arguments[3] === undefined ? [] : arguments[3]; + var metadataColumns = arguments.length <= 4 || arguments[4] === undefined ? [] : arguments[4]; + + _classCallCheck(this, ColumnProperties); + + this.allColumns = allColumns; + this.filteredColumns = filteredColumns; + this.childrenColumnName = childrenColumnName; + this.columnMetadata = columnMetadata; + this.metadataColumns = metadataColumns; + } + + _createClass(ColumnProperties, [{ + key: 'getMetadataColumns', + value: function getMetadataColumns() { + var meta = map(filter(this.columnMetadata, { visible: false }), function (item) { + return item.columnName; + }); + if (meta.indexOf(this.childrenColumnName) < 0) { + meta.push(this.childrenColumnName); + } + return meta.concat(this.metadataColumns); + } + }, { + key: 'getVisibleColumnCount', + value: function getVisibleColumnCount() { + return this.getColumns().length; + } + }, { + key: 'getColumnMetadataByName', + value: function getColumnMetadataByName(name) { + return find(this.columnMetadata, { columnName: name }); + } + }, { + key: 'hasColumnMetadata', + value: function hasColumnMetadata() { + return this.columnMetadata !== null && this.columnMetadata.length > 0; + } + }, { + key: 'getMetadataColumnProperty', + value: function getMetadataColumnProperty(columnName, propertyName, defaultValue) { + var meta = this.getColumnMetadataByName(columnName); + + //send back the default value if meta isn't there + if (typeof meta === "undefined" || meta === null) return defaultValue; + + return meta.hasOwnProperty(propertyName) ? meta[propertyName] : defaultValue; + } + }, { + key: 'orderColumns', + value: function orderColumns(cols) { + var _this = this; + + var ORDER_MAX = 100; + + var orderedColumns = sortBy(cols, function (item) { + var metaItem = find(_this.columnMetadata, { columnName: item }); + + if (typeof metaItem === 'undefined' || metaItem === null || isNaN(metaItem.order)) { + return ORDER_MAX; + } + + return metaItem.order; + }); + + return orderedColumns; + } + }, { + key: 'getColumns', + value: function getColumns() { + //if we didn't set default or filter + var filteredColumns = this.filteredColumns.length === 0 ? this.allColumns : this.filteredColumns; + + filteredColumns = difference(filteredColumns, this.metadataColumns); + + filteredColumns = this.orderColumns(filteredColumns); + + return filteredColumns; + } + }]); + + return ColumnProperties; +})(); + +module.exports = ColumnProperties; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/customFilterContainer.jsx.js": +/*!*************************************************************************!*\ + !*** ./node_modules/griddle-react/modules/customFilterContainer.jsx.js ***! + \*************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); + +var CustomFilterContainer = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "placeholderText": "" + }; + }, + render: function render() { + var that = this; + + if (typeof that.props.customFilterComponent !== 'function') { + console.log("Couldn't find valid template."); + return React.createElement('div', null); + } + + return React.createElement(that.props.customFilterComponent, { + changeFilter: this.props.changeFilter, + results: this.props.results, + currentResults: this.props.currentResults, + placeholderText: this.props.placeholderText }); + } +}); + +module.exports = CustomFilterContainer; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/customPaginationContainer.jsx.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/griddle-react/modules/customPaginationContainer.jsx.js ***! + \*****************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + Griddle - Simple Grid Component for React + https://github.com/DynamicTyped/Griddle + Copyright (c) 2014 Ryan Lanciaux | DynamicTyped + + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i];for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + }return target; +}; + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); + +var CustomPaginationContainer = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "maxPage": 0, + "nextText": "", + "previousText": "", + "currentPage": 0, + "customPagerComponent": {}, + "customPagerComponentOptions": {} + }; + }, + render: function render() { + var that = this; + + if (typeof that.props.customPagerComponent !== 'function') { + console.log("Couldn't find valid template."); + return React.createElement('div', null); + } + + return React.createElement(that.props.customPagerComponent, _extends({}, this.props.customPagerComponentOptions, { maxPage: this.props.maxPage, nextText: this.props.nextText, previousText: this.props.previousText, currentPage: this.props.currentPage, setPage: this.props.setPage, previous: this.props.previous, next: this.props.next })); + } +}); + +module.exports = CustomPaginationContainer; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/customRowComponentContainer.jsx.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/griddle-react/modules/customRowComponentContainer.jsx.js ***! + \*******************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + Griddle - Simple Grid Component for React + https://github.com/DynamicTyped/Griddle + Copyright (c) 2014 Ryan Lanciaux | DynamicTyped + + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); + +var CustomRowComponentContainer = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "data": [], + "metadataColumns": [], + "className": "", + "customComponent": {}, + "globalData": {} + }; + }, + render: function render() { + var that = this; + + if (typeof that.props.customComponent !== 'function') { + console.log("Couldn't find valid template."); + return React.createElement('div', { className: this.props.className }); + } + + var nodes = this.props.data.map(function (row, index) { + return React.createElement(that.props.customComponent, { data: row, metadataColumns: that.props.metadataColumns, key: index, globalData: that.props.globalData }); + }); + + var footer = this.props.showPager && this.props.pagingContent; + return React.createElement('div', { className: this.props.className, style: this.props.style }, nodes); + } +}); + +module.exports = CustomRowComponentContainer; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/deep.js": +/*!****************************************************!*\ + !*** ./node_modules/griddle-react/modules/deep.js ***! + \****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var forEach = __webpack_require__(/*! lodash/forEach */ "./node_modules/lodash/forEach.js"); +var isObject = __webpack_require__(/*! lodash/isObject */ "./node_modules/lodash/isObject.js"); +var isArray = __webpack_require__(/*! lodash/isArray */ "./node_modules/lodash/isArray.js"); +var isFunction = __webpack_require__(/*! lodash/isFunction */ "./node_modules/lodash/isFunction.js"); +var isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ "./node_modules/lodash/isPlainObject.js"); +var forOwn = __webpack_require__(/*! lodash/forOwn */ "./node_modules/lodash/forOwn.js"); + +// Credits: https://github.com/documentcloud/underscore-contrib +// Sub module: underscore.object.selectors +// License: MIT (https://github.com/documentcloud/underscore-contrib/blob/master/LICENSE) +// https://github.com/documentcloud/underscore-contrib/blob/master/underscore.object.selectors.js + +// Will take a path like 'element[0][1].subElement["Hey!.What?"]["[hey]"]' +// and return ["element", "0", "1", "subElement", "Hey!.What?", "[hey]"] +function keysFromPath(path) { + // from http://codereview.stackexchange.com/a/63010/8176 + /** + * Repeatedly capture either: + * - a bracketed expression, discarding optional matching quotes inside, or + * - an unbracketed expression, delimited by a dot or a bracket. + */ + var re = /\[("|')(.+)\1\]|([^.\[\]]+)/g; + + var elements = []; + var result; + while ((result = re.exec(path)) !== null) { + elements.push(result[2] || result[3]); + } + return elements; +} + +// Gets the value at any depth in a nested object based on the +// path described by the keys given. Keys may be given as an array +// or as a dot-separated string. +function getPath(obj, ks) { + if (typeof ks == "string") { + if (obj[ks] !== undefined) { + return obj[ks]; + } + ks = keysFromPath(ks); + } + + var i = -1, + length = ks.length; + + // If the obj is null or undefined we have to break as + // a TypeError will result trying to access any property + // Otherwise keep incrementally access the next property in + // ks until complete + while (++i < length && obj != null) { + obj = obj[ks[i]]; + } + return i === length ? obj : void 0; +} + +// Based on the origin underscore _.pick function +// Credit: https://github.com/jashkenas/underscore/blob/master/underscore.js +function powerPick(object, keys) { + var result = {}, + obj = object, + iteratee; + iteratee = function (key, obj) { + return key in obj; + }; + + obj = Object(obj); + + for (var i = 0, length = keys.length; i < length; i++) { + var key = keys[i]; + if (iteratee(key, obj)) result[key] = getPath(obj, key); + } + + return result; +} + +// Gets all the keys for a flattened object structure. +// Doesn't flatten arrays. +// Input: +// { +// a: { +// x: 1, +// y: 2 +// }, +// b: [3, 4], +// c: 5 +// } +// Output: +// [ +// "a.x", +// "a.y", +// "b", +// "c" +// ] +function getKeys(obj, prefix) { + var keys = []; + + forEach(obj, function (value, key) { + var fullKey = prefix ? prefix + "." + key : key; + if (isObject(value) && !isArray(value) && !isFunction(value) && !(value instanceof Date)) { + keys = keys.concat(getKeys(value, fullKey)); + } else { + keys.push(fullKey); + } + }); + + return keys; +} + +// Recursivly traverse plain objects and arrays calling `fn` on each +// non-object/non-array leaf node. +function iterObject(thing, fn) { + if (isArray(thing)) { + forEach(thing, function (item) { + iterObject(item, fn); + }); + } else if (isPlainObject(thing)) { + forOwn(thing, function (item) { + iterObject(item, fn); + }); + } else { + fn(thing); + } +} + +// Recursivly traverse plain objects and arrays and build a list of all +// non-object/non-array leaf nodes. +// +// Input: +// { "array": [1, "two", {"tree": 3}], "string": "a string" } +// +// Output: +// [1, 'two', 3, 'a string'] +// +function getObjectValues(thing) { + var results = []; + iterObject(thing, function (value) { + results.push(value); + }); + return results; +} + +module.exports = { + pick: powerPick, + getAt: getPath, + keys: getKeys, + getObjectValues: getObjectValues +}; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridFilter.jsx.js": +/*!**************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridFilter.jsx.js ***! + \**************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); + +var GridFilter = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "placeholderText": "" + }; + }, + handleChange: function handleChange(event) { + this.props.changeFilter(event.target.value); + }, + render: function render() { + return React.createElement('div', { className: 'filter-container' }, React.createElement('input', { type: 'text', name: 'filter', placeholder: this.props.placeholderText, className: 'form-control', onChange: this.handleChange })); + } +}); + +module.exports = GridFilter; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridNoData.jsx.js": +/*!**************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridNoData.jsx.js ***! + \**************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); + +var GridNoData = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "noDataMessage": "No Data" + }; + }, + render: function render() { + var that = this; + + return React.createElement('div', null, this.props.noDataMessage); + } +}); + +module.exports = GridNoData; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridPagination.jsx.js": +/*!******************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridPagination.jsx.js ***! + \******************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var assign = __webpack_require__(/*! lodash/assign */ "./node_modules/lodash/assign.js"); + +//needs props maxPage, currentPage, nextFunction, prevFunction +var GridPagination = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "maxPage": 0, + "nextText": "", + "previousText": "", + "currentPage": 0, + "useGriddleStyles": true, + "nextClassName": "griddle-next", + "previousClassName": "griddle-previous", + "nextIconComponent": null, + "previousIconComponent": null + }; + }, + pageChange: function pageChange(event) { + this.props.setPage(parseInt(event.target.value, 10) - 1); + }, + render: function render() { + var previous = ""; + var next = ""; + + if (this.props.currentPage > 0) { + previous = React.createElement('button', { type: 'button', onClick: this.props.previous, style: this.props.useGriddleStyles ? { "color": "#222", border: "none", background: "none", margin: "0 0 0 10px" } : null }, this.props.previousIconComponent, this.props.previousText); + } + + if (this.props.currentPage !== this.props.maxPage - 1) { + next = React.createElement('button', { type: 'button', onClick: this.props.next, style: this.props.useGriddleStyles ? { "color": "#222", border: "none", background: "none", margin: "0 10px 0 0" } : null }, this.props.nextText, this.props.nextIconComponent); + } + + var leftStyle = null; + var middleStyle = null; + var rightStyle = null; + + if (this.props.useGriddleStyles === true) { + var baseStyle = { + "float": "left", + minHeight: "1px", + marginTop: "5px" + }; + + rightStyle = assign({ textAlign: "right", width: "34%" }, baseStyle); + middleStyle = assign({ textAlign: "center", width: "33%" }, baseStyle); + leftStyle = assign({ width: "33%" }, baseStyle); + } + + var options = []; + + for (var i = 1; i <= this.props.maxPage; i++) { + options.push(React.createElement('option', { value: i, key: i }, i)); + } + + return React.createElement('div', { style: this.props.useGriddleStyles ? { minHeight: "35px" } : null }, React.createElement('div', { className: this.props.previousClassName, style: leftStyle }, previous), React.createElement('div', { className: 'griddle-page', style: middleStyle }, React.createElement('select', { value: this.props.currentPage + 1, onChange: this.pageChange }, options), ' / ', this.props.maxPage), React.createElement('div', { className: this.props.nextClassName, style: rightStyle }, next)); + } +}); + +module.exports = GridPagination; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridRow.jsx.js": +/*!***********************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridRow.jsx.js ***! + \***********************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var ColumnProperties = __webpack_require__(/*! ./columnProperties.js */ "./node_modules/griddle-react/modules/columnProperties.js"); +var deep = __webpack_require__(/*! ./deep.js */ "./node_modules/griddle-react/modules/deep.js"); +var isFunction = __webpack_require__(/*! lodash/isFunction */ "./node_modules/lodash/isFunction.js"); +var zipObject = __webpack_require__(/*! lodash/zipObject */ "./node_modules/lodash/zipObject.js"); +var assign = __webpack_require__(/*! lodash/assign */ "./node_modules/lodash/assign.js"); +var defaults = __webpack_require__(/*! lodash/defaults */ "./node_modules/lodash/defaults.js"); +var toPairs = __webpack_require__(/*! lodash/toPairs */ "./node_modules/lodash/toPairs.js"); +var without = __webpack_require__(/*! lodash/without */ "./node_modules/lodash/without.js"); + +var GridRow = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "isChildRow": false, + "showChildren": false, + "data": {}, + "columnSettings": null, + "rowSettings": null, + "hasChildren": false, + "useGriddleStyles": true, + "useGriddleIcons": true, + "isSubGriddle": false, + "paddingHeight": null, + "rowHeight": null, + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "parentRowCollapsedComponent": "â–¶", + "parentRowExpandedComponent": "â–¼", + "onRowClick": null, + "multipleSelectionSettings": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null + }; + }, + componentWillMount: function componentWillMount() { + if (this.props.onRowWillMount !== null && isFunction(this.props.onRowWillMount)) { + this.props.onRowWillMount(this); + } + }, + componentWillUnmount: function componentWillUnmount() { + if (this.props.onRowWillUnmount !== null && isFunction(this.props.onRowWillUnmount)) { + this.props.onRowWillUnmount(this); + } + }, + handleClick: function handleClick(e) { + if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { + this.props.onRowClick(this, e); + } else if (this.props.hasChildren) { + this.props.toggleChildren(); + } + }, + handleMouseEnter: function handleMouseEnter(e) { + if (this.props.onRowMouseEnter !== null && isFunction(this.props.onRowMouseEnter)) { + this.props.onRowMouseEnter(this, e); + } + }, + handleMouseLeave: function handleMouseLeave(e) { + if (this.props.onRowMouseLeave !== null && isFunction(this.props.onRowMouseLeave)) { + this.props.onRowMouseLeave(this, e); + } + }, + handleSelectionChange: function handleSelectionChange(e) { + //hack to get around warning that's not super useful in this case + return; + }, + handleSelectClick: function handleSelectClick(e) { + if (this.props.multipleSelectionSettings.isMultipleSelection) { + if (e.target.type === "checkbox") { + this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, this.refs.selected.checked); + } else { + this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, !this.refs.selected.checked); + } + } + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridRow: The columnSettings prop is null and it shouldn't be"); + } + }, + formatData: function formatData(data) { + if (typeof data === 'boolean') { + return String(data); + } + return data; + }, + render: function render() { + var _this = this; + + this.verifyProps(); + var that = this; + var columnStyles = null; + + if (this.props.useGriddleStyles) { + columnStyles = { + margin: "0px", + padding: that.props.paddingHeight + "px 5px " + that.props.paddingHeight + "px 5px", + height: that.props.rowHeight ? this.props.rowHeight - that.props.paddingHeight * 2 + "px" : null, + backgroundColor: "#FFF", + borderTopColor: "#DDD", + color: "#222" + }; + } + + var columns = this.props.columnSettings.getColumns(); + + // make sure that all the columns we need have default empty values + // otherwise they will get clipped + var defaultValues = zipObject(columns, []); + + // creates a 'view' on top the data so we will not alter the original data but will allow us to add default values to missing columns + var dataView = assign({}, this.props.data); + + defaults(dataView, defaultValues); + var data = toPairs(deep.pick(dataView, without(columns, 'children'))); + var nodes = data.map(function (col, index) { + var returnValue = null; + var meta = _this.props.columnSettings.getColumnMetadataByName(col[0]); + + //todo: Make this not as ridiculous looking + var firstColAppend = index === 0 && _this.props.hasChildren && _this.props.showChildren === false && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px", marginRight: "5px" } : null }, _this.props.parentRowCollapsedComponent) : index === 0 && _this.props.hasChildren && _this.props.showChildren && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px" } : null }, _this.props.parentRowExpandedComponent) : ""; + + if (index === 0 && _this.props.isChildRow && _this.props.useGriddleStyles) { + columnStyles = assign(columnStyles, { paddingLeft: 10 }); + } + + if (_this.props.columnSettings.hasColumnMetadata() && typeof meta !== 'undefined' && meta !== null) { + if (typeof meta.customComponent !== 'undefined' && meta.customComponent !== null) { + var customComponent = React.createElement(meta.customComponent, { data: col[1], rowData: dataView, metadata: meta }); + returnValue = React.createElement('td', { onClick: _this.handleClick, onMouseEnter: _this.handleMouseEnter, onMouseLeave: _this.handleMouseLeave, className: meta.cssClassName, key: index, style: columnStyles }, customComponent); + } else { + returnValue = React.createElement('td', { onClick: _this.handleClick, onMouseEnter: _this.handleMouseEnter, onMouseLeave: _this.handleMouseLeave, className: meta.cssClassName, key: index, style: columnStyles }, firstColAppend, _this.formatData(col[1])); + } + } + + return returnValue || React.createElement('td', { onClick: _this.handleClick, onMouseEnter: _this.handleMouseEnter, onMouseLeave: _this.handleMouseLeave, key: index, style: columnStyles }, firstColAppend, col[1]); + }); + + // Don't compete with onRowClick, but if no onRowClick function then + // clicking on the row should trigger select + var trOnClick, tdOnClick; + if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { + trOnClick = null; + tdOnClick = this.handleSelectClick; + } else { + if (this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { + trOnClick = this.handleSelectClick; + tdOnClick = null; + } else { + trOnClick = null; + tdOnClick = null; + } + } + + if (nodes && this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { + var selectedRowIds = this.props.multipleSelectionSettings.getSelectedRowIds(); + + nodes.unshift(React.createElement('td', { + key: 'selection', + style: columnStyles, + className: 'griddle-select griddle-select-cell', + onClick: tdOnClick + }, React.createElement('input', { + type: 'checkbox', + checked: this.props.multipleSelectionSettings.getIsRowChecked(dataView), + onChange: this.handleSelectionChange, + ref: 'selected' + }))); + } + + //Get the row from the row settings. + var className = that.props.rowSettings && that.props.rowSettings.getBodyRowMetadataClass(that.props.data) || "standard-row"; + + if (that.props.isChildRow) { + className = "child-row"; + } else if (that.props.hasChildren) { + className = that.props.showChildren ? this.props.parentRowExpandedClassName : this.props.parentRowCollapsedClassName; + } + + return React.createElement('tr', { onClick: trOnClick, className: className }, nodes); + } +}); + +module.exports = GridRow; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridRowContainer.jsx.js": +/*!********************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridRowContainer.jsx.js ***! + \********************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var ColumnProperties = __webpack_require__(/*! ./columnProperties.js */ "./node_modules/griddle-react/modules/columnProperties.js"); +var pick = __webpack_require__(/*! lodash/pick */ "./node_modules/lodash/pick.js"); + +var GridRowContainer = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "useGriddleStyles": true, + "useGriddleIcons": true, + "isSubGriddle": false, + "columnSettings": null, + "rowSettings": null, + "paddingHeight": null, + "rowHeight": null, + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "parentRowCollapsedComponent": "â–¶", + "parentRowExpandedComponent": "â–¼", + "onRowClick": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null, + "multipleSelectionSettings": null + }; + }, + getInitialState: function getInitialState() { + return { + "data": {}, + "showChildren": false + }; + }, + componentWillReceiveProps: function componentWillReceiveProps() { + this.setShowChildren(false); + }, + toggleChildren: function toggleChildren() { + this.setShowChildren(this.state.showChildren === false); + }, + setShowChildren: function setShowChildren(visible) { + this.setState({ + showChildren: visible + }); + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be"); + } + }, + render: function render() { + this.verifyProps(); + var that = this; + if (typeof this.props.data === "undefined") { + return React.createElement('tbody', null); + } + var arr = []; + + var columns = this.props.columnSettings.getColumns(); + + arr.push(React.createElement(this.props.rowSettings.rowComponent, { + useGriddleStyles: this.props.useGriddleStyles, + isSubGriddle: this.props.isSubGriddle, + data: this.props.rowSettings.isCustom ? pick(this.props.data, columns) : this.props.data, + rowData: this.props.rowSettings.isCustom ? this.props.data : null, + columnSettings: this.props.columnSettings, + rowSettings: this.props.rowSettings, + hasChildren: that.props.hasChildren, + toggleChildren: that.toggleChildren, + showChildren: that.state.showChildren, + key: that.props.uniqueId + '_base_row', + useGriddleIcons: that.props.useGriddleIcons, + parentRowExpandedClassName: this.props.parentRowExpandedClassName, + parentRowCollapsedClassName: this.props.parentRowCollapsedClassName, + parentRowExpandedComponent: this.props.parentRowExpandedComponent, + parentRowCollapsedComponent: this.props.parentRowCollapsedComponent, + paddingHeight: that.props.paddingHeight, + rowHeight: that.props.rowHeight, + onRowClick: that.props.onRowClick, + onRowMouseEnter: that.props.onRowMouseEnter, + onRowMouseLeave: that.props.onRowMouseLeave, + multipleSelectionSettings: this.props.multipleSelectionSettings, + onRowWillMount: that.props.onRowWillMount, + onRowWillUnmount: that.props.onRowWillUnmount })); + + var children = null; + + if (that.state.showChildren) { + children = that.props.hasChildren && this.props.data["children"].map(function (row, index) { + var key = that.props.rowSettings.getRowKey(row, index); + + if (typeof row["children"] !== "undefined") { + var Griddle = that.constructor.Griddle; + return React.createElement('tr', { key: key, style: { paddingLeft: 5 } }, React.createElement('td', { colSpan: that.props.columnSettings.getVisibleColumnCount(), className: 'griddle-parent', style: that.props.useGriddleStyles ? { border: "none", "padding": "0 0 0 5px" } : null }, React.createElement(Griddle, { + rowMetadata: { key: 'id' }, + isSubGriddle: true, + results: [row], + columns: that.props.columnSettings.getColumns(), + tableClassName: that.props.tableClassName, + parentRowExpandedClassName: that.props.parentRowExpandedClassName, + parentRowCollapsedClassName: that.props.parentRowCollapsedClassName, + showTableHeading: false, + showPager: false, + columnMetadata: that.props.columnSettings.columnMetadata, + parentRowExpandedComponent: that.props.parentRowExpandedComponent, + parentRowCollapsedComponent: that.props.parentRowCollapsedComponent, + paddingHeight: that.props.paddingHeight, + rowHeight: that.props.rowHeight + }))); + } + + return React.createElement(that.props.rowSettings.rowComponent, { + useGriddleStyles: that.props.useGriddleStyles, + isSubGriddle: that.props.isSubGriddle, + data: row, + columnSettings: that.props.columnSettings, + isChildRow: true, + columnMetadata: that.props.columnSettings.columnMetadata, + key: key + }); + }); + } + + return that.props.hasChildren === false ? arr[0] : React.createElement('tbody', null, that.state.showChildren ? arr.concat(children) : arr); + } +}); + +module.exports = GridRowContainer; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridSettings.jsx.js": +/*!****************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridSettings.jsx.js ***! + \****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var includes = __webpack_require__(/*! lodash/includes */ "./node_modules/lodash/includes.js"); +var without = __webpack_require__(/*! lodash/without */ "./node_modules/lodash/without.js"); +var find = __webpack_require__(/*! lodash/find */ "./node_modules/lodash/find.js"); + +var GridSettings = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "columns": [], + "columnMetadata": [], + "selectedColumns": [], + "settingsText": "", + "maxRowsText": "", + "resultsPerPage": 0, + "enableToggleCustom": false, + "useCustomComponent": false, + "useGriddleStyles": true, + "toggleCustomComponent": function toggleCustomComponent() {} + }; + }, + setPageSize: function setPageSize(event) { + var value = parseInt(event.target.value, 10); + this.props.setPageSize(value); + }, + handleChange: function handleChange(event) { + var columnName = event.target.dataset ? event.target.dataset.name : event.target.getAttribute('data-name'); + if (event.target.checked === true && includes(this.props.selectedColumns, columnName) === false) { + this.props.selectedColumns.push(columnName); + this.props.setColumns(this.props.selectedColumns); + } else { + /* redraw with the selected columns minus the one just unchecked */ + this.props.setColumns(without(this.props.selectedColumns, columnName)); + } + }, + render: function render() { + var that = this; + + var nodes = []; + //don't show column selector if we're on a custom component + if (that.props.useCustomComponent === false) { + nodes = this.props.columns.map(function (col, index) { + var checked = includes(that.props.selectedColumns, col); + //check column metadata -- if this one is locked make it disabled and don't put an onChange event + var meta = find(that.props.columnMetadata, { columnName: col }); + var displayName = col; + + if (typeof meta !== "undefined" && typeof meta.displayName !== "undefined" && meta.displayName != null) { + displayName = meta.displayName; + } + + if (typeof meta !== "undefined" && meta != null && meta.locked) { + return React.createElement('div', { className: 'column checkbox' }, React.createElement('label', null, React.createElement('input', { type: 'checkbox', disabled: true, name: 'check', checked: checked, 'data-name': col }), displayName)); + } else if (typeof meta !== "undefined" && meta != null && typeof meta.visible !== "undefined" && meta.visible === false) { + return null; + } + return React.createElement('div', { className: 'griddle-column-selection checkbox', key: col, style: that.props.useGriddleStyles ? { "float": "left", width: "20%" } : null }, React.createElement('label', null, React.createElement('input', { type: 'checkbox', name: 'check', onChange: that.handleChange, checked: checked, 'data-name': col }), displayName)); + }); + } + + var toggleCustom = that.props.enableToggleCustom ? React.createElement('div', { className: 'form-group' }, React.createElement('label', { htmlFor: 'maxRows' }, React.createElement('input', { type: 'checkbox', checked: this.props.useCustomComponent, onChange: this.props.toggleCustomComponent }), ' ', this.props.enableCustomFormatText)) : ""; + + var setPageSize = this.props.showSetPageSize ? React.createElement('div', null, React.createElement('label', { htmlFor: 'maxRows' }, this.props.maxRowsText, ':', React.createElement('select', { onChange: this.setPageSize, value: this.props.resultsPerPage }, React.createElement('option', { value: '5' }, '5'), React.createElement('option', { value: '10' }, '10'), React.createElement('option', { value: '25' }, '25'), React.createElement('option', { value: '50' }, '50'), React.createElement('option', { value: '100' }, '100')))) : ""; + + return React.createElement('div', { className: 'griddle-settings', style: this.props.useGriddleStyles ? { backgroundColor: "#FFF", border: "1px solid #DDD", color: "#222", padding: "10px", marginBottom: "10px" } : null }, React.createElement('h6', null, this.props.settingsText), React.createElement('div', { className: 'griddle-columns', style: this.props.useGriddleStyles ? { clear: "both", display: "table", width: "100%", borderBottom: "1px solid #EDEDED", marginBottom: "10px" } : null }, nodes), setPageSize, toggleCustom); + } +}); + +module.exports = GridSettings; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridTable.jsx.js": +/*!*************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridTable.jsx.js ***! + \*************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var GridTitle = __webpack_require__(/*! ./gridTitle.jsx */ "./node_modules/griddle-react/modules/gridTitle.jsx.js"); +var GridRowContainer = __webpack_require__(/*! ./gridRowContainer.jsx */ "./node_modules/griddle-react/modules/gridRowContainer.jsx.js"); +var ColumnProperties = __webpack_require__(/*! ./columnProperties.js */ "./node_modules/griddle-react/modules/columnProperties.js"); +var RowProperties = __webpack_require__(/*! ./rowProperties.js */ "./node_modules/griddle-react/modules/rowProperties.js"); + +var GridTable = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "data": [], + "columnSettings": null, + "rowSettings": null, + "sortSettings": null, + "multipleSelectionSettings": null, + "className": "", + "enableInfiniteScroll": false, + "nextPage": null, + "hasMorePages": false, + "useFixedHeader": false, + "useFixedLayout": true, + "paddingHeight": null, + "rowHeight": null, + "filterByColumn": null, + "infiniteScrollLoadTreshold": null, + "bodyHeight": null, + "useGriddleStyles": true, + "useGriddleIcons": true, + "isSubGriddle": false, + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "parentRowCollapsedComponent": "â–¶", + "parentRowExpandedComponent": "â–¼", + "externalLoadingComponent": null, + "externalIsLoading": false, + "onRowClick": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null + }; + }, + getInitialState: function getInitialState() { + return { + scrollTop: 0, + scrollHeight: this.props.bodyHeight, + clientHeight: this.props.bodyHeight + }; + }, + componentDidMount: function componentDidMount() { + // After the initial render, see if we need to load additional pages. + this.gridScroll(); + }, + componentDidUpdate: function componentDidUpdate(prevProps, prevState) { + // After the subsequent renders, see if we need to load additional pages. + this.gridScroll(); + }, + gridScroll: function gridScroll() { + if (this.props.enableInfiniteScroll && !this.props.externalIsLoading) { + // If the scroll height is greater than the current amount of rows displayed, update the page. + var scrollable = this.refs.scrollable; + var scrollTop = scrollable.scrollTop; + var scrollHeight = scrollable.scrollHeight; + var clientHeight = scrollable.clientHeight; + + // If the scroll position changed and the difference is greater than a row height + if (this.props.rowHeight !== null && this.state.scrollTop !== scrollTop && Math.abs(this.state.scrollTop - scrollTop) >= this.getAdjustedRowHeight()) { + var newState = { + scrollTop: scrollTop, + scrollHeight: scrollHeight, + clientHeight: clientHeight + }; + + // Set the state to the new state + this.setState(newState); + } + + // Determine the diff by subtracting the amount scrolled by the total height, taking into consideratoin + // the spacer's height. + var scrollHeightDiff = scrollHeight - (scrollTop + clientHeight) - this.props.infiniteScrollLoadTreshold; + + // Make sure that we load results a little before reaching the bottom. + var compareHeight = scrollHeightDiff * 0.6; + + if (compareHeight <= this.props.infiniteScrollLoadTreshold) { + this.props.nextPage(); + } + } + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridTable: The columnSettings prop is null and it shouldn't be"); + } + if (this.props.rowSettings === null) { + console.error("gridTable: The rowSettings prop is null and it shouldn't be"); + } + }, + getAdjustedRowHeight: function getAdjustedRowHeight() { + return this.props.rowHeight + this.props.paddingHeight * 2; // account for padding. + }, + getNodeContent: function getNodeContent() { + this.verifyProps(); + var that = this; + + //figure out if we need to wrap the group in one tbody or many + var anyHasChildren = false; + + // If the data is still being loaded, don't build the nodes unless this is an infinite scroll table. + if (!this.props.externalIsLoading || this.props.enableInfiniteScroll) { + var nodeData = that.props.data; + var aboveSpacerRow = null; + var belowSpacerRow = null; + var usingDefault = false; + + // If we have a row height specified, only render what's going to be visible. + if (this.props.enableInfiniteScroll && this.props.rowHeight !== null && this.refs.scrollable !== undefined) { + var adjustedHeight = that.getAdjustedRowHeight(); + var visibleRecordCount = Math.ceil(that.state.clientHeight / adjustedHeight); + + // Inspired by : http://jsfiddle.net/vjeux/KbWJ2/9/ + var displayStart = Math.max(0, Math.floor(that.state.scrollTop / adjustedHeight) - visibleRecordCount * 0.25); + var displayEnd = Math.min(displayStart + visibleRecordCount * 1.25, this.props.data.length - 1); + + // Split the amount of nodes. + nodeData = nodeData.slice(displayStart, displayEnd + 1); + + // Set the above and below nodes. + var aboveSpacerRowStyle = { height: displayStart * adjustedHeight + "px" }; + aboveSpacerRow = React.createElement('tr', { key: 'above-' + aboveSpacerRowStyle.height, style: aboveSpacerRowStyle }); + var belowSpacerRowStyle = { height: (this.props.data.length - displayEnd) * adjustedHeight + "px" }; + belowSpacerRow = React.createElement('tr', { key: 'below-' + belowSpacerRowStyle.height, style: belowSpacerRowStyle }); + } + + var nodes = nodeData.map(function (row, index) { + var hasChildren = typeof row["children"] !== "undefined" && row["children"].length > 0; + var uniqueId = that.props.rowSettings.getRowKey(row, index); + + //at least one item in the group has children. + if (hasChildren) { + anyHasChildren = hasChildren; + } + + return React.createElement(GridRowContainer, { + useGriddleStyles: that.props.useGriddleStyles, + isSubGriddle: that.props.isSubGriddle, + parentRowExpandedClassName: that.props.parentRowExpandedClassName, + parentRowCollapsedClassName: that.props.parentRowCollapsedClassName, + parentRowExpandedComponent: that.props.parentRowExpandedComponent, + parentRowCollapsedComponent: that.props.parentRowCollapsedComponent, + data: row, + key: uniqueId + '-container', + uniqueId: uniqueId, + columnSettings: that.props.columnSettings, + rowSettings: that.props.rowSettings, + paddingHeight: that.props.paddingHeight, + multipleSelectionSettings: that.props.multipleSelectionSettings, + rowHeight: that.props.rowHeight, + hasChildren: hasChildren, + tableClassName: that.props.className, + onRowClick: that.props.onRowClick, + onRowMouseEnter: that.props.onRowMouseEnter, + onRowMouseLeave: that.props.onRowMouseLeave, + onRowWillMount: that.props.onRowWillMount, + onRowWillUnmount: that.props.onRowWillUnmount + }); + }); + + // no data section + if (this.props.showNoData) { + var colSpan = this.props.columnSettings.getVisibleColumnCount(); + nodes.push(React.createElement('tr', { key: 'no-data-section' }, React.createElement('td', { colSpan: colSpan }, this.props.noDataSection))); + } + + // Add the spacer rows for nodes we're not rendering. + if (aboveSpacerRow) { + nodes.unshift(aboveSpacerRow); + } + if (belowSpacerRow) { + nodes.push(belowSpacerRow); + } + + // Send back the nodes. + return { + nodes: nodes, + anyHasChildren: anyHasChildren + }; + } else { + return null; + } + }, + render: function render() { + var that = this; + var nodes = []; + + // for if we need to wrap the group in one tbody or many + var anyHasChildren = false; + + // Grab the nodes to render + var nodeContent = this.getNodeContent(); + if (nodeContent) { + nodes = nodeContent.nodes; + anyHasChildren = nodeContent.anyHasChildren; + } + + var gridStyle = null; + var loadingContent = null; + var tableStyle = { + width: "100%" + }; + + if (this.props.useFixedLayout) { + tableStyle.tableLayout = "fixed"; + } + + if (this.props.enableInfiniteScroll) { + // If we're enabling infinite scrolling, we'll want to include the max height of the grid body + allow scrolling. + gridStyle = { + "position": "relative", + "overflowY": "scroll", + "height": this.props.bodyHeight + "px", + "width": "100%" + }; + } + + // If we're currently loading, populate the loading content + if (this.props.externalIsLoading) { + var defaultLoadingStyle = null; + var defaultColSpan = null; + + if (this.props.useGriddleStyles) { + defaultLoadingStyle = { + textAlign: "center", + paddingBottom: "40px" + }; + } + + defaultColSpan = this.props.columnSettings.getVisibleColumnCount(); + + var loadingComponent = this.props.externalLoadingComponent ? React.createElement(this.props.externalLoadingComponent, null) : React.createElement('div', null, 'Loading...'); + + loadingContent = React.createElement('tbody', null, React.createElement('tr', null, React.createElement('td', { style: defaultLoadingStyle, colSpan: defaultColSpan }, loadingComponent))); + } + + //construct the table heading component + var tableHeading = this.props.showTableHeading ? React.createElement(GridTitle, { useGriddleStyles: this.props.useGriddleStyles, useGriddleIcons: this.props.useGriddleIcons, + sortSettings: this.props.sortSettings, + multipleSelectionSettings: this.props.multipleSelectionSettings, + columnSettings: this.props.columnSettings, + filterByColumn: this.props.filterByColumn, + rowSettings: this.props.rowSettings }) : undefined; + + //check to see if any of the rows have children... if they don't wrap everything in a tbody so the browser doesn't auto do this + if (!anyHasChildren) { + nodes = React.createElement('tbody', null, nodes); + } + + var pagingContent = React.createElement('tbody', null); + if (this.props.showPager) { + var pagingStyles = this.props.useGriddleStyles ? { + padding: "0px", + backgroundColor: "#EDEDED", + border: "0px", + color: "#222", + height: this.props.showNoData ? "20px" : null + } : null; + pagingContent = React.createElement('tbody', null, React.createElement('tr', null, React.createElement('td', { colSpan: this.props.multipleSelectionSettings.isMultipleSelection ? this.props.columnSettings.getVisibleColumnCount() + 1 : this.props.columnSettings.getVisibleColumnCount(), style: pagingStyles, className: 'footer-container' }, !this.props.showNoData ? this.props.pagingContent : null))); + } + + // If we have a fixed header, split into two tables. + if (this.props.useFixedHeader) { + if (this.props.useGriddleStyles) { + tableStyle.tableLayout = "fixed"; + } + + return React.createElement('div', null, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading), React.createElement('div', { ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, nodes, loadingContent, pagingContent))); + } + + return React.createElement('div', { ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading, nodes, loadingContent, pagingContent)); + } +}); + +module.exports = GridTable; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/gridTitle.jsx.js": +/*!*************************************************************!*\ + !*** ./node_modules/griddle-react/modules/gridTitle.jsx.js ***! + \*************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE + */ + + +var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i];for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + }return target; +}; + +var React = __webpack_require__(/*! react */ "react"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var ColumnProperties = __webpack_require__(/*! ./columnProperties.js */ "./node_modules/griddle-react/modules/columnProperties.js"); +var assign = __webpack_require__(/*! lodash/assign */ "./node_modules/lodash/assign.js"); + +var DefaultHeaderComponent = createReactClass({ + render: function render() { + return React.createElement('span', null, this.props.displayName); + } +}); + +var GridTitle = createReactClass({ + getDefaultProps: function getDefaultProps() { + return { + "columnSettings": null, + "filterByColumn": function filterByColumn() {}, + "rowSettings": null, + "sortSettings": null, + "multipleSelectionSettings": null, + "headerStyle": null, + "useGriddleStyles": true, + "useGriddleIcons": true, + "headerStyles": {} + }; + }, + componentWillMount: function componentWillMount() { + this.verifyProps(); + }, + sort: function sort(column) { + var that = this; + return function (event) { + that.props.sortSettings.changeSort(column); + }; + }, + toggleSelectAll: function toggleSelectAll(event) { + this.props.multipleSelectionSettings.toggleSelectAll(); + }, + handleSelectionChange: function handleSelectionChange(event) { + //hack to get around warning message that's not helpful in this case + return; + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridTitle: The columnSettings prop is null and it shouldn't be"); + } + + if (this.props.sortSettings === null) { + console.error("gridTitle: The sortSettings prop is null and it shouldn't be"); + } + }, + render: function render() { + this.verifyProps(); + var that = this; + var titleStyles = {}; + + var nodes = this.props.columnSettings.getColumns().map(function (col, index) { + var defaultTitleStyles = {}; + var columnSort = ""; + var columnIsSortable = that.props.columnSettings.getMetadataColumnProperty(col, "sortable", true); + var sortComponent = columnIsSortable ? that.props.sortSettings.sortDefaultComponent : null; + + if (that.props.sortSettings.sortColumn == col && that.props.sortSettings.sortDirection === 'asc') { + columnSort = that.props.sortSettings.sortAscendingClassName; + sortComponent = that.props.useGriddleIcons && that.props.sortSettings.sortAscendingComponent; + } else if (that.props.sortSettings.sortColumn == col && that.props.sortSettings.sortDirection === 'desc') { + columnSort += that.props.sortSettings.sortDescendingClassName; + sortComponent = that.props.useGriddleIcons && that.props.sortSettings.sortDescendingComponent; + } + + var meta = that.props.columnSettings.getColumnMetadataByName(col); + var displayName = that.props.columnSettings.getMetadataColumnProperty(col, "displayName", col); + var HeaderComponent = that.props.columnSettings.getMetadataColumnProperty(col, "customHeaderComponent", DefaultHeaderComponent); + var headerProps = that.props.columnSettings.getMetadataColumnProperty(col, "customHeaderComponentProps", {}); + + columnSort = meta == null ? columnSort : (columnSort && columnSort + " " || columnSort) + that.props.columnSettings.getMetadataColumnProperty(col, "cssClassName", ""); + + if (that.props.useGriddleStyles) { + defaultTitleStyles = { + backgroundColor: "#EDEDEF", + border: "0px", + borderBottom: "1px solid #DDD", + color: "#222", + padding: "5px", + cursor: columnIsSortable ? "pointer" : "default" + }; + } + titleStyles = meta && meta.titleStyles ? assign({}, defaultTitleStyles, meta.titleStyles) : assign({}, defaultTitleStyles); + + var ComponentClass = displayName ? 'th' : 'td'; + return React.createElement(ComponentClass, { onClick: columnIsSortable ? that.sort(col) : null, 'data-title': col, className: columnSort, key: col, + style: titleStyles }, React.createElement(HeaderComponent, _extends({ columnName: col, displayName: displayName, + filterByColumn: that.props.filterByColumn }, headerProps)), sortComponent); + }); + + if (nodes && this.props.multipleSelectionSettings.isMultipleSelection) { + nodes.unshift(React.createElement('th', { key: 'selection', onClick: this.toggleSelectAll, style: titleStyles, className: 'griddle-select griddle-select-title' }, React.createElement('input', { + type: 'checkbox', + checked: this.props.multipleSelectionSettings.getIsSelectAllChecked(), + onChange: this.handleSelectionChange + }))); + } + + //Get the row from the row settings. + var className = that.props.rowSettings && that.props.rowSettings.getHeaderRowMetadataClass() || null; + + return React.createElement('thead', null, React.createElement('tr', { + className: className, + style: this.props.headerStyles }, nodes)); + } +}); + +module.exports = GridTitle; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/griddle.jsx.js": +/*!***********************************************************!*\ + !*** ./node_modules/griddle-react/modules/griddle.jsx.js ***! + \***********************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + Griddle - Simple Grid Component for React + https://github.com/DynamicTyped/Griddle + Copyright (c) 2014 Ryan Lanciaux | DynamicTyped + + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE +*/ + + +var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i];for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + }return target; +}; + +var React = __webpack_require__(/*! react */ "react"); +var PropTypes = __webpack_require__(/*! prop-types */ "prop-types"); +var createReactClass = __webpack_require__(/*! create-react-class */ "./node_modules/create-react-class/index.js"); +var GridTable = __webpack_require__(/*! ./gridTable.jsx */ "./node_modules/griddle-react/modules/gridTable.jsx.js"); +var GridFilter = __webpack_require__(/*! ./gridFilter.jsx */ "./node_modules/griddle-react/modules/gridFilter.jsx.js"); +var GridPagination = __webpack_require__(/*! ./gridPagination.jsx */ "./node_modules/griddle-react/modules/gridPagination.jsx.js"); +var GridSettings = __webpack_require__(/*! ./gridSettings.jsx */ "./node_modules/griddle-react/modules/gridSettings.jsx.js"); +var GridNoData = __webpack_require__(/*! ./gridNoData.jsx */ "./node_modules/griddle-react/modules/gridNoData.jsx.js"); +var GridRow = __webpack_require__(/*! ./gridRow.jsx */ "./node_modules/griddle-react/modules/gridRow.jsx.js"); +var GridRowContainer = __webpack_require__(/*! ./gridRowContainer.jsx */ "./node_modules/griddle-react/modules/gridRowContainer.jsx.js"); +var CustomRowComponentContainer = __webpack_require__(/*! ./customRowComponentContainer.jsx */ "./node_modules/griddle-react/modules/customRowComponentContainer.jsx.js"); +var CustomPaginationContainer = __webpack_require__(/*! ./customPaginationContainer.jsx */ "./node_modules/griddle-react/modules/customPaginationContainer.jsx.js"); +var CustomFilterContainer = __webpack_require__(/*! ./customFilterContainer.jsx */ "./node_modules/griddle-react/modules/customFilterContainer.jsx.js"); +var ColumnProperties = __webpack_require__(/*! ./columnProperties */ "./node_modules/griddle-react/modules/columnProperties.js"); +var RowProperties = __webpack_require__(/*! ./rowProperties */ "./node_modules/griddle-react/modules/rowProperties.js"); +var deep = __webpack_require__(/*! ./deep */ "./node_modules/griddle-react/modules/deep.js"); + +var drop = __webpack_require__(/*! lodash/drop */ "./node_modules/lodash/drop.js"); +var dropRight = __webpack_require__(/*! lodash/dropRight */ "./node_modules/lodash/dropRight.js"); +var find = __webpack_require__(/*! lodash/find */ "./node_modules/lodash/find.js"); +var first = __webpack_require__(/*! lodash/take */ "./node_modules/lodash/take.js"); +var forEach = __webpack_require__(/*! lodash/forEach */ "./node_modules/lodash/forEach.js"); +var initial = __webpack_require__(/*! lodash/initial */ "./node_modules/lodash/initial.js"); +var intersection = __webpack_require__(/*! lodash/intersection */ "./node_modules/lodash/intersection.js"); +var isArray = __webpack_require__(/*! lodash/isArray */ "./node_modules/lodash/isArray.js"); +var isEmpty = __webpack_require__(/*! lodash/isEmpty */ "./node_modules/lodash/isEmpty.js"); +var isNull = __webpack_require__(/*! lodash/isNull */ "./node_modules/lodash/isNull.js"); +var isUndefined = __webpack_require__(/*! lodash/isUndefined */ "./node_modules/lodash/isUndefined.js"); +var omit = __webpack_require__(/*! lodash/omit */ "./node_modules/lodash/omit.js"); +var map = __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js"); +var extend = __webpack_require__(/*! lodash/assign */ "./node_modules/lodash/assign.js"); +var _filter = __webpack_require__(/*! lodash/filter */ "./node_modules/lodash/filter.js"); + +var _orderBy = __webpack_require__(/*! lodash/orderBy */ "./node_modules/lodash/orderBy.js"); +var _property = __webpack_require__(/*! lodash/property */ "./node_modules/lodash/property.js"); +var _get = __webpack_require__(/*! lodash/get */ "./node_modules/lodash/get.js"); +var _some = __webpack_require__(/*! lodash/some */ "./node_modules/lodash/some.js"); + +var Griddle = createReactClass({ + statics: { + GridTable: GridTable, + GridFilter: GridFilter, + GridPagination: GridPagination, + GridSettings: GridSettings, + GridRow: GridRow + }, + columnSettings: null, + rowSettings: null, + getDefaultProps: function getDefaultProps() { + return { + "columns": [], + "gridMetadata": null, + "columnMetadata": [], + "rowMetadata": null, + "results": [], // Used if all results are already loaded. + "initialSort": "", + "gridClassName": "", + "tableClassName": "", + "customRowComponentClassName": "", + "settingsText": "Settings", + "filterPlaceholderText": "Filter Results", + "nextText": "Next", + "previousText": "Previous", + "maxRowsText": "Rows per page", + "enableCustomFormatText": "Enable Custom Formatting", + //this column will determine which column holds subgrid data + //it will be passed through with the data object but will not be rendered + "childrenColumnName": "children", + //Any column in this list will be treated as metadata and will be passed through with the data but won't be rendered + "metadataColumns": [], + "showFilter": false, + "showSettings": false, + "useCustomRowComponent": false, + "useCustomGridComponent": false, + "useCustomPagerComponent": false, + "useCustomFilterer": false, + "useCustomFilterComponent": false, + "useGriddleStyles": true, + "useGriddleIcons": true, + "customRowComponent": null, + "customGridComponent": null, + "customPagerComponent": {}, + "customFilterComponent": null, + "customFilterer": null, + "globalData": null, + "enableToggleCustom": false, + "noDataMessage": "There is no data to display.", + "noDataClassName": "griddle-nodata", + "customNoDataComponent": null, + "customNoDataComponentProps": null, + "allowEmptyGrid": false, + "showTableHeading": true, + "showPager": true, + "useFixedHeader": false, + "useExternal": false, + "externalSetPage": null, + "externalChangeSort": null, + "externalSetFilter": null, + "externalSetPageSize": null, + "externalMaxPage": null, + "externalCurrentPage": null, + "externalSortColumn": null, + "externalSortAscending": true, + "externalLoadingComponent": null, + "externalIsLoading": false, + "enableInfiniteScroll": false, + "bodyHeight": null, + "paddingHeight": 5, + "rowHeight": 25, + "infiniteScrollLoadTreshold": 50, + "useFixedLayout": true, + "isSubGriddle": false, + "enableSort": true, + "onRowClick": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null, + /* css class names */ + "sortAscendingClassName": "sort-ascending", + "sortDescendingClassName": "sort-descending", + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "settingsToggleClassName": "settings", + "nextClassName": "griddle-next", + "previousClassName": "griddle-previous", + "headerStyles": {}, + /* icon components */ + "sortAscendingComponent": " â–²", + "sortDescendingComponent": " â–¼", + "sortDefaultComponent": null, + "parentRowCollapsedComponent": "â–¶", + "parentRowExpandedComponent": "â–¼", + "settingsIconComponent": "", + "nextIconComponent": "", + "previousIconComponent": "", + "isMultipleSelection": false, //currently does not support subgrids + "selectedRowIds": [], + "uniqueIdentifier": "id", + "onSelectionChange": null, + "columnFilterFunc": null + }; + }, + propTypes: { + isMultipleSelection: PropTypes.bool, + selectedRowIds: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.arrayOf(PropTypes.string)]), + uniqueIdentifier: PropTypes.string, + onSelectionChange: PropTypes.func, + columnFilterFunc: PropTypes.func + }, + defaultFilter: function defaultFilter(results, filter) { + var that = this; + return _filter(results, function (item) { + var arr = deep.keys(item); + for (var i = 0; i < arr.length; i++) { + var isFilterable = that.columnSettings.getMetadataColumnProperty(arr[i], "filterable", true); + if (isFilterable && (deep.getAt(item, arr[i]) || "").toString().toLowerCase().indexOf(filter.toLowerCase()) >= 0) { + return true; + } + } + return false; + }); + }, + + defaultColumnFilter: function defaultColumnFilter(columnName, value, filter) { + var filters = map(isArray(filter) ? filter : [filter], function (filter) { + return (filter || '').toLowerCase(); + }); + return _some(deep.getObjectValues(value), function (value) { + value = value.toString().toLowerCase(); + return _some(filters, function (filter) { + return value.indexOf(filter) >= 0; + }); + }); + }, + + filterByColumnFilters: function filterByColumnFilters(columnFilters) { + var filterFunction = this.props.columnFilterFunc || this.defaultColumnFilter; + var filteredResults = Object.keys(columnFilters).reduce(function (previous, current) { + return _filter(previous, function (item) { + var value = deep.getAt(item, current || ""); + var filter = columnFilters[current]; + return filterFunction(current || '', value, filter); + }); + }, this.props.results); + + var newState = { + columnFilters: columnFilters + }; + + if (columnFilters) { + newState.filteredResults = filteredResults; + newState.maxPage = this.getMaxPage(newState.filteredResults); + } else if (this.state.filter) { + newState.filteredResults = this.props.useCustomFilterer ? this.props.customFilterer(this.props.results, filter) : this.defaultFilter(this.props.results, filter); + } else { + newState.filteredResults = null; + } + + this.setState(newState); + }, + + filterByColumn: function filterByColumn(filter, column) { + var columnFilters = this.state.columnFilters; + + //if filter is "" remove it from the columnFilters object + if (columnFilters.hasOwnProperty(column) && !filter) { + columnFilters = omit(columnFilters, column); + } else { + var newObject = {}; + newObject[column] = filter; + columnFilters = extend({}, columnFilters, newObject); + } + + this.filterByColumnFilters(columnFilters); + }, + + /* if we have a filter display the max page and results accordingly */ + setFilter: function setFilter(filter) { + var updatedResults = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + + if (this.props.useExternal) { + this.props.externalSetFilter(filter); + return; + } + + var that = this, + updatedState = { + page: 0, + filter: filter + }; + + // Obtain the state results. + updatedState.filteredResults = this.props.useCustomFilterer ? this.props.customFilterer(updatedResults || this.props.results, filter) : this.defaultFilter(updatedResults || this.props.results, filter); + + // Update the max page. + updatedState.maxPage = that.getMaxPage(updatedState.filteredResults); + + //if filter is null or undefined reset the filter. + if (isUndefined(filter) || isNull(filter) || isEmpty(filter)) { + updatedState.filter = filter; + updatedState.filteredResults = null; + } + + // Set the state. + that.setState(updatedState); + + this._resetSelectedRows(); + }, + setPageSize: function setPageSize(size) { + if (this.props.useExternal) { + this.setState({ + resultsPerPage: size + }); + this.props.externalSetPageSize(size); + return; + } + //make this better. + this.state.resultsPerPage = size; + this.setMaxPage(); + }, + toggleColumnChooser: function toggleColumnChooser() { + this.setState({ + showColumnChooser: !this.state.showColumnChooser + }); + }, + isNullOrUndefined: function isNullOrUndefined(value) { + return value === undefined || value === null; + }, + shouldUseCustomRowComponent: function shouldUseCustomRowComponent() { + return this.isNullOrUndefined(this.state.useCustomRowComponent) ? this.props.useCustomRowComponent : this.state.useCustomRowComponent; + }, + shouldUseCustomGridComponent: function shouldUseCustomGridComponent() { + return this.isNullOrUndefined(this.state.useCustomGridComponent) ? this.props.useCustomGridComponent : this.state.useCustomGridComponent; + }, + toggleCustomComponent: function toggleCustomComponent() { + if (this.state.customComponentType === "grid") { + this.setState({ + useCustomGridComponent: !this.shouldUseCustomGridComponent() + }); + } else if (this.state.customComponentType === "row") { + this.setState({ + useCustomRowComponent: !this.shouldUseCustomRowComponent() + }); + } + }, + getMaxPage: function getMaxPage(results, totalResults) { + if (this.props.useExternal) { + return this.props.externalMaxPage; + } + + if (!totalResults) { + totalResults = (results || this.getCurrentResults()).length; + } + var maxPage = Math.ceil(totalResults / this.state.resultsPerPage); + return maxPage; + }, + setMaxPage: function setMaxPage(results) { + var maxPage = this.getMaxPage(results); + //re-render if we have new max page value + if (this.state.maxPage !== maxPage) { + this.setState({ page: 0, maxPage: maxPage, filteredColumns: this.columnSettings.filteredColumns }); + } + }, + setPage: function setPage(number) { + if (this.props.useExternal) { + this.props.externalSetPage(number); + return; + } + + //check page size and move the filteredResults to pageSize * pageNumber + if (number * this.state.resultsPerPage <= this.state.resultsPerPage * this.state.maxPage) { + var that = this, + state = { + page: number + }; + + that.setState(state); + } + + //When infinite scrolling is enabled, uncheck the "select all" checkbox, since more unchecked rows will be appended at the end + if (this.props.enableInfiniteScroll) { + this.setState({ + isSelectAllChecked: false + }); + } + }, + setColumns: function setColumns(columns) { + this.columnSettings.filteredColumns = isArray(columns) ? columns : [columns]; + + this.setState({ + filteredColumns: this.columnSettings.filteredColumns + }); + }, + nextPage: function nextPage() { + var currentPage = this.getCurrentPage(); + if (currentPage < this.getCurrentMaxPage() - 1) { + this.setPage(currentPage + 1); + } + }, + previousPage: function previousPage() { + var currentPage = this.getCurrentPage(); + if (currentPage > 0) { + this.setPage(currentPage - 1); + } + }, + changeSort: function changeSort(column) { + if (this.props.enableSort === false) { + return; + } + + if (this.props.useExternal) { + var isAscending = this.props.externalSortColumn === column ? !this.props.externalSortAscending : true; + this.setState({ + sortColumn: column, + sortDirection: isAscending ? 'asc' : 'desc' + }); + this.props.externalChangeSort(column, isAscending); + return; + } + var columnMeta = find(this.props.columnMetadata, { columnName: column }) || {}; + var sortDirectionCycle = columnMeta.sortDirectionCycle ? columnMeta.sortDirectionCycle : [null, 'asc', 'desc']; + var sortDirection = null; + // Find the current position in the cycle (or -1). + var i = sortDirectionCycle.indexOf(this.state.sortDirection && column === this.state.sortColumn ? this.state.sortDirection : null); + + // Proceed to the next position in the cycle (or start at the beginning). + i = (i + 1) % sortDirectionCycle.length; + + if (sortDirectionCycle[i]) { + sortDirection = sortDirectionCycle[i]; + } else { + sortDirection = null; + } + + var state = { + page: 0, + sortColumn: column, + sortDirection: sortDirection + }; + + this.setState(state); + }, + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + // Check if results props changed + if (nextProps.results !== this.props.results) { + this.setFilter(this.state.filter, nextProps.results); + } + + this.setMaxPage(nextProps.results); + if (nextProps.resultsPerPage !== this.props.resultsPerPage) { + this.setPageSize(nextProps.resultsPerPage); + } + //This will updaet the column Metadata + this.columnSettings.columnMetadata = nextProps.columnMetadata; + if (nextProps.results.length > 0) { + var deepKeys = deep.keys(nextProps.results[0]); + + var is_same = this.columnSettings.allColumns.length == deepKeys.length && this.columnSettings.allColumns.every(function (element, index) { + return element === deepKeys[index]; + }); + + if (!is_same) { + this.columnSettings.allColumns = deepKeys; + } + } else if (this.columnSettings.allColumns.length > 0) { + this.columnSettings.allColumns = []; + } + + if (nextProps.selectedRowIds) { + var visibleRows = this.getDataForRender(this.getCurrentResults(nextProps.results), this.columnSettings.getColumns(), true); + + this.setState({ + isSelectAllChecked: this._getAreAllRowsChecked(nextProps.selectedRowIds, map(visibleRows, this.props.uniqueIdentifier)), + selectedRowIds: nextProps.selectedRowIds + }); + } + }, + getInitialState: function getInitialState() { + var state = { + maxPage: 0, + page: 0, + filteredResults: null, + filteredColumns: [], + filter: "", + //this sets the individual column filters + columnFilters: {}, + resultsPerPage: this.props.resultsPerPage || 5, + showColumnChooser: false, + isSelectAllChecked: false, + selectedRowIds: this.props.selectedRowIds + }; + return state; + }, + componentWillMount: function componentWillMount() { + this.verifyExternal(); + this.verifyCustom(); + + this.columnSettings = new ColumnProperties(this.props.results.length > 0 ? deep.keys(this.props.results[0]) : [], this.props.columns, this.props.childrenColumnName, this.props.columnMetadata, this.props.metadataColumns); + + this.rowSettings = new RowProperties(this.props.rowMetadata, this.props.useCustomTableRowComponent && this.props.customTableRowComponent ? this.props.customTableRowComponent : GridRow, this.props.useCustomTableRowComponent); + + if (this.props.initialSort) { + // shouldn't change Sort on init for external + if (this.props.useExternal) { + this.setState({ + sortColumn: this.props.externalSortColumn, + sortDirection: this.props.externalSortAscending ? 'asc' : 'desc' + }); + } else { + this.changeSort(this.props.initialSort); + } + } + this.setMaxPage(); + + //don't like the magic strings + if (this.shouldUseCustomGridComponent()) { + this.setState({ + customComponentType: "grid" + }); + } else if (this.shouldUseCustomRowComponent()) { + this.setState({ + customComponentType: "row" + }); + } else { + this.setState({ + filteredColumns: this.columnSettings.filteredColumns + }); + } + }, + componentDidMount: function componentDidMount() { + if (this.props.componentDidMount && typeof this.props.componentDidMount === "function") { + return this.props.componentDidMount(); + } + }, + componentDidUpdate: function componentDidUpdate() { + if (this.props.componentDidUpdate && typeof this.props.componentDidUpdate === "function") { + return this.props.componentDidUpdate(this.state); + } + }, + //todo: clean these verify methods up + verifyExternal: function verifyExternal() { + if (this.props.useExternal === true) { + //hooray for big ugly nested if + if (this.props.externalSetPage === null) { + console.error("useExternal is set to true but there is no externalSetPage function specified."); + } + + if (this.props.externalChangeSort === null) { + console.error("useExternal is set to true but there is no externalChangeSort function specified."); + } + + if (this.props.externalSetFilter === null) { + console.error("useExternal is set to true but there is no externalSetFilter function specified."); + } + + if (this.props.externalSetPageSize === null) { + console.error("useExternal is set to true but there is no externalSetPageSize function specified."); + } + + if (this.props.externalMaxPage === null) { + console.error("useExternal is set to true but externalMaxPage is not set."); + } + + if (this.props.externalCurrentPage === null) { + console.error("useExternal is set to true but externalCurrentPage is not set. Griddle will not page correctly without that property when using external data."); + } + } + }, + //TODO: Do this with propTypes + verifyCustom: function verifyCustom() { + if (this.props.useCustomGridComponent === true && this.props.customGridComponent === null) { + console.error("useCustomGridComponent is set to true but no custom component was specified."); + } + if (this.props.useCustomRowComponent === true && this.props.customRowComponent === null) { + console.error("useCustomRowComponent is set to true but no custom component was specified."); + } + if (this.props.useCustomGridComponent === true && this.props.useCustomRowComponent === true) { + console.error("Cannot currently use both customGridComponent and customRowComponent."); + } + if (this.props.useCustomFilterer === true && this.props.customFilterer === null) { + console.error("useCustomFilterer is set to true but no custom filter function was specified."); + } + if (this.props.useCustomFilterComponent === true && this.props.customFilterComponent === null) { + console.error("useCustomFilterComponent is set to true but no customFilterComponent was specified."); + } + }, + getDataForRender: function getDataForRender(data, cols, pageList) { + var _this = this; + + var that = this; + + if (!this.props.useExternal) { + if (this.state.sortColumn !== "") { + var column = this.state.sortColumn; + var sortColumn = _filter(this.props.columnMetadata, { columnName: column }); + var customCompareFn; + var multiSort = { + columns: [], + orders: [] + }; + + if (sortColumn.length > 0) { + customCompareFn = sortColumn[0].hasOwnProperty("customCompareFn") && sortColumn[0]["customCompareFn"]; + if (sortColumn[0]["multiSort"]) { + multiSort = sortColumn[0]["multiSort"]; + } + } + + if (this.state.sortDirection) { + if (typeof customCompareFn === 'function') { + if (customCompareFn.length === 2) { + data = data.sort(function (a, b) { + return customCompareFn(_get(a, column), _get(b, column)); + }); + + if (this.state.sortDirection === 'desc') { + data.reverse(); + } + } else if (customCompareFn.length === 1) { + data = _orderBy(data, function (item) { + return customCompareFn(_get(item, column)); + }, [this.state.sortDirection]); + } + } else { + var iteratees = [function (row) { + return (_get(row, column) || '').toString().toLowerCase(); + }]; + var orders = [this.state.sortDirection]; + multiSort.columns.forEach(function (col, i) { + iteratees.push(function (row) { + return (_get(row, col) || '').toString().toLowerCase(); + }); + if (multiSort.orders[i] === 'asc' || multiSort.orders[i] === 'desc') { + orders.push(multiSort.orders[i]); + } else { + orders.push(_this.state.sortDirection); + } + }); + + data = _orderBy(data, iteratees, orders); + } + } + } + + var currentPage = this.getCurrentPage(); + + if (!this.props.useExternal && pageList && this.state.resultsPerPage * (currentPage + 1) <= this.state.resultsPerPage * this.state.maxPage && currentPage >= 0) { + if (this.isInfiniteScrollEnabled()) { + // If we're doing infinite scroll, grab all results up to the current page. + data = first(data, (currentPage + 1) * this.state.resultsPerPage); + } else { + //the 'rest' is grabbing the whole array from index on and the 'initial' is getting the first n results + var rest = drop(data, currentPage * this.state.resultsPerPage); + data = (dropRight || initial)(rest, rest.length - this.state.resultsPerPage); + } + } + } + + var transformedData = []; + + for (var i = 0; i < data.length; i++) { + var mappedData = data[i]; + + if (typeof mappedData[that.props.childrenColumnName] !== "undefined" && mappedData[that.props.childrenColumnName].length > 0) { + //internally we're going to use children instead of whatever it is so we don't have to pass the custom name around + mappedData["children"] = that.getDataForRender(mappedData[that.props.childrenColumnName], cols, false); + + if (that.props.childrenColumnName !== "children") { + delete mappedData[that.props.childrenColumnName]; + } + } + + transformedData.push(mappedData); + } + return transformedData; + }, + getCurrentResults: function getCurrentResults(results) { + return this.state.filteredResults || results || this.props.results; + }, + getCurrentPage: function getCurrentPage() { + return this.props.externalCurrentPage || this.state.page; + }, + getCurrentSort: function getCurrentSort() { + return this.props.useExternal ? this.props.externalSortColumn : this.state.sortColumn; + }, + getCurrentSortAscending: function getCurrentSortAscending() { + return this.props.useExternal ? this.props.externalSortAscending : this.state.sortDirection === 'asc'; + }, + getCurrentMaxPage: function getCurrentMaxPage() { + return this.props.useExternal ? this.props.externalMaxPage : this.state.maxPage; + }, + //This takes the props relating to sort and puts them in one object + getSortObject: function getSortObject() { + return { + enableSort: this.props.enableSort, + changeSort: this.changeSort, + sortColumn: this.getCurrentSort(), + sortAscending: this.getCurrentSortAscending(), + sortDirection: this.state.sortDirection, + sortAscendingClassName: this.props.sortAscendingClassName, + sortDescendingClassName: this.props.sortDescendingClassName, + sortAscendingComponent: this.props.sortAscendingComponent, + sortDescendingComponent: this.props.sortDescendingComponent, + sortDefaultComponent: this.props.sortDefaultComponent + }; + }, + _toggleSelectAll: function _toggleSelectAll() { + var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true), + newIsSelectAllChecked = !this.state.isSelectAllChecked, + newSelectedRowIds = JSON.parse(JSON.stringify(this.state.selectedRowIds)); + + var self = this; + forEach(visibleRows, function (row) { + self._updateSelectedRowIds(row[self.props.uniqueIdentifier], newSelectedRowIds, newIsSelectAllChecked); + }, this); + + this.setState({ + isSelectAllChecked: newIsSelectAllChecked, + selectedRowIds: newSelectedRowIds + }); + + if (this.props.onSelectionChange) { + this.props.onSelectionChange(newSelectedRowIds, newIsSelectAllChecked); + } + }, + _toggleSelectRow: function _toggleSelectRow(row, isChecked) { + var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true), + newSelectedRowIds = JSON.parse(JSON.stringify(this.state.selectedRowIds)); + + this._updateSelectedRowIds(row[this.props.uniqueIdentifier], newSelectedRowIds, isChecked); + + var newIsSelectAllChecked = this._getAreAllRowsChecked(newSelectedRowIds, map(visibleRows, this.props.uniqueIdentifier)); + + this.setState({ + isSelectAllChecked: newIsSelectAllChecked, + selectedRowIds: newSelectedRowIds + }); + + if (this.props.onSelectionChange) { + this.props.onSelectionChange(newSelectedRowIds, newIsSelectAllChecked); + } + }, + _updateSelectedRowIds: function _updateSelectedRowIds(id, selectedRowIds, isChecked) { + + var isFound; + + if (isChecked) { + isFound = find(selectedRowIds, function (item) { + return id === item; + }); + + if (isFound === undefined) { + selectedRowIds.push(id); + } + } else { + selectedRowIds.splice(selectedRowIds.indexOf(id), 1); + } + }, + _getIsSelectAllChecked: function _getIsSelectAllChecked() { + + return this.state.isSelectAllChecked; + }, + _getAreAllRowsChecked: function _getAreAllRowsChecked(selectedRowIds, visibleRowIds) { + + return visibleRowIds.length === intersection(visibleRowIds, selectedRowIds).length; + }, + _getIsRowChecked: function _getIsRowChecked(row) { + + return this.state.selectedRowIds.indexOf(row[this.props.uniqueIdentifier]) > -1 ? true : false; + }, + getSelectedRowIds: function getSelectedRowIds() { + + return this.state.selectedRowIds; + }, + _resetSelectedRows: function _resetSelectedRows() { + + this.setState({ + isSelectAllChecked: false, + selectedRowIds: [] + }); + }, + //This takes the props relating to multiple selection and puts them in one object + getMultipleSelectionObject: function getMultipleSelectionObject() { + + return { + isMultipleSelection: find(this.props.results, function (result) { + return 'children' in result; + }) ? false : this.props.isMultipleSelection, //does not support subgrids + toggleSelectAll: this._toggleSelectAll, + getIsSelectAllChecked: this._getIsSelectAllChecked, + toggleSelectRow: this._toggleSelectRow, + getSelectedRowIds: this.getSelectedRowIds, + getIsRowChecked: this._getIsRowChecked + }; + }, + isInfiniteScrollEnabled: function isInfiniteScrollEnabled() { + // If a custom pager is included, don't allow for infinite scrolling. + if (this.props.useCustomPagerComponent) { + return false; + } + + // Otherwise, send back the property. + return this.props.enableInfiniteScroll; + }, + getClearFixStyles: function getClearFixStyles() { + return { + clear: "both", + display: "table", + width: "100%" + }; + }, + getSettingsStyles: function getSettingsStyles() { + return { + "float": "left", + width: "50%", + textAlign: "right" + }; + }, + getFilterStyles: function getFilterStyles() { + return { + "float": "left", + width: "50%", + textAlign: "left", + color: "#222", + minHeight: "1px" + }; + }, + getFilter: function getFilter() { + return this.props.showFilter && this.shouldUseCustomGridComponent() === false ? this.props.useCustomFilterComponent ? React.createElement(CustomFilterContainer, { changeFilter: this.setFilter, placeholderText: this.props.filterPlaceholderText, customFilterComponent: this.props.customFilterComponent, results: this.props.results, currentResults: this.getCurrentResults() }) : React.createElement(GridFilter, { changeFilter: this.setFilter, placeholderText: this.props.filterPlaceholderText }) : ""; + }, + getSettings: function getSettings() { + return this.props.showSettings ? React.createElement('button', { type: 'button', className: this.props.settingsToggleClassName, onClick: this.toggleColumnChooser, + style: this.props.useGriddleStyles ? { background: "none", border: "none", padding: 0, margin: 0, fontSize: 14 } : null }, this.props.settingsText, this.props.settingsIconComponent) : ""; + }, + getTopSection: function getTopSection(filter, settings) { + if (this.props.showFilter === false && this.props.showSettings === false) { + return ""; + } + + var filterStyles = null, + settingsStyles = null, + topContainerStyles = null; + + if (this.props.useGriddleStyles) { + filterStyles = this.getFilterStyles(); + settingsStyles = this.getSettingsStyles(); + + topContainerStyles = this.getClearFixStyles(); + } + + return React.createElement('div', { className: 'top-section', style: topContainerStyles }, React.createElement('div', { className: 'griddle-filter', style: filterStyles }, filter), React.createElement('div', { className: 'griddle-settings-toggle', style: settingsStyles }, settings)); + }, + getPagingSection: function getPagingSection(currentPage, maxPage) { + if ((this.props.showPager && !this.isInfiniteScrollEnabled() && !this.shouldUseCustomGridComponent()) === false) { + return undefined; + } + + return React.createElement('div', { className: 'griddle-footer' }, this.props.useCustomPagerComponent ? React.createElement(CustomPaginationContainer, { customPagerComponentOptions: this.props.customPagerComponentOptions, next: this.nextPage, previous: this.previousPage, currentPage: currentPage, maxPage: maxPage, setPage: this.setPage, nextText: this.props.nextText, previousText: this.props.previousText, customPagerComponent: this.props.customPagerComponent }) : React.createElement(GridPagination, { useGriddleStyles: this.props.useGriddleStyles, next: this.nextPage, previous: this.previousPage, nextClassName: this.props.nextClassName, nextIconComponent: this.props.nextIconComponent, previousClassName: this.props.previousClassName, previousIconComponent: this.props.previousIconComponent, currentPage: currentPage, maxPage: maxPage, setPage: this.setPage, nextText: this.props.nextText, previousText: this.props.previousText })); + }, + getColumnSelectorSection: function getColumnSelectorSection(keys, cols) { + return this.state.showColumnChooser ? React.createElement(GridSettings, { columns: keys, selectedColumns: cols, setColumns: this.setColumns, settingsText: this.props.settingsText, + settingsIconComponent: this.props.settingsIconComponent, maxRowsText: this.props.maxRowsText, setPageSize: this.setPageSize, + showSetPageSize: !this.shouldUseCustomGridComponent(), resultsPerPage: this.state.resultsPerPage, enableToggleCustom: this.props.enableToggleCustom, + toggleCustomComponent: this.toggleCustomComponent, useCustomComponent: this.shouldUseCustomRowComponent() || this.shouldUseCustomGridComponent(), + useGriddleStyles: this.props.useGriddleStyles, enableCustomFormatText: this.props.enableCustomFormatText, columnMetadata: this.props.columnMetadata }) : ""; + }, + getCustomGridSection: function getCustomGridSection() { + return React.createElement(this.props.customGridComponent, _extends({ data: this.props.results, className: this.props.customGridComponentClassName }, this.props.gridMetadata)); + }, + getCustomRowSection: function getCustomRowSection(data, cols, meta, pagingContent, globalData) { + return React.createElement('div', null, React.createElement(CustomRowComponentContainer, { data: data, columns: cols, metadataColumns: meta, globalData: globalData, + className: this.props.customRowComponentClassName, customComponent: this.props.customRowComponent, + style: this.props.useGriddleStyles ? this.getClearFixStyles() : null }), this.props.showPager && pagingContent); + }, + getStandardGridSection: function getStandardGridSection(data, cols, meta, pagingContent, hasMorePages) { + var sortProperties = this.getSortObject(); + var multipleSelectionProperties = this.getMultipleSelectionObject(); + + // no data section + var showNoData = this.shouldShowNoDataSection(data); + var noDataSection = this.getNoDataSection(); + + return React.createElement('div', { className: 'griddle-body' }, React.createElement(GridTable, { useGriddleStyles: this.props.useGriddleStyles, + noDataSection: noDataSection, + showNoData: showNoData, + columnSettings: this.columnSettings, + rowSettings: this.rowSettings, + sortSettings: sortProperties, + multipleSelectionSettings: multipleSelectionProperties, + filterByColumn: this.filterByColumn, + isSubGriddle: this.props.isSubGriddle, + useGriddleIcons: this.props.useGriddleIcons, + useFixedLayout: this.props.useFixedLayout, + showPager: this.props.showPager, + pagingContent: pagingContent, + data: data, + className: this.props.tableClassName, + enableInfiniteScroll: this.isInfiniteScrollEnabled(), + nextPage: this.nextPage, + showTableHeading: this.props.showTableHeading, + useFixedHeader: this.props.useFixedHeader, + parentRowCollapsedClassName: this.props.parentRowCollapsedClassName, + parentRowExpandedClassName: this.props.parentRowExpandedClassName, + parentRowCollapsedComponent: this.props.parentRowCollapsedComponent, + parentRowExpandedComponent: this.props.parentRowExpandedComponent, + bodyHeight: this.props.bodyHeight, + paddingHeight: this.props.paddingHeight, + rowHeight: this.props.rowHeight, + infiniteScrollLoadTreshold: this.props.infiniteScrollLoadTreshold, + externalLoadingComponent: this.props.externalLoadingComponent, + externalIsLoading: this.props.externalIsLoading, + hasMorePages: hasMorePages, + onRowClick: this.props.onRowClick, + onRowMouseEnter: this.props.onRowMouseEnter, + onRowMouseLeave: this.props.onRowMouseLeave, + onRowWillMount: this.props.onRowWillMount, + onRowWillUnmount: this.props.onRowWillUnmount })); + }, + getContentSection: function getContentSection(data, cols, meta, pagingContent, hasMorePages, globalData) { + if (this.shouldUseCustomGridComponent() && this.props.customGridComponent !== null) { + return this.getCustomGridSection(); + } else if (this.shouldUseCustomRowComponent()) { + return this.getCustomRowSection(data, cols, meta, pagingContent, globalData); + } else { + return this.getStandardGridSection(data, cols, meta, pagingContent, hasMorePages); + } + }, + getNoDataSection: function getNoDataSection() { + if (this.props.customNoDataComponent != null) { + return React.createElement('div', { className: this.props.noDataClassName }, React.createElement(this.props.customNoDataComponent, this.props.customNoDataComponentProps)); + } + return React.createElement(GridNoData, { noDataMessage: this.props.noDataMessage }); + }, + shouldShowNoDataSection: function shouldShowNoDataSection(results) { + if (this.props.allowEmptyGrid) { + return false; + } + + return this.props.useExternal === false && (typeof results === 'undefined' || results.length === 0) || this.props.useExternal === true && this.props.externalIsLoading === false && results.length === 0; + }, + render: function render() { + var that = this, + results = this.getCurrentResults(); // Attempt to assign to the filtered results, if we have any. + + var headerTableClassName = this.props.tableClassName + " table-header"; + + //figure out if we want to show the filter section + var filter = this.getFilter(); + var settings = this.getSettings(); + + //if we have neither filter or settings don't need to render this stuff + var topSection = this.getTopSection(filter, settings); + + var keys = []; + var cols = this.columnSettings.getColumns(); + //figure out which columns are displayed and show only those + var data = this.getDataForRender(results, cols, true); + + var meta = this.columnSettings.getMetadataColumns(); + + if (this.props.columnMetadata) { + // Get column keys from column metadata + forEach(this.props.columnMetadata, function (meta) { + if (!(typeof meta.visible === 'boolean' && meta.visible === false)) { + keys.push(meta.columnName); + } + }); + } else { + // Grab the column keys from the first results + keys = deep.keys(omit(results[0], meta)); + } + + // sort keys by order + keys = this.columnSettings.orderColumns(keys); + + // Grab the current and max page values. + var currentPage = this.getCurrentPage(); + var maxPage = this.getCurrentMaxPage(); + + // Determine if we need to enable infinite scrolling on the table. + var hasMorePages = currentPage + 1 < maxPage; + + // Grab the paging content if it's to be displayed + var pagingContent = this.getPagingSection(currentPage, maxPage); + + var resultContent = this.getContentSection(data, cols, meta, pagingContent, hasMorePages, this.props.globalData); + + var columnSelector = this.getColumnSelectorSection(keys, cols); + + var gridClassName = this.props.gridClassName.length > 0 ? "griddle " + this.props.gridClassName : "griddle"; + //add custom to the class name so we can style it differently + gridClassName += this.shouldUseCustomRowComponent() ? " griddle-custom" : ""; + + return React.createElement('div', { className: gridClassName }, topSection, columnSelector, React.createElement('div', { className: 'griddle-container', style: this.props.useGriddleStyles && !this.props.isSubGriddle ? { border: "1px solid #DDD" } : null }, resultContent)); + } +}); + +GridRowContainer.Griddle = module.exports = Griddle; + + +/***/ }), + +/***/ "./node_modules/griddle-react/modules/rowProperties.js": +/*!*************************************************************!*\ + !*** ./node_modules/griddle-react/modules/rowProperties.js ***! + \*************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + +var _uniqueId = __webpack_require__(/*! lodash/uniqueId */ "./node_modules/lodash/uniqueId.js"); + +var RowProperties = (function () { + function RowProperties() { + var rowMetadata = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + var rowComponent = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var isCustom = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2]; + + _classCallCheck(this, RowProperties); + + this.rowMetadata = rowMetadata; + this.rowComponent = rowComponent; + this.isCustom = isCustom; + // assign unique Id to each griddle instance + } + + _createClass(RowProperties, [{ + key: 'getRowKey', + value: function getRowKey(row, key) { + var uniqueId; + + if (this.hasRowMetadataKey()) { + uniqueId = row[this.rowMetadata.key]; + } else { + uniqueId = _uniqueId("grid_row"); + } + + //todo: add error handling + + return uniqueId; + } + }, { + key: 'hasRowMetadataKey', + value: function hasRowMetadataKey() { + return this.hasRowMetadata() && this.rowMetadata.key !== null && this.rowMetadata.key !== undefined; + } + }, { + key: 'getBodyRowMetadataClass', + value: function getBodyRowMetadataClass(rowData) { + if (this.hasRowMetadata() && this.rowMetadata.bodyCssClassName !== null && this.rowMetadata.bodyCssClassName !== undefined) { + if (typeof this.rowMetadata.bodyCssClassName === 'function') { + return this.rowMetadata.bodyCssClassName(rowData); + } else { + return this.rowMetadata.bodyCssClassName; + } + } + return null; + } + }, { + key: 'getHeaderRowMetadataClass', + value: function getHeaderRowMetadataClass() { + return this.hasRowMetadata() && this.rowMetadata.headerCssClassName !== null && this.rowMetadata.headerCssClassName !== undefined ? this.rowMetadata.headerCssClassName : null; + } + }, { + key: 'hasRowMetadata', + value: function hasRowMetadata() { + return this.rowMetadata !== null; + } + }]); + + return RowProperties; +})(); + +module.exports = RowProperties; + + +/***/ }), + +/***/ "./node_modules/lodash/_DataView.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_DataView.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'); + +module.exports = DataView; + + +/***/ }), + +/***/ "./node_modules/lodash/_Hash.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/_Hash.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var hashClear = __webpack_require__(/*! ./_hashClear */ "./node_modules/lodash/_hashClear.js"), + hashDelete = __webpack_require__(/*! ./_hashDelete */ "./node_modules/lodash/_hashDelete.js"), + hashGet = __webpack_require__(/*! ./_hashGet */ "./node_modules/lodash/_hashGet.js"), + hashHas = __webpack_require__(/*! ./_hashHas */ "./node_modules/lodash/_hashHas.js"), + hashSet = __webpack_require__(/*! ./_hashSet */ "./node_modules/lodash/_hashSet.js"); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +module.exports = Hash; + + +/***/ }), + +/***/ "./node_modules/lodash/_ListCache.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_ListCache.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "./node_modules/lodash/_listCacheClear.js"), + listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "./node_modules/lodash/_listCacheDelete.js"), + listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "./node_modules/lodash/_listCacheGet.js"), + listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "./node_modules/lodash/_listCacheHas.js"), + listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "./node_modules/lodash/_listCacheSet.js"); + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +module.exports = ListCache; + + +/***/ }), + +/***/ "./node_modules/lodash/_Map.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/_Map.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); + +module.exports = Map; + + +/***/ }), + +/***/ "./node_modules/lodash/_MapCache.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_MapCache.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var mapCacheClear = __webpack_require__(/*! ./_mapCacheClear */ "./node_modules/lodash/_mapCacheClear.js"), + mapCacheDelete = __webpack_require__(/*! ./_mapCacheDelete */ "./node_modules/lodash/_mapCacheDelete.js"), + mapCacheGet = __webpack_require__(/*! ./_mapCacheGet */ "./node_modules/lodash/_mapCacheGet.js"), + mapCacheHas = __webpack_require__(/*! ./_mapCacheHas */ "./node_modules/lodash/_mapCacheHas.js"), + mapCacheSet = __webpack_require__(/*! ./_mapCacheSet */ "./node_modules/lodash/_mapCacheSet.js"); + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +module.exports = MapCache; + + +/***/ }), + +/***/ "./node_modules/lodash/_Promise.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_Promise.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var Promise = getNative(root, 'Promise'); + +module.exports = Promise; + + +/***/ }), + +/***/ "./node_modules/lodash/_Set.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/_Set.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); + +module.exports = Set; + + +/***/ }), + +/***/ "./node_modules/lodash/_SetCache.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_SetCache.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/lodash/_MapCache.js"), + setCacheAdd = __webpack_require__(/*! ./_setCacheAdd */ "./node_modules/lodash/_setCacheAdd.js"), + setCacheHas = __webpack_require__(/*! ./_setCacheHas */ "./node_modules/lodash/_setCacheHas.js"); + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +module.exports = SetCache; + + +/***/ }), + +/***/ "./node_modules/lodash/_Stack.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/_Stack.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"), + stackClear = __webpack_require__(/*! ./_stackClear */ "./node_modules/lodash/_stackClear.js"), + stackDelete = __webpack_require__(/*! ./_stackDelete */ "./node_modules/lodash/_stackDelete.js"), + stackGet = __webpack_require__(/*! ./_stackGet */ "./node_modules/lodash/_stackGet.js"), + stackHas = __webpack_require__(/*! ./_stackHas */ "./node_modules/lodash/_stackHas.js"), + stackSet = __webpack_require__(/*! ./_stackSet */ "./node_modules/lodash/_stackSet.js"); + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +module.exports = Stack; + + +/***/ }), + +/***/ "./node_modules/lodash/_Symbol.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/_Symbol.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/** Built-in value references. */ +var Symbol = root.Symbol; + +module.exports = Symbol; + + +/***/ }), + +/***/ "./node_modules/lodash/_Uint8Array.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_Uint8Array.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/** Built-in value references. */ +var Uint8Array = root.Uint8Array; + +module.exports = Uint8Array; + + +/***/ }), + +/***/ "./node_modules/lodash/_WeakMap.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_WeakMap.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var WeakMap = getNative(root, 'WeakMap'); + +module.exports = WeakMap; + + +/***/ }), + +/***/ "./node_modules/lodash/_apply.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/_apply.js ***! + \***************************************/ +/***/ (function(module) { + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +module.exports = apply; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayEach.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_arrayEach.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEach; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayFilter.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_arrayFilter.js ***! + \*********************************************/ +/***/ (function(module) { + +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = arrayFilter; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayIncludes.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_arrayIncludes.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ "./node_modules/lodash/_baseIndexOf.js"); + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; +} + +module.exports = arrayIncludes; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayIncludesWith.js": +/*!***************************************************!*\ + !*** ./node_modules/lodash/_arrayIncludesWith.js ***! + \***************************************************/ +/***/ (function(module) { + +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +module.exports = arrayIncludesWith; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayLikeKeys.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_arrayLikeKeys.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseTimes = __webpack_require__(/*! ./_baseTimes */ "./node_modules/lodash/_baseTimes.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"), + isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/lodash/isTypedArray.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +module.exports = arrayLikeKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayMap.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_arrayMap.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +module.exports = arrayMap; + + +/***/ }), + +/***/ "./node_modules/lodash/_arrayPush.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_arrayPush.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +module.exports = arrayPush; + + +/***/ }), + +/***/ "./node_modules/lodash/_arraySome.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_arraySome.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +module.exports = arraySome; + + +/***/ }), + +/***/ "./node_modules/lodash/_assignValue.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_assignValue.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/lodash/_baseAssignValue.js"), + eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +module.exports = assignValue; + + +/***/ }), + +/***/ "./node_modules/lodash/_assocIndexOf.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_assocIndexOf.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"); + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +module.exports = assocIndexOf; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseAssign.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseAssign.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} + +module.exports = baseAssign; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseAssignIn.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseAssignIn.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); + +/** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); +} + +module.exports = baseAssignIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseAssignValue.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseAssignValue.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var defineProperty = __webpack_require__(/*! ./_defineProperty */ "./node_modules/lodash/_defineProperty.js"); + +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } +} + +module.exports = baseAssignValue; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseClone.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseClone.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/lodash/_Stack.js"), + arrayEach = __webpack_require__(/*! ./_arrayEach */ "./node_modules/lodash/_arrayEach.js"), + assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + baseAssign = __webpack_require__(/*! ./_baseAssign */ "./node_modules/lodash/_baseAssign.js"), + baseAssignIn = __webpack_require__(/*! ./_baseAssignIn */ "./node_modules/lodash/_baseAssignIn.js"), + cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ "./node_modules/lodash/_cloneBuffer.js"), + copyArray = __webpack_require__(/*! ./_copyArray */ "./node_modules/lodash/_copyArray.js"), + copySymbols = __webpack_require__(/*! ./_copySymbols */ "./node_modules/lodash/_copySymbols.js"), + copySymbolsIn = __webpack_require__(/*! ./_copySymbolsIn */ "./node_modules/lodash/_copySymbolsIn.js"), + getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "./node_modules/lodash/_getAllKeys.js"), + getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ "./node_modules/lodash/_getAllKeysIn.js"), + getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + initCloneArray = __webpack_require__(/*! ./_initCloneArray */ "./node_modules/lodash/_initCloneArray.js"), + initCloneByTag = __webpack_require__(/*! ./_initCloneByTag */ "./node_modules/lodash/_initCloneByTag.js"), + initCloneObject = __webpack_require__(/*! ./_initCloneObject */ "./node_modules/lodash/_initCloneObject.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), + isMap = __webpack_require__(/*! ./isMap */ "./node_modules/lodash/isMap.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + isSet = __webpack_require__(/*! ./isSet */ "./node_modules/lodash/isSet.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; +} + +module.exports = baseClone; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseCreate.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseCreate.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); + +/** Built-in value references. */ +var objectCreate = Object.create; + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); + +module.exports = baseCreate; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseDifference.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_baseDifference.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var SetCache = __webpack_require__(/*! ./_SetCache */ "./node_modules/lodash/_SetCache.js"), + arrayIncludes = __webpack_require__(/*! ./_arrayIncludes */ "./node_modules/lodash/_arrayIncludes.js"), + arrayIncludesWith = __webpack_require__(/*! ./_arrayIncludesWith */ "./node_modules/lodash/_arrayIncludesWith.js"), + arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + cacheHas = __webpack_require__(/*! ./_cacheHas */ "./node_modules/lodash/_cacheHas.js"); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ +function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; +} + +module.exports = baseDifference; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseEach.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseEach.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "./node_modules/lodash/_baseForOwn.js"), + createBaseEach = __webpack_require__(/*! ./_createBaseEach */ "./node_modules/lodash/_createBaseEach.js"); + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +module.exports = baseEach; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseFilter.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseFilter.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/lodash/_baseEach.js"); + +/** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; +} + +module.exports = baseFilter; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseFindIndex.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_baseFindIndex.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +module.exports = baseFindIndex; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseFlatten.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseFlatten.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"), + isFlattenable = __webpack_require__(/*! ./_isFlattenable */ "./node_modules/lodash/_isFlattenable.js"); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +module.exports = baseFlatten; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseFor.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_baseFor.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var createBaseFor = __webpack_require__(/*! ./_createBaseFor */ "./node_modules/lodash/_createBaseFor.js"); + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +module.exports = baseFor; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseForOwn.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseForOwn.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseFor = __webpack_require__(/*! ./_baseFor */ "./node_modules/lodash/_baseFor.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +module.exports = baseForOwn; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseGet.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_baseGet.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +module.exports = baseGet; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseGetAllKeys.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_baseGetAllKeys.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +module.exports = baseGetAllKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseGetTag.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseGetTag.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), + getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"), + objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js"); + +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +module.exports = baseGetTag; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseHasIn.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseHasIn.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +module.exports = baseHasIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIndexOf.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseIndexOf.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ "./node_modules/lodash/_baseFindIndex.js"), + baseIsNaN = __webpack_require__(/*! ./_baseIsNaN */ "./node_modules/lodash/_baseIsNaN.js"), + strictIndexOf = __webpack_require__(/*! ./_strictIndexOf */ "./node_modules/lodash/_strictIndexOf.js"); + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); +} + +module.exports = baseIndexOf; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIntersection.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_baseIntersection.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var SetCache = __webpack_require__(/*! ./_SetCache */ "./node_modules/lodash/_SetCache.js"), + arrayIncludes = __webpack_require__(/*! ./_arrayIncludes */ "./node_modules/lodash/_arrayIncludes.js"), + arrayIncludesWith = __webpack_require__(/*! ./_arrayIncludesWith */ "./node_modules/lodash/_arrayIncludesWith.js"), + arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + cacheHas = __webpack_require__(/*! ./_cacheHas */ "./node_modules/lodash/_cacheHas.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ +function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseIntersection; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsArguments.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseIsArguments.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +module.exports = baseIsArguments; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsEqual.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseIsEqual.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsEqualDeep = __webpack_require__(/*! ./_baseIsEqualDeep */ "./node_modules/lodash/_baseIsEqualDeep.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); +} + +module.exports = baseIsEqual; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsEqualDeep.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseIsEqualDeep.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/lodash/_Stack.js"), + equalArrays = __webpack_require__(/*! ./_equalArrays */ "./node_modules/lodash/_equalArrays.js"), + equalByTag = __webpack_require__(/*! ./_equalByTag */ "./node_modules/lodash/_equalByTag.js"), + equalObjects = __webpack_require__(/*! ./_equalObjects */ "./node_modules/lodash/_equalObjects.js"), + getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), + isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/lodash/isTypedArray.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} + +module.exports = baseIsEqualDeep; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsMap.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseIsMap.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]'; + +/** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ +function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; +} + +module.exports = baseIsMap; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsMatch.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseIsMatch.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/lodash/_Stack.js"), + baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ "./node_modules/lodash/_baseIsEqual.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; +} + +module.exports = baseIsMatch; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsNaN.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseIsNaN.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +module.exports = baseIsNaN; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsNative.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseIsNative.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/lodash/isFunction.js"), + isMasked = __webpack_require__(/*! ./_isMasked */ "./node_modules/lodash/_isMasked.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + toSource = __webpack_require__(/*! ./_toSource */ "./node_modules/lodash/_toSource.js"); + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +module.exports = baseIsNative; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsSet.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseIsSet.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var setTag = '[object Set]'; + +/** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ +function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; +} + +module.exports = baseIsSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIsTypedArray.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_baseIsTypedArray.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +module.exports = baseIsTypedArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseIteratee.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseIteratee.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseMatches = __webpack_require__(/*! ./_baseMatches */ "./node_modules/lodash/_baseMatches.js"), + baseMatchesProperty = __webpack_require__(/*! ./_baseMatchesProperty */ "./node_modules/lodash/_baseMatchesProperty.js"), + identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + property = __webpack_require__(/*! ./property */ "./node_modules/lodash/property.js"); + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +module.exports = baseIteratee; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseKeys.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseKeys.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"), + nativeKeys = __webpack_require__(/*! ./_nativeKeys */ "./node_modules/lodash/_nativeKeys.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +module.exports = baseKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseKeysIn.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseKeysIn.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"), + nativeKeysIn = __webpack_require__(/*! ./_nativeKeysIn */ "./node_modules/lodash/_nativeKeysIn.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +module.exports = baseKeysIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseMap.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_baseMap.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/lodash/_baseEach.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"); + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +module.exports = baseMap; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseMatches.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseMatches.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsMatch = __webpack_require__(/*! ./_baseIsMatch */ "./node_modules/lodash/_baseIsMatch.js"), + getMatchData = __webpack_require__(/*! ./_getMatchData */ "./node_modules/lodash/_getMatchData.js"), + matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ "./node_modules/lodash/_matchesStrictComparable.js"); + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +module.exports = baseMatches; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseMatchesProperty.js": +/*!*****************************************************!*\ + !*** ./node_modules/lodash/_baseMatchesProperty.js ***! + \*****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ "./node_modules/lodash/_baseIsEqual.js"), + get = __webpack_require__(/*! ./get */ "./node_modules/lodash/get.js"), + hasIn = __webpack_require__(/*! ./hasIn */ "./node_modules/lodash/hasIn.js"), + isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/lodash/_isKey.js"), + isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ "./node_modules/lodash/_isStrictComparable.js"), + matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ "./node_modules/lodash/_matchesStrictComparable.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; +} + +module.exports = baseMatchesProperty; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseOrderBy.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseOrderBy.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + baseMap = __webpack_require__(/*! ./_baseMap */ "./node_modules/lodash/_baseMap.js"), + baseSortBy = __webpack_require__(/*! ./_baseSortBy */ "./node_modules/lodash/_baseSortBy.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + compareMultiple = __webpack_require__(/*! ./_compareMultiple */ "./node_modules/lodash/_compareMultiple.js"), + identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee) { + if (isArray(iteratee)) { + return function(value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + } + } + return iteratee; + }); + } else { + iteratees = [identity]; + } + + var index = -1; + iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +module.exports = baseOrderBy; + + +/***/ }), + +/***/ "./node_modules/lodash/_basePick.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_basePick.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var basePickBy = __webpack_require__(/*! ./_basePickBy */ "./node_modules/lodash/_basePickBy.js"), + hasIn = __webpack_require__(/*! ./hasIn */ "./node_modules/lodash/hasIn.js"); + +/** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ +function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); +} + +module.exports = basePick; + + +/***/ }), + +/***/ "./node_modules/lodash/_basePickBy.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_basePickBy.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"), + baseSet = __webpack_require__(/*! ./_baseSet */ "./node_modules/lodash/_baseSet.js"), + castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"); + +/** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ +function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; +} + +module.exports = basePickBy; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseProperty.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseProperty.js ***! + \**********************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = baseProperty; + + +/***/ }), + +/***/ "./node_modules/lodash/_basePropertyDeep.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_basePropertyDeep.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"); + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +module.exports = basePropertyDeep; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseRest.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseRest.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"), + overRest = __webpack_require__(/*! ./_overRest */ "./node_modules/lodash/_overRest.js"), + setToString = __webpack_require__(/*! ./_setToString */ "./node_modules/lodash/_setToString.js"); + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} + +module.exports = baseRest; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSet.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_baseSet.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ +function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; +} + +module.exports = baseSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSetToString.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseSetToString.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var constant = __webpack_require__(/*! ./constant */ "./node_modules/lodash/constant.js"), + defineProperty = __webpack_require__(/*! ./_defineProperty */ "./node_modules/lodash/_defineProperty.js"), + identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"); + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +module.exports = baseSetToString; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSlice.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseSlice.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +module.exports = baseSlice; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSome.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseSome.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/lodash/_baseEach.js"); + +/** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; +} + +module.exports = baseSome; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseSortBy.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseSortBy.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +module.exports = baseSortBy; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseTimes.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseTimes.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +module.exports = baseTimes; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseToPairs.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseToPairs.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"); + +/** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ +function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); +} + +module.exports = baseToPairs; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseToString.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_baseToString.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), + arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = baseToString; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseTrim.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_baseTrim.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var trimmedEndIndex = __webpack_require__(/*! ./_trimmedEndIndex */ "./node_modules/lodash/_trimmedEndIndex.js"); + +/** Used to match leading whitespace. */ +var reTrimStart = /^\s+/; + +/** + * The base implementation of `_.trim`. + * + * @private + * @param {string} string The string to trim. + * @returns {string} Returns the trimmed string. + */ +function baseTrim(string) { + return string + ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') + : string; +} + +module.exports = baseTrim; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseUnary.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseUnary.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +module.exports = baseUnary; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseUnset.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseUnset.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + last = __webpack_require__(/*! ./last */ "./node_modules/lodash/last.js"), + parent = __webpack_require__(/*! ./_parent */ "./node_modules/lodash/_parent.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ +function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; +} + +module.exports = baseUnset; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseValues.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseValues.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"); + +/** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ +function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); +} + +module.exports = baseValues; + + +/***/ }), + +/***/ "./node_modules/lodash/_baseZipObject.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_baseZipObject.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ +function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; +} + +module.exports = baseZipObject; + + +/***/ }), + +/***/ "./node_modules/lodash/_cacheHas.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_cacheHas.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +module.exports = cacheHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_castArrayLikeObject.js": +/*!*****************************************************!*\ + !*** ./node_modules/lodash/_castArrayLikeObject.js ***! + \*****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ "./node_modules/lodash/isArrayLikeObject.js"); + +/** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ +function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; +} + +module.exports = castArrayLikeObject; + + +/***/ }), + +/***/ "./node_modules/lodash/_castFunction.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_castFunction.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"); + +/** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ +function castFunction(value) { + return typeof value == 'function' ? value : identity; +} + +module.exports = castFunction; + + +/***/ }), + +/***/ "./node_modules/lodash/_castPath.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_castPath.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/lodash/_isKey.js"), + stringToPath = __webpack_require__(/*! ./_stringToPath */ "./node_modules/lodash/_stringToPath.js"), + toString = __webpack_require__(/*! ./toString */ "./node_modules/lodash/toString.js"); + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); +} + +module.exports = castPath; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneArrayBuffer.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_cloneArrayBuffer.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "./node_modules/lodash/_Uint8Array.js"); + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +module.exports = cloneArrayBuffer; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneBuffer.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_cloneBuffer.js ***! + \*********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; +} + +module.exports = cloneBuffer; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneDataView.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_cloneDataView.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/lodash/_cloneArrayBuffer.js"); + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +module.exports = cloneDataView; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneRegExp.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_cloneRegExp.js ***! + \*********************************************/ +/***/ (function(module) { + +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +module.exports = cloneRegExp; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneSymbol.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_cloneSymbol.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +module.exports = cloneSymbol; + + +/***/ }), + +/***/ "./node_modules/lodash/_cloneTypedArray.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_cloneTypedArray.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/lodash/_cloneArrayBuffer.js"); + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +module.exports = cloneTypedArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_compareAscending.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_compareAscending.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +module.exports = compareAscending; + + +/***/ }), + +/***/ "./node_modules/lodash/_compareMultiple.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_compareMultiple.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var compareAscending = __webpack_require__(/*! ./_compareAscending */ "./node_modules/lodash/_compareAscending.js"); + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +module.exports = compareMultiple; + + +/***/ }), + +/***/ "./node_modules/lodash/_copyArray.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_copyArray.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +module.exports = copyArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_copyObject.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_copyObject.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/lodash/_baseAssignValue.js"); + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +module.exports = copyObject; + + +/***/ }), + +/***/ "./node_modules/lodash/_copySymbols.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_copySymbols.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/lodash/_getSymbols.js"); + +/** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +module.exports = copySymbols; + + +/***/ }), + +/***/ "./node_modules/lodash/_copySymbolsIn.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_copySymbolsIn.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "./node_modules/lodash/_getSymbolsIn.js"); + +/** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); +} + +module.exports = copySymbolsIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_coreJsData.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_coreJsData.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +module.exports = coreJsData; + + +/***/ }), + +/***/ "./node_modules/lodash/_createAssigner.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_createAssigner.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/lodash/_isIterateeCall.js"); + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +module.exports = createAssigner; + + +/***/ }), + +/***/ "./node_modules/lodash/_createBaseEach.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_createBaseEach.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"); + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +module.exports = createBaseEach; + + +/***/ }), + +/***/ "./node_modules/lodash/_createBaseFor.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_createBaseFor.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +module.exports = createBaseFor; + + +/***/ }), + +/***/ "./node_modules/lodash/_createFind.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_createFind.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ +function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; +} + +module.exports = createFind; + + +/***/ }), + +/***/ "./node_modules/lodash/_createToPairs.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_createToPairs.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseToPairs = __webpack_require__(/*! ./_baseToPairs */ "./node_modules/lodash/_baseToPairs.js"), + getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + mapToArray = __webpack_require__(/*! ./_mapToArray */ "./node_modules/lodash/_mapToArray.js"), + setToPairs = __webpack_require__(/*! ./_setToPairs */ "./node_modules/lodash/_setToPairs.js"); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ +function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; +} + +module.exports = createToPairs; + + +/***/ }), + +/***/ "./node_modules/lodash/_customOmitClone.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_customOmitClone.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isPlainObject = __webpack_require__(/*! ./isPlainObject */ "./node_modules/lodash/isPlainObject.js"); + +/** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ +function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; +} + +module.exports = customOmitClone; + + +/***/ }), + +/***/ "./node_modules/lodash/_defineProperty.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_defineProperty.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"); + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; + + +/***/ }), + +/***/ "./node_modules/lodash/_equalArrays.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_equalArrays.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var SetCache = __webpack_require__(/*! ./_SetCache */ "./node_modules/lodash/_SetCache.js"), + arraySome = __webpack_require__(/*! ./_arraySome */ "./node_modules/lodash/_arraySome.js"), + cacheHas = __webpack_require__(/*! ./_cacheHas */ "./node_modules/lodash/_cacheHas.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +module.exports = equalArrays; + + +/***/ }), + +/***/ "./node_modules/lodash/_equalByTag.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_equalByTag.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), + Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "./node_modules/lodash/_Uint8Array.js"), + eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"), + equalArrays = __webpack_require__(/*! ./_equalArrays */ "./node_modules/lodash/_equalArrays.js"), + mapToArray = __webpack_require__(/*! ./_mapToArray */ "./node_modules/lodash/_mapToArray.js"), + setToArray = __webpack_require__(/*! ./_setToArray */ "./node_modules/lodash/_setToArray.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]'; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +module.exports = equalByTag; + + +/***/ }), + +/***/ "./node_modules/lodash/_equalObjects.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_equalObjects.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "./node_modules/lodash/_getAllKeys.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +module.exports = equalObjects; + + +/***/ }), + +/***/ "./node_modules/lodash/_flatRest.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_flatRest.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var flatten = __webpack_require__(/*! ./flatten */ "./node_modules/lodash/flatten.js"), + overRest = __webpack_require__(/*! ./_overRest */ "./node_modules/lodash/_overRest.js"), + setToString = __webpack_require__(/*! ./_setToString */ "./node_modules/lodash/_setToString.js"); + +/** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ +function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); +} + +module.exports = flatRest; + + +/***/ }), + +/***/ "./node_modules/lodash/_freeGlobal.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_freeGlobal.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; + +module.exports = freeGlobal; + + +/***/ }), + +/***/ "./node_modules/lodash/_getAllKeys.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_getAllKeys.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "./node_modules/lodash/_baseGetAllKeys.js"), + getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/lodash/_getSymbols.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +module.exports = getAllKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_getAllKeysIn.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_getAllKeysIn.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "./node_modules/lodash/_baseGetAllKeys.js"), + getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "./node_modules/lodash/_getSymbolsIn.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); + +/** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); +} + +module.exports = getAllKeysIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_getMapData.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_getMapData.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isKeyable = __webpack_require__(/*! ./_isKeyable */ "./node_modules/lodash/_isKeyable.js"); + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +module.exports = getMapData; + + +/***/ }), + +/***/ "./node_modules/lodash/_getMatchData.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_getMatchData.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ "./node_modules/lodash/_isStrictComparable.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +module.exports = getMatchData; + + +/***/ }), + +/***/ "./node_modules/lodash/_getNative.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_getNative.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsNative = __webpack_require__(/*! ./_baseIsNative */ "./node_modules/lodash/_baseIsNative.js"), + getValue = __webpack_require__(/*! ./_getValue */ "./node_modules/lodash/_getValue.js"); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +module.exports = getNative; + + +/***/ }), + +/***/ "./node_modules/lodash/_getPrototype.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_getPrototype.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var overArg = __webpack_require__(/*! ./_overArg */ "./node_modules/lodash/_overArg.js"); + +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); + +module.exports = getPrototype; + + +/***/ }), + +/***/ "./node_modules/lodash/_getRawTag.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_getRawTag.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +module.exports = getRawTag; + + +/***/ }), + +/***/ "./node_modules/lodash/_getSymbols.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_getSymbols.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ "./node_modules/lodash/_arrayFilter.js"), + stubArray = __webpack_require__(/*! ./stubArray */ "./node_modules/lodash/stubArray.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +module.exports = getSymbols; + + +/***/ }), + +/***/ "./node_modules/lodash/_getSymbolsIn.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_getSymbolsIn.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"), + getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/lodash/_getPrototype.js"), + getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/lodash/_getSymbols.js"), + stubArray = __webpack_require__(/*! ./stubArray */ "./node_modules/lodash/stubArray.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; +}; + +module.exports = getSymbolsIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_getTag.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/_getTag.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var DataView = __webpack_require__(/*! ./_DataView */ "./node_modules/lodash/_DataView.js"), + Map = __webpack_require__(/*! ./_Map */ "./node_modules/lodash/_Map.js"), + Promise = __webpack_require__(/*! ./_Promise */ "./node_modules/lodash/_Promise.js"), + Set = __webpack_require__(/*! ./_Set */ "./node_modules/lodash/_Set.js"), + WeakMap = __webpack_require__(/*! ./_WeakMap */ "./node_modules/lodash/_WeakMap.js"), + baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + toSource = __webpack_require__(/*! ./_toSource */ "./node_modules/lodash/_toSource.js"); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; + +var dataViewTag = '[object DataView]'; + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +module.exports = getTag; + + +/***/ }), + +/***/ "./node_modules/lodash/_getValue.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_getValue.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +module.exports = getValue; + + +/***/ }), + +/***/ "./node_modules/lodash/_hasPath.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_hasPath.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"), + isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +module.exports = hasPath; + + +/***/ }), + +/***/ "./node_modules/lodash/_hashClear.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_hashClear.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +module.exports = hashClear; + + +/***/ }), + +/***/ "./node_modules/lodash/_hashDelete.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_hashDelete.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +module.exports = hashDelete; + + +/***/ }), + +/***/ "./node_modules/lodash/_hashGet.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_hashGet.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +module.exports = hashGet; + + +/***/ }), + +/***/ "./node_modules/lodash/_hashHas.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_hashHas.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +module.exports = hashHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_hashSet.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_hashSet.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js"); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +module.exports = hashSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_initCloneArray.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_initCloneArray.js ***! + \************************************************/ +/***/ (function(module) { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +module.exports = initCloneArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_initCloneByTag.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_initCloneByTag.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/lodash/_cloneArrayBuffer.js"), + cloneDataView = __webpack_require__(/*! ./_cloneDataView */ "./node_modules/lodash/_cloneDataView.js"), + cloneRegExp = __webpack_require__(/*! ./_cloneRegExp */ "./node_modules/lodash/_cloneRegExp.js"), + cloneSymbol = __webpack_require__(/*! ./_cloneSymbol */ "./node_modules/lodash/_cloneSymbol.js"), + cloneTypedArray = __webpack_require__(/*! ./_cloneTypedArray */ "./node_modules/lodash/_cloneTypedArray.js"); + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } +} + +module.exports = initCloneByTag; + + +/***/ }), + +/***/ "./node_modules/lodash/_initCloneObject.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_initCloneObject.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseCreate = __webpack_require__(/*! ./_baseCreate */ "./node_modules/lodash/_baseCreate.js"), + getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/lodash/_getPrototype.js"), + isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"); + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +module.exports = initCloneObject; + + +/***/ }), + +/***/ "./node_modules/lodash/_isFlattenable.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_isFlattenable.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** Built-in value references. */ +var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +module.exports = isFlattenable; + + +/***/ }), + +/***/ "./node_modules/lodash/_isIndex.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_isIndex.js ***! + \*****************************************/ +/***/ (function(module) { + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +module.exports = isIndex; + + +/***/ }), + +/***/ "./node_modules/lodash/_isIterateeCall.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_isIterateeCall.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +module.exports = isIterateeCall; + + +/***/ }), + +/***/ "./node_modules/lodash/_isKey.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/_isKey.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +module.exports = isKey; + + +/***/ }), + +/***/ "./node_modules/lodash/_isKeyable.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_isKeyable.js ***! + \*******************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +module.exports = isKeyable; + + +/***/ }), + +/***/ "./node_modules/lodash/_isMasked.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_isMasked.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var coreJsData = __webpack_require__(/*! ./_coreJsData */ "./node_modules/lodash/_coreJsData.js"); + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +module.exports = isMasked; + + +/***/ }), + +/***/ "./node_modules/lodash/_isPrototype.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_isPrototype.js ***! + \*********************************************/ +/***/ (function(module) { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +module.exports = isPrototype; + + +/***/ }), + +/***/ "./node_modules/lodash/_isStrictComparable.js": +/*!****************************************************!*\ + !*** ./node_modules/lodash/_isStrictComparable.js ***! + \****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +module.exports = isStrictComparable; + + +/***/ }), + +/***/ "./node_modules/lodash/_listCacheClear.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_listCacheClear.js ***! + \************************************************/ +/***/ (function(module) { + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +module.exports = listCacheClear; + + +/***/ }), + +/***/ "./node_modules/lodash/_listCacheDelete.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_listCacheDelete.js ***! + \*************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +module.exports = listCacheDelete; + + +/***/ }), + +/***/ "./node_modules/lodash/_listCacheGet.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_listCacheGet.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +module.exports = listCacheGet; + + +/***/ }), + +/***/ "./node_modules/lodash/_listCacheHas.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_listCacheHas.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +module.exports = listCacheHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_listCacheSet.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_listCacheSet.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js"); + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +module.exports = listCacheSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapCacheClear.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_mapCacheClear.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Hash = __webpack_require__(/*! ./_Hash */ "./node_modules/lodash/_Hash.js"), + ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"), + Map = __webpack_require__(/*! ./_Map */ "./node_modules/lodash/_Map.js"); + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +module.exports = mapCacheClear; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapCacheDelete.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_mapCacheDelete.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +module.exports = mapCacheDelete; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapCacheGet.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_mapCacheGet.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +module.exports = mapCacheGet; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapCacheHas.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_mapCacheHas.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +module.exports = mapCacheHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapCacheSet.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_mapCacheSet.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js"); + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +module.exports = mapCacheSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_mapToArray.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_mapToArray.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +module.exports = mapToArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_matchesStrictComparable.js": +/*!*********************************************************!*\ + !*** ./node_modules/lodash/_matchesStrictComparable.js ***! + \*********************************************************/ +/***/ (function(module) { + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +module.exports = matchesStrictComparable; + + +/***/ }), + +/***/ "./node_modules/lodash/_memoizeCapped.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_memoizeCapped.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var memoize = __webpack_require__(/*! ./memoize */ "./node_modules/lodash/memoize.js"); + +/** Used as the maximum memoize cache size. */ +var MAX_MEMOIZE_SIZE = 500; + +/** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ +function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; +} + +module.exports = memoizeCapped; + + +/***/ }), + +/***/ "./node_modules/lodash/_nativeCreate.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_nativeCreate.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"); + +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); + +module.exports = nativeCreate; + + +/***/ }), + +/***/ "./node_modules/lodash/_nativeKeys.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_nativeKeys.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var overArg = __webpack_require__(/*! ./_overArg */ "./node_modules/lodash/_overArg.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +module.exports = nativeKeys; + + +/***/ }), + +/***/ "./node_modules/lodash/_nativeKeysIn.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_nativeKeysIn.js ***! + \**********************************************/ +/***/ (function(module) { + +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +module.exports = nativeKeysIn; + + +/***/ }), + +/***/ "./node_modules/lodash/_nodeUtil.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_nodeUtil.js ***! + \******************************************/ +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js"); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +module.exports = nodeUtil; + + +/***/ }), + +/***/ "./node_modules/lodash/_objectToString.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_objectToString.js ***! + \************************************************/ +/***/ (function(module) { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +module.exports = objectToString; + + +/***/ }), + +/***/ "./node_modules/lodash/_overArg.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_overArg.js ***! + \*****************************************/ +/***/ (function(module) { + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +module.exports = overArg; + + +/***/ }), + +/***/ "./node_modules/lodash/_overRest.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_overRest.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var apply = __webpack_require__(/*! ./_apply */ "./node_modules/lodash/_apply.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +module.exports = overRest; + + +/***/ }), + +/***/ "./node_modules/lodash/_parent.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/_parent.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"), + baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"); + +/** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ +function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); +} + +module.exports = parent; + + +/***/ }), + +/***/ "./node_modules/lodash/_root.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/_root.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js"); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +module.exports = root; + + +/***/ }), + +/***/ "./node_modules/lodash/_setCacheAdd.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_setCacheAdd.js ***! + \*********************************************/ +/***/ (function(module) { + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +module.exports = setCacheAdd; + + +/***/ }), + +/***/ "./node_modules/lodash/_setCacheHas.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_setCacheHas.js ***! + \*********************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +module.exports = setCacheHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_setToArray.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_setToArray.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +module.exports = setToArray; + + +/***/ }), + +/***/ "./node_modules/lodash/_setToPairs.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_setToPairs.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ +function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; +} + +module.exports = setToPairs; + + +/***/ }), + +/***/ "./node_modules/lodash/_setToString.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_setToString.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseSetToString = __webpack_require__(/*! ./_baseSetToString */ "./node_modules/lodash/_baseSetToString.js"), + shortOut = __webpack_require__(/*! ./_shortOut */ "./node_modules/lodash/_shortOut.js"); + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +module.exports = setToString; + + +/***/ }), + +/***/ "./node_modules/lodash/_shortOut.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_shortOut.js ***! + \******************************************/ +/***/ (function(module) { + +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeNow = Date.now; + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + +module.exports = shortOut; + + +/***/ }), + +/***/ "./node_modules/lodash/_stackClear.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_stackClear.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"); + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +module.exports = stackClear; + + +/***/ }), + +/***/ "./node_modules/lodash/_stackDelete.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/_stackDelete.js ***! + \*********************************************/ +/***/ (function(module) { + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +module.exports = stackDelete; + + +/***/ }), + +/***/ "./node_modules/lodash/_stackGet.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_stackGet.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +module.exports = stackGet; + + +/***/ }), + +/***/ "./node_modules/lodash/_stackHas.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_stackHas.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +module.exports = stackHas; + + +/***/ }), + +/***/ "./node_modules/lodash/_stackSet.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_stackSet.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"), + Map = __webpack_require__(/*! ./_Map */ "./node_modules/lodash/_Map.js"), + MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/lodash/_MapCache.js"); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +module.exports = stackSet; + + +/***/ }), + +/***/ "./node_modules/lodash/_strictIndexOf.js": +/*!***********************************************!*\ + !*** ./node_modules/lodash/_strictIndexOf.js ***! + \***********************************************/ +/***/ (function(module) { + +/** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +module.exports = strictIndexOf; + + +/***/ }), + +/***/ "./node_modules/lodash/_stringToPath.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_stringToPath.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var memoizeCapped = __webpack_require__(/*! ./_memoizeCapped */ "./node_modules/lodash/_memoizeCapped.js"); + +/** Used to match property names within property paths. */ +var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +module.exports = stringToPath; + + +/***/ }), + +/***/ "./node_modules/lodash/_toKey.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/_toKey.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = toKey; + + +/***/ }), + +/***/ "./node_modules/lodash/_toSource.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_toSource.js ***! + \******************************************/ +/***/ (function(module) { + +/** Used for built-in method references. */ +var funcProto = Function.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +module.exports = toSource; + + +/***/ }), + +/***/ "./node_modules/lodash/_trimmedEndIndex.js": +/*!*************************************************!*\ + !*** ./node_modules/lodash/_trimmedEndIndex.js ***! + \*************************************************/ +/***/ (function(module) { + +/** Used to match a single whitespace character. */ +var reWhitespace = /\s/; + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the last non-whitespace character. + */ +function trimmedEndIndex(string) { + var index = string.length; + + while (index-- && reWhitespace.test(string.charAt(index))) {} + return index; +} + +module.exports = trimmedEndIndex; + + +/***/ }), + +/***/ "./node_modules/lodash/assign.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/assign.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + createAssigner = __webpack_require__(/*! ./_createAssigner */ "./node_modules/lodash/_createAssigner.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ +var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } +}); + +module.exports = assign; + + +/***/ }), + +/***/ "./node_modules/lodash/constant.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/constant.js ***! + \*****************************************/ +/***/ (function(module) { + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +module.exports = constant; + + +/***/ }), + +/***/ "./node_modules/lodash/defaults.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/defaults.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"), + isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/lodash/_isIterateeCall.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; +}); + +module.exports = defaults; + + +/***/ }), + +/***/ "./node_modules/lodash/difference.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/difference.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseDifference = __webpack_require__(/*! ./_baseDifference */ "./node_modules/lodash/_baseDifference.js"), + baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js"), + baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ "./node_modules/lodash/isArrayLikeObject.js"); + +/** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ +var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; +}); + +module.exports = difference; + + +/***/ }), + +/***/ "./node_modules/lodash/drop.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/drop.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"), + toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/lodash/toInteger.js"); + +/** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); +} + +module.exports = drop; + + +/***/ }), + +/***/ "./node_modules/lodash/dropRight.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/dropRight.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"), + toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/lodash/toInteger.js"); + +/** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); +} + +module.exports = dropRight; + + +/***/ }), + +/***/ "./node_modules/lodash/eq.js": +/*!***********************************!*\ + !*** ./node_modules/lodash/eq.js ***! + \***********************************/ +/***/ (function(module) { + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +module.exports = eq; + + +/***/ }), + +/***/ "./node_modules/lodash/filter.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/filter.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ "./node_modules/lodash/_arrayFilter.js"), + baseFilter = __webpack_require__(/*! ./_baseFilter */ "./node_modules/lodash/_baseFilter.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] + */ +function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = filter; + + +/***/ }), + +/***/ "./node_modules/lodash/find.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/find.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var createFind = __webpack_require__(/*! ./_createFind */ "./node_modules/lodash/_createFind.js"), + findIndex = __webpack_require__(/*! ./findIndex */ "./node_modules/lodash/findIndex.js"); + +/** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ +var find = createFind(findIndex); + +module.exports = find; + + +/***/ }), + +/***/ "./node_modules/lodash/findIndex.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/findIndex.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ "./node_modules/lodash/_baseFindIndex.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/lodash/toInteger.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ +function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); +} + +module.exports = findIndex; + + +/***/ }), + +/***/ "./node_modules/lodash/flatten.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/flatten.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js"); + +/** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ +function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; +} + +module.exports = flatten; + + +/***/ }), + +/***/ "./node_modules/lodash/forEach.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/forEach.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayEach = __webpack_require__(/*! ./_arrayEach */ "./node_modules/lodash/_arrayEach.js"), + baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/lodash/_baseEach.js"), + castFunction = __webpack_require__(/*! ./_castFunction */ "./node_modules/lodash/_castFunction.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, castFunction(iteratee)); +} + +module.exports = forEach; + + +/***/ }), + +/***/ "./node_modules/lodash/forOwn.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/forOwn.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "./node_modules/lodash/_baseForOwn.js"), + castFunction = __webpack_require__(/*! ./_castFunction */ "./node_modules/lodash/_castFunction.js"); + +/** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forOwn(object, iteratee) { + return object && baseForOwn(object, castFunction(iteratee)); +} + +module.exports = forOwn; + + +/***/ }), + +/***/ "./node_modules/lodash/get.js": +/*!************************************!*\ + !*** ./node_modules/lodash/get.js ***! + \************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js"); + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; + + +/***/ }), + +/***/ "./node_modules/lodash/hasIn.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/hasIn.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseHasIn = __webpack_require__(/*! ./_baseHasIn */ "./node_modules/lodash/_baseHasIn.js"), + hasPath = __webpack_require__(/*! ./_hasPath */ "./node_modules/lodash/_hasPath.js"); + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +module.exports = hasIn; + + +/***/ }), + +/***/ "./node_modules/lodash/identity.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/identity.js ***! + \*****************************************/ +/***/ (function(module) { + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; + + +/***/ }), + +/***/ "./node_modules/lodash/includes.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/includes.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ "./node_modules/lodash/_baseIndexOf.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + isString = __webpack_require__(/*! ./isString */ "./node_modules/lodash/isString.js"), + toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/lodash/toInteger.js"), + values = __webpack_require__(/*! ./values */ "./node_modules/lodash/values.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ +function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); +} + +module.exports = includes; + + +/***/ }), + +/***/ "./node_modules/lodash/initial.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/initial.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"); + +/** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ +function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; +} + +module.exports = initial; + + +/***/ }), + +/***/ "./node_modules/lodash/intersection.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/intersection.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseIntersection = __webpack_require__(/*! ./_baseIntersection */ "./node_modules/lodash/_baseIntersection.js"), + baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + castArrayLikeObject = __webpack_require__(/*! ./_castArrayLikeObject */ "./node_modules/lodash/_castArrayLikeObject.js"); + +/** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ +var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; +}); + +module.exports = intersection; + + +/***/ }), + +/***/ "./node_modules/lodash/isArguments.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/isArguments.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ "./node_modules/lodash/_baseIsArguments.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +module.exports = isArguments; + + +/***/ }), + +/***/ "./node_modules/lodash/isArray.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/isArray.js ***! + \****************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +module.exports = isArray; + + +/***/ }), + +/***/ "./node_modules/lodash/isArrayLike.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/isArrayLike.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/lodash/isFunction.js"), + isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js"); + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +module.exports = isArrayLike; + + +/***/ }), + +/***/ "./node_modules/lodash/isArrayLikeObject.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/isArrayLikeObject.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +module.exports = isArrayLikeObject; + + +/***/ }), + +/***/ "./node_modules/lodash/isBuffer.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isBuffer.js ***! + \*****************************************/ +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"), + stubFalse = __webpack_require__(/*! ./stubFalse */ "./node_modules/lodash/stubFalse.js"); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +module.exports = isBuffer; + + +/***/ }), + +/***/ "./node_modules/lodash/isEmpty.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/isEmpty.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseKeys = __webpack_require__(/*! ./_baseKeys */ "./node_modules/lodash/_baseKeys.js"), + getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"), + isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"), + isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/lodash/isTypedArray.js"); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ +function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; +} + +module.exports = isEmpty; + + +/***/ }), + +/***/ "./node_modules/lodash/isFunction.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/isFunction.js ***! + \*******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"); + +/** `Object#toString` result references. */ +var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +module.exports = isFunction; + + +/***/ }), + +/***/ "./node_modules/lodash/isLength.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isLength.js ***! + \*****************************************/ +/***/ (function(module) { + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = isLength; + + +/***/ }), + +/***/ "./node_modules/lodash/isMap.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/isMap.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsMap = __webpack_require__(/*! ./_baseIsMap */ "./node_modules/lodash/_baseIsMap.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/lodash/_nodeUtil.js"); + +/* Node.js helper references. */ +var nodeIsMap = nodeUtil && nodeUtil.isMap; + +/** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ +var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + +module.exports = isMap; + + +/***/ }), + +/***/ "./node_modules/lodash/isNull.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/isNull.js ***! + \***************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ +function isNull(value) { + return value === null; +} + +module.exports = isNull; + + +/***/ }), + +/***/ "./node_modules/lodash/isObject.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isObject.js ***! + \*****************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +module.exports = isObject; + + +/***/ }), + +/***/ "./node_modules/lodash/isObjectLike.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/isObjectLike.js ***! + \*********************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +module.exports = isObjectLike; + + +/***/ }), + +/***/ "./node_modules/lodash/isPlainObject.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/isPlainObject.js ***! + \**********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/lodash/_getPrototype.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +module.exports = isPlainObject; + + +/***/ }), + +/***/ "./node_modules/lodash/isSet.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/isSet.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsSet = __webpack_require__(/*! ./_baseIsSet */ "./node_modules/lodash/_baseIsSet.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/lodash/_nodeUtil.js"); + +/* Node.js helper references. */ +var nodeIsSet = nodeUtil && nodeUtil.isSet; + +/** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ +var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + +module.exports = isSet; + + +/***/ }), + +/***/ "./node_modules/lodash/isString.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isString.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var stringTag = '[object String]'; + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); +} + +module.exports = isString; + + +/***/ }), + +/***/ "./node_modules/lodash/isSymbol.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isSymbol.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); +} + +module.exports = isSymbol; + + +/***/ }), + +/***/ "./node_modules/lodash/isTypedArray.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/isTypedArray.js ***! + \*********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseIsTypedArray = __webpack_require__(/*! ./_baseIsTypedArray */ "./node_modules/lodash/_baseIsTypedArray.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"), + nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/lodash/_nodeUtil.js"); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +module.exports = isTypedArray; + + +/***/ }), + +/***/ "./node_modules/lodash/isUndefined.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/isUndefined.js ***! + \********************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ +function isUndefined(value) { + return value === undefined; +} + +module.exports = isUndefined; + + +/***/ }), + +/***/ "./node_modules/lodash/keys.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/keys.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "./node_modules/lodash/_arrayLikeKeys.js"), + baseKeys = __webpack_require__(/*! ./_baseKeys */ "./node_modules/lodash/_baseKeys.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +module.exports = keys; + + +/***/ }), + +/***/ "./node_modules/lodash/keysIn.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/keysIn.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "./node_modules/lodash/_arrayLikeKeys.js"), + baseKeysIn = __webpack_require__(/*! ./_baseKeysIn */ "./node_modules/lodash/_baseKeysIn.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js"); + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +module.exports = keysIn; + + +/***/ }), + +/***/ "./node_modules/lodash/last.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/last.js ***! + \*************************************/ +/***/ (function(module) { + +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; +} + +module.exports = last; + + +/***/ }), + +/***/ "./node_modules/lodash/map.js": +/*!************************************!*\ + !*** ./node_modules/lodash/map.js ***! + \************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + baseMap = __webpack_require__(/*! ./_baseMap */ "./node_modules/lodash/_baseMap.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ +function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, baseIteratee(iteratee, 3)); +} + +module.exports = map; + + +/***/ }), + +/***/ "./node_modules/lodash/memoize.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/memoize.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/lodash/_MapCache.js"); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Expose `MapCache`. +memoize.Cache = MapCache; + +module.exports = memoize; + + +/***/ }), + +/***/ "./node_modules/lodash/omit.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/omit.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + baseClone = __webpack_require__(/*! ./_baseClone */ "./node_modules/lodash/_baseClone.js"), + baseUnset = __webpack_require__(/*! ./_baseUnset */ "./node_modules/lodash/_baseUnset.js"), + castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"), + copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"), + customOmitClone = __webpack_require__(/*! ./_customOmitClone */ "./node_modules/lodash/_customOmitClone.js"), + flatRest = __webpack_require__(/*! ./_flatRest */ "./node_modules/lodash/_flatRest.js"), + getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ "./node_modules/lodash/_getAllKeysIn.js"); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + +/** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ +var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; + } + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; +}); + +module.exports = omit; + + +/***/ }), + +/***/ "./node_modules/lodash/orderBy.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/orderBy.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseOrderBy = __webpack_require__(/*! ./_baseOrderBy */ "./node_modules/lodash/_baseOrderBy.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"); + +/** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ +function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); +} + +module.exports = orderBy; + + +/***/ }), + +/***/ "./node_modules/lodash/pick.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/pick.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var basePick = __webpack_require__(/*! ./_basePick */ "./node_modules/lodash/_basePick.js"), + flatRest = __webpack_require__(/*! ./_flatRest */ "./node_modules/lodash/_flatRest.js"); + +/** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ +var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); +}); + +module.exports = pick; + + +/***/ }), + +/***/ "./node_modules/lodash/property.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/property.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseProperty = __webpack_require__(/*! ./_baseProperty */ "./node_modules/lodash/_baseProperty.js"), + basePropertyDeep = __webpack_require__(/*! ./_basePropertyDeep */ "./node_modules/lodash/_basePropertyDeep.js"), + isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/lodash/_isKey.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"); + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = property; + + +/***/ }), + +/***/ "./node_modules/lodash/some.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/some.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arraySome = __webpack_require__(/*! ./_arraySome */ "./node_modules/lodash/_arraySome.js"), + baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"), + baseSome = __webpack_require__(/*! ./_baseSome */ "./node_modules/lodash/_baseSome.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/lodash/_isIterateeCall.js"); + +/** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ +function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = some; + + +/***/ }), + +/***/ "./node_modules/lodash/sortBy.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/sortBy.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js"), + baseOrderBy = __webpack_require__(/*! ./_baseOrderBy */ "./node_modules/lodash/_baseOrderBy.js"), + baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "./node_modules/lodash/_isIterateeCall.js"); + +/** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 30 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] + */ +var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); +}); + +module.exports = sortBy; + + +/***/ }), + +/***/ "./node_modules/lodash/stubArray.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/stubArray.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +module.exports = stubArray; + + +/***/ }), + +/***/ "./node_modules/lodash/stubFalse.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/stubFalse.js ***! + \******************************************/ +/***/ (function(module) { + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = stubFalse; + + +/***/ }), + +/***/ "./node_modules/lodash/take.js": +/*!*************************************!*\ + !*** ./node_modules/lodash/take.js ***! + \*************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseSlice = __webpack_require__(/*! ./_baseSlice */ "./node_modules/lodash/_baseSlice.js"), + toInteger = __webpack_require__(/*! ./toInteger */ "./node_modules/lodash/toInteger.js"); + +/** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ +function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); +} + +module.exports = take; + + +/***/ }), + +/***/ "./node_modules/lodash/toFinite.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/toFinite.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var toNumber = __webpack_require__(/*! ./toNumber */ "./node_modules/lodash/toNumber.js"); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_INTEGER = 1.7976931348623157e+308; + +/** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ +function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; +} + +module.exports = toFinite; + + +/***/ }), + +/***/ "./node_modules/lodash/toInteger.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/toInteger.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var toFinite = __webpack_require__(/*! ./toFinite */ "./node_modules/lodash/toFinite.js"); + +/** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ +function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; +} + +module.exports = toInteger; + + +/***/ }), + +/***/ "./node_modules/lodash/toNumber.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/toNumber.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseTrim = __webpack_require__(/*! ./_baseTrim */ "./node_modules/lodash/_baseTrim.js"), + isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), + isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = baseTrim(value); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +module.exports = toNumber; + + +/***/ }), + +/***/ "./node_modules/lodash/toPairs.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/toPairs.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var createToPairs = __webpack_require__(/*! ./_createToPairs */ "./node_modules/lodash/_createToPairs.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ +var toPairs = createToPairs(keys); + +module.exports = toPairs; + + +/***/ }), + +/***/ "./node_modules/lodash/toPath.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/toPath.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"), + copyArray = __webpack_require__(/*! ./_copyArray */ "./node_modules/lodash/_copyArray.js"), + isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"), + isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"), + stringToPath = __webpack_require__(/*! ./_stringToPath */ "./node_modules/lodash/_stringToPath.js"), + toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js"), + toString = __webpack_require__(/*! ./toString */ "./node_modules/lodash/toString.js"); + +/** + * Converts `value` to a property path array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {*} value The value to convert. + * @returns {Array} Returns the new property path array. + * @example + * + * _.toPath('a.b.c'); + * // => ['a', 'b', 'c'] + * + * _.toPath('a[0].b.c'); + * // => ['a', '0', 'b', 'c'] + */ +function toPath(value) { + if (isArray(value)) { + return arrayMap(value, toKey); + } + return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); +} + +module.exports = toPath; + + +/***/ }), + +/***/ "./node_modules/lodash/toString.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/toString.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseToString = __webpack_require__(/*! ./_baseToString */ "./node_modules/lodash/_baseToString.js"); + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +module.exports = toString; + + +/***/ }), + +/***/ "./node_modules/lodash/uniqueId.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/uniqueId.js ***! + \*****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var toString = __webpack_require__(/*! ./toString */ "./node_modules/lodash/toString.js"); + +/** Used to generate unique IDs. */ +var idCounter = 0; + +/** + * Generates a unique ID. If `prefix` is given, the ID is appended to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {string} [prefix=''] The value to prefix the ID with. + * @returns {string} Returns the unique ID. + * @example + * + * _.uniqueId('contact_'); + * // => 'contact_104' + * + * _.uniqueId(); + * // => '105' + */ +function uniqueId(prefix) { + var id = ++idCounter; + return toString(prefix) + id; +} + +module.exports = uniqueId; + + +/***/ }), + +/***/ "./node_modules/lodash/values.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/values.js ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseValues = __webpack_require__(/*! ./_baseValues */ "./node_modules/lodash/_baseValues.js"), + keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js"); + +/** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ +function values(object) { + return object == null ? [] : baseValues(object, keys(object)); +} + +module.exports = values; + + +/***/ }), + +/***/ "./node_modules/lodash/without.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/without.js ***! + \****************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var baseDifference = __webpack_require__(/*! ./_baseDifference */ "./node_modules/lodash/_baseDifference.js"), + baseRest = __webpack_require__(/*! ./_baseRest */ "./node_modules/lodash/_baseRest.js"), + isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ "./node_modules/lodash/isArrayLikeObject.js"); + +/** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ +var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; +}); + +module.exports = without; + + +/***/ }), + +/***/ "./node_modules/lodash/zipObject.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/zipObject.js ***! + \******************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"), + baseZipObject = __webpack_require__(/*! ./_baseZipObject */ "./node_modules/lodash/_baseZipObject.js"); + +/** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ +function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); +} + +module.exports = zipObject; + + +/***/ }), + +/***/ "./node_modules/object-assign/index.js": +/*!*********************************************!*\ + !*** ./node_modules/object-assign/index.js ***! + \*********************************************/ +/***/ (function(module) { + +"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + + +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; + + +/***/ }), + +/***/ "./node_modules/react-selectable/dist/react-selectable.js": +/*!****************************************************************!*\ + !*** ./node_modules/react-selectable/dist/react-selectable.js ***! + \****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +!function(e,t){if(true)module.exports=t(__webpack_require__(/*! react */ "react"),__webpack_require__(/*! react-dom */ "react-dom"));else { var r, n; }}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=12)}([function(e,t,n){"use strict";function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(s===setTimeout)return setTimeout(e,0);if((s===r||!s)&&setTimeout)return s=setTimeout,setTimeout(e,0);try{return s(e,0)}catch(t){try{return s.call(null,e,0)}catch(t){return s.call(this,e,0)}}}function u(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){b&&y&&(b=!1,y.length?h=y.concat(h):v=-1,h.length&&c())}function c(){if(!b){var e=i(a);b=!0;for(var t=h.length;t;){for(y=h,h=[];++v1)for(var n=1;n1?t-1:0),r=1;r2?n-2:0),o=2;o1&&void 0!==arguments[1]&&arguments[1],n=this.props,r=n.tolerance,o=n.onSelection,i=n.onEndSelection,u=[],a=(0,l.findDOMNode)(this.refs.selectbox);a&&(this._registry.forEach(function(e){e.domNode&&(0,x.default)(a,e.domNode,r)&&!u.includes(e.key)&&u.push(e.key)}),t?"function"==typeof i&&i(u,e):"function"==typeof o&&o(u,e))}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.enabled,r=e.fixedPosition,o=e.className,i=e.selectingClassName,u=this.state,a=u.isBoxSelecting,c=u.boxLeft,l=u.boxTop,s=u.boxWidth,p=u.boxHeight,d=this.props.component;if(!n)return f.default.createElement(d,{className:o},t);var h={left:c,top:l,width:s,height:p,zIndex:9e3,position:r?"fixed":"absolute",cursor:"default"},b={backgroundColor:"transparent",border:"1px dashed #999",width:"100%",height:"100%",float:"left"},v={position:"relative",overflow:"visible"};return f.default.createElement(d,{className:(0,y.default)(o,a?i:null),style:v},a?f.default.createElement("div",{style:h,ref:"selectbox"},f.default.createElement("span",{style:b})):null,t)}}]),t}(c.Component);j.propTypes={children:p.default.node,onBeginSelection:p.default.func,onEndSelection:p.default.func,onSelection:p.default.func,component:p.default.node,tolerance:p.default.number,fixedPosition:p.default.bool,preventDefault:p.default.bool,onNonItemClick:p.default.func,enabled:p.default.bool,className:p.default.string,selectingClassName:p.default.string},j.defaultProps={component:"div",tolerance:0,fixedPosition:!1,preventDefault:!0,enabled:!0},j.childContextTypes={selectable:p.default.object},t.default=j},function(e,t,n){"use strict";(function(t){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=n(1),i=n(2),u=n(8),a=n(15),c=n(3),f=n(16);e.exports=function(e,n){function l(e){var t=e&&(N&&e[N]||e[P]);if("function"==typeof t)return t}function s(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function p(e){this.message=e,this.stack=""}function d(e){function r(r,f,l,s,d,y,h){if(s=s||k,y=y||l,h!==c)if(n)i(!1,"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");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var b=s+":"+l;!o[b]&&a<3&&(u(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",y,s),o[b]=!0,a++)}return null==f[l]?r?new p(null===f[l]?"The "+d+" `"+y+"` is marked as required in `"+s+"`, but its value is `null`.":"The "+d+" `"+y+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(f,l,s,d,y)}if("production"!==t.env.NODE_ENV)var o={},a=0;var f=r.bind(null,!1);return f.isRequired=r.bind(null,!0),f}function y(e){function t(t,n,r,o,i,u){var a=t[n];if(S(a)!==e)return new p("Invalid "+o+" `"+i+"` of type `"+j(a)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return d(t)}function h(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var u=t[n];if(!Array.isArray(u)){return new p("Invalid "+o+" `"+i+"` of type `"+S(u)+"` supplied to `"+r+"`, expected an array.")}for(var a=0;an+a||t+o-cr+u)};t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=e instanceof HTMLElement?(0,o.default)(e):e,u=t instanceof HTMLElement?(0,o.default)(t):t;return i(r.top,r.left,u.top,u.left,r.offsetWidth,r.offsetHeight,u.offsetWidth,u.offsetHeight,n)}},function(e,t,n){"use strict";(function(t){function n(e,t,n){function r(t){var n=h,r=b;return h=b=void 0,w=t,m=e.apply(r,n)}function i(e){return w=e,g=setTimeout(l,t),j?r(e):m}function u(e){var n=e-_,r=e-w,o=t-n;return E?O(o,v-r):o}function c(e){var n=e-_,r=e-w;return void 0===_||n>=t||n<0||E&&r>=v}function l(){var e=S();if(c(e))return s(e);g=setTimeout(l,u(e))}function s(e){return g=void 0,T&&h?r(e):(h=b=void 0,m)}function p(){void 0!==g&&clearTimeout(g),w=0,h=_=b=g=void 0}function d(){return void 0===g?m:s(S())}function y(){var e=S(),n=c(e);if(h=arguments,b=this,_=e,n){if(void 0===g)return i(_);if(E)return g=setTimeout(l,t),r(_)}return void 0===g&&(g=setTimeout(l,t)),m}var h,b,v,m,g,_,w=0,j=!1,E=!1,T=!0;if("function"!=typeof e)throw new TypeError(f);return t=a(t)||0,o(n)&&(j=!!n.leading,E="maxWait"in n,v=E?x(a(n.maxWait)||0,t):v,T="trailing"in n?!!n.trailing:T),y.cancel=p,y.flush=d,y}function r(e,t,r){var i=!0,u=!0;if("function"!=typeof e)throw new TypeError(f);return o(r)&&(i="leading"in r?!!r.leading:i,u="trailing"in r?!!r.trailing:u),n(e,t,{leading:i,maxWait:t,trailing:u})}function o(e){var t=void 0===e?"undefined":c(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==(void 0===e?"undefined":c(e))}function u(e){return"symbol"==(void 0===e?"undefined":c(e))||i(e)&&w.call(e)==s}function a(e){if("number"==typeof e)return e;if(u(e))return l;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(p,"");var n=y.test(e);return n||h.test(e)?b(e.slice(2),n?2:8):d.test(e)?l:+e}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f="Expected a function",l=NaN,s="[object Symbol]",p=/^\s+|\s+$/g,d=/^[-+]0x[0-9a-f]+$/i,y=/^0b[01]+$/i,h=/^0o[0-7]+$/i,b=parseInt,v="object"==(void 0===t?"undefined":c(t))&&t&&t.Object===Object&&t,m="object"==("undefined"==typeof self?"undefined":c(self))&&self&&self.Object===Object&&self,g=v||m||Function("return this")(),_=Object.prototype,w=_.toString,x=Math.max,O=Math.min,S=function(){return g.Date.now()};e.exports=r}).call(t,n(21))},function(e,t,n){"use strict";var r,o="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};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":o(window))&&(r=window)}e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function u(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)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n"; + + +let $4ca367182776f80b$var$defaultOptions = { + /** + * Has to be specified on elements other than form (or when the form doesn't + * have an `action` attribute). + * + * You can also provide a function that will be called with `files` and + * `dataBlocks` and must return the url as string. + */ url: null, + /** + * Can be changed to `"put"` if necessary. You can also provide a function + * that will be called with `files` and must return the method (since `v3.12.0`). + */ method: "post", + /** + * Will be set on the XHRequest. + */ withCredentials: false, + /** + * The timeout for the XHR requests in milliseconds (since `v4.4.0`). + * If set to null or 0, no timeout is going to be set. + */ timeout: null, + /** + * How many file uploads to process in parallel (See the + * Enqueuing file uploads documentation section for more info) + */ parallelUploads: 2, + /** + * Whether to send multiple files in one request. If + * this it set to true, then the fallback file input element will + * have the `multiple` attribute as well. This option will + * also trigger additional events (like `processingmultiple`). See the events + * documentation section for more information. + */ uploadMultiple: false, + /** + * Whether you want files to be uploaded in chunks to your server. This can't be + * used in combination with `uploadMultiple`. + * + * See [chunksUploaded](#config-chunksUploaded) for the callback to finalise an upload. + */ chunking: false, + /** + * If `chunking` is enabled, this defines whether **every** file should be chunked, + * even if the file size is below chunkSize. This means, that the additional chunk + * form data will be submitted and the `chunksUploaded` callback will be invoked. + */ forceChunking: false, + /** + * If `chunking` is `true`, then this defines the chunk size in bytes. + */ chunkSize: 2097152, + /** + * If `true`, the individual chunks of a file are being uploaded simultaneously. + * The limit of concurrent connections is governed by `parallelUploads`. + */ parallelChunkUploads: false, + /** + * Whether a chunk should be retried if it fails. + */ retryChunks: false, + /** + * If `retryChunks` is true, how many times should it be retried. + */ retryChunksLimit: 3, + /** + * The maximum filesize (in MiB) that is allowed to be uploaded. + */ maxFilesize: 256, + /** + * The name of the file param that gets transferred. + * **NOTE**: If you have the option `uploadMultiple` set to `true`, then + * Dropzone will append `[]` to the name. + */ paramName: "file", + /** + * Whether thumbnails for images should be generated + */ createImageThumbnails: true, + /** + * In MB. When the filename exceeds this limit, the thumbnail will not be generated. + */ maxThumbnailFilesize: 10, + /** + * If `null`, the ratio of the image will be used to calculate it. + */ thumbnailWidth: 120, + /** + * The same as `thumbnailWidth`. If both are null, images will not be resized. + */ thumbnailHeight: 120, + /** + * How the images should be scaled down in case both, `thumbnailWidth` and `thumbnailHeight` are provided. + * Can be either `contain` or `crop`. + */ thumbnailMethod: "crop", + /** + * If set, images will be resized to these dimensions before being **uploaded**. + * If only one, `resizeWidth` **or** `resizeHeight` is provided, the original aspect + * ratio of the file will be preserved. + * + * The `options.transformFile` function uses these options, so if the `transformFile` function + * is overridden, these options don't do anything. + */ resizeWidth: null, + /** + * See `resizeWidth`. + */ resizeHeight: null, + /** + * The mime type of the resized image (before it gets uploaded to the server). + * If `null` the original mime type will be used. To force jpeg, for example, use `image/jpeg`. + * See `resizeWidth` for more information. + */ resizeMimeType: null, + /** + * The quality of the resized images. See `resizeWidth`. + */ resizeQuality: 0.8, + /** + * How the images should be scaled down in case both, `resizeWidth` and `resizeHeight` are provided. + * Can be either `contain` or `crop`. + */ resizeMethod: "contain", + /** + * The base that is used to calculate the **displayed** filesize. You can + * change this to 1024 if you would rather display kibibytes, mebibytes, + * etc... 1024 is technically incorrect, because `1024 bytes` are `1 kibibyte` + * not `1 kilobyte`. You can change this to `1024` if you don't care about + * validity. + */ filesizeBase: 1000, + /** + * If not `null` defines how many files this Dropzone handles. If it exceeds, + * the event `maxfilesexceeded` will be called. The dropzone element gets the + * class `dz-max-files-reached` accordingly so you can provide visual + * feedback. + */ maxFiles: null, + /** + * An optional object to send additional headers to the server. Eg: + * `{ "My-Awesome-Header": "header value" }` + */ headers: null, + /** + * Should the default headers be set or not? + * Accept: application/json <- for requesting json response + * Cache-Control: no-cache <- Request shouldn't be cached + * X-Requested-With: XMLHttpRequest <- We sent the request via XMLHttpRequest + */ defaultHeaders: true, + /** + * If `true`, the dropzone element itself will be clickable, if `false` + * nothing will be clickable. + * + * You can also pass an HTML element, a CSS selector (for multiple elements) + * or an array of those. In that case, all of those elements will trigger an + * upload when clicked. + */ clickable: true, + /** + * Whether hidden files in directories should be ignored. + */ ignoreHiddenFiles: true, + /** + * The default implementation of `accept` checks the file's mime type or + * extension against this list. This is a comma separated list of mime + * types or file extensions. + * + * Eg.: `image/*,application/pdf,.psd` + * + * If the Dropzone is `clickable` this option will also be used as + * [`accept`](https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept) + * parameter on the hidden file input as well. + */ acceptedFiles: null, + /** + * If false, files will be added to the queue but the queue will not be + * processed automatically. + * This can be useful if you need some additional user input before sending + * files (or if you want want all files sent at once). + * If you're ready to send the file simply call `myDropzone.processQueue()`. + * + * See the [enqueuing file uploads](#enqueuing-file-uploads) documentation + * section for more information. + */ autoProcessQueue: true, + /** + * If false, files added to the dropzone will not be queued by default. + * You'll have to call `enqueueFile(file)` manually. + */ autoQueue: true, + /** + * If `true`, this will add a link to every file preview to remove or cancel (if + * already uploading) the file. The `dictCancelUpload`, `dictCancelUploadConfirmation` + * and `dictRemoveFile` options are used for the wording. + */ addRemoveLinks: false, + /** + * Defines where to display the file previews – if `null` the + * Dropzone element itself is used. Can be a plain `HTMLElement` or a CSS + * selector. The element should have the `dropzone-previews` class so + * the previews are displayed properly. + */ previewsContainer: null, + /** + * Set this to `true` if you don't want previews to be shown. + */ disablePreviews: false, + /** + * This is the element the hidden input field (which is used when clicking on the + * dropzone to trigger file selection) will be appended to. This might + * be important in case you use frameworks to switch the content of your page. + * + * Can be a selector string, or an element directly. + */ hiddenInputContainer: "body", + /** + * If null, no capture type will be specified + * If camera, mobile devices will skip the file selection and choose camera + * If microphone, mobile devices will skip the file selection and choose the microphone + * If camcorder, mobile devices will skip the file selection and choose the camera in video mode + * On apple devices multiple must be set to false. AcceptedFiles may need to + * be set to an appropriate mime type (e.g. "image/*", "audio/*", or "video/*"). + */ capture: null, + /** + * **Deprecated**. Use `renameFile` instead. + */ renameFilename: null, + /** + * A function that is invoked before the file is uploaded to the server and renames the file. + * This function gets the `File` as argument and can use the `file.name`. The actual name of the + * file that gets used during the upload can be accessed through `file.upload.filename`. + */ renameFile: null, + /** + * If `true` the fallback will be forced. This is very useful to test your server + * implementations first and make sure that everything works as + * expected without dropzone if you experience problems, and to test + * how your fallbacks will look. + */ forceFallback: false, + /** + * The text used before any files are dropped. + */ dictDefaultMessage: "Drop files here to upload", + /** + * The text that replaces the default message text it the browser is not supported. + */ dictFallbackMessage: "Your browser does not support drag'n'drop file uploads.", + /** + * The text that will be added before the fallback form. + * If you provide a fallback element yourself, or if this option is `null` this will + * be ignored. + */ dictFallbackText: "Please use the fallback form below to upload your files like in the olden days.", + /** + * If the filesize is too big. + * `{{filesize}}` and `{{maxFilesize}}` will be replaced with the respective configuration values. + */ dictFileTooBig: "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.", + /** + * If the file doesn't match the file type. + */ dictInvalidFileType: "You can't upload files of this type.", + /** + * If the server response was invalid. + * `{{statusCode}}` will be replaced with the servers status code. + */ dictResponseError: "Server responded with {{statusCode}} code.", + /** + * If `addRemoveLinks` is true, the text to be used for the cancel upload link. + */ dictCancelUpload: "Cancel upload", + /** + * The text that is displayed if an upload was manually canceled + */ dictUploadCanceled: "Upload canceled.", + /** + * If `addRemoveLinks` is true, the text to be used for confirmation when cancelling upload. + */ dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?", + /** + * If `addRemoveLinks` is true, the text to be used to remove a file. + */ dictRemoveFile: "Remove file", + /** + * If this is not null, then the user will be prompted before removing a file. + */ dictRemoveFileConfirmation: null, + /** + * Displayed if `maxFiles` is st and exceeded. + * The string `{{maxFiles}}` will be replaced by the configuration value. + */ dictMaxFilesExceeded: "You cannot upload any more files.", + /** + * Allows you to translate the different units. Starting with `tb` for terabytes and going down to + * `b` for bytes. + */ dictFileSizeUnits: { + tb: "TB", + gb: "GB", + mb: "MB", + kb: "KB", + b: "b" + }, + /** + * Called when dropzone initialized + * You can add event listeners here + */ init () {}, + /** + * Can be an **object** of additional parameters to transfer to the server, **or** a `Function` + * that gets invoked with the `files`, `xhr` and, if it's a chunked upload, `chunk` arguments. In case + * of a function, this needs to return a map. + * + * The default implementation does nothing for normal uploads, but adds relevant information for + * chunked uploads. + * + * This is the same as adding hidden input fields in the form element. + */ params (files, xhr, chunk) { + if (chunk) return { + dzuuid: chunk.file.upload.uuid, + dzchunkindex: chunk.index, + dztotalfilesize: chunk.file.size, + dzchunksize: this.options.chunkSize, + dztotalchunkcount: chunk.file.upload.totalChunkCount, + dzchunkbyteoffset: chunk.index * this.options.chunkSize + }; + }, + /** + * A function that gets a [file](https://developer.mozilla.org/en-US/docs/DOM/File) + * and a `done` function as parameters. + * + * If the done function is invoked without arguments, the file is "accepted" and will + * be processed. If you pass an error message, the file is rejected, and the error + * message will be displayed. + * This function will not be called if the file is too big or doesn't match the mime types. + */ accept (file, done) { + return done(); + }, + /** + * The callback that will be invoked when all chunks have been uploaded for a file. + * It gets the file for which the chunks have been uploaded as the first parameter, + * and the `done` function as second. `done()` needs to be invoked when everything + * needed to finish the upload process is done. + */ chunksUploaded: function(file, done) { + done(); + }, + /** + * Sends the file as binary blob in body instead of form data. + * If this is set, the `params` option will be ignored. + * It's an error to set this to `true` along with `uploadMultiple` since + * multiple files cannot be in a single binary body. + */ binaryBody: false, + /** + * Gets called when the browser is not supported. + * The default implementation shows the fallback input field and adds + * a text. + */ fallback () { + // This code should pass in IE7... :( + let messageElement; + this.element.className = `${this.element.className} dz-browser-not-supported`; + for (let child of this.element.getElementsByTagName("div"))if (/(^| )dz-message($| )/.test(child.className)) { + messageElement = child; + child.className = "dz-message"; // Removes the 'dz-default' class + break; + } + if (!messageElement) { + messageElement = (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).createElement('
'); + this.element.appendChild(messageElement); + } + let span = messageElement.getElementsByTagName("span")[0]; + if (span) { + if (span.textContent != null) span.textContent = this.options.dictFallbackMessage; + else if (span.innerText != null) span.innerText = this.options.dictFallbackMessage; + } + return this.element.appendChild(this.getFallbackForm()); + }, + /** + * Gets called to calculate the thumbnail dimensions. + * + * It gets `file`, `width` and `height` (both may be `null`) as parameters and must return an object containing: + * + * - `srcWidth` & `srcHeight` (required) + * - `trgWidth` & `trgHeight` (required) + * - `srcX` & `srcY` (optional, default `0`) + * - `trgX` & `trgY` (optional, default `0`) + * + * Those values are going to be used by `ctx.drawImage()`. + */ resize (file, width, height, resizeMethod) { + let info = { + srcX: 0, + srcY: 0, + srcWidth: file.width, + srcHeight: file.height + }; + let srcRatio = file.width / file.height; + // Automatically calculate dimensions if not specified + if (width == null && height == null) { + width = info.srcWidth; + height = info.srcHeight; + } else if (width == null) width = height * srcRatio; + else if (height == null) height = width / srcRatio; + // Make sure images aren't upscaled + width = Math.min(width, info.srcWidth); + height = Math.min(height, info.srcHeight); + let trgRatio = width / height; + if (info.srcWidth > width || info.srcHeight > height) { + // Image is bigger and needs rescaling + if (resizeMethod === "crop") { + if (srcRatio > trgRatio) { + info.srcHeight = file.height; + info.srcWidth = info.srcHeight * trgRatio; + } else { + info.srcWidth = file.width; + info.srcHeight = info.srcWidth / trgRatio; + } + } else if (resizeMethod === "contain") { + // Method 'contain' + if (srcRatio > trgRatio) height = width / srcRatio; + else width = height * srcRatio; + } else throw new Error(`Unknown resizeMethod '${resizeMethod}'`); + } + info.srcX = (file.width - info.srcWidth) / 2; + info.srcY = (file.height - info.srcHeight) / 2; + info.trgWidth = width; + info.trgHeight = height; + return info; + }, + /** + * Can be used to transform the file (for example, resize an image if necessary). + * + * The default implementation uses `resizeWidth` and `resizeHeight` (if provided) and resizes + * images according to those dimensions. + * + * Gets the `file` as the first parameter, and a `done()` function as the second, that needs + * to be invoked with the file when the transformation is done. + */ transformFile (file, done) { + if ((this.options.resizeWidth || this.options.resizeHeight) && file.type.match(/image.*/)) return this.resizeImage(file, this.options.resizeWidth, this.options.resizeHeight, this.options.resizeMethod, done); + else return done(file); + }, + /** + * A string that contains the template used for each dropped + * file. Change it to fulfill your needs but make sure to properly + * provide all elements. + * + * If you want to use an actual HTML element instead of providing a String + * as a config option, you could create a div with the id `tpl`, + * put the template inside it and provide the element like this: + * + * document + * .querySelector('#tpl') + * .innerHTML + * + */ previewTemplate: (0, (/*@__PURE__*/$parcel$interopDefault($6ad14d34cb5b5425$exports))), + /* + Those functions register themselves to the events on init and handle all + the user interface specific stuff. Overwriting them won't break the upload + but can break the way it's displayed. + You can overwrite them if you don't like the default behavior. If you just + want to add an additional event handler, register it on the dropzone object + and don't overwrite those options. + */ // Those are self explanatory and simply concern the DragnDrop. + drop (e) { + return this.element.classList.remove("dz-drag-hover"); + }, + dragstart (e) {}, + dragend (e) { + return this.element.classList.remove("dz-drag-hover"); + }, + dragenter (e) { + return this.element.classList.add("dz-drag-hover"); + }, + dragover (e) { + return this.element.classList.add("dz-drag-hover"); + }, + dragleave (e) { + return this.element.classList.remove("dz-drag-hover"); + }, + paste (e) {}, + // Called whenever there are no files left in the dropzone anymore, and the + // dropzone should be displayed as if in the initial state. + reset () { + return this.element.classList.remove("dz-started"); + }, + // Called when a file is added to the queue + // Receives `file` + addedfile (file) { + if (this.element === this.previewsContainer) this.element.classList.add("dz-started"); + if (this.previewsContainer && !this.options.disablePreviews) { + file.previewElement = (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).createElement(this.options.previewTemplate.trim()); + file.previewTemplate = file.previewElement; // Backwards compatibility + this.previewsContainer.appendChild(file.previewElement); + for (var node of file.previewElement.querySelectorAll("[data-dz-name]"))node.textContent = file.name; + for (node of file.previewElement.querySelectorAll("[data-dz-size]"))node.innerHTML = this.filesize(file.size); + if (this.options.addRemoveLinks) { + file._removeLink = (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).createElement(`${this.options.dictRemoveFile}`); + file.previewElement.appendChild(file._removeLink); + } + let removeFileEvent = (e)=>{ + e.preventDefault(); + e.stopPropagation(); + if (file.status === (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).UPLOADING) return (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).confirm(this.options.dictCancelUploadConfirmation, ()=>this.removeFile(file)); + else { + if (this.options.dictRemoveFileConfirmation) return (0, $3ed269f2f0fb224b$export$2e2bcd8739ae039).confirm(this.options.dictRemoveFileConfirmation, ()=>this.removeFile(file)); + else return this.removeFile(file); + } + }; + for (let removeLink of file.previewElement.querySelectorAll("[data-dz-remove]"))removeLink.addEventListener("click", removeFileEvent); + } + }, + // Called whenever a file is removed. + removedfile (file) { + if (file.previewElement != null && file.previewElement.parentNode != null) file.previewElement.parentNode.removeChild(file.previewElement); + return this._updateMaxFilesReachedClass(); + }, + // Called when a thumbnail has been generated + // Receives `file` and `dataUrl` + thumbnail (file, dataUrl) { + if (file.previewElement) { + file.previewElement.classList.remove("dz-file-preview"); + for (let thumbnailElement of file.previewElement.querySelectorAll("[data-dz-thumbnail]")){ + thumbnailElement.alt = file.name; + thumbnailElement.src = dataUrl; + } + return setTimeout(()=>file.previewElement.classList.add("dz-image-preview"), 1); + } + }, + // Called whenever an error occurs + // Receives `file` and `message` + error (file, message) { + if (file.previewElement) { + file.previewElement.classList.add("dz-error"); + if (typeof message !== "string" && message.error) message = message.error; + for (let node of file.previewElement.querySelectorAll("[data-dz-errormessage]"))node.textContent = message; + } + }, + errormultiple () {}, + // Called when a file gets processed. Since there is a queue, not all added + // files are processed immediately. + // Receives `file` + processing (file) { + if (file.previewElement) { + file.previewElement.classList.add("dz-processing"); + if (file._removeLink) return file._removeLink.innerHTML = this.options.dictCancelUpload; + } + }, + processingmultiple () {}, + // Called whenever the upload progress gets updated. + // Receives `file`, `progress` (percentage 0-100) and `bytesSent`. + // To get the total number of bytes of the file, use `file.size` + uploadprogress (file, progress, bytesSent) { + if (file.previewElement) for (let node of file.previewElement.querySelectorAll("[data-dz-uploadprogress]"))node.nodeName === "PROGRESS" ? node.value = progress : node.style.width = `${progress}%`; + }, + // Called whenever the total upload progress gets updated. + // Called with totalUploadProgress (0-100), totalBytes and totalBytesSent + totaluploadprogress () {}, + // Called just before the file is sent. Gets the `xhr` object as second + // parameter, so you can modify it (for example to add a CSRF token) and a + // `formData` object to add additional information. + sending () {}, + sendingmultiple () {}, + // When the complete upload is finished and successful + // Receives `file` + success (file) { + if (file.previewElement) return file.previewElement.classList.add("dz-success"); + }, + successmultiple () {}, + // When the upload is canceled. + canceled (file) { + return this.emit("error", file, this.options.dictUploadCanceled); + }, + canceledmultiple () {}, + // When the upload is finished, either with success or an error. + // Receives `file` + complete (file) { + if (file._removeLink) file._removeLink.innerHTML = this.options.dictRemoveFile; + if (file.previewElement) return file.previewElement.classList.add("dz-complete"); + }, + completemultiple () {}, + maxfilesexceeded () {}, + maxfilesreached () {}, + queuecomplete () {}, + addedfiles () {} +}; +var $4ca367182776f80b$export$2e2bcd8739ae039 = $4ca367182776f80b$var$defaultOptions; + + +class $3ed269f2f0fb224b$export$2e2bcd8739ae039 extends (0, $4040acfd8584338d$export$2e2bcd8739ae039) { + static initClass() { + // Exposing the emitter class, mainly for tests + this.prototype.Emitter = (0, $4040acfd8584338d$export$2e2bcd8739ae039); + /* + This is a list of all available events you can register on a dropzone object. + + You can register an event handler like this: + + dropzone.on("dragEnter", function() { }); + + */ this.prototype.events = [ + "drop", + "dragstart", + "dragend", + "dragenter", + "dragover", + "dragleave", + "addedfile", + "addedfiles", + "removedfile", + "thumbnail", + "error", + "errormultiple", + "processing", + "processingmultiple", + "uploadprogress", + "totaluploadprogress", + "sending", + "sendingmultiple", + "success", + "successmultiple", + "canceled", + "canceledmultiple", + "complete", + "completemultiple", + "reset", + "maxfilesexceeded", + "maxfilesreached", + "queuecomplete" + ]; + this.prototype._thumbnailQueue = []; + this.prototype._processingThumbnail = false; + } + constructor(el, options){ + super(); + let fallback, left; + this.element = el; + this.clickableElements = []; + this.listeners = []; + this.files = []; // All files + if (typeof this.element === "string") this.element = document.querySelector(this.element); + // make sure we actually have an HTML Element + if (this.element === null || !this.element instanceof HTMLElement) throw new Error("Invalid dropzone element: not an instance of HTMLElement."); + if (this.element.dropzone) throw new Error("Dropzone already attached."); + // Now add this dropzone to the instances. + $3ed269f2f0fb224b$export$2e2bcd8739ae039.instances.push(this); + // Put the dropzone inside the element itself. + this.element.dropzone = this; + let elementOptions = (left = $3ed269f2f0fb224b$export$2e2bcd8739ae039.optionsForElement(this.element)) != null ? left : {}; + this.options = Object.assign({}, (0, $4ca367182776f80b$export$2e2bcd8739ae039), elementOptions, options != null ? options : {}); + this.options.previewTemplate = this.options.previewTemplate.replace(/\n*/g, ""); + // If the browser failed, just call the fallback and leave + if (this.options.forceFallback || !$3ed269f2f0fb224b$export$2e2bcd8739ae039.isBrowserSupported()) return this.options.fallback.call(this); + // @options.url = @element.getAttribute "action" unless @options.url? + if (this.options.url == null) this.options.url = this.element.getAttribute("action"); + if (!this.options.url) throw new Error("No URL provided."); + if (this.options.uploadMultiple && this.options.chunking) throw new Error("You cannot set both: uploadMultiple and chunking."); + if (this.options.binaryBody && this.options.uploadMultiple) throw new Error("You cannot set both: binaryBody and uploadMultiple."); + if (typeof this.options.method === "string") this.options.method = this.options.method.toUpperCase(); + if ((fallback = this.getExistingFallback()) && fallback.parentNode) // Remove the fallback + fallback.parentNode.removeChild(fallback); + // Display previews in the previewsContainer element or the Dropzone element unless explicitly set to false + if (this.options.previewsContainer !== false) { + if (this.options.previewsContainer) this.previewsContainer = $3ed269f2f0fb224b$export$2e2bcd8739ae039.getElement(this.options.previewsContainer, "previewsContainer"); + else this.previewsContainer = this.element; + } + if (this.options.clickable) { + if (this.options.clickable === true) this.clickableElements = [ + this.element + ]; + else this.clickableElements = $3ed269f2f0fb224b$export$2e2bcd8739ae039.getElements(this.options.clickable, "clickable"); + } + this.init(); + } + // Returns all files that have been accepted + getAcceptedFiles() { + return this.files.filter((file)=>file.accepted).map((file)=>file); + } + // Returns all files that have been rejected + // Not sure when that's going to be useful, but added for completeness. + getRejectedFiles() { + return this.files.filter((file)=>!file.accepted).map((file)=>file); + } + getFilesWithStatus(status) { + return this.files.filter((file)=>file.status === status).map((file)=>file); + } + // Returns all files that are in the queue + getQueuedFiles() { + return this.getFilesWithStatus($3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED); + } + getUploadingFiles() { + return this.getFilesWithStatus($3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING); + } + getAddedFiles() { + return this.getFilesWithStatus($3ed269f2f0fb224b$export$2e2bcd8739ae039.ADDED); + } + // Files that are either queued or uploading + getActiveFiles() { + return this.files.filter((file)=>file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING || file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED).map((file)=>file); + } + // The function that gets called when Dropzone is initialized. You + // can (and should) setup event listeners inside this function. + init() { + // In case it isn't set already + if (this.element.tagName === "form") this.element.setAttribute("enctype", "multipart/form-data"); + if (this.element.classList.contains("dropzone") && !this.element.querySelector(".dz-message")) this.element.appendChild($3ed269f2f0fb224b$export$2e2bcd8739ae039.createElement(`
`)); + if (this.clickableElements.length) { + let setupHiddenFileInput = ()=>{ + if (this.hiddenFileInput) this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput); + this.hiddenFileInput = document.createElement("input"); + this.hiddenFileInput.setAttribute("type", "file"); + this.hiddenFileInput.setAttribute("form", this.element.id); + if (this.options.maxFiles === null || this.options.maxFiles > 1) this.hiddenFileInput.setAttribute("multiple", "multiple"); + this.hiddenFileInput.className = "dz-hidden-input"; + if (this.options.acceptedFiles !== null) this.hiddenFileInput.setAttribute("accept", this.options.acceptedFiles); + if (this.options.capture !== null) this.hiddenFileInput.setAttribute("capture", this.options.capture); + // Making sure that no one can "tab" into this field. + this.hiddenFileInput.setAttribute("tabindex", "-1"); + // Add arialabel for a11y + this.hiddenFileInput.setAttribute("aria-label", "dropzone hidden input"); + // Not setting `display="none"` because some browsers don't accept clicks + // on elements that aren't displayed. + this.hiddenFileInput.style.visibility = "hidden"; + this.hiddenFileInput.style.position = "absolute"; + this.hiddenFileInput.style.top = "0"; + this.hiddenFileInput.style.left = "0"; + this.hiddenFileInput.style.height = "0"; + this.hiddenFileInput.style.width = "0"; + $3ed269f2f0fb224b$export$2e2bcd8739ae039.getElement(this.options.hiddenInputContainer, "hiddenInputContainer").appendChild(this.hiddenFileInput); + this.hiddenFileInput.addEventListener("change", ()=>{ + let { files: files } = this.hiddenFileInput; + if (files.length) for (let file of files)this.addFile(file); + this.emit("addedfiles", files); + setupHiddenFileInput(); + }); + }; + setupHiddenFileInput(); + } + this.URL = window.URL !== null ? window.URL : window.webkitURL; + // Setup all event listeners on the Dropzone object itself. + // They're not in @setupEventListeners() because they shouldn't be removed + // again when the dropzone gets disabled. + for (let eventName of this.events)this.on(eventName, this.options[eventName]); + this.on("uploadprogress", ()=>this.updateTotalUploadProgress()); + this.on("removedfile", ()=>this.updateTotalUploadProgress()); + this.on("canceled", (file)=>this.emit("complete", file)); + // Emit a `queuecomplete` event if all files finished uploading. + this.on("complete", (file)=>{ + if (this.getAddedFiles().length === 0 && this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) // This needs to be deferred so that `queuecomplete` really triggers after `complete` + return setTimeout(()=>this.emit("queuecomplete"), 0); + }); + const containsFiles = function(e) { + return e.dataTransfer.types && e.dataTransfer.types.includes("Files"); + }; + let noPropagation = function(e) { + // If there are no files, we don't want to stop + // propagation so we don't interfere with other + // drag and drop behaviour. + if (!containsFiles(e)) return; + e.stopPropagation(); + return e.preventDefault(); + }; + // Create the listeners + this.listeners = [ + { + element: this.element, + events: { + dragstart: (e)=>{ + return this.emit("dragstart", e); + }, + dragenter: (e)=>{ + noPropagation(e); + return this.emit("dragenter", e); + }, + dragover: (e)=>{ + // Makes it possible to drag files from chrome's download bar + // http://stackoverflow.com/questions/19526430/drag-and-drop-file-uploads-from-chrome-downloads-bar + const efct = e.dataTransfer.effectAllowed; + e.dataTransfer.dropEffect = "move" === efct || "linkMove" === efct ? "move" : "copy"; + noPropagation(e); + return this.emit("dragover", e); + }, + dragleave: (e)=>{ + return this.emit("dragleave", e); + }, + drop: (e)=>{ + noPropagation(e); + return this.drop(e); + }, + dragend: (e)=>{ + return this.emit("dragend", e); + } + } + } + ]; + this.clickableElements.forEach((clickableElement)=>{ + return this.listeners.push({ + element: clickableElement, + events: { + click: (evt)=>{ + // Only the actual dropzone or the message element should trigger file selection + if (clickableElement !== this.element || evt.target === this.element || $3ed269f2f0fb224b$export$2e2bcd8739ae039.elementInside(evt.target, this.element.querySelector(".dz-message"))) this.hiddenFileInput.click(); // Forward the click + return true; + } + } + }); + }); + this.enable(); + return this.options.init.call(this); + } + // Not fully tested yet + destroy() { + this.disable(); + this.removeAllFiles(true); + if (this.hiddenFileInput != null ? this.hiddenFileInput.parentNode : undefined) { + this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput); + this.hiddenFileInput = null; + } + delete this.element.dropzone; + return $3ed269f2f0fb224b$export$2e2bcd8739ae039.instances.splice($3ed269f2f0fb224b$export$2e2bcd8739ae039.instances.indexOf(this), 1); + } + updateTotalUploadProgress() { + let totalUploadProgress; + let totalBytesSent = 0; + let totalBytes = 0; + let activeFiles = this.getActiveFiles(); + if (activeFiles.length) { + for (let file of this.getActiveFiles()){ + totalBytesSent += file.upload.bytesSent; + totalBytes += file.upload.total; + } + totalUploadProgress = 100 * totalBytesSent / totalBytes; + } else totalUploadProgress = 100; + return this.emit("totaluploadprogress", totalUploadProgress, totalBytes, totalBytesSent); + } + // @options.paramName can be a function taking one parameter rather than a string. + // A parameter name for a file is obtained simply by calling this with an index number. + _getParamName(n) { + if (typeof this.options.paramName === "function") return this.options.paramName(n); + else return `${this.options.paramName}${this.options.uploadMultiple ? `[${n}]` : ""}`; + } + // If @options.renameFile is a function, + // the function will be used to rename the file.name before appending it to the formData. + // MacOS 14+ screenshots contain narrow non-breaking space (U+202F) characters in filenames + // (e.g., "Screenshot 2024-01-30 at 10.32.07 AM.png" where the space after "07" and before "AM" is U+202F). + // This function now replaces these with regular spaces to prevent upload issues and maintain compatibility with MacOS + _renameFile(file) { + const cleanFile = { + ...file, + name: file.name.replace(/\u202F/g, " ") + }; + if (typeof this.options.renameFile !== "function") return cleanFile.name; + return this.options.renameFile(cleanFile); + } + // Returns a form that can be used as fallback if the browser does not support DragnDrop + // + // If the dropzone is already a form, only the input field and button are returned. Otherwise a complete form element is provided. + // This code has to pass in IE7 :( + getFallbackForm() { + let existingFallback, form; + if (existingFallback = this.getExistingFallback()) return existingFallback; + let fieldsString = '
'; + if (this.options.dictFallbackText) fieldsString += `

${this.options.dictFallbackText}

`; + fieldsString += `
`; + let fields = $3ed269f2f0fb224b$export$2e2bcd8739ae039.createElement(fieldsString); + if (this.element.tagName !== "FORM") { + form = $3ed269f2f0fb224b$export$2e2bcd8739ae039.createElement(`
`); + form.appendChild(fields); + } else { + // Make sure that the enctype and method attributes are set properly + this.element.setAttribute("enctype", "multipart/form-data"); + this.element.setAttribute("method", this.options.method); + } + return form != null ? form : fields; + } + // Returns the fallback elements if they exist already + // + // This code has to pass in IE7 :( + getExistingFallback() { + let getFallback = function(elements) { + for (let el of elements){ + if (/(^| )fallback($| )/.test(el.className)) return el; + } + }; + for (let tagName of [ + "div", + "form" + ]){ + var fallback; + if (fallback = getFallback(this.element.getElementsByTagName(tagName))) return fallback; + } + } + // Activates all listeners stored in @listeners + setupEventListeners() { + return this.listeners.map((elementListeners)=>(()=>{ + let result = []; + for(let event in elementListeners.events){ + let listener = elementListeners.events[event]; + result.push(elementListeners.element.addEventListener(event, listener, false)); + } + return result; + })()); + } + // Deactivates all listeners stored in @listeners + removeEventListeners() { + return this.listeners.map((elementListeners)=>(()=>{ + let result = []; + for(let event in elementListeners.events){ + let listener = elementListeners.events[event]; + result.push(elementListeners.element.removeEventListener(event, listener, false)); + } + return result; + })()); + } + // Removes all event listeners and cancels all files in the queue or being processed. + disable() { + this.clickableElements.forEach((element)=>element.classList.remove("dz-clickable")); + this.removeEventListeners(); + this.disabled = true; + return this.files.map((file)=>this.cancelUpload(file)); + } + enable() { + delete this.disabled; + this.clickableElements.forEach((element)=>element.classList.add("dz-clickable")); + return this.setupEventListeners(); + } + // Returns a nicely formatted filesize + filesize(size) { + let selectedSize = 0; + let selectedUnit = "b"; + if (size > 0) { + let units = [ + "tb", + "gb", + "mb", + "kb", + "b" + ]; + for(let i = 0; i < units.length; i++){ + let unit = units[i]; + let cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10; + if (size >= cutoff) { + selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i); + selectedUnit = unit; + break; + } + } + selectedSize = Math.round(10 * selectedSize) / 10; // Cutting of digits + } + return `${selectedSize} ${this.options.dictFileSizeUnits[selectedUnit]}`; + } + // Adds or removes the `dz-max-files-reached` class from the form. + _updateMaxFilesReachedClass() { + if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) { + if (this.getAcceptedFiles().length === this.options.maxFiles) this.emit("maxfilesreached", this.files); + return this.element.classList.add("dz-max-files-reached"); + } else return this.element.classList.remove("dz-max-files-reached"); + } + drop(e) { + if (!e.dataTransfer) return; + this.emit("drop", e); + // Convert the FileList to an Array + // This is necessary for IE11 + let files = []; + for(let i = 0; i < e.dataTransfer.files.length; i++)files[i] = e.dataTransfer.files[i]; + // Even if it's a folder, files.length will contain the folders. + if (files.length) { + let { items: items } = e.dataTransfer; + if (items && items.length && items[0].webkitGetAsEntry != null) // The browser supports dropping of folders, so handle items instead of files + this._addFilesFromItems(items); + else this.handleFiles(files); + } + this.emit("addedfiles", files); + } + paste(e) { + if ($3ed269f2f0fb224b$var$__guard__(e != null ? e.clipboardData : undefined, (x)=>x.items) == null) return; + this.emit("paste", e); + let { items: items } = e.clipboardData; + if (items.length) return this._addFilesFromItems(items); + } + handleFiles(files) { + for (let file of files)this.addFile(file); + } + // When a folder is dropped (or files are pasted), items must be handled + // instead of files. + _addFilesFromItems(items) { + return (()=>{ + let result = []; + for (let item of items){ + var entry; + if (item.webkitGetAsEntry != null && (entry = item.webkitGetAsEntry())) { + if (entry.isFile) result.push(this.addFile(item.getAsFile())); + else if (entry.isDirectory) // Append all files from that directory to files + result.push(this._addFilesFromDirectory(entry, entry.name)); + else result.push(undefined); + } else if (item.getAsFile != null) { + if (item.kind == null || item.kind === "file") result.push(this.addFile(item.getAsFile())); + else result.push(undefined); + } else result.push(undefined); + } + return result; + })(); + } + // Goes through the directory, and adds each file it finds recursively + _addFilesFromDirectory(directory, path) { + let dirReader = directory.createReader(); + let errorHandler = (error)=>$3ed269f2f0fb224b$var$__guardMethod__(console, "log", (o)=>o.log(error)); + var readEntries = ()=>{ + return dirReader.readEntries((entries)=>{ + if (entries.length > 0) { + for (let entry of entries){ + if (entry.isFile) entry.file((file)=>{ + if (this.options.ignoreHiddenFiles && file.name.substring(0, 1) === ".") return; + file.fullPath = `${path}/${file.name}`; + return this.addFile(file); + }); + else if (entry.isDirectory) this._addFilesFromDirectory(entry, `${path}/${entry.name}`); + } + // Recursively call readEntries() again, since browser only handle + // the first 100 entries. + // See: https://developer.mozilla.org/en-US/docs/Web/API/DirectoryReader#readEntries + readEntries(); + } + return null; + }, errorHandler); + }; + return readEntries(); + } + // If `done()` is called without argument the file is accepted + // If you call it with an error message, the file is rejected + // (This allows for asynchronous validation) + // + // This function checks the filesize, and if the file.type passes the + // `acceptedFiles` check. + accept(file, done) { + if (this.options.maxFilesize && file.size > this.options.maxFilesize * 1048576) done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize)); + else if (!$3ed269f2f0fb224b$export$2e2bcd8739ae039.isValidFile(file, this.options.acceptedFiles)) done(this.options.dictInvalidFileType); + else if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) { + done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}", this.options.maxFiles)); + this.emit("maxfilesexceeded", file); + } else this.options.accept.call(this, file, done); + } + addFile(file) { + file.upload = { + // note: this only works if window.isSecureContext is true, which includes localhost in http + uuid: window.isSecureContext ? self.crypto.randomUUID() : $3ed269f2f0fb224b$export$2e2bcd8739ae039.uuidv4(), + progress: 0, + // Setting the total upload size to file.size for the beginning + // It's actual different than the size to be transmitted. + total: file.size, + bytesSent: 0, + filename: this._renameFile(file) + }; + this.files.push(file); + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.ADDED; + this.emit("addedfile", file); + this._enqueueThumbnail(file); + this.accept(file, (error)=>{ + if (error) { + file.accepted = false; + this._errorProcessing([ + file + ], error); // Will set the file.status + } else { + file.accepted = true; + if (this.options.autoQueue) this.enqueueFile(file); + // Will set .accepted = true + } + this._updateMaxFilesReachedClass(); + }); + } + // Wrapper for enqueueFile + enqueueFiles(files) { + for (let file of files)this.enqueueFile(file); + return null; + } + enqueueFile(file) { + if (file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.ADDED && file.accepted === true) { + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED; + if (this.options.autoProcessQueue) return setTimeout(()=>this.processQueue(), 0); // Deferring the call + } else throw new Error("This file can't be queued because it has already been processed or was rejected."); + } + _enqueueThumbnail(file) { + if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1048576) { + this._thumbnailQueue.push(file); + return setTimeout(()=>this._processThumbnailQueue(), 0); // Deferring the call + } + } + _processThumbnailQueue() { + if (this._processingThumbnail || this._thumbnailQueue.length === 0) return; + this._processingThumbnail = true; + let file = this._thumbnailQueue.shift(); + return this.createThumbnail(file, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, true, (dataUrl)=>{ + this.emit("thumbnail", file, dataUrl); + this._processingThumbnail = false; + return this._processThumbnailQueue(); + }); + } + // Can be called by the user to remove a file + removeFile(file) { + if (file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING) this.cancelUpload(file); + this.files = $3ed269f2f0fb224b$var$without(this.files, file); + this.emit("removedfile", file); + if (this.files.length === 0) return this.emit("reset"); + } + // Removes all files that aren't currently processed from the list + removeAllFiles(cancelIfNecessary) { + // Create a copy of files since removeFile() changes the @files array. + if (cancelIfNecessary == null) cancelIfNecessary = false; + for (let file of this.files.slice())if (file.status !== $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING || cancelIfNecessary) this.removeFile(file); + return null; + } + // Resizes an image before it gets sent to the server. This function is the default behavior of + // `options.transformFile` if `resizeWidth` or `resizeHeight` are set. The callback is invoked with + // the resized blob. + resizeImage(file, width, height, resizeMethod, callback) { + return this.createThumbnail(file, width, height, resizeMethod, true, (dataUrl, canvas)=>{ + if (canvas == null) // The image has not been resized + return callback(file); + else { + let { resizeMimeType: resizeMimeType } = this.options; + if (resizeMimeType == null) resizeMimeType = file.type; + let resizedDataURL = canvas.toDataURL(resizeMimeType, this.options.resizeQuality); + if (resizeMimeType === "image/jpeg" || resizeMimeType === "image/jpg") // Now add the original EXIF information + resizedDataURL = $3ed269f2f0fb224b$var$restoreExif(file.dataURL, resizedDataURL); + return callback($3ed269f2f0fb224b$export$2e2bcd8739ae039.dataURItoBlob(resizedDataURL)); + } + }, true); + } + createThumbnail(file, width, height, resizeMethod, fixOrientation, callback, ignoreExif = false) { + let fileReader = new FileReader(); + fileReader.onload = ()=>{ + file.dataURL = fileReader.result; + // Don't bother creating a thumbnail for SVG images since they're vector + if (file.type === "image/svg+xml") { + if (callback != null) callback(fileReader.result); + return; + } + this.createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, undefined, ignoreExif); + }; + fileReader.readAsDataURL(file); + } + // `mockFile` needs to have these attributes: + // + // { name: 'name', size: 12345, imageUrl: '' } + // + // `callback` will be invoked when the image has been downloaded and displayed. + // `crossOrigin` will be added to the `img` tag when accessing the file. + displayExistingFile(mockFile, imageUrl, callback, crossOrigin, resizeThumbnail = true) { + this.emit("addedfile", mockFile); + this.emit("complete", mockFile); + if (!resizeThumbnail) { + this.emit("thumbnail", mockFile, imageUrl); + if (callback) callback(); + } else { + let onDone = (thumbnail)=>{ + this.emit("thumbnail", mockFile, thumbnail); + if (callback) callback(); + }; + mockFile.dataURL = imageUrl; + this.createThumbnailFromUrl(mockFile, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, this.options.fixOrientation, onDone, crossOrigin); + } + } + createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin, ignoreExif = false) { + // Not using `new Image` here because of a bug in latest Chrome versions. + // See https://github.com/enyo/dropzone/pull/226 + let img = document.createElement("img"); + if (crossOrigin) img.crossOrigin = crossOrigin; + // fixOrientation is not needed anymore with browsers handling imageOrientation + fixOrientation = getComputedStyle(document.body)["imageOrientation"] == "from-image" ? false : fixOrientation; + img.onload = ()=>{ + let loadExif = (callback)=>callback(1); + if (typeof EXIF !== "undefined" && EXIF !== null && fixOrientation) loadExif = (callback)=>EXIF.getData(img, function() { + return callback(EXIF.getTag(this, "Orientation")); + }); + return loadExif((orientation)=>{ + file.width = img.width; + file.height = img.height; + let resizeInfo = this.options.resize.call(this, file, width, height, resizeMethod); + let canvas = document.createElement("canvas"); + let ctx = canvas.getContext("2d"); + canvas.width = resizeInfo.trgWidth; + canvas.height = resizeInfo.trgHeight; + if (orientation > 4) { + canvas.width = resizeInfo.trgHeight; + canvas.height = resizeInfo.trgWidth; + } + switch(orientation){ + case 2: + // horizontal flip + ctx.translate(canvas.width, 0); + ctx.scale(-1, 1); + break; + case 3: + // 180° rotate left + ctx.translate(canvas.width, canvas.height); + ctx.rotate(Math.PI); + break; + case 4: + // vertical flip + ctx.translate(0, canvas.height); + ctx.scale(1, -1); + break; + case 5: + // vertical flip + 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.scale(1, -1); + break; + case 6: + // 90° rotate right + ctx.rotate(0.5 * Math.PI); + ctx.translate(0, -canvas.width); + break; + case 7: + // horizontal flip + 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.translate(canvas.height, -canvas.width); + ctx.scale(-1, 1); + break; + case 8: + // 90° rotate left + ctx.rotate(-0.5 * Math.PI); + ctx.translate(-canvas.height, 0); + break; + } + // This is a bugfix for iOS' scaling bug. + $3ed269f2f0fb224b$var$drawImageIOSFix(ctx, img, resizeInfo.srcX != null ? resizeInfo.srcX : 0, resizeInfo.srcY != null ? resizeInfo.srcY : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, resizeInfo.trgX != null ? resizeInfo.trgX : 0, resizeInfo.trgY != null ? resizeInfo.trgY : 0, resizeInfo.trgWidth, resizeInfo.trgHeight); + let thumbnail = canvas.toDataURL("image/png"); + if (callback != null) return callback(thumbnail, canvas); + }); + }; + if (callback != null) img.onerror = callback; + var dataURL = file.dataURL; + if (ignoreExif) dataURL = $3ed269f2f0fb224b$var$removeExif(dataURL); + return img.src = dataURL; + } + // Goes through the queue and processes files if there aren't too many already. + processQueue() { + let { parallelUploads: parallelUploads } = this.options; + let processingLength = this.getUploadingFiles().length; + let i = processingLength; + // There are already at least as many files uploading than should be + if (processingLength >= parallelUploads) return; + let queuedFiles = this.getQueuedFiles(); + if (!(queuedFiles.length > 0)) return; + if (this.options.uploadMultiple) // The files should be uploaded in one request + return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength)); + else while(i < parallelUploads){ + if (!queuedFiles.length) return; + // Nothing left to process + this.processFile(queuedFiles.shift()); + i++; + } + } + // Wrapper for `processFiles` + processFile(file) { + return this.processFiles([ + file + ]); + } + // Loads the file, then calls finishedLoading() + processFiles(files) { + for (let file of files){ + file.processing = true; // Backwards compatibility + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING; + this.emit("processing", file); + } + if (this.options.uploadMultiple) this.emit("processingmultiple", files); + return this.uploadFiles(files); + } + _getFilesWithXhr(xhr) { + let files; + return files = this.files.filter((file)=>file.xhr === xhr).map((file)=>file); + } + // Cancels the file upload and sets the status to CANCELED + // **if** the file is actually being uploaded. + // If it's still in the queue, the file is being removed from it and the status + // set to CANCELED. + cancelUpload(file) { + if (file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING) { + let groupedFiles = this._getFilesWithXhr(file.xhr); + for (let groupedFile of groupedFiles)groupedFile.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.CANCELED; + if (typeof file.xhr !== "undefined") file.xhr.abort(); + for (let groupedFile of groupedFiles)this.emit("canceled", groupedFile); + if (this.options.uploadMultiple) this.emit("canceledmultiple", groupedFiles); + } else if (file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.ADDED || file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED) { + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.CANCELED; + this.emit("canceled", file); + if (this.options.uploadMultiple) this.emit("canceledmultiple", [ + file + ]); + } + if (this.options.autoProcessQueue) return this.processQueue(); + } + resolveOption(option, ...args) { + if (typeof option === "function") return option.apply(this, args); + return option; + } + uploadFile(file) { + return this.uploadFiles([ + file + ]); + } + uploadFiles(files) { + this._transformFiles(files, (transformedFiles)=>{ + if (this.options.chunking) { + // Chunking is not allowed to be used with `uploadMultiple` so we know + // that there is only __one__file. + let transformedFile = transformedFiles[0]; + files[0].upload.chunked = this.options.chunking && (this.options.forceChunking || transformedFile.size > this.options.chunkSize); + files[0].upload.totalChunkCount = Math.ceil(transformedFile.size / this.options.chunkSize); + if (transformedFile.size === 0) files[0].upload.totalChunkCount = 1; + } + if (files[0].upload.chunked) { + // This file should be sent in chunks! + // If the chunking option is set, we **know** that there can only be **one** file, since + // uploadMultiple is not allowed with this option. + let file = files[0]; + let transformedFile = transformedFiles[0]; + file.upload.chunks = []; + let handleNextChunk = ()=>{ + let chunkIndex = 0; + // Find the next item in file.upload.chunks that is not defined yet. + while(file.upload.chunks[chunkIndex] !== undefined)chunkIndex++; + // This means, that all chunks have already been started. + if (chunkIndex >= file.upload.totalChunkCount) return; + let start = chunkIndex * this.options.chunkSize; + let end = Math.min(start + this.options.chunkSize, transformedFile.size); + let dataBlock = { + name: this._getParamName(0), + data: transformedFile.webkitSlice ? transformedFile.webkitSlice(start, end) : transformedFile.slice(start, end), + filename: file.upload.filename, + chunkIndex: chunkIndex + }; + file.upload.chunks[chunkIndex] = { + file: file, + index: chunkIndex, + dataBlock: dataBlock, + status: $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING, + progress: 0, + retries: 0 + }; + this._uploadData(files, [ + dataBlock + ]); + }; + file.upload.finishedChunkUpload = (chunk, response)=>{ + let allFinished = true; + chunk.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.SUCCESS; + // Clear the data from the chunk + chunk.dataBlock = null; + chunk.response = chunk.xhr.responseText; + chunk.responseHeaders = chunk.xhr.getAllResponseHeaders(); + // Leaving this reference to xhr will cause memory leaks. + chunk.xhr = null; + for(let i = 0; i < file.upload.totalChunkCount; i++){ + if (file.upload.chunks[i] === undefined) return handleNextChunk(); + if (file.upload.chunks[i].status !== $3ed269f2f0fb224b$export$2e2bcd8739ae039.SUCCESS) allFinished = false; + } + if (allFinished) this.options.chunksUploaded(file, ()=>{ + this._finished(files, response, null); + }); + }; + if (this.options.parallelChunkUploads) { + // we want to limit parallelChunkUploads to the same value as parallelUploads option + const parallelCount = Math.min(this.options.parallelChunkUploads === true ? this.options.parallelUploads : this.options.parallelChunkUploads, file.upload.totalChunkCount); + for(let i = 0; i < parallelCount; i++)handleNextChunk(); + } else handleNextChunk(); + } else { + let dataBlocks = []; + for(let i = 0; i < files.length; i++)dataBlocks[i] = { + name: this._getParamName(i), + data: transformedFiles[i], + filename: files[i].upload.filename + }; + this._uploadData(files, dataBlocks); + } + }); + } + /// Returns the right chunk for given file and xhr + _getChunk(file, xhr) { + for(let i = 0; i < file.upload.totalChunkCount; i++){ + if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].xhr === xhr) return file.upload.chunks[i]; + } + } + // This function actually uploads the file(s) to the server. + // + // If dataBlocks contains the actual data to upload (meaning, that this could + // either be transformed files, or individual chunks for chunked upload) then + // they will be used for the actual data to upload. + _uploadData(files, dataBlocks) { + let xhr = new XMLHttpRequest(); + // Put the xhr object in the file objects to be able to reference it later. + for (let file of files)file.xhr = xhr; + if (files[0].upload.chunked) // Put the xhr object in the right chunk object, so it can be associated + // later, and found with _getChunk. + files[0].upload.chunks[dataBlocks[0].chunkIndex].xhr = xhr; + let method = this.resolveOption(this.options.method, files, dataBlocks); + let url = this.resolveOption(this.options.url, files, dataBlocks); + xhr.open(method, url, true); + // Setting the timeout after open because of IE11 issue: https://gitlab.com/meno/dropzone/issues/8 + let timeout = this.resolveOption(this.options.timeout, files); + if (timeout) xhr.timeout = this.resolveOption(this.options.timeout, files); + // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179 + xhr.withCredentials = !!this.options.withCredentials; + xhr.onload = (e)=>{ + this._finishedUploading(files, xhr, e); + }; + xhr.ontimeout = ()=>{ + this._handleUploadError(files, xhr, `Request timedout after ${this.options.timeout / 1000} seconds`); + }; + xhr.onerror = ()=>{ + this._handleUploadError(files, xhr); + }; + // Some browsers do not have the .upload property + let progressObj = xhr.upload != null ? xhr.upload : xhr; + progressObj.onprogress = (e)=>this._updateFilesUploadProgress(files, xhr, e); + let headers = this.options.defaultHeaders ? { + Accept: "application/json", + "Cache-Control": "no-cache", + "X-Requested-With": "XMLHttpRequest" + } : {}; + if (this.options.binaryBody) headers["Content-Type"] = files[0].type; + if (this.options.headers) Object.assign(headers, this.options.headers); + for(let headerName in headers){ + let headerValue = headers[headerName]; + if (headerValue) xhr.setRequestHeader(headerName, headerValue); + } + if (this.options.binaryBody) { + // Since the file is going to be sent as binary body, it doesn't make + // any sense to generate `FormData` for it. + for (let file of files)this.emit("sending", file, xhr); + if (this.options.uploadMultiple) this.emit("sendingmultiple", files, xhr); + this.submitRequest(xhr, null, files); + } else { + let formData = new FormData(); + // Adding all @options parameters + if (this.options.params) { + let additionalParams = this.options.params; + if (typeof additionalParams === "function") additionalParams = additionalParams.call(this, files, xhr, files[0].upload.chunked ? this._getChunk(files[0], xhr) : null); + for(let key in additionalParams){ + let value = additionalParams[key]; + if (Array.isArray(value)) // The additional parameter contains an array, + // so lets iterate over it to attach each value + // individually. + for(let i = 0; i < value.length; i++)formData.append(key, value[i]); + else formData.append(key, value); + } + } + // Let the user add additional data if necessary + for (let file of files)this.emit("sending", file, xhr, formData); + if (this.options.uploadMultiple) this.emit("sendingmultiple", files, xhr, formData); + this._addFormElementData(formData); + // Finally add the files + // Has to be last because some servers (eg: S3) expect the file to be the last parameter + for(let i = 0; i < dataBlocks.length; i++){ + let dataBlock = dataBlocks[i]; + formData.append(dataBlock.name, dataBlock.data, dataBlock.filename); + } + this.submitRequest(xhr, formData, files); + } + } + // Transforms all files with this.options.transformFile and invokes done with the transformed files when done. + _transformFiles(files, done) { + let transformedFiles = []; + // Clumsy way of handling asynchronous calls, until I get to add a proper Future library. + let doneCounter = 0; + for(let i = 0; i < files.length; i++)this.options.transformFile.call(this, files[i], (transformedFile)=>{ + transformedFiles[i] = transformedFile; + if (++doneCounter === files.length) done(transformedFiles); + }); + } + // Takes care of adding other input elements of the form to the AJAX request + _addFormElementData(formData) { + // Take care of other input elements + if (this.element.tagName === "FORM") for (let input of this.element.querySelectorAll("input, textarea, select, button")){ + let inputName = input.getAttribute("name"); + let inputType = input.getAttribute("type"); + if (inputType) inputType = inputType.toLowerCase(); + // If the input doesn't have a name, we can't use it. + if (typeof inputName === "undefined" || inputName === null) continue; + if (input.tagName === "SELECT" && input.hasAttribute("multiple")) { + // Possibly multiple values + for (let option of input.options)if (option.selected) formData.append(inputName, option.value); + } else if (!inputType || inputType !== "checkbox" && inputType !== "radio" || input.checked) formData.append(inputName, input.value); + } + } + // Invoked when there is new progress information about given files. + // If e is not provided, it is assumed that the upload is finished. + _updateFilesUploadProgress(files, xhr, e) { + if (!files[0].upload.chunked) // Handle file uploads without chunking + for (let file of files){ + if (file.upload.total && file.upload.bytesSent && file.upload.bytesSent == file.upload.total) continue; + if (e) { + file.upload.progress = 100 * e.loaded / e.total; + file.upload.total = e.total; + file.upload.bytesSent = e.loaded; + } else { + // No event, so we're at 100% + file.upload.progress = 100; + file.upload.bytesSent = file.upload.total; + } + this.emit("uploadprogress", file, file.upload.progress, file.upload.bytesSent); + } + else { + // Handle chunked file uploads + // Chunked upload is not compatible with uploading multiple files in one + // request, so we know there's only one file. + let file = files[0]; + // Since this is a chunked upload, we need to update the appropriate chunk + // progress. + let chunk = this._getChunk(file, xhr); + if (e) { + chunk.progress = 100 * e.loaded / e.total; + chunk.total = e.total; + chunk.bytesSent = e.loaded; + } else { + // No event, so we're at 100% + chunk.progress = 100; + chunk.bytesSent = chunk.total; + } + // Now tally the *file* upload progress from its individual chunks + file.upload.progress = 0; + file.upload.total = 0; + file.upload.bytesSent = 0; + for(let i = 0; i < file.upload.totalChunkCount; i++)if (file.upload.chunks[i] && typeof file.upload.chunks[i].progress !== "undefined") { + file.upload.progress += file.upload.chunks[i].progress; + file.upload.total += file.upload.chunks[i].total; + file.upload.bytesSent += file.upload.chunks[i].bytesSent; + } + // Since the process is a percentage, we need to divide by the amount of + // chunks we've used. + file.upload.progress = file.upload.progress / file.upload.totalChunkCount; + this.emit("uploadprogress", file, file.upload.progress, file.upload.bytesSent); + } + } + _finishedUploading(files, xhr, e) { + let response; + if (files[0].status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.CANCELED) return; + if (xhr.readyState !== 4) return; + if (xhr.responseType !== "arraybuffer" && xhr.responseType !== "blob") { + response = xhr.responseText; + if (xhr.getResponseHeader("content-type") && ~xhr.getResponseHeader("content-type").indexOf("application/json")) try { + response = JSON.parse(response); + } catch (error) { + e = error; + response = "Invalid JSON response from server."; + } + } + this._updateFilesUploadProgress(files, xhr); + if (!(200 <= xhr.status && xhr.status < 300)) this._handleUploadError(files, xhr, response); + else if (files[0].upload.chunked) files[0].upload.finishedChunkUpload(this._getChunk(files[0], xhr), response); + else this._finished(files, response, e); + } + _handleUploadError(files, xhr, response) { + if (files[0].status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.CANCELED) return; + if (files[0].upload.chunked && this.options.retryChunks) { + let chunk = this._getChunk(files[0], xhr); + if (chunk.retries++ < this.options.retryChunksLimit) { + this._uploadData(files, [ + chunk.dataBlock + ]); + return; + } else console.warn("Retried this chunk too often. Giving up."); + } + this._errorProcessing(files, response || this.options.dictResponseError.replace("{{statusCode}}", xhr.status), xhr); + } + submitRequest(xhr, formData, files) { + if (xhr.readyState != 1) { + console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED."); + return; + } + if (this.options.binaryBody) { + if (files[0].upload.chunked) { + const chunk = this._getChunk(files[0], xhr); + xhr.send(chunk.dataBlock.data); + } else xhr.send(files[0]); + } else xhr.send(formData); + } + // Called internally when processing is finished. + // Individual callbacks have to be called in the appropriate sections. + _finished(files, responseText, e) { + for (let file of files){ + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.SUCCESS; + this.emit("success", file, responseText, e); + this.emit("complete", file); + } + if (this.options.uploadMultiple) { + this.emit("successmultiple", files, responseText, e); + this.emit("completemultiple", files); + } + if (this.options.autoProcessQueue) return this.processQueue(); + } + // Called internally when processing is finished. + // Individual callbacks have to be called in the appropriate sections. + _errorProcessing(files, message, xhr) { + for (let file of files){ + file.status = $3ed269f2f0fb224b$export$2e2bcd8739ae039.ERROR; + this.emit("error", file, message, xhr); + this.emit("complete", file); + } + if (this.options.uploadMultiple) { + this.emit("errormultiple", files, message, xhr); + this.emit("completemultiple", files); + } + if (this.options.autoProcessQueue) return this.processQueue(); + } + static uuidv4() { + return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c)=>(+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16)); + } +} +$3ed269f2f0fb224b$export$2e2bcd8739ae039.initClass(); +// This is a map of options for your different dropzones. Add configurations +// to this object for your different dropzone elements. +// +// Example: +// +// Dropzone.options.myDropzoneElementId = { maxFilesize: 1 }; +// +// And in html: +// +//
+$3ed269f2f0fb224b$export$2e2bcd8739ae039.options = {}; +// Returns the options for an element or undefined if none available. +$3ed269f2f0fb224b$export$2e2bcd8739ae039.optionsForElement = function(element) { + // Get the `Dropzone.options.elementId` for this element if it exists + if (element.getAttribute("id") && typeof $3ed269f2f0fb224b$export$2e2bcd8739ae039.options !== "undefined") return $3ed269f2f0fb224b$export$2e2bcd8739ae039.options[$3ed269f2f0fb224b$var$camelize(element.getAttribute("id"))]; + else return undefined; +}; +// Holds a list of all dropzone instances +$3ed269f2f0fb224b$export$2e2bcd8739ae039.instances = []; +// Returns the dropzone for given element if any +$3ed269f2f0fb224b$export$2e2bcd8739ae039.forElement = function(element) { + if (typeof element === "string") element = document.querySelector(element); + if ((element != null ? element.dropzone : undefined) == null) throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone."); + return element.dropzone; +}; +// Looks for all .dropzone elements and creates a dropzone for them +$3ed269f2f0fb224b$export$2e2bcd8739ae039.discover = function() { + let dropzones; + if (document.querySelectorAll) dropzones = document.querySelectorAll(".dropzone"); + else { + dropzones = []; + // IE :( + let checkElements = (elements)=>(()=>{ + let result = []; + for (let el of elements)if (/(^| )dropzone($| )/.test(el.className)) result.push(dropzones.push(el)); + else result.push(undefined); + return result; + })(); + checkElements(document.getElementsByTagName("div")); + checkElements(document.getElementsByTagName("form")); + } + return (()=>{ + let result = []; + for (let dropzone of dropzones)// Create a dropzone unless auto discover has been disabled for specific element + if ($3ed269f2f0fb224b$export$2e2bcd8739ae039.optionsForElement(dropzone) !== false) result.push(new $3ed269f2f0fb224b$export$2e2bcd8739ae039(dropzone)); + else result.push(undefined); + return result; + })(); +}; +// Checks if the browser is supported by simply checking if Promise is here: a good cutoff +$3ed269f2f0fb224b$export$2e2bcd8739ae039.isBrowserSupported = function() { + return typeof Promise !== "undefined"; +}; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.dataURItoBlob = function(dataURI) { + // convert base64 to raw binary data held in a string + // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this + let byteString = atob(dataURI.split(",")[1]); + // separate out the mime component + let mimeString = dataURI.split(",")[0].split(":")[1].split(";")[0]; + // write the bytes of the string to an ArrayBuffer + let ab = new ArrayBuffer(byteString.length); + let ia = new Uint8Array(ab); + for(let i = 0, end = byteString.length, asc = 0 <= end; asc ? i <= end : i >= end; asc ? i++ : i--)ia[i] = byteString.charCodeAt(i); + // write the ArrayBuffer to a blob + return new Blob([ + ab + ], { + type: mimeString + }); +}; +// Returns an array without the rejected item +const $3ed269f2f0fb224b$var$without = (list, rejectedItem)=>list.filter((item)=>item !== rejectedItem).map((item)=>item); +// abc-def_ghi -> abcDefGhi +const $3ed269f2f0fb224b$var$camelize = (str)=>str.replace(/[\-_](\w)/g, (match)=>match.charAt(1).toUpperCase()); +// Creates an element from string +$3ed269f2f0fb224b$export$2e2bcd8739ae039.createElement = function(string) { + let div = document.createElement("div"); + div.innerHTML = string; + return div.childNodes[0]; +}; +// Tests if given element is inside (or simply is) the container +$3ed269f2f0fb224b$export$2e2bcd8739ae039.elementInside = function(element, container) { + if (element === container) return true; + // Coffeescript doesn't support do/while loops + while(element = element.parentNode){ + if (element === container) return true; + } + return false; +}; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.getElement = function(el, name) { + let element; + if (typeof el === "string") element = document.querySelector(el); + else if (el.nodeType != null) element = el; + if (element == null) throw new Error(`Invalid \`${name}\` option provided. Please provide a CSS selector or a plain HTML element.`); + return element; +}; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.getElements = function(els, name) { + let el, elements; + if (els instanceof Array) { + elements = []; + try { + for (el of els)elements.push(this.getElement(el, name)); + } catch (e) { + elements = null; + } + } else if (typeof els === "string") { + elements = []; + for (el of document.querySelectorAll(els))elements.push(el); + } else if (els.nodeType != null) elements = [ + els + ]; + if (elements == null || !elements.length) throw new Error(`Invalid \`${name}\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`); + return elements; +}; +// Asks the user the question and calls accepted or rejected accordingly +// +// The default implementation just uses `window.confirm` and then calls the +// appropriate callback. +$3ed269f2f0fb224b$export$2e2bcd8739ae039.confirm = function(question, accepted, rejected) { + if (window.confirm(question)) return accepted(); + else if (rejected != null) return rejected(); +}; +// Validates the mime type like this: +// +// https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept +$3ed269f2f0fb224b$export$2e2bcd8739ae039.isValidFile = function(file, acceptedFiles) { + if (!acceptedFiles) return true; + // If there are no accepted mime types, it's OK + acceptedFiles = acceptedFiles.split(","); + let mimeType = file.type; + let baseMimeType = mimeType.replace(/\/.*$/, ""); + for (let validType of acceptedFiles){ + validType = validType.trim(); + if (validType.charAt(0) === ".") { + if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) return true; + } else if (/\/\*$/.test(validType)) { + // This is something like a image/* mime type + if (baseMimeType === validType.replace(/\/.*$/, "")) return true; + } else { + if (mimeType === validType) return true; + } + } + return false; +}; +// Augment jQuery +if (typeof jQuery !== "undefined" && jQuery !== null) jQuery.fn.dropzone = function(options) { + return this.each(function() { + return new $3ed269f2f0fb224b$export$2e2bcd8739ae039(this, options); + }); +}; +// Dropzone file status codes +$3ed269f2f0fb224b$export$2e2bcd8739ae039.ADDED = "added"; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED = "queued"; +// For backwards compatibility. Now, if a file is accepted, it's either queued +// or uploading. +$3ed269f2f0fb224b$export$2e2bcd8739ae039.ACCEPTED = $3ed269f2f0fb224b$export$2e2bcd8739ae039.QUEUED; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING = "uploading"; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.PROCESSING = $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING; // alias +$3ed269f2f0fb224b$export$2e2bcd8739ae039.CANCELED = "canceled"; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.ERROR = "error"; +$3ed269f2f0fb224b$export$2e2bcd8739ae039.SUCCESS = "success"; +/* + + Bugfix for iOS 6 and 7 + Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios + based on the work of https://github.com/stomita/ios-imagefile-megapixel + + */ // Detecting vertical squash in loaded image. +// Fixes a bug which squash image vertically while drawing into canvas for some images. +// This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel +let $3ed269f2f0fb224b$var$detectVerticalSquash = function(img) { + let ih = img.naturalHeight; + let canvas = document.createElement("canvas"); + canvas.width = 1; + canvas.height = ih; + let ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0); + let { data: data } = ctx.getImageData(1, 0, 1, ih); + // search image edge pixel position in case it is squashed vertically. + let sy = 0; + let ey = ih; + let py = ih; + while(py > sy){ + let alpha = data[(py - 1) * 4 + 3]; + if (alpha === 0) ey = py; + else sy = py; + py = ey + sy >> 1; + } + let ratio = py / ih; + if (ratio === 0) return 1; + else return ratio; +}; +// A replacement for context.drawImage +// (args are for source and destination). +var $3ed269f2f0fb224b$var$drawImageIOSFix = function(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) { + let vertSquashRatio = $3ed269f2f0fb224b$var$detectVerticalSquash(img); + return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio); +}; +// Inspired by MinifyJpeg +// Source: http://www.perry.cz/files/ExifRestorer.js +// http://elicon.blog57.fc2.com/blog-entry-206.html +function $3ed269f2f0fb224b$var$removeExif(origFileBase64) { + var marker = "data:image/jpeg;base64,"; + if (!origFileBase64.startsWith(marker)) return origFileBase64; + var origFile = window.atob(origFileBase64.slice(marker.length)); + if (!origFile.startsWith("\xff\xd8\xff")) return origFileBase64; + // loop through the JPEG file segments and copy all but Exif segments into the filtered file. + var head = 0; + var filteredFile = ""; + while(head < origFile.length){ + if (origFile.slice(head, head + 2) == "\xff\xda") { + // this is the start of the image data, we don't expect exif data after that. + filteredFile += origFile.slice(head); + break; + } else if (origFile.slice(head, head + 2) == "\xff\xd8") { + // this is the global start marker. + filteredFile += origFile.slice(head, head + 2); + head += 2; + } else { + // we have a segment of variable size. + var length = origFile.charCodeAt(head + 2) * 256 + origFile.charCodeAt(head + 3); + var endPoint = head + length + 2; + var segment = origFile.slice(head, endPoint); + if (!segment.startsWith("\xff\xe1")) filteredFile += segment; + head = endPoint; + } + } + return marker + window.btoa(filteredFile); +} +function $3ed269f2f0fb224b$var$restoreExif(origFileBase64, resizedFileBase64) { + var marker = "data:image/jpeg;base64,"; + if (!(origFileBase64.startsWith(marker) && resizedFileBase64.startsWith(marker))) return resizedFileBase64; + var origFile = window.atob(origFileBase64.slice(marker.length)); + if (!origFile.startsWith("\xff\xd8\xff")) return resizedFileBase64; + // Go through the JPEG file segments one by one and collect any Exif segments we find. + var head = 0; + var exifData = ""; + while(head < origFile.length){ + if (origFile.slice(head, head + 2) == "\xff\xda") break; + else if (origFile.slice(head, head + 2) == "\xff\xd8") // this is the global start marker. + head += 2; + else { + // we have a segment of variable size. + var length = origFile.charCodeAt(head + 2) * 256 + origFile.charCodeAt(head + 3); + var endPoint = head + length + 2; + var segment = origFile.slice(head, endPoint); + if (segment.startsWith("\xff\xe1")) exifData += segment; + head = endPoint; + } + } + if (exifData == "") return resizedFileBase64; + var resizedFile = window.atob(resizedFileBase64.slice(marker.length)); + if (!resizedFile.startsWith("\xff\xd8\xff")) return resizedFileBase64; + // The first file segment is always header information so insert the Exif data as second segment. + var splitPoint = 4 + resizedFile.charCodeAt(4) * 256 + resizedFile.charCodeAt(5); + resizedFile = resizedFile.slice(0, splitPoint) + exifData + resizedFile.slice(splitPoint); + return marker + window.btoa(resizedFile); +} +function $3ed269f2f0fb224b$var$__guard__(value, transform) { + return typeof value !== "undefined" && value !== null ? transform(value) : undefined; +} +function $3ed269f2f0fb224b$var$__guardMethod__(obj, methodName, transform) { + if (typeof obj !== "undefined" && obj !== null && typeof obj[methodName] === "function") return transform(obj, methodName); + else return undefined; +} + + + +//# sourceMappingURL=dropzone.mjs.map + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ id: moduleId, +/******/ loaded: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ !function() { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function() { return module['default']; } : +/******/ function() { return module; }; +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ !function() { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/node module decorator */ +/******/ !function() { +/******/ __webpack_require__.nmd = function(module) { +/******/ module.paths = []; +/******/ if (!module.children) module.children = []; +/******/ return module; +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. +!function() { +"use strict"; +/*!**************************************!*\ + !*** ./client/src/bundles/bundle.js ***! + \**************************************/ + + +__webpack_require__(/*! expose-loader?exposes=InsertMediaModal!containers/InsertMediaModal/InsertMediaModal */ "./node_modules/expose-loader/dist/cjs.js?exposes=InsertMediaModal!./client/src/containers/InsertMediaModal/InsertMediaModal-exposed.js"); +__webpack_require__(/*! expose-loader?exposes=InsertEmbedModal!components/InsertEmbedModal/InsertEmbedModal */ "./node_modules/expose-loader/dist/cjs.js?exposes=InsertEmbedModal!./client/src/components/InsertEmbedModal/InsertEmbedModal-exposed.js"); +__webpack_require__(/*! boot */ "./client/src/boot/index.js"); +__webpack_require__(/*! entwine/UploadField/UploadFieldEntwine */ "./client/src/entwine/UploadField/UploadFieldEntwine.js"); +}(); +/******/ })() +; +//# sourceMappingURL=bundle.js.map \ No newline at end of file diff --git a/client/dist/styles/bundle.css b/client/dist/styles/bundle.css index ffddb3b96..fee2af6c4 100644 --- a/client/dist/styles/bundle.css +++ b/client/dist/styles/bundle.css @@ -1 +1,1938 @@ -.gallery-item{opacity:1;position:relative;background-color:#fff;border:1px solid;border-color:rgb(218.7079545455,224.0352272727,232.6920454545) rgb(206.0738636364,213.2556818182,224.9261363636) rgb(193.4397727273,202.4761363636,217.1602272727);width:178px;border-radius:.192rem;height:174px;transition:opacity 250ms linear}.gallery-item:hover{box-shadow:0 1px 4px rgba(0,0,0,.2);cursor:pointer}.gallery-item:not(.gallery-item--error,.gallery-item--folder):hover .gallery-item--overlay{opacity:1;display:block}.gallery-item--dropping{border-color:#29abe2;background-color:rgb(231.7,245.1331632653,255)}.gallery-item__draggable,.gallery-item__droppable{margin:0 1.2308rem 1.2308rem 0}.gallery-item__draggable .gallery-item__droppable,.gallery-item__droppable .gallery-item__draggable{margin:0}.gallery-item--folder{display:flex;height:54px}.gallery-item--folder .gallery-item__thumbnail{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGFJREFUeNpi1Jhy/D8D6cDxRo7lAQYaACYy9Tkw0AiQ6yD7weYgB83VjwRo4SBGoMH/GQYRYGIYZGDUQaMOGnXQqINGHTTqoFEHjTpo1EGjDhp10KiDRh006qDB7SCAAAMAe8YKeWd2MukAAAAASUVORK5CYII=) 12px 14px no-repeat;background-size:27px 24px;height:52px;width:45px;float:left}.gallery-item--folder .gallery-item__title{padding-top:17px;padding-bottom:17px;padding-left:0;width:131px;height:52px}.gallery-item--folder .gallery-item__checkbox-label{margin-top:5px}.gallery-item--folder .gallery-item__status-flags{display:none}.gallery-item--folder .gallery-item__status-icons{grid-column:1;text-align:left;margin:20px 0 0 17px}.gallery-item--folder .file-status-icon__icon:before{color:#005ae1;font-size:16px}.gallery-item__thumbnail{height:132px;width:176px;margin:0 auto;background-repeat:no-repeat;background-position:center center;border-top-left-radius:.192rem;border-top-right-radius:.192rem;background-size:cover;display:grid;grid-template-columns:50% 50%}.gallery-item__thumbnail--error{background-color:rgb(220.6,54.2,54.2)}.gallery-item__thumbnail--no-preview{background-color:rgb(86.4147727273,107.0511363636,140.5852272727)}.gallery-item__thumbnail--loading{background:#fff url(data:image/gif;base64,R0lGODlhKwArAKIHAOvt7rS8wdLW2EB9ogBakqysrP///////yH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo1NWQ2NWU5Yy1iZjAwLTRmNjktODVlNS03NDQ4ODZiM2E1MDEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MjRFNkFDN0EwNjZDMTFFNTg1QTBBNzNENzVBQ0M0ODQiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MjRFNkFDNzkwNjZDMTFFNTg1QTBBNzNENzVBQ0M0ODQiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2MzRlNmQ4NC00OGE1LTRmNzQtYTcwYS0wNDM4N2E1ZTYzZjAiIHN0UmVmOmRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDo5ZjhiOTRiYy00YTNiLTExNzgtYWNjMy1kNzg3OTk3MTdhNzQiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4B//79/Pv6+fj39vX08/Lx8O/u7ezr6uno5+bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL++vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI+OjYyLiomIh4aFhIOCgYB/fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAAAh+QQFAAAHACwAAAAAKwArAAADtni23P4wOiWrvTjrzbv/YCiOWCCQGVAUAXoF6+pKABwXMyTca5szKt7q9DPshAViroZMFoNCHwQgEAA+Np7ScbwFrppu7BvJCrcWs7PcjKElWlr7luGBG4KWuHfGxIE2VDdEUD0ldgtiVj13RjwYeyx9aw2FOH5zK41cjxiWURJ7UheRYxFMfylqlJygHlRWp6uaRaUsmyi2b7lIZEUGq7szPL6/C17GDoHJXKPMz9DR0tMT1AcJACH5BAUAAAcALBAABwAGAAcAAAMQeApTGiSyGAetdxwb3SZaAgAh+QQFAAAHACwIAAoADAAKAAADIXi6F8QMDPJgm7QqmbsSWEcVR9gNwlGYI2Oi1kEN8RLECQAh+QQFAAAHACwHAA8ABwAMAAADG2hCzDaNlchgtG0YGnYsDyVgjZcZUwUawVC8CQAh+QQFAAAHACwKABQADgAJAAADI3i6O8TwCEdCPKCQTUrkYABYCggKjMkNiwoCy6QWMJQVARolACH5BAUAAAcALA8ADwARAAkAAAMseLqsUSW0Bgq5d0wFBsba5n0YdQjkt1RHlV7bMV4FcB5GuASYEC+FA0HHSAAAIfkEBQAABwAsHAAPAAkADgAAAyR4CtpNQzhFapmnkjD1YJQGGaHXFCLRBGkztAcrDs5Lc9iF4QkAIfkEBQAABwAsGAAZAAwACQAAAx54urOuYpB5SFNl6tni3kLwgYc0XsooPBUHsMqwsgkAIfkEBQAABwAsEAAHAA0AHgAAAzp4aiH6EJQS4GNzWpXzPkNXfZ3zgcN4rmzrvnAsz3Rt31vRDgRbEL0VD7gCGg+qh5EwAHyMSUuhCUkAACH5BAUAAAcALAgACgAPAA4AAAMveLoHwVAZUUpkoNZ7pv6FsDigJi5lFRgMkZ7Q8AUAd8ihvcgXq3eBwW/YsOyIkgQAIfkEBQAABwAsBwAPAAgADAAAAx54cNwXjolSYqC1YSrYLsvxdc8GHdM2DOLWpJnDNgkAIfkEBQAABwAsCAAUABEACQAAAyl4unwSLSoQShGygGOEtVhWfeBWNCS5rUv6QYznWoERUa5gSxwgCBtJAgAh+QQFAAAHACwVAA8ACwAKAAADIni6IHFmGVFqGTJYu/SuCvBx03gdzSYsYRUArGIUayzZSgIAIfkEBQAABwAsHQAPAAgADAAAAyAocNxXJSwHi6D1sgpN4NAFgAEjgMzIbSgzvEfpHISQAAAh+QQFAAAHACwZABgACwALAAADIXi6sq6iSLlAmBPiGeyewPAV3SFuzYKVjygYj0Kk8QHXCQA7) center center no-repeat}@media only screen and (min-device-pixel-ratio: 2),only screen and (resolution >= 192dpi),only screen and (resolution >= 2dppx){.gallery-item__thumbnail--loading{background:#fff url(data:image/gif;base64,R0lGODlhVgBWAPf/AP///5qkqnigubi4uO3y9fD09tTU1MrKyi1xnCZtmhlnl7q6ulWDnxFilWWTsSlvm1WJqk+AnsbGxpa0x+bm5h1pmEqDpsPDw6Woq83Nzc3a46nC0fLy8snW3uTk5K6urmuNomGJoXSet7S0tFGHqR9qmG2ZtNHe5hVklq6vsAlelJWhqdjj6enp6X2WpYOnvoWZpnOSpdvb28zU2ARck566y+nv87nN2UR6nI2uwqzE0ubt8Ymbp7/Gy6mrrEF9o8vZ4nuiuvz9/pu3yQ5hlevw85KyxaCmqmqXs6usrPr7/Ep9namqq0eBpVyGoAZdk5q2yAxglE2FpzBxmTp2m4qswSJql22Vraq0uwJbkqysrABakjN1noadrHGatO3v8ZGfqPX29k2Coh1olufs78/R0j94nLKysvf39/z8/Le3t9DQ0LGxsePj48jIyN/o7fr6+v7+/7y8vPHx8fb4+r29veDg4P7+/vv7+/n5+fj4+ER/pAFaktLS0tnZ2cXFxcDAwP39/fb29t/f397e3vX19erq6q2trV+QriFrmZCwxPT09OLi4u3t7QFbkrOzs6urq+Hh4QNck/Dw8GCRr3+lvApflGOSr+fu8r7Q26W/z+zs7M7Ozr+/v93d3dPT0/L2+LCwsNjY2Ovr68TExNfX17m6uzV2n4mrwLPI1ViMrLe4ua/G1Pj6+8jX4ePq7zBznefn5+Dh4bbL18jJyVOIqfPz84+wxNvl7Dh4oD17ocTFxdjZ2bS2tqytrsjY4eHp7tTf5vf5+u/v79HR0cnJyba2tqG8zfz9/cLT3fb5+g9ilVKGp5e1x9vl66e+zPL192aSrgdek3aft2GQrV6Prjd0mvv8/KK6ydPU1DNymoKitdXg56a/z9/g4X+juJ6yvp2oriRrmNvc3fz8/eHl536crvb29+Xl5XicsoWfsN3e3/r7++zx9I2dp8jLzoeovGWPqc3X3+Xr74+ouJSzxq26wpKxxUt/oGOQrdXZ3PX4+cDK0N3m7La2twAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowNzgwMTE3NDA3MjA2ODExODA4M0Y1OEQ5Qzk3MEQ4RSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo3OTA5OUY3RTkzRjIxMUU0QjVEM0JDM0U0RkMyRUM5NyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo3OTA5OUY3RDkzRjIxMUU0QjVEM0JDM0U0RkMyRUM5NyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChNYWNpbnRvc2gpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MDg4MDExNzQwNzIwNjgxMTgwODNGNThEOUM5NzBEOEUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MDc4MDExNzQwNzIwNjgxMTgwODNGNThEOUM5NzBEOEUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4B//79/Pv6+fj39vX08/Lx8O/u7ezr6uno5+bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL++vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI+OjYyLiomIh4aFhIOCgYB/fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAAAh+QQFAAD/ACwAAAAAVgBWAEAI/wD/CQRAsKDBgwgTKlzIsKFDggL/PZxIsaLFixgbGlKjpeMHOBlDijRYCFDHkyhTaiE0sqXDNSpjdnQDkmKkBTJPslmTx+XCnFrQPWxzZiXBSECTpjyTxidBOI+UKh2AMc2InGqcTtSDBk/VA5CkdlSDRqtZgpOk1ll0ti3DRQtauJ1Lt67du3jz6jU4Rw7QT3sz4nEj1uOaQIEvykh6oWzFQBwLq8xw9gBQOY4Ltois0g8AWykfUWCYISebtncsS9ZyRi7FPH+kSkhcEQ1nqRcE0c5oIOaARruDax0onG7E4nYlIl/OvPnCFgvYOh/ZaEBMA9MrLqojdVL2hYIuSP8m+/0gmquFDzS9CAeNnsASpP55T7EFm9VaDtxpezvliPUWWYdfaD05dZ9MlC0UC3on2QKAKDKp4VpBaPiV0wFOpVHUgCrZQRAhrDHyEDpAnVUah1qogVht4gElA115rHFgTgtEUlEehIm1RnkHBbLGB5K54RWPBYEoFiCFEKlQH0AtMIeSD8EBZEcDGALllVhmSRtxWlLEZZdghinmmGSWGWYanADphpkHpfFjSm2weccnU6q0I5ml1CnTi2HKEIpUC4DpyYxKAaIlUZLJkeSVguBUmDFWYpkGd2KpEYtFm6xRx4ZafKCGG3YMWdcch0h1RpwULdJJYWwMMpcepQL8dYaHFQ1DqGSk7GdWfDkVg5EfKJ7kqlYp5ITdQ2j0UdAcwaJEjFZAicgQHDlqIQdBwMoEyR8ezDGKAZzKJK1LFsbERmYGpaFaSh62EdMBNZl3K0rX+sRIUmcYMMocbfwRlkyiEFSuBPEqdG9OWjHZbEdPErQGugz1JlMKZg2ysGcXVRvTbGbdQQqHbABXkR3hxnQIfW0NMm9OnXBQEaJKHeKdXXjYIcEAdZ5RxxqbWBRLf0DVASCUG0m2gG5XFlKuqahiaZJYbHgCpqNJhcInmIsB9UEpZcIU0wcG6Fqmuyh90MfQbBL2ASdos+n223DHLXdBys0N0XFyRxQQACH5BAUAAP8ALA4ADgA7ADsAQAjpAP8JHEiwoMGCGxKdOMiwocOHA3mU2EKxYkVXEDNq3Mix479eHkOKHEmSI5OSKFOqXMmy5cZMiSxWNOHSY5IjIBI8oajgTc2fK1MARUlrKEpeRpMqBZqqQsUnBJY2VCdNpkUHUhu6GGN1S46sEH1h6EEOrNmGSM9qPKk2Y9G2D4XCfQhyrt27ePPqXWlrVSy8oFQ52mIhL51LWWQOmRvIC42uWyjNjREF8pYXc48sgZzoLgYQDfhY5BInLwYYDLT96Le3tevXeHfB/udrNlvXskzBNiUL9m3XtWHLnk28uPHjyJMrX868ZEAAIfkEBQAA/wAsEQATABgAFQBACKAA/wkcSLCgEiQFE05osKWhw4cQtyRg8c9HjDERiShKyLHjv0oqIHLEYiaiyS0oNHkkmG2lS45xRDxp+FIgqignHRYkkyinSQWsBvoAwTBnAygvmbgwo4CGlDg1o/779WCL1IEnEDyUyuLUSZdvdPncSrCAhbEQHVVT9i8MPrQPaxUgeCQCH7QWinQEYy3nj1dJQWB0mOvNVYEBXMRgJzUgACH5BAUAAP8ALA4AHQAPABkAQAibAP8J/NdvoMGBe7YoXMjQYDOGEBU2eFHu4L8ZAQJAsvhL0kKLAyMynGDxlsgtjnAEGEjnwRaQA195bAiSxsktJgwmuGkJl0EHN7fwWXJkoJIfDBuYgbHR4BsFMA1S+hi1CU2QlUSCrHBTAZ2BfG7WMBjlpiqDJIImeCOQDpGgW7SB+Wejwc0GMXwMhCBSGwyLyK6Ie4ADxMqBAQEAIfkEBQAA/wAsEwAnABgAEgBACIoA/wkcSLBgQWAO4hgUuKWhw4cQt2ggWECRhQo0HEZBcOnGwo8LC5CIuKUeQZIot1jKBLKlDQsOE4BEMgtIjT18UgowmJJkEIFQiPSECGtiy6P/oDTYUgVpQU0oIHJzykoByp8Lhz68l1VrwxJdvVZo9Y9aFq8Po+goiAlRlKGJjDj9J4TMGwJIAwIAIfkEBQAA/wAsKgAeABcAEgBACKkA/wkcSJAggTc7hBQcWGKLw4cQIzq0dkSRwCpbGjRbyLEjqygSQ9KI4CPYPwEhtyjQURDYlSMdBUJJlHLLSF8EWzWsKTHBCoFGeIa0wuPkv2ARURyLyZTgDUQIQDqkkSidvo4nYAndgsJFwWSWtj7UBlNgELEQfQrUgPbhEydMBKJMyWdPDSCzkDQgEsLHPyP/JoQkQYBjmIHTBCZ42MRG04VxLgF7XDAgACH5BAUAAP8ALDwAHwANABgAQAiMAP9Fewbtn8GDCP9tWciQoZeDJhpKpHFQ4g8lCHFZktgwwT8YDzgujNLOIEMiORIiFHmrokiGzQxOeLkwjhSaW/YcxAAjRIQlDECs+GJySxREmFS6ZEgCo0qOEJ5ybFCyqMhlwt4kwEnCIASaUQzWwPmPjgKaFbAgwPnCoLslZxk+SUBPZRIMGJggDAgAIfkEBQAA/wAsMAAyABkAEgBACJ0A/wkcSPDfm1xbCip8h2OLw4cQI26xUEDhQHcMxGiwyNGiDQsSQzqkJBCSCxQit5xi0bElpj0hCTpkNhBaLT4pJSp4M/CImZwPdfHsCONBRAQnWiodqIjIQ47Silgc0gCoQ0kbCWpCadXhAzoD5VXo+jCRM4IBqJBtMMEiBgaOckZBpTRAQ4kqKi0dmMSFNmlbnoiIs9dimUCFCQYEACH5BAUAAP8ALB8ADgAZADsAQAjxAP8JHDgw1ipbBBMS5KNthZaHECFOUkixosWLGDNq3MixI8EcW0KK9EjgicgKqSw2GhARogGOWcQ5cXeEiT80HnPq3MnzorBpKHI6EElU5AMgCg2pgfgBTkYg5lq2/KQxywMYUrUQ2omo58ZmXsOKHUu2bMc3CkZ6dFVU7UYTbbckytTxRKINHdNw+qDFjcc0a/hGbKMx0CfBUtdkjMLAR9aHMjQ2AOFY6gKONLTBSBIREACPfCyJMxOPjNnTqFOrXs26tevXsC124MkiQUidcbgUzZmorccXcd1iRBScBhIlGocUzXKJjkcLWxypAkUxIAAh+QQFAAD/ACwRABMAGQAYAEAIugD/CRxIsOCdgggFtjmjpaHDhxC1yCkk8MkSDBHP2EnIkaOMUBETcgEBKaJJNbE6DuQTJYhKgmj6AHj5D0CpDw1pDvTExuRDhDYW+PRpzBDBLDgwDj3TRmcDBmB8aCk2U6dVhAW24ZjS4OocOVcLLqrz82ohQD5pCrow9ORAPG7aRvywJtDAGHIhHkhTUJqTvFrcwOloBcbQP3qchlDa8AKasAItaXPSBQ/kywK9BQCB7XI3BU+y8BEYEAAh+QQFAAD/ACwOAB0ADgAZAEAIlwD/CfwnaKBBgbu0KFy40KAshhAVhoN38F+NigLnHGqIkUnEhYwODvrIJESDgWnqKMT4T89Ghhh9fVRoYKCpmVrYoBnYB6cWECcF3umEIckRGBFQ8DmIZgTLgWtWPpUAEyOvjxV74RyRRqDHmegGpsCZYSAtn3LO/UtzxicPcf/gPJoZgEqWgRkgHgExpmIgcE5wWHliMCAAIfkEBQAA/wAsEgAoABsAEQBACIsA/wkcSLBgwTZntIwzSFCLw4cQI2oZwLAgAD1o8FTcWBBNwRZqJDr084/bnQMiUz4804Kjy3+xRkT8wlGlSDsMbYpUE8hgnjVsdC6I9LLoPzhuHsoxSjANSonrOJ4xMGpOmz+QVIqqqRPinIpdI5IUSCqsSDaNDA4KarYTB5d47EgY8GFlnTWbOAYEACH5BAUAAP8ALCkAHgAWAB4AQAi9AP8JHEiwIBw0YeIUFDhAi8OHECH6ABGFICEtZxgt3Mixo0eBLdhEHImBAY1/tv6JGulQTYuC8z7K3Hjt20yPkRawZGKyYCA1LEf6cKGAkMBIQUcmgWGFoK2IjyjcnEq1qkBQVgtuWlPnjMMkMajk47ioU1It7qYsHCbyrBZIMRoQ9OP2ISQXKAbOqfvwCL4sA+kGhfTHw5xRZZwA/mfnXxuWB+DMlPNQguSpANagycq5s+fPC+WVqPoGwdSAACH5BAUAAP8ALDoAHgAPABYAQAiPAPUA+EewoMGDWhIqXPgoz0F0CyP6IBgx4YE7B/+hkVNxIa2DUaYwAEGSwZQoFBWyWeMwY8qOGQx2jHgmjcEMM7WkKCisC4aOGLpo+aDGjR08LmUuZDMo6UxSGJXObFowZ0JiBA2csapFVkE0bHKaMsgoJxOD2XJOLCguBJifCTGACaHK5ZMoDaI8+SfpX0AAIfkEBQAA/wAsMQAuABgAFQBACKkA/wkcSLCgQYFMCOZxo6Whw4cQ1xB8AAZiQ0CFDmo0iOaCRYi8iFgL8PGjGzwb/yVIyXJjmhFaDmrpdTDPn5IQJQjcZw8STotq0BAsweOnlguCWD7BUVFLnUUtowo0sNEXSwAMHQ50uGujnTNGD+kx2AasUS2HJhGkoOaswzppBHYQs8JtwwVJCU4JkMTomTYaVYTo+5GNp5ZZlpB0GEqGVIIJQvAD8DggADs=) center center no-repeat;background-size:43px 43px}}.gallery-item__thumbnail--small{background-size:auto;background-color:#fff}.gallery-item__title{padding:11px 12px;height:40px;width:176px;margin:0;overflow:hidden;box-sizing:border-box;text-overflow:ellipsis;white-space:nowrap;position:relative}.gallery-item--selectable .gallery-item__title{padding-right:32px}.gallery-item__checkbox{margin:13px 4px;transform:scale(0.1);z-index:-1;position:absolute}.gallery-item__checkbox-label{width:30px;height:40px;position:absolute;right:0;top:0;margin-bottom:0}.asset-admin--single-select .gallery-item--selectable .gallery-item__checkbox-label{display:none}.gallery-item--selectable .gallery-item__checkbox-label:before{cursor:pointer;top:0;bottom:0;right:0;height:19px;width:19px;margin:auto 10px;position:absolute;border:1px solid rgb(206.0738636364,213.2556818182,224.9261363636);border-radius:.192rem;font-size:1.15em;padding:1px;color:rgba(0,0,0,0);background-color:#fff}.gallery-item--selectable .gallery-item__checkbox-label:not(.gallery-item__checkbox-label--disabled):hover:before{border:1px solid #29abe2}.gallery-item--error .gallery-item__checkbox-label:before,.gallery-item__upload-progress+.gallery-item__title .gallery-item__checkbox-label:before{font-size:19px;border:0;border-radius:0;padding:0}.gallery-item--error .gallery-item__checkbox-label:hover:before,.gallery-item__upload-progress+.gallery-item__title .gallery-item__checkbox-label:hover:before{border:0}.gallery-item--error:hover,.gallery-item--error .gallery-item__thumbnail,.gallery-item--error .gallery-item__title,.gallery-item--error .gallery-item__checkbox-label{cursor:not-allowed}.gallery-item--error .gallery-item__checkbox-label:before{color:#d40404}.gallery-item__error-message{position:absolute;top:calc(50% - 40px/2);left:50%;transform:translateX(-50%) translateY(-50%);max-height:calc(100% - 40px);overflow:hidden;width:90%;color:#fff;background-color:rgb(220.6,54.2,54.2);text-align:center}.gallery-item--error .gallery-item__thumbnail,.gallery-item--missing .gallery-item__thumbnail{position:relative}.gallery-item--error .gallery-item__thumbnail:after,.gallery-item--missing .gallery-item__thumbnail:after{content:"";position:absolute;inset:0;background:rgb(220.6,54.2,54.2);border-radius:2px 2px 0 0}.gallery-item--error:hover .gallery-item__thumbnail:after,.gallery-item--error:hover .gallery-item__error-message,.gallery-item--missing:hover .gallery-item__thumbnail:after,.gallery-item--missing:hover .gallery-item__error-message{background:rgb(216.3,29.1,29.1)}.gallery-item--overlay{grid-column:1/span 2;grid-row:1;background:rgba(47.5852272727,58.9488636364,77.4147727273,.5);opacity:0;display:none;transition-property:opacity,background;transition-duration:.5s;border-top-left-radius:.192rem;border-top-right-radius:.192rem;color:#fff;height:132px;width:100%;font-size:14px;padding-top:56px;text-align:center}.gallery-item--overlay:before{margin-right:.385rem;position:relative;top:.2rem}.gallery-item--selected{border-color:#29abe2}.gallery-item--selected .gallery-item__checkbox-label:before{border-color:#29abe2;background-color:#29abe2;color:#fff}.gallery__main--dragging .gallery-item--selected{opacity:.2}.gallery-item--highlighted,.gallery-item__drag-shadow{border-color:#29abe2;background-color:rgb(231.7,245.1331632653,255)}.gallery-item--focussed .gallery-item--overlay{opacity:1;display:block}.gallery-item--archive .gallery-item__thumbnail{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAArlJREFUeNrs3c9qE1EUx/F7JxmDf/APSCWbancK/kFXQi1CXkDciKCIz6ArC+6k4KKufAARBXe+QBGhDyAUF7pJoZtgF1aamEkzTeIkBdf3jp1z7/V+fxCyOZMMH2ZO7klmiJ5MJorIRduCt9vt08XTm+Jx5zB3ZOXdJ/Vta9uo9tmDlrp0fs6oNk1TVa/XnzabzVc+gCcltvl82NiVH1Var3Y6nSfBgRdH9+Pi6VqQp7In6LZH+IWg+6cH6ImKLK7RowN3jR4luEv0aMFdoUcN7gI9enBp9HqIQOsbm8ZT6b3WdRt0VfVE6g348sOWce2jlQ/GtabgUui0FOH2ArgwOuDC6IALowMujA64MDrgwuiAC6MDLozuzaT5cf2rce3F+Tkf0EtNpEGCv12+b1zb6w9UN9utYpdXgwavKo20prr9seple17sTxQ9/Oyp4+rE0QbgMaJHtUrxAT26ZaFr9CjX4S7Rox18XKFHPWm6QI9+tJdG92bwubt0uZKp1OR1p+izqVRgOAoS3OZXe9PXlULn20Lh9gK4MDrgwuiAC6MDLowOuDA64MLogAujAy6M7s2kaXPr99LVhb+ToQv0f5lIg/wR+daVBeN77atEp6UEgA64cAAHHHACOOAktHX4YLhvXLv1Y8e41uV63Wvw7Z2uce37tS/GtTaXNkfVUubPnaGHE8ABJ4CzLDTJ9Dtu35Zw/z04LYUADjgBHHACOOCAE8ABJ4ADTgAHHHACOOAEcMAJ4IADTjwB/9XLjkB2EJvLq0uDZ3t5OuZPq2cZ5gLg+Wic/Nztg52Ppmd7qW2tr7ya3vK8Pxqrk8caKkni+wjIhrnq/h6osme6FbhWavOgf+WzR9zRvcpbyu2bN14Xb/SdDq5ULdEvRZaFjbS2mGi9FvORXUuS58XB96LU1hNWHaL5I8AAi1XlrYdFnTIAAAAASUVORK5CYII=) center center no-repeat}.gallery-item--audio .gallery-item__thumbnail{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABH1JREFUeNrsnE9u2kAUxp2oe7gB9AThAJVwThB6Alype8i2m7Dqtsm+UuAG9ASxpe4DNzA3ICdI50mvKYV5D57/xcbfk6wqUDz2z998881gc/H6+hqgqqsLAAdwAEcBOICjABzAUQAO4ACOAnAARwE4gKMAHMABHAXgJdanr99nO39uf//8dg/g5QLfh7Fw0KMi27gEZrXG7iLMAbx66BGAl1Nr4fVHB30A4MVXqEBfOuhdAC+w3AC5Zegbz9s9t+X281qnFFYURbM+KayMmCa0S/YRu63jefvaHUd8dsDdSYesqN7Oyx/dyaYZ90cXa9eHp25fK+X/T90/Pzxvbdzn+mdjKaRqhvO0BztgpWctgj3c2WJtIOTelPisZW+C1FzgO115UkFznRMGQoqDL57Xp1kH0MsawSbVPLvtqsJmqQctFZWnPIb4Lta0kcBJ1W4jL70ruSkpYQzZr6W6F1JL1DjgfKJxFap2aiXgt8LbM3csfSUqzgQvjxoBnE7ObTGngE6FOZvUuhAsQhsIl4KXj2oPnFWx4qTwHjUVLGLMUVRSuc+SbqyD54ccaaKb8WRvyuo1e7FxxaAO4PFFfxJ8OVa8fCKofF6awvlgn/mArdtNicqN9tqKFWuJhYw9Vrw8FdZZRmVbymNDlkaueAIlleTZI2PSCRs90yy4Joovx4JiteTh6zUdy9LtOQHfGvN3IExqrhRbWQlpJWwd8CNrH5ES9wIjQN+CV7+tliKufShxb20E7rOVVlqKtvYh2oQAUFNsCoWf5tmhwSKGRuC91gJnlScGFaZVHt+5xsKVQeFpAftuPfCtsUf4ZtTaugqAN6VaD1xZ7VsB+OkVGgAOLNYhWU1rgbNih4bBsVvl8Z2jwkeGCY6k8ETZv+8CvbQSOKt75nlro9z0Exqj4iCP35+bwu+FWd9c+czQCHCQJ8tfnpG6yUrGQne/Vz5jsR8AP5Y2yGKUyUpksR9eAOsZL1Crcngi3XHL8HzfsS6NcTOw3E2bBfi6IbA3gf795Ex4fW5MQEnZsTCsKfQ4+He/Cd3sM1ImLwPB7xPFTroZesRBme9L4ZPI9LwLD1KkoMLvtuJu3TekGYvqJb83A6/Uwx2UJUP59Y5pZiZEweSIF/u+pltbHxCofNCkHuI2UvpnywytINhkh3dWdfOX0D1DT6lfStlR+6Ii2AOl+z9kUPeL1U7ePRay2kk914H/BsuiZ6EdIXUdU7fvdup5li8japHDWV2kwIeKmyaVRkqa6SoXI9MTdbWZ+LDapxWp/S15aE+yMeyeYEFpo4GfqPZtgU194XFEG2AnQq+YZW207g/Ghtx1yUNz/5QG+zHZxFJTKFtJKnj+bZ4HdBvxeym07pG1C2dsbyUMlJTVwzz7xg/UHMKeB/Iy7yDvhQfw02D/9fx53jZwX8r/JcFeFAEbwE+rpMjfvQJwvWgWOipyhwB+CPhN2W4L895LiEHz+MBJk65tWTEUwCsuAAdwAEcBOICjABzAUQAO4ACOAnAARwE4gKMAHMDbUH8EGABZtyoqqLbafgAAAABJRU5ErkJggg==) center center no-repeat}.gallery-item--video .gallery-item__thumbnail{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAjFJREFUeNrs3UFOwkAUxvFi2MMN9Abq3kRuoDegC/eyZmPduLXuSYATiCegJOzFE1huQE+Ar+E1BBITF/I60/l/yYTEhW1+TvoN00lsbbfbiNjlDALAASeAA04AB5wADjjgBHDACeCAE8ABB5wADjgBHHBSpV3XhW8eXjL5uJXxJWOwHA2zEMBbdRyTEOyefMyPfryQEQt8ziPFJuVs/5Y/xkTGBeB26ctYCXoiowu4TToynmTkgh4Dbgs/FvRcn/uAG+W8LNlyZSPjCnDbYv30uVh9/eLT1xWNd8Xq+zfNqlgHgNsW66sW6z3gtsX6rsXaA9y2WOeuFmuTdwurYk1dKtYQtmcftVgTwI23CrRYY8Bti3VcZ7GG+sanKtaZdbGG/ortLtrvwXcBt13R5BZbBYAfFWu0e/kRA25frKtTbAUD/nsuZaSA24YZbpwB4DYpz8hcL0fDyX//4ja2B1lHu8NI2akuAPgeOjnFjAb8MIWuRFLB3lhcMGTwabQ7RLqxvGiI4LUeGg0J3Ilj0SGAmxVi6OCFlmHi0k01FfxNZ/XGtRtrGviHPqdzV2+wKeALndGZ6zfqO7hThdhk8EKhU99u3EfwZ8uv4iGDT3VW55HH8QHcm0L0HXytS7xZk9atLoIXCj2JGpi2Y9Cme9Mhga8UuNOkQvxLWnX9Dwg9RFmOPATo2sFDDcckAAecAA44ARxwAjjggBPAASeAA04ABxxwAjjgBHDACeB15UeAAQBIj8DeaiiktQAAAABJRU5ErkJggg==) center center no-repeat}.gallery-item--document .gallery-item__thumbnail{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAsFJREFUeNrs3c1qE1EYxvF3JjNNbUQjaEs2re4URMGVUIrQhVtxJ+hCvARdWXAjgrioKy9ARNdegEWEXoAgBXWT0m5Cq2hsPptpEicpgguVJM15T4/n/8CQTWc6/fXMc85MUhp0u10heolG2alYLObTl+fpds2FHzKOY4mi6F6hUHhq+1zCEfd75wr2rwRBsFwqle46B56O7tvpy0UXL+fDgD7KCD/tcofaRg/Fw9hE9xLcJrq34LbQvQa3ge49uDY64MrogCujA66MDrgyOuDK6IArowOujA64MjrgyuiAK6MDrowOuDI64MrokcmT+vqjJqsf1o0c++zstJybmx7oa6v1plQaOyZOY3nYTwIYBf9Srsnr1TUjx76+cH5g8GyckUq9I9XGrvUrw5tKOXk8J0ePZAH3Dd27SdM2utEOn5vJy/2bi0aOfSqfOxB6fzK10OlGwacmJwae2GyMdBvoXq/DbdSL9zc+2ujcaSqjG+3wjxvb8vjVW+d+AQ/vXGWE/y8B/A8xWS+AK3e60Q7PTcb9p3quoptYpxsFn505IUu3Fp0e6eNGp1KU6wVwZXTAldGNdni92ZKNrbJzuH974DaOTjcK3sN28U7zxdINYxMplaJcLxF8B1syMsIPObqzb7G5Gm/fYrMVKgVwwIkrHb659V1evnlv5NgLF870N8B/S62ZyKfNbdXbbyqFAA44k+b4evZfT94Y4QRwwAnggBPAAQecAA44ARxwAjjggBPAASeAA04ABxxwAjjgBHDAiQHwcrUxAdt+mq098+CN3STu8I+r+2klCuBJuxN+26mDnbR7V/vQ+4306dne35nvtTtybCorYejfNNBoJVKpNWWUK31o8EBkfb+/kv7md4Kq8Uq5cvnSs/QbfabBRTJh8ERlWZiNM/NhEKz4PLIzYfggHXyPht6zy4pDNT8FGAAqQOmy57wEGAAAAABJRU5ErkJggg==) center center no-repeat}.gallery-item--false .gallery-item__thumbnail{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAfdJREFUeNrs3TtOw0AYReGZiU3EQ0BBk44dIFEhUbAEtsAaoKajoYCKBbAQCrZBE8p0CCUmTuIkxknEAmwpd7D+cyTLlfP4NB6PpTx8WZaOdCVNDur3+8fV7rXartvwJtM0dUmS3PV6vefYryU0PO69Ldh/ee+fBoPBbevAq9F9U+3O2ng6/wf0JiP8tM1zaGz04AwWE90keEx0s+Cx0E2Dx0A3D65GB1yMDrgYHXAxOuBidMDF6ICL0QEXowMuRgdcjA64GB1wMTrgYnTAxeiJBZxsPHGjfLiNh36q+0kAE+DdtONG46XL8mn012JmSjk52ncHu13AraGbu2jGRje5SomJbnZZGAvd9Do8Brr5Gx81OneaYnTAxeiAi9EBF6MDLkYHXIwOuBgdcDE64GJ0wMXogIvRARejAy5GT+Brjs4IbwE64OIABxxwAhxwAhxwAhxwwAlwwAlwwAlwwAEnwAEnwAEnwAEHnAAHnAAHnAAHHHACHHACHHACvGXg31m+A9umyWy+ffB8WqRL/rh63awQgBeLZfgajsEuFquzvfZxjb6JvPpZ6Pli6Q73ui4Ee5eBfFa40c/ENTnTa4N75z4381ex3mzns61PKVcX5y/VE30wgzvXCf5Rsizspp3L4P2b5ZHdCeG+GnwPtY8sWXFI+xVgAB+AqE72La37AAAAAElFTkSuQmCC) center center no-repeat}.gallery-item__upload-progress{height:18px;width:75%;position:absolute;top:calc(50% - 40px/2);left:50%;transform:translateX(-50%) translateY(-50%);border-radius:10px;overflow:hidden;background-color:rgb(174.4886363636,186.3068181818,205.5113636364)}.gallery-item__upload-progress+.gallery-item__title .gallery-item__checkbox-label:before{color:#43536d}.gallery-item__progress-bar{height:100%;background:#0071c4;transition:width .5s ease;width:0%}.gallery-item__status-flags{grid-column:1;grid-row:1}.gallery-item__status-icons{grid-column:2;grid-row:1;display:flex;flex-direction:column;margin:8px 8px 0 auto;text-align:right}.gallery-item__status-icons .file-status-icon{cursor:pointer}.gallery-item__status-icons .file-status-icon+.file-status-icon{margin-top:6px}.gallery-item--draft,.gallery-item--modified{display:block;width:8px;height:8px;box-shadow:0 0 1px .5px #fff;border-radius:100%;z-index:1;margin:5px 0 0 5px}.gallery-item--draft:hover:after,.gallery-item--modified:hover:after{font-size:.75rem;font-weight:200;position:absolute;top:0;left:0;color:#fff;margin:3px 0 0 18px}.gallery-item--draft{background-color:#ff7f22;border:1px solid #cf3f00}.gallery-item--draft:hover:after{content:"DRAFT"}.gallery-item--modified{background-color:#fff7f0;border:1px solid #cf3f00}.gallery-item--modified:hover:after{content:"MODIFIED"}.gallery-item--max-selected{opacity:.2}.gallery-item--max-selected .gallery-item__checkbox-label,.gallery-item--max-selected .gallery-item__checkbox-label:before{cursor:not-allowed}.gallery-item--dragging{opacity:.2}.gallery-item--dragging.gallery-item{cursor:grabbing}.gallery-item__drag-layer-item .gallery-item--dragging{opacity:1}.gallery-item__drag-layer{position:fixed;inset:0;pointer-events:none;z-index:100}.gallery-item__drag-layer-preview{transform:scale(0.4) translate(-100%, -160%);border:1px solid #29abe2}.gallery-item__drag-layer-preview .gallery-item__thumbnail{transform:scale(2.5) translate(22px, 16px)}.gallery-item__drag-layer-item{display:inline-block;position:relative;opacity:1}.gallery-item__drag-layer-item .gallery-item{border-width:2px;z-index:104;height:134px}.gallery-item__drag-layer-item .gallery-item__title{display:none}.gallery-item__drag-layer-count{display:inline-block;position:absolute;font-size:1rem;top:-45%;left:25%;z-index:105}.gallery-item__badge{display:inline-block;position:absolute;font-size:1rem;top:-0.5rem;right:-0.5rem;z-index:99}.gallery-item__drag-shadow{display:inline-block;position:absolute;inset:0;transform:translate(0.75rem, -0.75rem);z-index:103;border:2px solid #29abe2;background:#fff}.gallery-item__drag-shadow.gallery-item__drag-shadow--second{transform:translate(1.5rem, -1.5rem);z-index:102}.bulk-actions{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:flex-start;width:100%;padding:.76925rem 1.5385rem;margin:0 auto;position:absolute;height:53px;z-index:2;bottom:0;background-color:rgb(243.9761363636,245.5943181818,248.2238636364);transition:top .5s ease-in-out,transform .5s ease-in-out;transform:scale(1);min-width:160px;border-top:1px solid rgb(218.7079545455,224.0352272727,232.6920454545)}.bulk-actions-enter{bottom:-53px}.bulk-actions-enter-active{bottom:0;transition:bottom .2s ease-out}.bulk-actions-leave{bottom:0}.bulk-actions-leave-active{bottom:-53px;transition:bottom .2s ease-in-out .1s}.bulk-actions .bulk-actions-counter{vertical-align:middle;padding:5px 12px 5px 8px;margin-right:8px;line-height:1.5384;color:#fff;text-align:center;background-color:#0071c4;border-radius:.23rem;font-weight:bold}.bulk-actions .bulk-actions-counter.btn-secondary:hover,.bulk-actions .bulk-actions-counter.btn-secondary:focus,.bulk-actions .bulk-actions-counter.btn-secondary:focus-visible{background-color:#005a93;border-color:#005a93;color:#fff}.bulk-actions .bulk-actions-select-all button{color:#0071c4;font-weight:bold}.bulk-actions .bulk-actions__action.ss-ui-button{line-height:1.5384;margin-bottom:0;height:32px}.bulk-actions .bulk-actions__action.ss-ui-button[class*=font-icon-]:before{font-size:20px;line-height:18px;position:relative;top:-1px;vertical-align:middle}.bulk-actions .chosen-single{border-radius:5px 0 0 5px;border:0;filter:none;background:none;box-shadow:none;color:inherit}.bulk-actions .chosen-single:focus{box-shadow:0 0 3px rgba(0,0,0,.2)}.bulk-actions .chosen-single>span{text-align:left;display:inline-block;margin-right:0}.bulk-actions .chosen-single>div{position:static;display:inline-block}.bulk-actions .chosen-drop{border-radius:3px;box-shadow:0 0 3px rgba(0,0,0,.2);border:0}.bulk-actions .search-choice-close{display:none}.bulk-actions .chosen-results li{padding-left:22px;position:relative}.bulk-actions .chosen-results li:before{position:absolute;font-family:"silverstripe";left:4px;font-size:14px;vertical-align:middle;margin-right:4px}.bulk-actions .chosen-results li:nth-child(1):before{content:"g"}.asset-dropzone:after{position:absolute;inset:0 -1.5385rem 0 -1.5385rem;background:rgba(250.2931818182,250.9840909091,252.1068181818,.9) url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSItMzU1IDIyMi41IDMxMiAzMjQuNSIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAtMzU1IDIyMi41IDMxMiAzMjQuNSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8cGF0aCBmaWxsPSIjMkM3RUIwIiBkPSJNLTE0Mi43LDM3NC40Yy0yLjgsMC01LjYsMC4yLTguMywwLjdjLTYuNy0yMi0yNy42LTM4LTUyLjMtMzhjLTMwLjEsMC01NC41LDIzLjktNTQuNSw1My4zDQoJYzAsMi42LDAuMiw1LjIsMC42LDcuN2MtMS40LTAuMi0yLjktMC4zLTQuNC0wLjNjLTIwLjUsMC0zNy4xLDE2LjItMzcuMSwzNi4zYzAsMjAsMTYuNiwzNi4zLDM3LjEsMzYuM2g1MS4xdi0zOC42bC0yMS41LTAuMw0KCWwzNS45LTUxLjNsMzUuOSw1MS4zbC0yMS41LDAuM3YzOC42aDM5LjFjMjcuMSwwLDQ5LjEtMjEuNSw0OS4xLTQ4Qy05My42LDM5NS45LTExNS42LDM3NC40LTE0Mi43LDM3NC40eiIvPg0KPHBhdGggZmlsbD0iIzJDN0VCMCIgZD0iTS0yNzcuMSw1MzcuNHYtMjIuOWg3LjljMS44LDAsMy4xLDAuMSw0LjEsMC4zYzEuMywwLjMsMi40LDAuOCwzLjQsMS42YzEuMiwxLDIuMSwyLjMsMi43LDMuOQ0KCWMwLjYsMS42LDAuOSwzLjQsMC45LDUuNGMwLDEuNy0wLjIsMy4zLTAuNiw0LjZzLTAuOSwyLjUtMS42LDMuM2MtMC42LDAuOS0xLjMsMS42LTIuMSwyLjFjLTAuOCwwLjUtMS43LDAuOS0yLjcsMS4xDQoJYy0xLjEsMC4zLTIuMywwLjQtMy43LDAuNGgtOC4zVjUzNy40eiBNLTI3NCw1MzQuN2g0LjljMS41LDAsMi43LTAuMSwzLjYtMC40czEuNS0wLjcsMi4xLTEuMmMwLjctMC43LDEuMy0xLjcsMS43LTIuOQ0KCWMwLjQtMS4yLDAuNi0yLjcsMC42LTQuNGMwLTIuNC0wLjQtNC4yLTEuMi01LjVjLTAuOC0xLjMtMS43LTIuMS0yLjktMi42Yy0wLjgtMC4zLTIuMS0wLjUtMy45LTAuNWgtNC44djE3LjVILTI3NHogTS0yNTUuNCw1MzcuNA0KCXYtMTYuNmgyLjV2Mi41YzAuNi0xLjIsMS4yLTIsMS44LTIuM3MxLjEtMC42LDEuOC0wLjZjMC45LDAsMS45LDAuMywyLjksMC45bC0xLDIuNmMtMC43LTAuNC0xLjQtMC42LTIuMS0wLjYNCgljLTAuNiwwLTEuMiwwLjItMS43LDAuNmMtMC41LDAuNC0wLjgsMC45LTEsMS41Yy0wLjMsMS0wLjUsMi4xLTAuNSwzLjN2OC43TC0yNTUuNCw1MzcuNEwtMjU1LjQsNTM3LjR6IE0tMjM0LjQsNTM1LjQNCgljLTEsMC45LTIsMS41LTMsMS45cy0yLDAuNS0zLjEsMC41Yy0xLjgsMC0zLjItMC40LTQuMi0xLjNjLTEtMC45LTEuNS0yLTEuNS0zLjRjMC0wLjgsMC4yLTEuNiwwLjYtMi4yYzAuNC0wLjcsMC45LTEuMiwxLjUtMS42DQoJYzAuNi0wLjQsMS4zLTAuNywyLTAuOWMwLjYtMC4xLDEuNC0wLjMsMi41LTAuNGMyLjMtMC4zLDMuOS0wLjYsNS0xYzAtMC40LDAtMC42LDAtMC43YzAtMS4xLTAuMy0yLTAuOC0yLjRjLTAuNy0wLjYtMS44LTEtMy4yLTENCgljLTEuMywwLTIuMywwLjItMi45LDAuN2MtMC42LDAuNS0xLjEsMS4zLTEuNCwyLjVsLTIuOC0wLjRjMC4yLTEuMiwwLjctMi4xLDEuMi0yLjljMC42LTAuNywxLjQtMS4zLDIuNS0xLjdzMi4zLTAuNiwzLjgtMC42DQoJYzEuNCwwLDIuNiwwLjIsMy41LDAuNXMxLjUsMC44LDIsMS4zYzAuNCwwLjUsMC43LDEuMSwwLjksMS45YzAuMSwwLjUsMC4xLDEuMywwLjEsMi42djMuOGMwLDIuNiwwLjEsNC4zLDAuMiw1DQoJYzAuMSwwLjcsMC40LDEuNCwwLjcsMmgtMi45Qy0yMzQuMSw1MzYuOS0yMzQuMyw1MzYuMi0yMzQuNCw1MzUuNHogTS0yMzQuNiw1MjkuMWMtMSwwLjQtMi42LDAuOC00LjYsMS4xYy0xLjIsMC4yLTIsMC40LTIuNSwwLjYNCgljLTAuNSwwLjItMC44LDAuNS0xLjEsMC45cy0wLjQsMC44LTAuNCwxLjNjMCwwLjgsMC4zLDEuNCwwLjksMS45YzAuNiwwLjUsMS40LDAuOCwyLjUsMC44czItMC4yLDIuOS0wLjdjMC44LTAuNSwxLjUtMS4xLDEuOS0xLjkNCgljMC4zLTAuNiwwLjUtMS42LDAuNS0yLjhMLTIzNC42LDUyOS4xTC0yMzQuNiw1MjkuMXogTS0yMjguNCw1MzguOGwyLjcsMC40YzAuMSwwLjgsMC40LDEuNSwxLDEuOGMwLjcsMC41LDEuNywwLjgsMi45LDAuOA0KCWMxLjMsMCwyLjMtMC4zLDMtMC44czEuMi0xLjIsMS40LTIuMmMwLjEtMC42LDAuMi0xLjgsMC4yLTMuNmMtMS4yLDEuNC0yLjgsMi4yLTQuNiwyLjJjLTIuMywwLTQtMC44LTUuMy0yLjUNCgljLTEuMi0xLjYtMS45LTMuNi0xLjktNS45YzAtMS42LDAuMy0zLDAuOS00LjRjMC42LTEuMywxLjQtMi40LDIuNS0zLjFjMS4xLTAuNywyLjQtMS4xLDMuOC0xLjFjMiwwLDMuNiwwLjgsNC44LDIuNHYtMmgyLjZ2MTQuMw0KCWMwLDIuNi0wLjMsNC40LTAuOCw1LjVzLTEuNCwxLjktMi41LDIuNnMtMi41LDAuOS00LjIsMC45Yy0yLDAtMy42LTAuNC00LjgtMS4zUy0yMjguNCw1NDAuNi0yMjguNCw1MzguOHogTS0yMjYsNTI4LjgNCgljMCwyLjIsMC40LDMuOCwxLjMsNC44YzAuOSwxLDEuOSwxLjUsMy4yLDEuNXMyLjQtMC41LDMuMi0xLjVjMC45LTEsMS4zLTIuNiwxLjMtNC43YzAtMi0wLjUtMy42LTEuNC00LjZzLTItMS41LTMuMy0xLjUNCgljLTEuMiwwLTIuMywwLjUtMy4yLDEuNVMtMjI2LDUyNi44LTIyNiw1MjguOHogTS0xODksNTM0LjdjLTAuOSwxLTEuOSwxLjgtMywyLjNzLTIuMywwLjgtMy41LDAuOGMtMi4zLDAtNC4yLTAuOC01LjYtMi40DQoJYy0xLjEtMS4zLTEuNy0yLjctMS43LTQuM2MwLTEuNCwwLjUtMi43LDEuNC0zLjhzMi4zLTIuMSw0LjEtM2MtMS0xLjItMS43LTIuMi0yLjEtMi45Yy0wLjMtMC43LTAuNS0xLjUtMC41LTIuMQ0KCWMwLTEuNCwwLjUtMi42LDEuNi0zLjZzMi40LTEuNSw0LjEtMS41YzEuNiwwLDIuOCwwLjUsMy44LDEuNGMxLDEsMS41LDIuMSwxLjUsMy41YzAsMi4yLTEuNCw0LTQuMyw1LjZsNC4xLDUuMg0KCWMwLjUtMC45LDAuOC0yLDEuMS0zLjJsMi45LDAuNmMtMC41LDItMS4yLDMuNi0yLDQuOWMxLjEsMS40LDIuMiwyLjYsMy42LDMuNWwtMS45LDIuMkMtMTg2LjYsNTM3LjItMTg3LjgsNTM2LjItMTg5LDUzNC43eg0KCSBNLTE5MC43LDUzMi41bC01LjItNi40Yy0xLjUsMC45LTIuNSwxLjctMy4xLDIuNWMtMC41LDAuOC0wLjgsMS41LTAuOCwyLjNjMCwwLjksMC40LDEuOSwxLjEsMi45YzAuNywxLDEuOCwxLjUsMy4xLDEuNQ0KCWMwLjgsMCwxLjctMC4zLDIuNi0wLjhDLTE5Miw1MzQtMTkxLjMsNTMzLjMtMTkwLjcsNTMyLjV6IE0tMTk0LjcsNTIyLjhjMS4yLTAuNywyLTEuMywyLjQtMS45YzAuNC0wLjUsMC41LTEuMSwwLjUtMS44DQoJYzAtMC44LTAuMi0xLjQtMC43LTEuOXMtMS4xLTAuNy0xLjktMC43Yy0wLjgsMC0xLjQsMC4yLTEuOSwwLjdzLTAuOCwxLjEtMC44LDEuOGMwLDAuNCwwLjEsMC43LDAuMywxLjFjMC4yLDAuNCwwLjUsMC44LDAuOCwxLjINCglMLTE5NC43LDUyMi44eiBNLTE2Miw1MzcuNHYtMi4xYy0xLjEsMS42LTIuNiwyLjUtNC42LDIuNWMtMS4zLDAtMi41LTAuNC0zLjYtMS4xcy0yLTEuNy0yLjYtMy4xYy0wLjYtMS4zLTAuOS0yLjgtMC45LTQuNQ0KCXMwLjMtMy4yLDAuOC00LjVjMC42LTEuMywxLjQtMi40LDIuNS0zLjFjMS4xLTAuNywyLjMtMS4xLDMuNy0xLjFjMSwwLDEuOSwwLjIsMi43LDAuNnMxLjQsMSwxLjksMS42di04LjJoMi44djIyLjlMLTE2Miw1MzcuNA0KCUwtMTYyLDUzNy40eiBNLTE3MC45LDUyOS4yYzAsMi4xLDAuNCwzLjcsMS4zLDQuOGMwLjksMS4xLDIsMS42LDMuMiwxLjZzMi4zLTAuNSwzLjEtMS41YzAuOS0xLDEuMy0yLjUsMS4zLTQuNg0KCWMwLTIuMy0wLjQtMy45LTEuMy01cy0yLTEuNi0zLjItMS42cy0yLjMsMC41LTMuMSwxLjVDLTE3MC40LDUyNS4zLTE3MC45LDUyNy0xNzAuOSw1MjkuMnogTS0xNTUuNCw1MzcuNHYtMTYuNmgyLjV2Mi41DQoJYzAuNi0xLjIsMS4yLTIsMS44LTIuM3MxLjEtMC42LDEuOC0wLjZjMC45LDAsMS45LDAuMywyLjksMC45bC0xLDIuNmMtMC43LTAuNC0xLjQtMC42LTIuMS0wLjZjLTAuNiwwLTEuMiwwLjItMS43LDAuNg0KCWMtMC41LDAuNC0wLjgsMC45LTEsMS41Yy0wLjMsMS0wLjUsMi4xLTAuNSwzLjN2OC43TC0xNTUuNCw1MzcuNEwtMTU1LjQsNTM3LjR6IE0tMTQ2LjIsNTI5LjFjMC0zLjEsMC45LTUuMywyLjYtNi44DQoJYzEuNC0xLjIsMy4yLTEuOCw1LjItMS44YzIuMywwLDQuMSwwLjcsNS42LDIuMmMxLjQsMS41LDIuMiwzLjYsMi4yLDYuMmMwLDIuMS0wLjMsMy44LTEsNWMtMC42LDEuMi0xLjYsMi4yLTIuOCwyLjlzLTIuNiwxLTQsMQ0KCWMtMi4zLDAtNC4yLTAuNy01LjYtMi4yQy0xNDUuNSw1MzQuMS0xNDYuMiw1MzEuOS0xNDYuMiw1MjkuMXogTS0xNDMuMyw1MjkuMWMwLDIuMSwwLjUsMy43LDEuNCw0LjhzMi4xLDEuNiwzLjUsMS42DQoJczIuNi0wLjUsMy41LTEuNnMxLjQtMi43LDEuNC00LjljMC0yLjEtMC41LTMuNi0xLjQtNC43Yy0wLjktMS4xLTIuMS0xLjYtMy41LTEuNnMtMi42LDAuNS0zLjUsMS42DQoJQy0xNDIuOSw1MjUuNC0xNDMuMyw1MjctMTQzLjMsNTI5LjF6IE0tMTI3LjgsNTQzLjh2LTIzaDIuNnYyLjJjMC42LTAuOCwxLjMtMS41LDItMS45YzAuOC0wLjQsMS43LTAuNiwyLjgtMC42DQoJYzEuNCwwLDIuNywwLjQsMy44LDEuMWMxLjEsMC43LDEuOSwxLjgsMi41LDMuMXMwLjgsMi44LDAuOCw0LjRjMCwxLjctMC4zLDMuMi0wLjksNC42cy0xLjUsMi40LTIuNywzLjFjLTEuMiwwLjctMi40LDEuMS0zLjcsMS4xDQoJYy0wLjksMC0xLjgtMC4yLTIuNS0wLjZjLTAuNy0wLjQtMS40LTAuOS0xLjgtMS41djguMUwtMTI3LjgsNTQzLjhMLTEyNy44LDU0My44eiBNLTEyNS4zLDUyOS4yYzAsMi4xLDAuNCwzLjcsMS4zLDQuNw0KCXMxLjksMS41LDMuMSwxLjVzMi4zLTAuNSwzLjItMS42YzAuOS0xLjEsMS4zLTIuNywxLjMtNC45YzAtMi4xLTAuNC0zLjctMS4zLTQuOHMtMS45LTEuNi0zLjEtMS42cy0yLjMsMC42LTMuMiwxLjcNCglDLTEyNC44LDUyNS41LTEyNS4zLDUyNy4xLTEyNS4zLDUyOS4yeiIvPg0KPHBhdGggZmlsbD0iIzJDN0VCMCIgZD0iTS0xNzIuNSwyNDEuNWwtMi44LTE2LjFsLTU2LjUsOS45bDguMyw0Ny4ybDUuNi0wLjl2NC4xaDU3LjR2LTQ0LjFoLTEyVjI0MS41eiBNLTIxNy45LDI3Ni44bC0xLjgsMC4zDQoJbC02LjctMzguMWw0Ny40LTguNGwxLjksMTAuOGgtNDAuN3YzNS40SC0yMTcuOXogTS0xNjUuMiwyODAuOWgtNDguMXYtMzQuOGg0OC4xVjI4MC45eiBNLTIxMC4xLDI0OS4yVjI3NWw5LjgtNi41bDYsMy44bDE0LjctMTYuMQ0KCWwxLjksMC44bDkuNSwxMXYtMTguN0wtMjEwLjEsMjQ5LjJMLTIxMC4xLDI0OS4yeiBNLTIwMC44LDI2MC40Yy0yLjIsMC00LjEtMS45LTQuMS00LjFjMC0yLjIsMS45LTQuMSw0LjEtNC4xDQoJYzIuMiwwLDQuMSwxLjksNC4xLDQuMUMtMTk2LjcsMjU4LjUtMTk4LjYsMjYwLjQtMjAwLjgsMjYwLjR6Ii8+DQo8cGF0aCBmaWxsPSIjMkM3RUIwIiBkPSJNLTMzMS41LDI3Ny44djM1LjRjLTItMC45LTQuNi0xLjEtNy4xLTAuNmMtNS40LDEuMi05LjEsNS42LTguMyw5LjhjMC43LDMuNCw0LjMsNS45LDguNyw1LjkNCgljMC45LDAsMS44LTAuMSwyLjctMC4zYzQuNy0xLDguMi00LjUsOC40LTguM3YtMzMuMWwyNi4xLTMuOXYyNS44Yy0yLTAuOS00LjYtMS4xLTcuMS0wLjZjLTUuNCwxLjItOS4xLDUuNi04LjMsOS44DQoJYzAuNywzLjQsNC4zLDUuOSw4LjcsNS45bDAsMGMwLjksMCwxLjgtMC4xLDIuNy0wLjNjNC43LTEsOC4yLTQuNSw4LjQtOC4zdi00Mi4xTC0zMzEuNSwyNzcuOHoiLz4NCjxwYXRoIGZpbGw9IiMyQzdFQjAiIGQ9Ik0tNTIuNywzMTkuM3YtNi43aDYuN3YtNy41aC02Ljd2LTYuN2g2Ljd2LTYuN2gtNi43di03LjVoNi43di02LjdoLTY1LjF2Ni43aDYuN3Y3LjVoLTYuN3Y2LjdoNi43djYuN2gtNi43DQoJdjcuNWg2Ljd2Ni43aC02Ljd2Ni43SC00NnYtNi43SC01Mi43eiBNLTgyLjgsMzA5LjF2LTEzLjlsMTIuMSw3TC04Mi44LDMwOS4xeiIvPg0KPC9zdmc+DQo=) center center no-repeat;background-size:312px 325px;z-index:100}.asset-dropzone.dragging:after{content:""}.asset-dropzone--button{position:static}.uploadfield__dropzone{position:relative;inset:0 auto auto 0;margin:0 0 10px;border-width:2px;border-style:dashed;border-color:rgb(193.4397727273,202.4761363636,217.1602272727);border-radius:5px;padding:0;background:#fff;height:78px}.uploadfield__dropzone:after{inset:0;box-shadow:inset 0 0 10px 0 rgba(0,0,0,.2);background:rgba(0,0,0,.03)}.uploadfield__dropzone--hidden{display:none}.uploadfield__backdrop{position:absolute;inset:0;cursor:pointer}.uploadfield__join:before,.uploadfield__join:after{content:" ";display:inline}.uploadfield__upload-button,.uploadfield__add-button{border:0;margin:0;padding:0;background:none;text-decoration:none;color:#0071c4}.uploadfield__upload-button:hover,.uploadfield__add-button:hover{color:rgb(0,98.2984693878,170.5);text-decoration:underline}.uploadfield__droptext{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:inline-block;text-align:center}.uploadfield__droptext a,.uploadfield__droptext button{cursor:pointer}.uploadfield__droptext:before{font-family:"silverstripe",sans-serif;content:"v";font-size:1.7em;padding-right:20px;vertical-align:middle}.uploadfield-item{position:relative;margin:0;background-color:#fff;border:1px solid;border-color:rgb(206.0738636364,213.2556818182,224.9261363636);border-bottom-width:0;width:auto;transition:box-shadow .3s;height:61px}.uploadfield-item:first-child{border-top-left-radius:.192rem;border-top-right-radius:.192rem}.uploadfield-item:last-child{border-bottom-width:1px;height:62px;border-bottom-left-radius:.192rem;border-bottom-right-radius:.192rem}.uploadfield-item:not(.uploadfield-item--error,.uploadfield-item--folder):hover .uploadfield-item--overlay{opacity:1;display:block}.uploadfield__dropzone+.uploadfield-item{border-top-left-radius:.192rem;border-top-right-radius:.192rem}.uploadfield-item__thumbnail{height:60px;width:60px;margin:0;background-repeat:no-repeat;background-position:center center;background-size:cover;border-radius:.192rem .192rem 0 0}.uploadfield-item--folder .uploadfield-item__thumbnail{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGFJREFUeNpi1Jhy/D8D6cDxRo7lAQYaACYy9Tkw0AiQ6yD7weYgB83VjwRo4SBGoMH/GQYRYGIYZGDUQaMOGnXQqINGHTTqoFEHjTpo1EGjDhp10KiDRh006qDB7SCAAAMAe8YKeWd2MukAAAAASUVORK5CYII=) 12px 14px no-repeat;background-size:27px 24px}.uploadfield-item__thumbnail--small{background-size:auto;background-color:#fff}.uploadfield-item__details{padding:11px 0 11px 12px;height:100%;margin:0;box-sizing:border-box;position:relative;width:50px;justify-content:center}.uploadfield-item__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.uploadfield-item__meta{font-size:.846rem;text-transform:uppercase;display:flex;align-items:center}.uploadfield-item__meta .file-status-icon{margin-left:6px}.uploadfield-item__specs{color:rgb(86.4147727273,107.0511363636,140.5852272727)}.uploadfield-item__remove-btn{margin:0}.uploadfield-item--archive .uploadfield-item__thumbnail{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAArlJREFUeNrs3c9qE1EUx/F7JxmDf/APSCWbancK/kFXQi1CXkDciKCIz6ArC+6k4KKufAARBXe+QBGhDyAUF7pJoZtgF1aamEkzTeIkBdf3jp1z7/V+fxCyOZMMH2ZO7klmiJ5MJorIRduCt9vt08XTm+Jx5zB3ZOXdJ/Vta9uo9tmDlrp0fs6oNk1TVa/XnzabzVc+gCcltvl82NiVH1Var3Y6nSfBgRdH9+Pi6VqQp7In6LZH+IWg+6cH6ImKLK7RowN3jR4luEv0aMFdoUcN7gI9enBp9HqIQOsbm8ZT6b3WdRt0VfVE6g348sOWce2jlQ/GtabgUui0FOH2ArgwOuDC6IALowMujA64MDrgwuiAC6MDLozuzaT5cf2rce3F+Tkf0EtNpEGCv12+b1zb6w9UN9utYpdXgwavKo20prr9seple17sTxQ9/Oyp4+rE0QbgMaJHtUrxAT26ZaFr9CjX4S7Rox18XKFHPWm6QI9+tJdG92bwubt0uZKp1OR1p+izqVRgOAoS3OZXe9PXlULn20Lh9gK4MDrgwuiAC6MDLowOuDA64MLogAujAy6M7s2kaXPr99LVhb+ToQv0f5lIg/wR+daVBeN77atEp6UEgA64cAAHHHACOOAktHX4YLhvXLv1Y8e41uV63Wvw7Z2uce37tS/GtTaXNkfVUubPnaGHE8ABJ4CzLDTJ9Dtu35Zw/z04LYUADjgBHHACOOCAE8ABJ4ADTgAHHHACOOAEcMAJ4IADTjwB/9XLjkB2EJvLq0uDZ3t5OuZPq2cZ5gLg+Wic/Nztg52Ppmd7qW2tr7ya3vK8Pxqrk8caKkni+wjIhrnq/h6osme6FbhWavOgf+WzR9zRvcpbyu2bN14Xb/SdDq5ULdEvRZaFjbS2mGi9FvORXUuS58XB96LU1hNWHaL5I8AAi1XlrYdFnTIAAAAASUVORK5CYII=) center center no-repeat}.uploadfield-item--audio .uploadfield-item__thumbnail{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABH1JREFUeNrsnE9u2kAUxp2oe7gB9AThAJVwThB6Alype8i2m7Dqtsm+UuAG9ASxpe4DNzA3ICdI50mvKYV5D57/xcbfk6wqUDz2z998881gc/H6+hqgqqsLAAdwAEcBOICjABzAUQAO4ACOAnAARwE4gKMAHMABHAXgJdanr99nO39uf//8dg/g5QLfh7Fw0KMi27gEZrXG7iLMAbx66BGAl1Nr4fVHB30A4MVXqEBfOuhdAC+w3AC5Zegbz9s9t+X281qnFFYURbM+KayMmCa0S/YRu63jefvaHUd8dsDdSYesqN7Oyx/dyaYZ90cXa9eHp25fK+X/T90/Pzxvbdzn+mdjKaRqhvO0BztgpWctgj3c2WJtIOTelPisZW+C1FzgO115UkFznRMGQoqDL57Xp1kH0MsawSbVPLvtqsJmqQctFZWnPIb4Lta0kcBJ1W4jL70ruSkpYQzZr6W6F1JL1DjgfKJxFap2aiXgt8LbM3csfSUqzgQvjxoBnE7ObTGngE6FOZvUuhAsQhsIl4KXj2oPnFWx4qTwHjUVLGLMUVRSuc+SbqyD54ccaaKb8WRvyuo1e7FxxaAO4PFFfxJ8OVa8fCKofF6awvlgn/mArdtNicqN9tqKFWuJhYw9Vrw8FdZZRmVbymNDlkaueAIlleTZI2PSCRs90yy4Joovx4JiteTh6zUdy9LtOQHfGvN3IExqrhRbWQlpJWwd8CNrH5ES9wIjQN+CV7+tliKufShxb20E7rOVVlqKtvYh2oQAUFNsCoWf5tmhwSKGRuC91gJnlScGFaZVHt+5xsKVQeFpAftuPfCtsUf4ZtTaugqAN6VaD1xZ7VsB+OkVGgAOLNYhWU1rgbNih4bBsVvl8Z2jwkeGCY6k8ETZv+8CvbQSOKt75nlro9z0Exqj4iCP35+bwu+FWd9c+czQCHCQJ8tfnpG6yUrGQne/Vz5jsR8AP5Y2yGKUyUpksR9eAOsZL1Crcngi3XHL8HzfsS6NcTOw3E2bBfi6IbA3gf795Ex4fW5MQEnZsTCsKfQ4+He/Cd3sM1ImLwPB7xPFTroZesRBme9L4ZPI9LwLD1KkoMLvtuJu3TekGYvqJb83A6/Uwx2UJUP59Y5pZiZEweSIF/u+pltbHxCofNCkHuI2UvpnywytINhkh3dWdfOX0D1DT6lfStlR+6Ii2AOl+z9kUPeL1U7ePRay2kk914H/BsuiZ6EdIXUdU7fvdup5li8japHDWV2kwIeKmyaVRkqa6SoXI9MTdbWZ+LDapxWp/S15aE+yMeyeYEFpo4GfqPZtgU194XFEG2AnQq+YZW207g/Ghtx1yUNz/5QG+zHZxFJTKFtJKnj+bZ4HdBvxeym07pG1C2dsbyUMlJTVwzz7xg/UHMKeB/Iy7yDvhQfw02D/9fx53jZwX8r/JcFeFAEbwE+rpMjfvQJwvWgWOipyhwB+CPhN2W4L895LiEHz+MBJk65tWTEUwCsuAAdwAEcBOICjABzAUQAO4ACOAnAARwE4gKMAHMDbUH8EGABZtyoqqLbafgAAAABJRU5ErkJggg==) center center no-repeat}.uploadfield-item--video .uploadfield-item__thumbnail{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAjFJREFUeNrs3UFOwkAUxvFi2MMN9Abq3kRuoDegC/eyZmPduLXuSYATiCegJOzFE1huQE+Ar+E1BBITF/I60/l/yYTEhW1+TvoN00lsbbfbiNjlDALAASeAA04AB5wADjjgBHDACeCAE8ABB5wADjgBHHBSpV3XhW8eXjL5uJXxJWOwHA2zEMBbdRyTEOyefMyPfryQEQt8ziPFJuVs/5Y/xkTGBeB26ctYCXoiowu4TToynmTkgh4Dbgs/FvRcn/uAG+W8LNlyZSPjCnDbYv30uVh9/eLT1xWNd8Xq+zfNqlgHgNsW66sW6z3gtsX6rsXaA9y2WOeuFmuTdwurYk1dKtYQtmcftVgTwI23CrRYY8Bti3VcZ7GG+sanKtaZdbGG/ortLtrvwXcBt13R5BZbBYAfFWu0e/kRA25frKtTbAUD/nsuZaSA24YZbpwB4DYpz8hcL0fDyX//4ja2B1lHu8NI2akuAPgeOjnFjAb8MIWuRFLB3lhcMGTwabQ7RLqxvGiI4LUeGg0J3Ilj0SGAmxVi6OCFlmHi0k01FfxNZ/XGtRtrGviHPqdzV2+wKeALndGZ6zfqO7hThdhk8EKhU99u3EfwZ8uv4iGDT3VW55HH8QHcm0L0HXytS7xZk9atLoIXCj2JGpi2Y9Cme9Mhga8UuNOkQvxLWnX9Dwg9RFmOPATo2sFDDcckAAecAA44ARxwAjjggBPAASeAA04ABxxwAjjgBHDACeB15UeAAQBIj8DeaiiktQAAAABJRU5ErkJggg==) center center no-repeat}.uploadfield-item--document .uploadfield-item__thumbnail{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAsFJREFUeNrs3c1qE1EYxvF3JjNNbUQjaEs2re4URMGVUIrQhVtxJ+hCvARdWXAjgrioKy9ARNdegEWEXoAgBXWT0m5Cq2hsPptpEicpgguVJM15T4/n/8CQTWc6/fXMc85MUhp0u10heolG2alYLObTl+fpds2FHzKOY4mi6F6hUHhq+1zCEfd75wr2rwRBsFwqle46B56O7tvpy0UXL+fDgD7KCD/tcofaRg/Fw9hE9xLcJrq34LbQvQa3ge49uDY64MrogCujA66MDrgyOuDK6IArowOujA64MjrgyuiAK6MDrowOuDI64MrokcmT+vqjJqsf1o0c++zstJybmx7oa6v1plQaOyZOY3nYTwIYBf9Srsnr1TUjx76+cH5g8GyckUq9I9XGrvUrw5tKOXk8J0ePZAH3Dd27SdM2utEOn5vJy/2bi0aOfSqfOxB6fzK10OlGwacmJwae2GyMdBvoXq/DbdSL9zc+2ujcaSqjG+3wjxvb8vjVW+d+AQ/vXGWE/y8B/A8xWS+AK3e60Q7PTcb9p3quoptYpxsFn505IUu3Fp0e6eNGp1KU6wVwZXTAldGNdni92ZKNrbJzuH974DaOTjcK3sN28U7zxdINYxMplaJcLxF8B1syMsIPObqzb7G5Gm/fYrMVKgVwwIkrHb659V1evnlv5NgLF870N8B/S62ZyKfNbdXbbyqFAA44k+b4evZfT94Y4QRwwAnggBPAAQecAA44ARxwAjjggBPAASeAA04ABxxwAjjgBHDAiQHwcrUxAdt+mq098+CN3STu8I+r+2klCuBJuxN+26mDnbR7V/vQ+4306dne35nvtTtybCorYejfNNBoJVKpNWWUK31o8EBkfb+/kv7md4Kq8Uq5cvnSs/QbfabBRTJh8ERlWZiNM/NhEKz4PLIzYfggHXyPht6zy4pDNT8FGAAqQOmy57wEGAAAAABJRU5ErkJggg==) center center no-repeat}.uploadfield-item--false .uploadfield-item__thumbnail{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAfdJREFUeNrs3TtOw0AYReGZiU3EQ0BBk44dIFEhUbAEtsAaoKajoYCKBbAQCrZBE8p0CCUmTuIkxknEAmwpd7D+cyTLlfP4NB6PpTx8WZaOdCVNDur3+8fV7rXartvwJtM0dUmS3PV6vefYryU0PO69Ldh/ee+fBoPBbevAq9F9U+3O2ng6/wf0JiP8tM1zaGz04AwWE90keEx0s+Cx0E2Dx0A3D65GB1yMDrgYHXAxOuBidMDF6ICL0QEXowMuRgdcjA64GB1wMTrgYnTAxeiJBZxsPHGjfLiNh36q+0kAE+DdtONG46XL8mn012JmSjk52ncHu13AraGbu2jGRje5SomJbnZZGAvd9Do8Brr5Gx81OneaYnTAxeiAi9EBF6MDLkYHXIwOuBgdcDE64GJ0wMXogIvRARejAy5GT+Brjs4IbwE64OIABxxwAhxwAhxwAhxwwAlwwAlwwAlwwAEnwAEnwAEnwAEHnAAHnAAHnAAHHHACHHACHHACvGXg31m+A9umyWy+ffB8WqRL/rh63awQgBeLZfgajsEuFquzvfZxjb6JvPpZ6Pli6Q73ui4Ee5eBfFa40c/ENTnTa4N75z4381ex3mzns61PKVcX5y/VE30wgzvXCf5Rsizspp3L4P2b5ZHdCeG+GnwPtY8sWXFI+xVgAB+AqE72La37AAAAAElFTkSuQmCC) center center no-repeat}.uploadfield-item__upload-progress{height:16px;margin:22px 5px;width:30%;border-radius:10px;overflow:hidden}.uploadfield-item__upload-progress+.uploadfield-item__title .uploadfield-item__checkbox-label:before{color:#43536d}.uploadfield-item__progress-bar{height:100%;background:#0071c4;transition:width .5s ease;width:0%}.uploadfield-item__error-message{line-height:28px;height:28px;margin:16px 5px;padding:0 10px;color:#fff;background:#d40404;border-radius:14px;max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.uploadfield-item__complete-icon{line-height:38px;padding:11px 5px}.uploadfield-item__complete-icon:after{color:#3fa142;font-size:30px;display:inline;font-family:"silverstripe",sans-serif;content:"I"}.uploadfield-item__status{margin:0 0 0 .6154rem;color:#cf3f00;text-transform:uppercase}.preview-image-field__container{position:relative}.preview-image-field__toolbar{position:absolute;top:50%;right:0;transform:translateY(-50%);height:auto;max-height:100%;border-bottom-left-radius:.23rem;border-top-left-radius:.23rem;overflow:hidden}.preview-image-field__toolbar-button--link:before{content:"="}.preview-image-field__toolbar-button--replace:before{content:"b"}.preview-image-field__toolbar-button{padding:11px 0;height:47px;width:47px;overflow:hidden;background:#000;opacity:.55;color:#fff;border:0}.preview-image-field__toolbar-button:hover,.preview-image-field__toolbar-button:active,.preview-image-field__toolbar-button:focus{color:hsl(0,0%,70%);text-decoration:none}.preview-image-field__toolbar-button:before{padding:0 11px;font-family:"silverstripe";font-style:normal;speak:none;line-height:1;font-size:25px;height:25px;width:25px;vertical-align:middle}.preview-image-field__progress{height:18px;width:75%;position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%);border-radius:10px;overflow:hidden;background:hsl(0,0%,90%)}.preview-image-field__progress-bar{height:100%;background:#0071c4;transition:width .5s ease;width:0}.preview-image-field__message{position:absolute;bottom:0;left:0;right:0;padding:1.5385rem 1.5385rem}@media(min-width: 992px){.preview-image-field__message{display:flex}}.preview-image-field__message-button{margin-left:.76925rem}.preview-image-field__message--error{color:#fff;background:#d40404}.preview-image-field__message--success{color:#fff;background:#3fa142}.insert-embed-modal .modal-content{height:auto;max-height:100%}.insert-embed-modal .modal-body{display:flex;justify-items:stretch;flex-direction:column;background-color:#fff}.insert-embed-modal--edit{width:100%}@media(min-width: 768px){.insert-embed-modal--edit .btn-toolbar{margin-left:30%}}.insert-embed-modal--create{flex:1;width:100%}.alert+.insert-embed-modal--create{padding-top:0}.insert-embed-modal__url-create .form-control.text{padding:.75rem 1.25rem;font-size:1.231rem;line-height:1.3333333333;border-radius:.5rem}@media(min-width: 768px){.insert-embed-modal__fields--fill-width{width:100%;display:flex;flex-direction:row}}.insert-embed-modal__preview-container{padding-bottom:1.2308rem}@media(min-width: 768px){.insert-embed-modal__preview-container{order:2;padding-left:1.2308rem;width:30%}}.insert-embed-modal__preview{display:block;max-width:100%;margin:0 auto;max-height:198px}.insert-embed-modal__placement .form__field-holder>div{display:flex;flex-direction:row;justify-items:stretch}.insert-embed-modal__placement .form-check{flex:1;margin-bottom:0;padding-left:0}.insert-embed-modal__placement .form-check:first-of-type .form-check-label span:before{border-top-left-radius:.23rem;border-bottom-left-radius:.23rem}.insert-embed-modal__placement .form-check:last-of-type .form-check-label span:before{border-top-right-radius:.23rem;border-bottom-right-radius:.23rem}.insert-embed-modal__placement .form-check .form-check-label{display:block;cursor:pointer}.insert-embed-modal__placement .form-check .form-check-label span{display:block;color:rgba(67,83,109,0);font-size:.9rem;letter-spacing:1px;text-align:center;text-transform:uppercase;transition:color .1s ease-out}.insert-embed-modal__placement .form-check .form-check-label span:before{content:" ";display:block;box-sizing:content-box;height:36px;padding:5px 0;border:1px solid rgb(218.7079545455,224.0352272727,232.6920454545);background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAFoCAYAAAAl0bm1AAAACXBIWXMAAAsSAAALEgHS3X78AAAB7klEQVR42u3cwW3CQBBAURu5DRqgHoqgAAqgAAqgCOqhAQox173YAuPdsTVvblFE9JV9WmmiVfpxHLstz6Hb+Gw+cCi/OD3fq57363zsHbFAgQIFChQoUKDAf6a3k9hJAqbcZRhkkEEGGWRQoECB7e7B2/2x6p1zu178jVqgQIECBQoUKFDgX2MvtpNETLnLMMgggwwyyKBAgQLb3YNzE/XG2hELFChQoECBAgXmDrQX59pJvB9kkEEGGWSQQYECc9+DcxP1xtoRCxQoUKBAgQIF5g60F+faSbwfZJBBBhlkkEGBAnPfg0un5htrRyxQoECBAgUKFJg70F6cayfxfpBBBhlkkEEGBQrMfQ8unZpvrB2xQIECBQoUKFBg7kB7ca6dxPtBBhlkkEEGGRQoMPc9WPM99C8/u/zc0Oo38e0/yGawqsGawyCDDDLIIIMM7tOgvdhOEjEMMsgggwwyKFCgwJh7sOZ76F9+dvm5ZkvTt/8gm8Hd7sUMMsgggwwyyOA+DdqL7SQRwyCDDDLIIIMCBQqMuQeXvm2p+f56mPqGI2awEQcGGWSQQQYZZDDWoL2YwYjxfpBBBhlkkEGBAgXG3INL37bUfH89TH3DETPYiAODDDLIIIMMMhhr0F7MYMR4P8gggwwyyKDA7cwHteyC9AjuZNIAAAAASUVORK5CYII=) center top no-repeat content-box;transition:background-color .1s ease-out}.insert-embed-modal__placement .form-check .form-check-label:hover span,.insert-embed-modal__placement .form-check .form-check-label:focus span{color:#43536d}.insert-embed-modal__placement .form-check .form-check-input{position:absolute;left:-9999px}.insert-embed-modal__placement .form-check .form-check-input.checked+span{color:#29abe2}.insert-embed-modal__placement .form-check .form-check-input.checked+span:before{border:1px solid #29abe2;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAFoCAYAAAAl0bm1AAAACXBIWXMAAAsSAAALEgHS3X78AAAB7klEQVR42u3cwW3CQBBAURu5DRqgHoqgAAqgAAqgCOqhAQox173YAuPdsTVvblFE9JV9WmmiVfpxHLstz6Hb+Gw+cCi/OD3fq57363zsHbFAgQIFChQoUKDAf6a3k9hJAqbcZRhkkEEGGWRQoECB7e7B2/2x6p1zu178jVqgQIECBQoUKFDgX2MvtpNETLnLMMgggwwyyKBAgQLb3YNzE/XG2hELFChQoECBAgXmDrQX59pJvB9kkEEGGWSQQYECc9+DcxP1xtoRCxQoUKBAgQIF5g60F+faSbwfZJBBBhlkkEGBAnPfg0un5htrRyxQoECBAgUKFJg70F6cayfxfpBBBhlkkEEGBQrMfQ8unZpvrB2xQIECBQoUKFBg7kB7ca6dxPtBBhlkkEEGGRQoMPc9WPM99C8/u/zc0Oo38e0/yGawqsGawyCDDDLIIIMM7tOgvdhOEjEMMsgggwwyKFCgwJh7sOZ76F9+dvm5ZkvTt/8gm8Hd7sUMMsgggwwyyOA+DdqL7SQRwyCDDDLIIIMCBQqMuQeXvm2p+f56mPqGI2awEQcGGWSQQQYZZDDWoL2YwYjxfpBBBhlkkEGBAgXG3INL37bUfH89TH3DETPYiAODDDLIIIMMMhhr0F7MYMR4P8gggwwyyKDA7cwHteyC9AjuZNIAAAAASUVORK5CYII=) center top no-repeat content-box,rgb(231.7,245.1331632653,255) padding-box}.insert-embed-modal__placement .form-check .option-val--leftAlone+span:before{background-position-y:-36px}.insert-embed-modal__placement .form-check .option-val--leftAlone.checked+span:before{background-position-y:0}.insert-embed-modal__placement .form-check .option-val--center+span:before{background-position-y:-108px}.insert-embed-modal__placement .form-check .option-val--center.checked+span:before{background-position-y:-72px}.insert-embed-modal__placement .form-check .option-val--rightAlone+span:before{background-position-y:-180px}.insert-embed-modal__placement .form-check .option-val--rightAlone.checked+span:before{background-position-y:-144px}.insert-embed-modal__placement .form-check .option-val--left+span:before{background-position-y:-252px}.insert-embed-modal__placement .form-check .option-val--left.checked+span:before{background-position-y:-216px}.insert-embed-modal__placement .form-check .option-val--right+span:before{background-position-y:-324px}.insert-embed-modal__placement .form-check .option-val--right.checked+span:before{background-position-y:-288px}.image-size-preset-list{display:block;padding-left:0;margin-bottom:0;width:100%}.image-size-preset-list__list-item{display:inline-block;list-style:none}.image-size-preset-list__list-item .btn{padding-left:0}.image-size-preset-list__list-item .btn:disabled{text-decoration:none;pointer-events:all}.gallery{position:relative}.gallery__outer{position:relative}.gallery__main{height:100%;position:relative}@media(max-width: 991.98px){.gallery__main.gallery__main--has-opened-item{display:none}}.gallery__no-item-notice{text-align:center;font-size:1.231rem;margin-top:1.2308rem}.gallery__back{position:relative}.gallery__back.ss-ui-button:before{font-size:23px}.gallery__back .gallery__back-badge{display:inline-block;position:absolute;font-size:1rem;top:-0.5rem;right:-1rem}.gallery__back--droppable-hover{background-color:rgb(234.5005681818,237.5096590909,242.3994318182);transform:scale(1.3);border:1px solid #29abe2}.gallery__main--selectable{-webkit-user-select:none;-moz-user-select:none;user-select:none;margin:-1.5385rem -1.5385rem;padding:1.5385rem 1.5385rem}.gallery__back-container{display:inline-block}.gallery__back-container .gallery-item__droppable{margin:0}.gallery__folders,.gallery__files{display:flex;flex-flow:row wrap}@media(max-width: 991.98px){.gallery__files{margin-bottom:53px}}.gallery__load{width:100%;display:inline-block}.gallery__load-more{display:block;color:#fff;cursor:pointer;margin:8px auto 24px;padding:4px;width:200px;font-size:16px;height:44px;background-color:#29abe2;border:0;border-radius:4px}.gallery__sort{display:inline-block;vertical-align:middle;padding:0 .7692rem}@media(max-width: 767.98px){.gallery__sort .chosen-container{width:auto !important}}.gallery__sort .chosen-single{display:flex;align-items:center;justify-content:flex-end}.gallery__sort .chosen-single:focus{box-shadow:0 0 3px rgba(0,0,0,.2)}.gallery__sort .chosen-single>span{text-align:right;color:inherit}@media(max-width: 767.98px){.gallery__sort .chosen-single>span{font-size:0}}.gallery__sort .chosen-single>span:before{content:"";font-family:"silverstripe";color:rgb(86.4147727273,107.0511363636,140.5852272727);margin-right:5px;position:relative;top:1px;font-size:.923rem}@media(max-width: 767.98px){.gallery__sort .chosen-single>span:before{font-size:1.231rem}}.gallery__sort .chosen-container-active .chosen-single{outline:5px auto -webkit-focus-ring-color}.gallery .gallery__sort .chosen-single{border:0;filter:none;background:none;box-shadow:none;color:inherit;margin-top:-1px}.gallery__sort .chosen-drop{min-width:160px;right:0;border-radius:3px;box-shadow:0 0 3px rgba(0,0,0,.2);border:0}.gallery__sort .active-result{text-transform:capitalize}.gallery__error{display:table;width:100%;height:100%}.gallery__error-message{display:table-cell;vertical-align:middle;text-align:center}.gallery__view-change-button .icon:before{vertical-align:middle}.gallery__btn-toolbar .btn-toolbar:first-child{margin-left:-10px}@media(min-width: 544px){.gallery__state-buttons{margin-right:-0.7693rem}}.gallery__state-buttons .btn-group:last-child{margin-right:0}.gallery__view-change-button{margin-right:-0.76925rem}.griddle-footer>div{display:flex}.griddle-page{flex:1;text-align:center;margin-top:-3px}.griddle-page select{height:calc(1.5384 + 1.2308rem);padding:.3846rem .7692rem;line-height:1.5384;color:rgb(86.4147727273,107.0511363636,140.5852272727);border:1px solid rgb(206.0738636364,213.2556818182,224.9261363636);background-color:#fff;background-image:none;text-align:center;display:inline}.griddle-page select:focus{color:rgb(86.4147727273,107.0511363636,140.5852272727);background-color:#fff;border-color:#66afe9;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),rgba(102,175,233,.6)}.griddle-footer{width:200px;margin:0 auto}.griddle-previous button:before{content:"'"}.griddle-next button:before{content:"&"}.griddle-previous,.griddle-next{width:36px}.griddle-previous button,.griddle-next button{white-space:nowrap;border:0;background:rgba(0,0,0,0);width:36px;height:30px;position:relative;border-radius:.23rem;overflow:hidden}.griddle-previous button:before,.griddle-next button:before{font-family:"silverstripe";color:rgb(86.4147727273,107.0511363636,140.5852272727);width:36px;height:30px;background-color:rgb(250.2931818182,250.9840909091,252.1068181818);position:absolute;top:0;left:0;padding:.3846rem;transition:all .2s ease-in-out;font-size:1.231rem;-webkit-font-smoothing:antialiased;line-height:1.5384}.griddle-previous button:hover,.griddle-next button:hover{background-color:rgb(206.0738636364,213.2556818182,224.9261363636);border-color:rgba(0,0,0,0)}.griddle-previous button:hover:before,.griddle-next button:hover:before{background-color:rgb(206.0738636364,213.2556818182,224.9261363636)}.gallery__search-message-clear{padding-left:.6154rem}th.sort--disabled>span:after{content:""}.gallery__table{margin-bottom:-1.5385rem}.gallery__table td,.gallery__table th{word-wrap:break-word}.gallery__table td{word-break:break-all}.gallery__table td.gallery__table-column-image{padding:0}.gallery__table th{cursor:pointer}.gallery__table th>span{display:inline;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gallery__table th>span:after{color:rgb(142.9034090909,159.3579545455,186.0965909091);content:")";display:inline-block;font-family:"silverstripe";margin-left:4px}.gallery__table tbody td{padding-top:1.8462rem;padding-bottom:1.8462rem}@media(max-width: 767.98px){.gallery__table tbody td:nth-child(n+4){display:none}}.gallery__table thead th,.gallery__table thead td{height:52px}.gallery__table thead th:hover{background-color:rgb(243.9761363636,245.5943181818,248.2238636364)}@media(max-width: 767.98px){.gallery__table thead th:nth-child(n+4){display:none}}.gallery__table .sort-descending,.gallery__table .sort-ascending{border-bottom:1px solid #29abe2}.gallery__table .sort-descending>span:after,.gallery__table .sort-ascending>span:after{color:#29abe2}.gallery__table .sort-descending>span:after{content:"*"}.gallery__table .sort-ascending>span:after{content:"("}.gallery__table .footer-container,.gallery__table .footer-container:hover{background-color:rgb(250.2931818182,250.9840909091,252.1068181818);border-bottom:0}.gallery__table-row{cursor:pointer}.gallery__table-column--title .flexbox-area-grow{display:flex}.gallery__table-column--title .file-status-icon{cursor:pointer;margin-left:6px}.gallery__table-column--title .file-status-icon:last-of-type{margin-right:6px}.gallery__table-column--select{width:1%}.gallery__table-column--select input[type=checkbox]{width:14px;height:14px}.gallery__table-row--highlighted{border-color:#29abe2;background-color:rgb(231.7,245.1331632653,255)}.gallery__table-column--image{width:68px;max-width:68px;height:69px;text-align:center}.gallery__table .gallery__table-row>.gallery__table-column--image{padding:0;vertical-align:middle}.gallery__table .gallery__table-row>.gallery__table-column--image:first-child{max-width:none;padding-left:1.5385rem}.gallery__table-image{background-repeat:no-repeat;background-position:center center;height:68px;width:68px;background-size:calc(68px - 1.5385rem) auto}.gallery__table-image--image{background-size:68px auto}.gallery__table-image--folder{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGYAAAB6CAYAAABNyyaCAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAXxJREFUeNrs2q9Ow0AcwPEdXQerAY3FDBQBNbcQwCJnwE4jAD83Am+A4AHgBXgKLJLAE2D4Y3ocvAPJL/TzTbra9j69a3NZyjn3FK8lQwBGYMAIDBiBERgwAgNGYAQGjMD8l9Lo5vGy9/V5EeFi8sf7+dPZ3jWWnxkTBOX3KRk2V6PFwwJLxKVsZXiwMT6uwERbW+vBTjk1YALWPzo5BBPxi2SwPAETsaoag4k4Y/r1bvkAaMAErJ7O9sHEnDUTMDHfM9Ot+9c1MNFq2/Xy+1xwtrsIkzbvXmL+eTm35eo6ucf6Vo7TuHeeOrvxvVqOW9v+3jECA0ZgwAiMwIARGDACIzBgBAaMwIARGIEBIzBgBEZgwAgMGIEBIzACA0ZgwAiMwIARGDACA8YQgBEYMAIDRmAEBozAgBEYgQEjMGAEBozACAwYgQEjMAIDRmDACAwYgREYMALTIZi5YQjXPOWcDYOlTGDACAwYgREYMAIDRmAEBozAgNHf9S3AAJeuKdi1sikAAAAAAElFTkSuQmCC)}.gallery__table-image--archive{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAArlJREFUeNrs3c9qE1EUx/F7JxmDf/APSCWbancK/kFXQi1CXkDciKCIz6ArC+6k4KKufAARBXe+QBGhDyAUF7pJoZtgF1aamEkzTeIkBdf3jp1z7/V+fxCyOZMMH2ZO7klmiJ5MJorIRduCt9vt08XTm+Jx5zB3ZOXdJ/Vta9uo9tmDlrp0fs6oNk1TVa/XnzabzVc+gCcltvl82NiVH1Var3Y6nSfBgRdH9+Pi6VqQp7In6LZH+IWg+6cH6ImKLK7RowN3jR4luEv0aMFdoUcN7gI9enBp9HqIQOsbm8ZT6b3WdRt0VfVE6g348sOWce2jlQ/GtabgUui0FOH2ArgwOuDC6IALowMujA64MDrgwuiAC6MDLozuzaT5cf2rce3F+Tkf0EtNpEGCv12+b1zb6w9UN9utYpdXgwavKo20prr9seple17sTxQ9/Oyp4+rE0QbgMaJHtUrxAT26ZaFr9CjX4S7Rox18XKFHPWm6QI9+tJdG92bwubt0uZKp1OR1p+izqVRgOAoS3OZXe9PXlULn20Lh9gK4MDrgwuiAC6MDLowOuDA64MLogAujAy6M7s2kaXPr99LVhb+ToQv0f5lIg/wR+daVBeN77atEp6UEgA64cAAHHHACOOAktHX4YLhvXLv1Y8e41uV63Wvw7Z2uce37tS/GtTaXNkfVUubPnaGHE8ABJ4CzLDTJ9Dtu35Zw/z04LYUADjgBHHACOOCAE8ABJ4ADTgAHHHACOOAEcMAJ4IADTjwB/9XLjkB2EJvLq0uDZ3t5OuZPq2cZ5gLg+Wic/Nztg52Ppmd7qW2tr7ya3vK8Pxqrk8caKkni+wjIhrnq/h6osme6FbhWavOgf+WzR9zRvcpbyu2bN14Xb/SdDq5ULdEvRZaFjbS2mGi9FvORXUuS58XB96LU1hNWHaL5I8AAi1XlrYdFnTIAAAAASUVORK5CYII=)}.gallery__table-image--audio{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABH1JREFUeNrsnE9u2kAUxp2oe7gB9AThAJVwThB6Alype8i2m7Dqtsm+UuAG9ASxpe4DNzA3ICdI50mvKYV5D57/xcbfk6wqUDz2z998881gc/H6+hqgqqsLAAdwAEcBOICjABzAUQAO4ACOAnAARwE4gKMAHMABHAXgJdanr99nO39uf//8dg/g5QLfh7Fw0KMi27gEZrXG7iLMAbx66BGAl1Nr4fVHB30A4MVXqEBfOuhdAC+w3AC5Zegbz9s9t+X281qnFFYURbM+KayMmCa0S/YRu63jefvaHUd8dsDdSYesqN7Oyx/dyaYZ90cXa9eHp25fK+X/T90/Pzxvbdzn+mdjKaRqhvO0BztgpWctgj3c2WJtIOTelPisZW+C1FzgO115UkFznRMGQoqDL57Xp1kH0MsawSbVPLvtqsJmqQctFZWnPIb4Lta0kcBJ1W4jL70ruSkpYQzZr6W6F1JL1DjgfKJxFap2aiXgt8LbM3csfSUqzgQvjxoBnE7ObTGngE6FOZvUuhAsQhsIl4KXj2oPnFWx4qTwHjUVLGLMUVRSuc+SbqyD54ccaaKb8WRvyuo1e7FxxaAO4PFFfxJ8OVa8fCKofF6awvlgn/mArdtNicqN9tqKFWuJhYw9Vrw8FdZZRmVbymNDlkaueAIlleTZI2PSCRs90yy4Joovx4JiteTh6zUdy9LtOQHfGvN3IExqrhRbWQlpJWwd8CNrH5ES9wIjQN+CV7+tliKufShxb20E7rOVVlqKtvYh2oQAUFNsCoWf5tmhwSKGRuC91gJnlScGFaZVHt+5xsKVQeFpAftuPfCtsUf4ZtTaugqAN6VaD1xZ7VsB+OkVGgAOLNYhWU1rgbNih4bBsVvl8Z2jwkeGCY6k8ETZv+8CvbQSOKt75nlro9z0Exqj4iCP35+bwu+FWd9c+czQCHCQJ8tfnpG6yUrGQne/Vz5jsR8AP5Y2yGKUyUpksR9eAOsZL1Crcngi3XHL8HzfsS6NcTOw3E2bBfi6IbA3gf795Ex4fW5MQEnZsTCsKfQ4+He/Cd3sM1ImLwPB7xPFTroZesRBme9L4ZPI9LwLD1KkoMLvtuJu3TekGYvqJb83A6/Uwx2UJUP59Y5pZiZEweSIF/u+pltbHxCofNCkHuI2UvpnywytINhkh3dWdfOX0D1DT6lfStlR+6Ii2AOl+z9kUPeL1U7ePRay2kk914H/BsuiZ6EdIXUdU7fvdup5li8japHDWV2kwIeKmyaVRkqa6SoXI9MTdbWZ+LDapxWp/S15aE+yMeyeYEFpo4GfqPZtgU194XFEG2AnQq+YZW207g/Ghtx1yUNz/5QG+zHZxFJTKFtJKnj+bZ4HdBvxeym07pG1C2dsbyUMlJTVwzz7xg/UHMKeB/Iy7yDvhQfw02D/9fx53jZwX8r/JcFeFAEbwE+rpMjfvQJwvWgWOipyhwB+CPhN2W4L895LiEHz+MBJk65tWTEUwCsuAAdwAEcBOICjABzAUQAO4ACOAnAARwE4gKMAHMDbUH8EGABZtyoqqLbafgAAAABJRU5ErkJggg==)}.gallery__table-image--video{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAjFJREFUeNrs3UFOwkAUxvFi2MMN9Abq3kRuoDegC/eyZmPduLXuSYATiCegJOzFE1huQE+Ar+E1BBITF/I60/l/yYTEhW1+TvoN00lsbbfbiNjlDALAASeAA04AB5wADjjgBHDACeCAE8ABB5wADjgBHHBSpV3XhW8eXjL5uJXxJWOwHA2zEMBbdRyTEOyefMyPfryQEQt8ziPFJuVs/5Y/xkTGBeB26ctYCXoiowu4TToynmTkgh4Dbgs/FvRcn/uAG+W8LNlyZSPjCnDbYv30uVh9/eLT1xWNd8Xq+zfNqlgHgNsW66sW6z3gtsX6rsXaA9y2WOeuFmuTdwurYk1dKtYQtmcftVgTwI23CrRYY8Bti3VcZ7GG+sanKtaZdbGG/ortLtrvwXcBt13R5BZbBYAfFWu0e/kRA25frKtTbAUD/nsuZaSA24YZbpwB4DYpz8hcL0fDyX//4ja2B1lHu8NI2akuAPgeOjnFjAb8MIWuRFLB3lhcMGTwabQ7RLqxvGiI4LUeGg0J3Ilj0SGAmxVi6OCFlmHi0k01FfxNZ/XGtRtrGviHPqdzV2+wKeALndGZ6zfqO7hThdhk8EKhU99u3EfwZ8uv4iGDT3VW55HH8QHcm0L0HXytS7xZk9atLoIXCj2JGpi2Y9Cme9Mhga8UuNOkQvxLWnX9Dwg9RFmOPATo2sFDDcckAAecAA44ARxwAjjggBPAASeAA04ABxxwAjjgBHDACeB15UeAAQBIj8DeaiiktQAAAABJRU5ErkJggg==)}.gallery__table-image--document{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAsFJREFUeNrs3c1qE1EYxvF3JjNNbUQjaEs2re4URMGVUIrQhVtxJ+hCvARdWXAjgrioKy9ARNdegEWEXoAgBXWT0m5Cq2hsPptpEicpgguVJM15T4/n/8CQTWc6/fXMc85MUhp0u10heolG2alYLObTl+fpds2FHzKOY4mi6F6hUHhq+1zCEfd75wr2rwRBsFwqle46B56O7tvpy0UXL+fDgD7KCD/tcofaRg/Fw9hE9xLcJrq34LbQvQa3ge49uDY64MrogCujA66MDrgyOuDK6IArowOujA64MjrgyuiAK6MDrowOuDI64MrokcmT+vqjJqsf1o0c++zstJybmx7oa6v1plQaOyZOY3nYTwIYBf9Srsnr1TUjx76+cH5g8GyckUq9I9XGrvUrw5tKOXk8J0ePZAH3Dd27SdM2utEOn5vJy/2bi0aOfSqfOxB6fzK10OlGwacmJwae2GyMdBvoXq/DbdSL9zc+2ujcaSqjG+3wjxvb8vjVW+d+AQ/vXGWE/y8B/A8xWS+AK3e60Q7PTcb9p3quoptYpxsFn505IUu3Fp0e6eNGp1KU6wVwZXTAldGNdni92ZKNrbJzuH974DaOTjcK3sN28U7zxdINYxMplaJcLxF8B1syMsIPObqzb7G5Gm/fYrMVKgVwwIkrHb659V1evnlv5NgLF870N8B/S62ZyKfNbdXbbyqFAA44k+b4evZfT94Y4QRwwAnggBPAAQecAA44ARxwAjjggBPAASeAA04ABxxwAjjgBHDAiQHwcrUxAdt+mq098+CN3STu8I+r+2klCuBJuxN+26mDnbR7V/vQ+4306dne35nvtTtybCorYejfNNBoJVKpNWWUK31o8EBkfb+/kv7md4Kq8Uq5cvnSs/QbfabBRTJh8ERlWZiNM/NhEKz4PLIzYfggHXyPht6zy4pDNT8FGAAqQOmy57wEGAAAAABJRU5ErkJggg==)}.gallery__table-image--error{background:#d40404;height:68px;width:68px}.gallery__table-image--error:after{content:"<";line-height:68px;font-size:30px;display:inline;font-family:"silverstripe",sans-serif;color:#fff;opacity:.8}.gallery__progress-bar-progress{height:100%;background:#0071c4;transition:width .5s ease;width:0%}.gallery__progress-bar{height:16px;width:30%;border-radius:10px;overflow:hidden}.gallery__progress-bar--complete:after{color:#3fa142;font-size:20px;display:inline;font-family:"silverstripe",sans-serif;content:"I"}.editor-header{display:flex;flex-wrap:nowrap;justify-content:flex-start;align-items:flex-start;margin-bottom:.76925rem}.editor-header__back-button{flex:0 0 auto;align-self:center}.editor-header__back-button--md-below{display:none}@media(max-width: 991.98px){.editor-header__back-button--md-below{display:block;margin-left:0}}.editor-header__edit{flex:0 0 auto;margin:0}.editor-header__field{flex:1 1 auto;min-width:0;overflow:hidden}.editor-header__field .field{margin-bottom:0}.editor-header__cancel-button{align-self:center;flex:0 0 auto;margin:0}.editor-header__cancel-button--lg-above{display:none}@media(min-width: 992px){.editor-header__cancel-button--lg-above{display:block}}.editor{background-color:rgb(250.2931818182,250.9840909091,252.1068181818);z-index:2;position:absolute;height:100%;left:0}@media(min-width: 992px){.editor{width:300px;border-left:1px solid rgb(206.0738636364,213.2556818182,224.9261363636);position:relative;padding-bottom:0}}@media(min-width: 1200px){.editor{width:448px}}.editor .nav-tabs{z-index:1;position:relative}.editor .editor__details{transform:translateZ(0)}.editor .editor__details fieldset{overflow-y:auto}.editor--asset-dropzone--disable .asset-dropzone{pointer-events:none}.editor h2{margin-bottom:0;margin-top:1.2308rem}.editor__heading{font-size:19px;line-height:2rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:2px}.editor__status-flag{color:#f46b00;background-color:#fff7f2;border-color:#f46b00;clear:both;text-transform:uppercase;display:inline-block;position:relative;line-height:1rem;margin-left:3px}.editor-header__field .file-status-icon{margin-left:6px}.editor-header__field .file-status-icon:last-of-type{margin-right:6px}.editor-header__field .file-status-icon+.editor__status-flag{margin-left:0}.editor-header__field .field-group-component__small-holder.editor-header-folder{width:100%;display:flex}.editor-header__field .field-group-component__small-holder.editor-header-folder .field{max-width:calc(100% - 30px)}.editor-header__field .field-group-component__small-holder.editor-header-folder .file-status-icon{margin-top:5px}.editor__specs{color:rgb(86.4147727273,107.0511363636,140.5852272727);font-size:.75rem;display:flex;align-items:center}.editor__top-message{margin:-0.76925rem -1.5385rem 1.2308rem}.editor__thumbnail{display:block;max-width:100%;max-height:336px;min-height:80px;margin:auto;transform:scale(1);transition:all .5s}.editor__file-preview{text-align:center;margin:0 -1.5385rem .76925rem;position:relative;max-height:336px;min-height:60px;overflow:hidden;display:block;align-items:center;text-decoration:none}.editor__file-preview:not(.editor__file-preview--folder):hover .editor__thumbnail{transform:scale(1.04)}.editor__file-preview--folder{margin-left:0;margin-right:0;width:100%}.editor__file-preview-link:before{position:absolute;top:50%;left:50%;margin-top:-25px;margin-left:-25px;padding:11px;height:50px;width:50px;border-radius:50%;background-color:rgba(0,0,0,.6);color:#fff;font-size:22px;opacity:0;content:"=";font-family:"silverstripe";line-height:27px;z-index:1;transition:all .5s}.editor__file-preview-link:hover,.editor__file-preview-link:hover:before,.editor__file-preview-link:active:before{text-decoration:none;opacity:1}.editor__file-preview-message--file-missing{margin:2.4616rem 0 1.2308rem;font-size:1.231rem;color:#d40404;text-align:center}@media(max-width: 991.98px){.editor__heading,.editor__specs{text-align:center;margin-right:36px;display:flex;justify-content:center}}#Form_fileInsertForm .tab-pane .show{display:flex;flex-wrap:wrap;margin-top:-10px}#Form_fileInsertForm .tab-pane .show>div{width:100%}#Form_fileInsertForm .tab-pane .show #Form_fileInsertForm_Dimensions_Holder{width:67%}#Form_fileInsertForm .tab-pane .show #Form_fileInsertForm_Dimensions_Holder .field-group-component{display:flex;flex-wrap:wrap}#Form_fileInsertForm .tab-pane .show #Form_fileInsertForm_Dimensions_Holder .field-group-component .field{margin-bottom:0}#Form_fileInsertForm .tab-pane .show #Form_fileInsertForm_Loading_Holder{width:33%}.asset-admin .popover-field .popover{box-shadow:0 2px 5px 0 rgba(0,0,0,.1),0 2px 10px 0 rgba(0,0,0,.1);font-size:1rem;min-width:230px}.asset-admin .popover-field .popover:focus{outline:none}.asset-admin .popover-field .popover.top .arrow,.asset-admin .popover-field .popover.bottom .arrow{margin-left:-5px}.asset-admin .popover-field .popover.top{margin-top:-10px}.asset-admin .popover-field .popover.left .arrow,.asset-admin .popover-field .popover.right .arrow{margin-top:-3px}.asset-admin .popover-field .popover.left{margin-left:-10px}.asset-admin .popover-field .popover-body{padding:.5rem .75rem}.asset-admin .popover-field .popover-body ul{padding-left:0 !important;list-style-type:none;margin-left:-1.2308rem1px;margin-right:-1.2308rem1px;margin-bottom:0}.asset-admin .popover-field .popover-body a{display:block;padding:.3077rem 1.2308rem;color:#43536d}.asset-admin .popover-field .popover-body a:hover{text-decoration:none;background-color:rgb(206.0738636364,213.2556818182,224.9261363636);color:#43536d}.asset-admin .popover-field .popover-body .btn{padding-left:calc(1.2308rem - 1px);padding-right:calc(1.2308rem - 1px);margin-left:calc(-0.75rem + 1px);margin-right:calc(-0.75rem + 1px);display:block;width:calc(100% + 1.5rem - 2px);text-align:left;border-radius:0}.asset-admin .popover-field .popover-body .btn:hover{background-color:hsl(202.1052631579,32.2033898305%,93.431372549%)}.asset-admin__toolbar-extra{width:auto}.asset-admin__toolbar-extra button:last-of-type{margin-right:-10px}.insert-media-modal.modal-lg{width:calc(100% - .76925rem);max-width:1600px;margin-top:0;margin-left:auto;margin-right:auto;height:calc(100% - 53px)}@media(max-width: 991.98px){.insert-media-modal.modal-lg{width:calc(100% - 1rem);height:calc(100% - .5rem);margin:0 auto}}.insert-media-modal .modal-content{height:100%;border-top-left-radius:0;border-top-right-radius:0}.insert-media-modal .modal-body{padding:0;height:100%}@media(max-width: 991.98px){.insert-media-modal .editor__details{height:100%}}@media(min-width: 992px){.insert-media-modal .btn--close-panel{display:none}}.insert-media-modal .tab-content{margin-bottom:1.2308rem}.insert-media-modal .fieldgroup.fill-width .field.flexbox-area-grow:first-child{margin-right:1.5385rem}.insert-media-modal .asset-admin--multi-select [name=action_insert]{display:none}@media(min-width: 992px){.insert-media-modal .asset-admin--single-select [name=action_insert]{display:none}}@media(max-width: 991.98px){.insert-media-modal .asset-admin--multi-select [name=action_insert]{display:block}}.insert-media-modal__main{height:calc(100vh - 106px)}.insert-media-modal__close-button{float:right;height:32px;margin:10px -10px 10px 0}.insert-media-modal__close-button:before{top:0}.history-item{padding-top:1rem}.history-item:hover,.history-item:focus{background-color:rgb(243.9761363636,245.5943181818,248.2238636364)}.history-item p{margin-bottom:0}.list-group-flush:first-child .history-item:first-child{border-top:1px solid rgb(206.0738636364,213.2556818182,224.9261363636)}.history-item__date,.history-item__version{opacity:.7;font-size:.846rem;margin-bottom:1px}.history-item__date{display:block}.history-item__version{position:absolute;right:1.5385rem;top:.9231rem;font-size:.846rem;opacity:.7}.history-item__status-flag{color:#3fa142;text-transform:uppercase;font-size:.923rem}.history-list{position:relative;min-height:50vh}.history-list>form{display:block}.history-list>.list-group{margin-top:calc(-1.5385rem - 1px)}.history-list .form{margin-left:10px}.history-list .editor__file-preview-link,.history-list .editor__file-preview-message--file-missing{max-width:50%;position:relative;display:block;text-align:center;font-size:10px;padding:10px;background:rgb(243.9761363636,245.5943181818,248.2238636364);border:1px solid rgb(218.7079545455,224.0352272727,232.6920454545);margin:0 auto 10px}.history-list .editor__specs{text-align:center}.history-list__back{padding:5px;position:absolute;top:0;left:-0.76925rem;z-index:2} +/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./node_modules/resolve-url-loader/index.js??ruleSet[1].rules[0].use[3]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[0].use[4]!./client/src/styles/bundle.scss ***! + \*****************************************************************************************************************************************************************************************************************************************************************************************************************************/ +.gallery-item { + opacity: 1; + position: relative; + background-color: #fff; + border: 1px solid; + border-color: rgb(218.7079545455, 224.0352272727, 232.6920454545) rgb(206.0738636364, 213.2556818182, 224.9261363636) rgb(193.4397727273, 202.4761363636, 217.1602272727); + width: 178px; + border-radius: 0.192rem; + height: 174px; + transition: opacity 250ms linear; +} +.gallery-item:hover { + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); + cursor: pointer; +} +.gallery-item:not(.gallery-item--error, .gallery-item--folder):hover .gallery-item--overlay { + opacity: 1; + display: block; +} + +.gallery-item--dropping { + border-color: #29abe2; + background-color: rgb(231.7, 245.1331632653, 255); +} + +.gallery-item__draggable, +.gallery-item__droppable { + margin: 0 1.2308rem 1.2308rem 0; +} + +.gallery-item__draggable .gallery-item__droppable, +.gallery-item__droppable .gallery-item__draggable { + margin: 0; +} + +.gallery-item--folder { + display: flex; + height: 54px; +} +.gallery-item--folder .gallery-item__thumbnail { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGFJREFUeNpi1Jhy/D8D6cDxRo7lAQYaACYy9Tkw0AiQ6yD7weYgB83VjwRo4SBGoMH/GQYRYGIYZGDUQaMOGnXQqINGHTTqoFEHjTpo1EGjDhp10KiDRh006qDB7SCAAAMAe8YKeWd2MukAAAAASUVORK5CYII=) 12px 14px no-repeat; + background-size: 27px 24px; + height: 52px; + width: 45px; + float: left; +} +.gallery-item--folder .gallery-item__title { + padding-top: 17px; + padding-bottom: 17px; + padding-left: 0; + width: 131px; + height: 52px; +} +.gallery-item--folder .gallery-item__checkbox-label { + margin-top: 5px; +} +.gallery-item--folder .gallery-item__status-flags { + display: none; +} +.gallery-item--folder .gallery-item__status-icons { + grid-column: 1; + text-align: left; + margin: 20px 0 0 17px; +} +.gallery-item--folder .file-status-icon__icon:before { + color: #005ae1; + font-size: 16px; +} + +.gallery-item__thumbnail { + height: 132px; + width: 176px; + margin: 0 auto; + background-repeat: no-repeat; + background-position: center center; + border-top-left-radius: 0.192rem; + border-top-right-radius: 0.192rem; + background-size: cover; + display: grid; + grid-template-columns: 50% 50%; +} + +.gallery-item__thumbnail--error { + background-color: rgb(220.6, 54.2, 54.2); +} + +.gallery-item__thumbnail--no-preview { + background-color: rgb(86.4147727273, 107.0511363636, 140.5852272727); +} + +.gallery-item__thumbnail--loading { + background: #fff url(data:image/gif;base64,R0lGODlhKwArAKIHAOvt7rS8wdLW2EB9ogBakqysrP///////yH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo1NWQ2NWU5Yy1iZjAwLTRmNjktODVlNS03NDQ4ODZiM2E1MDEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MjRFNkFDN0EwNjZDMTFFNTg1QTBBNzNENzVBQ0M0ODQiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MjRFNkFDNzkwNjZDMTFFNTg1QTBBNzNENzVBQ0M0ODQiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2MzRlNmQ4NC00OGE1LTRmNzQtYTcwYS0wNDM4N2E1ZTYzZjAiIHN0UmVmOmRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDo5ZjhiOTRiYy00YTNiLTExNzgtYWNjMy1kNzg3OTk3MTdhNzQiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4B//79/Pv6+fj39vX08/Lx8O/u7ezr6uno5+bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL++vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI+OjYyLiomIh4aFhIOCgYB/fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAAAh+QQFAAAHACwAAAAAKwArAAADtni23P4wOiWrvTjrzbv/YCiOWCCQGVAUAXoF6+pKABwXMyTca5szKt7q9DPshAViroZMFoNCHwQgEAA+Np7ScbwFrppu7BvJCrcWs7PcjKElWlr7luGBG4KWuHfGxIE2VDdEUD0ldgtiVj13RjwYeyx9aw2FOH5zK41cjxiWURJ7UheRYxFMfylqlJygHlRWp6uaRaUsmyi2b7lIZEUGq7szPL6/C17GDoHJXKPMz9DR0tMT1AcJACH5BAUAAAcALBAABwAGAAcAAAMQeApTGiSyGAetdxwb3SZaAgAh+QQFAAAHACwIAAoADAAKAAADIXi6F8QMDPJgm7QqmbsSWEcVR9gNwlGYI2Oi1kEN8RLECQAh+QQFAAAHACwHAA8ABwAMAAADG2hCzDaNlchgtG0YGnYsDyVgjZcZUwUawVC8CQAh+QQFAAAHACwKABQADgAJAAADI3i6O8TwCEdCPKCQTUrkYABYCggKjMkNiwoCy6QWMJQVARolACH5BAUAAAcALA8ADwARAAkAAAMseLqsUSW0Bgq5d0wFBsba5n0YdQjkt1RHlV7bMV4FcB5GuASYEC+FA0HHSAAAIfkEBQAABwAsHAAPAAkADgAAAyR4CtpNQzhFapmnkjD1YJQGGaHXFCLRBGkztAcrDs5Lc9iF4QkAIfkEBQAABwAsGAAZAAwACQAAAx54urOuYpB5SFNl6tni3kLwgYc0XsooPBUHsMqwsgkAIfkEBQAABwAsEAAHAA0AHgAAAzp4aiH6EJQS4GNzWpXzPkNXfZ3zgcN4rmzrvnAsz3Rt31vRDgRbEL0VD7gCGg+qh5EwAHyMSUuhCUkAACH5BAUAAAcALAgACgAPAA4AAAMveLoHwVAZUUpkoNZ7pv6FsDigJi5lFRgMkZ7Q8AUAd8ihvcgXq3eBwW/YsOyIkgQAIfkEBQAABwAsBwAPAAgADAAAAx54cNwXjolSYqC1YSrYLsvxdc8GHdM2DOLWpJnDNgkAIfkEBQAABwAsCAAUABEACQAAAyl4unwSLSoQShGygGOEtVhWfeBWNCS5rUv6QYznWoERUa5gSxwgCBtJAgAh+QQFAAAHACwVAA8ACwAKAAADIni6IHFmGVFqGTJYu/SuCvBx03gdzSYsYRUArGIUayzZSgIAIfkEBQAABwAsHQAPAAgADAAAAyAocNxXJSwHi6D1sgpN4NAFgAEjgMzIbSgzvEfpHISQAAAh+QQFAAAHACwZABgACwALAAADIXi6sq6iSLlAmBPiGeyewPAV3SFuzYKVjygYj0Kk8QHXCQA7) center center no-repeat; +} + +/* stylelint-disable media-feature-name-no-unknown */ +@media only screen and (min-device-pixel-ratio: 2), only screen and (resolution >= 192dpi), only screen and (resolution >= 2dppx) { + .gallery-item__thumbnail--loading { + background: #fff url(data:image/gif;base64,R0lGODlhVgBWAPf/AP///5qkqnigubi4uO3y9fD09tTU1MrKyi1xnCZtmhlnl7q6ulWDnxFilWWTsSlvm1WJqk+AnsbGxpa0x+bm5h1pmEqDpsPDw6Woq83Nzc3a46nC0fLy8snW3uTk5K6urmuNomGJoXSet7S0tFGHqR9qmG2ZtNHe5hVklq6vsAlelJWhqdjj6enp6X2WpYOnvoWZpnOSpdvb28zU2ARck566y+nv87nN2UR6nI2uwqzE0ubt8Ymbp7/Gy6mrrEF9o8vZ4nuiuvz9/pu3yQ5hlevw85KyxaCmqmqXs6usrPr7/Ep9namqq0eBpVyGoAZdk5q2yAxglE2FpzBxmTp2m4qswSJql22Vraq0uwJbkqysrABakjN1noadrHGatO3v8ZGfqPX29k2Coh1olufs78/R0j94nLKysvf39/z8/Le3t9DQ0LGxsePj48jIyN/o7fr6+v7+/7y8vPHx8fb4+r29veDg4P7+/vv7+/n5+fj4+ER/pAFaktLS0tnZ2cXFxcDAwP39/fb29t/f397e3vX19erq6q2trV+QriFrmZCwxPT09OLi4u3t7QFbkrOzs6urq+Hh4QNck/Dw8GCRr3+lvApflGOSr+fu8r7Q26W/z+zs7M7Ozr+/v93d3dPT0/L2+LCwsNjY2Ovr68TExNfX17m6uzV2n4mrwLPI1ViMrLe4ua/G1Pj6+8jX4ePq7zBznefn5+Dh4bbL18jJyVOIqfPz84+wxNvl7Dh4oD17ocTFxdjZ2bS2tqytrsjY4eHp7tTf5vf5+u/v79HR0cnJyba2tqG8zfz9/cLT3fb5+g9ilVKGp5e1x9vl66e+zPL192aSrgdek3aft2GQrV6Prjd0mvv8/KK6ydPU1DNymoKitdXg56a/z9/g4X+juJ6yvp2oriRrmNvc3fz8/eHl536crvb29+Xl5XicsoWfsN3e3/r7++zx9I2dp8jLzoeovGWPqc3X3+Xr74+ouJSzxq26wpKxxUt/oGOQrdXZ3PX4+cDK0N3m7La2twAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowNzgwMTE3NDA3MjA2ODExODA4M0Y1OEQ5Qzk3MEQ4RSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo3OTA5OUY3RTkzRjIxMUU0QjVEM0JDM0U0RkMyRUM5NyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo3OTA5OUY3RDkzRjIxMUU0QjVEM0JDM0U0RkMyRUM5NyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChNYWNpbnRvc2gpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MDg4MDExNzQwNzIwNjgxMTgwODNGNThEOUM5NzBEOEUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MDc4MDExNzQwNzIwNjgxMTgwODNGNThEOUM5NzBEOEUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4B//79/Pv6+fj39vX08/Lx8O/u7ezr6uno5+bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL++vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI+OjYyLiomIh4aFhIOCgYB/fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAAAh+QQFAAD/ACwAAAAAVgBWAEAI/wD/CQRAsKDBgwgTKlzIsKFDggL/PZxIsaLFixgbGlKjpeMHOBlDijRYCFDHkyhTaiE0sqXDNSpjdnQDkmKkBTJPslmTx+XCnFrQPWxzZiXBSECTpjyTxidBOI+UKh2AMc2InGqcTtSDBk/VA5CkdlSDRqtZgpOk1ll0ti3DRQtauJ1Lt67du3jz6jU4Rw7QT3sz4nEj1uOaQIEvykh6oWzFQBwLq8xw9gBQOY4Ltois0g8AWykfUWCYISebtncsS9ZyRi7FPH+kSkhcEQ1nqRcE0c5oIOaARruDax0onG7E4nYlIl/OvPnCFgvYOh/ZaEBMA9MrLqojdVL2hYIuSP8m+/0gmquFDzS9CAeNnsASpP55T7EFm9VaDtxpezvliPUWWYdfaD05dZ9MlC0UC3on2QKAKDKp4VpBaPiV0wFOpVHUgCrZQRAhrDHyEDpAnVUah1qogVht4gElA115rHFgTgtEUlEehIm1RnkHBbLGB5K54RWPBYEoFiCFEKlQH0AtMIeSD8EBZEcDGALllVhmSRtxWlLEZZdghinmmGSWGWYanADphpkHpfFjSm2weccnU6q0I5ml1CnTi2HKEIpUC4DpyYxKAaIlUZLJkeSVguBUmDFWYpkGd2KpEYtFm6xRx4ZafKCGG3YMWdcch0h1RpwULdJJYWwMMpcepQL8dYaHFQ1DqGSk7GdWfDkVg5EfKJ7kqlYp5ITdQ2j0UdAcwaJEjFZAicgQHDlqIQdBwMoEyR8ezDGKAZzKJK1LFsbERmYGpaFaSh62EdMBNZl3K0rX+sRIUmcYMMocbfwRlkyiEFSuBPEqdG9OWjHZbEdPErQGugz1JlMKZg2ysGcXVRvTbGbdQQqHbABXkR3hxnQIfW0NMm9OnXBQEaJKHeKdXXjYIcEAdZ5RxxqbWBRLf0DVASCUG0m2gG5XFlKuqahiaZJYbHgCpqNJhcInmIsB9UEpZcIU0wcG6Fqmuyh90MfQbBL2ASdos+n223DHLXdBys0N0XFyRxQQACH5BAUAAP8ALA4ADgA7ADsAQAjpAP8JHEiwoMGCGxKdOMiwocOHA3mU2EKxYkVXEDNq3Mix479eHkOKHEmSI5OSKFOqXMmy5cZMiSxWNOHSY5IjIBI8oajgTc2fK1MARUlrKEpeRpMqBZqqQsUnBJY2VCdNpkUHUhu6GGN1S46sEH1h6EEOrNmGSM9qPKk2Y9G2D4XCfQhyrt27ePPqXWlrVSy8oFQ52mIhL51LWWQOmRvIC42uWyjNjREF8pYXc48sgZzoLgYQDfhY5BInLwYYDLT96Le3tevXeHfB/udrNlvXskzBNiUL9m3XtWHLnk28uPHjyJMrX868ZEAAIfkEBQAA/wAsEQATABgAFQBACKAA/wkcSLCgEiQFE05osKWhw4cQtyRg8c9HjDERiShKyLHjv0oqIHLEYiaiyS0oNHkkmG2lS45xRDxp+FIgqignHRYkkyinSQWsBvoAwTBnAygvmbgwo4CGlDg1o/779WCL1IEnEDyUyuLUSZdvdPncSrCAhbEQHVVT9i8MPrQPaxUgeCQCH7QWinQEYy3nj1dJQWB0mOvNVYEBXMRgJzUgACH5BAUAAP8ALA4AHQAPABkAQAibAP8J/NdvoMGBe7YoXMjQYDOGEBU2eFHu4L8ZAQJAsvhL0kKLAyMynGDxlsgtjnAEGEjnwRaQA195bAiSxsktJgwmuGkJl0EHN7fwWXJkoJIfDBuYgbHR4BsFMA1S+hi1CU2QlUSCrHBTAZ2BfG7WMBjlpiqDJIImeCOQDpGgW7SB+Wejwc0GMXwMhCBSGwyLyK6Ie4ADxMqBAQEAIfkEBQAA/wAsEwAnABgAEgBACIoA/wkcSLBgQWAO4hgUuKWhw4cQt2ggWECRhQo0HEZBcOnGwo8LC5CIuKUeQZIot1jKBLKlDQsOE4BEMgtIjT18UgowmJJkEIFQiPSECGtiy6P/oDTYUgVpQU0oIHJzykoByp8Lhz68l1VrwxJdvVZo9Y9aFq8Po+goiAlRlKGJjDj9J4TMGwJIAwIAIfkEBQAA/wAsKgAeABcAEgBACKkA/wkcSJAggTc7hBQcWGKLw4cQIzq0dkSRwCpbGjRbyLEjqygSQ9KI4CPYPwEhtyjQURDYlSMdBUJJlHLLSF8EWzWsKTHBCoFGeIa0wuPkv2ARURyLyZTgDUQIQDqkkSidvo4nYAndgsJFwWSWtj7UBlNgELEQfQrUgPbhEydMBKJMyWdPDSCzkDQgEsLHPyP/JoQkQYBjmIHTBCZ42MRG04VxLgF7XDAgACH5BAUAAP8ALDwAHwANABgAQAiMAP9Fewbtn8GDCP9tWciQoZeDJhpKpHFQ4g8lCHFZktgwwT8YDzgujNLOIEMiORIiFHmrokiGzQxOeLkwjhSaW/YcxAAjRIQlDECs+GJySxREmFS6ZEgCo0qOEJ5ybFCyqMhlwt4kwEnCIASaUQzWwPmPjgKaFbAgwPnCoLslZxk+SUBPZRIMGJggDAgAIfkEBQAA/wAsMAAyABkAEgBACJ0A/wkcSPDfm1xbCip8h2OLw4cQI26xUEDhQHcMxGiwyNGiDQsSQzqkJBCSCxQit5xi0bElpj0hCTpkNhBaLT4pJSp4M/CImZwPdfHsCONBRAQnWiodqIjIQ47Silgc0gCoQ0kbCWpCadXhAzoD5VXo+jCRM4IBqJBtMMEiBgaOckZBpTRAQ4kqKi0dmMSFNmlbnoiIs9dimUCFCQYEACH5BAUAAP8ALB8ADgAZADsAQAjxAP8JHDgw1ipbBBMS5KNthZaHECFOUkixosWLGDNq3MixI8EcW0KK9EjgicgKqSw2GhARogGOWcQ5cXeEiT80HnPq3MnzorBpKHI6EElU5AMgCg2pgfgBTkYg5lq2/KQxywMYUrUQ2omo58ZmXsOKHUu2bMc3CkZ6dFVU7UYTbbckytTxRKINHdNw+qDFjcc0a/hGbKMx0CfBUtdkjMLAR9aHMjQ2AOFY6gKONLTBSBIREACPfCyJMxOPjNnTqFOrXs26tevXsC124MkiQUidcbgUzZmorccXcd1iRBScBhIlGocUzXKJjkcLWxypAkUxIAAh+QQFAAD/ACwRABMAGQAYAEAIugD/CRxIsOCdgggFtjmjpaHDhxC1yCkk8MkSDBHP2EnIkaOMUBETcgEBKaJJNbE6DuQTJYhKgmj6AHj5D0CpDw1pDvTExuRDhDYW+PRpzBDBLDgwDj3TRmcDBmB8aCk2U6dVhAW24ZjS4OocOVcLLqrz82ohQD5pCrow9ORAPG7aRvywJtDAGHIhHkhTUJqTvFrcwOloBcbQP3qchlDa8AKasAItaXPSBQ/kywK9BQCB7XI3BU+y8BEYEAAh+QQFAAD/ACwOAB0ADgAZAEAIlwD/CfwnaKBBgbu0KFy40KAshhAVhoN38F+NigLnHGqIkUnEhYwODvrIJESDgWnqKMT4T89Ghhh9fVRoYKCpmVrYoBnYB6cWECcF3umEIckRGBFQ8DmIZgTLgWtWPpUAEyOvjxV74RyRRqDHmegGpsCZYSAtn3LO/UtzxicPcf/gPJoZgEqWgRkgHgExpmIgcE5wWHliMCAAIfkEBQAA/wAsEgAoABsAEQBACIsA/wkcSLBgwTZntIwzSFCLw4cQI2oZwLAgAD1o8FTcWBBNwRZqJDr084/bnQMiUz4804Kjy3+xRkT8wlGlSDsMbYpUE8hgnjVsdC6I9LLoPzhuHsoxSjANSonrOJ4xMGpOmz+QVIqqqRPinIpdI5IUSCqsSDaNDA4KarYTB5d47EgY8GFlnTWbOAYEACH5BAUAAP8ALCkAHgAWAB4AQAi9AP8JHEiwIBw0YeIUFDhAi8OHECH6ABGFICEtZxgt3Mixo0eBLdhEHImBAY1/tv6JGulQTYuC8z7K3Hjt20yPkRawZGKyYCA1LEf6cKGAkMBIQUcmgWGFoK2IjyjcnEq1qkBQVgtuWlPnjMMkMajk47ioU1It7qYsHCbyrBZIMRoQ9OP2ISQXKAbOqfvwCL4sA+kGhfTHw5xRZZwA/mfnXxuWB+DMlPNQguSpANagycq5s+fPC+WVqPoGwdSAACH5BAUAAP8ALDoAHgAPABYAQAiPAPUA+EewoMGDWhIqXPgoz0F0CyP6IBgx4YE7B/+hkVNxIa2DUaYwAEGSwZQoFBWyWeMwY8qOGQx2jHgmjcEMM7WkKCisC4aOGLpo+aDGjR08LmUuZDMo6UxSGJXObFowZ0JiBA2csapFVkE0bHKaMsgoJxOD2XJOLCguBJifCTGACaHK5ZMoDaI8+SfpX0AAIfkEBQAA/wAsMQAuABgAFQBACKkA/wkcSLCgQYFMCOZxo6Whw4cQ1xB8AAZiQ0CFDmo0iOaCRYi8iFgL8PGjGzwb/yVIyXJjmhFaDmrpdTDPn5IQJQjcZw8STotq0BAsweOnlguCWD7BUVFLnUUtowo0sNEXSwAMHQ50uGujnTNGD+kx2AasUS2HJhGkoOaswzppBHYQs8JtwwVJCU4JkMTomTYaVYTo+5GNp5ZZlpB0GEqGVIIJQvAD8DggADs=) center center no-repeat; + background-size: 43px 43px; + } +} +/* stylelint-enable media-feature-name-no-unknown */ +.gallery-item__thumbnail--small { + background-size: auto; + background-color: #fff; +} + +.gallery-item__title { + padding: 11px 12px; + height: 40px; + width: 176px; + margin: 0; + overflow: hidden; + box-sizing: border-box; + text-overflow: ellipsis; + white-space: nowrap; + position: relative; +} +.gallery-item--selectable .gallery-item__title { + padding-right: 32px; +} + +.gallery-item__checkbox { + margin: 13px 4px; + transform: scale(0.1); + z-index: -1; + position: absolute; +} + +.gallery-item__checkbox-label { + width: 30px; + height: 40px; + position: absolute; + right: 0; + top: 0; + margin-bottom: 0; +} +.asset-admin--single-select .gallery-item--selectable .gallery-item__checkbox-label { + display: none; +} +.gallery-item--selectable .gallery-item__checkbox-label:before { + cursor: pointer; + top: 0; + bottom: 0; + right: 0; + height: 19px; + width: 19px; + margin: auto 10px; + position: absolute; + border: 1px solid rgb(206.0738636364, 213.2556818182, 224.9261363636); + border-radius: 0.192rem; + font-size: 1.15em; + padding: 1px; + color: transparent; + background-color: #fff; +} + +.gallery-item--selectable .gallery-item__checkbox-label:not(.gallery-item__checkbox-label--disabled):hover:before { + border: 1px solid #29abe2; +} + +.gallery-item--error .gallery-item__checkbox-label:before, +.gallery-item__upload-progress + .gallery-item__title .gallery-item__checkbox-label:before { + font-size: 19px; + border: 0; + border-radius: 0; + padding: 0; +} +.gallery-item--error .gallery-item__checkbox-label:hover:before, +.gallery-item__upload-progress + .gallery-item__title .gallery-item__checkbox-label:hover:before { + border: 0; +} + +.gallery-item--error:hover, +.gallery-item--error .gallery-item__thumbnail, +.gallery-item--error .gallery-item__title, +.gallery-item--error .gallery-item__checkbox-label { + cursor: not-allowed; +} +.gallery-item--error .gallery-item__checkbox-label:before { + color: #d40404; +} + +.gallery-item__error-message { + position: absolute; + top: calc(50% - 40px / 2); + left: 50%; + transform: translateX(-50%) translateY(-50%); + max-height: calc(100% - 40px); + overflow: hidden; + width: 90%; + color: #fff; + background-color: rgb(220.6, 54.2, 54.2); + text-align: center; +} + +.gallery-item--error .gallery-item__thumbnail, +.gallery-item--missing .gallery-item__thumbnail { + position: relative; +} +.gallery-item--error .gallery-item__thumbnail:after, +.gallery-item--missing .gallery-item__thumbnail:after { + content: ""; + position: absolute; + inset: 0; + background: rgb(220.6, 54.2, 54.2); + border-radius: 2px 2px 0 0; +} +.gallery-item--error:hover .gallery-item__thumbnail:after, .gallery-item--error:hover .gallery-item__error-message, +.gallery-item--missing:hover .gallery-item__thumbnail:after, +.gallery-item--missing:hover .gallery-item__error-message { + background: rgb(216.3, 29.1, 29.1); +} + +.gallery-item--overlay { + grid-column: 1/span 2; + grid-row: 1; + background: rgba(47.5852272727, 58.9488636364, 77.4147727273, 0.5); + opacity: 0; + display: none; + transition-property: opacity, background; + transition-duration: 0.5s; + border-top-left-radius: 0.192rem; + border-top-right-radius: 0.192rem; + color: #fff; + height: 132px; + width: 100%; + font-size: 14px; + padding-top: 56px; + text-align: center; +} +.gallery-item--overlay:before { + margin-right: 0.385rem; + position: relative; + top: 0.2rem; +} + +.gallery-item--selected { + border-color: #29abe2; +} +.gallery-item--selected .gallery-item__checkbox-label:before { + border-color: #29abe2; + background-color: #29abe2; + color: #fff; +} +.gallery__main--dragging .gallery-item--selected { + opacity: 0.2; +} + +.gallery-item--highlighted, +.gallery-item__drag-shadow { + border-color: #29abe2; + background-color: rgb(231.7, 245.1331632653, 255); +} + +.gallery-item--focussed .gallery-item--overlay { + opacity: 1; + display: block; +} + +.gallery-item--archive .gallery-item__thumbnail { + background: #fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAArlJREFUeNrs3c9qE1EUx/F7JxmDf/APSCWbancK/kFXQi1CXkDciKCIz6ArC+6k4KKufAARBXe+QBGhDyAUF7pJoZtgF1aamEkzTeIkBdf3jp1z7/V+fxCyOZMMH2ZO7klmiJ5MJorIRduCt9vt08XTm+Jx5zB3ZOXdJ/Vta9uo9tmDlrp0fs6oNk1TVa/XnzabzVc+gCcltvl82NiVH1Var3Y6nSfBgRdH9+Pi6VqQp7In6LZH+IWg+6cH6ImKLK7RowN3jR4luEv0aMFdoUcN7gI9enBp9HqIQOsbm8ZT6b3WdRt0VfVE6g348sOWce2jlQ/GtabgUui0FOH2ArgwOuDC6IALowMujA64MDrgwuiAC6MDLozuzaT5cf2rce3F+Tkf0EtNpEGCv12+b1zb6w9UN9utYpdXgwavKo20prr9seple17sTxQ9/Oyp4+rE0QbgMaJHtUrxAT26ZaFr9CjX4S7Rox18XKFHPWm6QI9+tJdG92bwubt0uZKp1OR1p+izqVRgOAoS3OZXe9PXlULn20Lh9gK4MDrgwuiAC6MDLowOuDA64MLogAujAy6M7s2kaXPr99LVhb+ToQv0f5lIg/wR+daVBeN77atEp6UEgA64cAAHHHACOOAktHX4YLhvXLv1Y8e41uV63Wvw7Z2uce37tS/GtTaXNkfVUubPnaGHE8ABJ4CzLDTJ9Dtu35Zw/z04LYUADjgBHHACOOCAE8ABJ4ADTgAHHHACOOAEcMAJ4IADTjwB/9XLjkB2EJvLq0uDZ3t5OuZPq2cZ5gLg+Wic/Nztg52Ppmd7qW2tr7ya3vK8Pxqrk8caKkni+wjIhrnq/h6osme6FbhWavOgf+WzR9zRvcpbyu2bN14Xb/SdDq5ULdEvRZaFjbS2mGi9FvORXUuS58XB96LU1hNWHaL5I8AAi1XlrYdFnTIAAAAASUVORK5CYII=) center center no-repeat; +} + +.gallery-item--audio .gallery-item__thumbnail { + background: #fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABH1JREFUeNrsnE9u2kAUxp2oe7gB9AThAJVwThB6Alype8i2m7Dqtsm+UuAG9ASxpe4DNzA3ICdI50mvKYV5D57/xcbfk6wqUDz2z998881gc/H6+hqgqqsLAAdwAEcBOICjABzAUQAO4ACOAnAARwE4gKMAHMABHAXgJdanr99nO39uf//8dg/g5QLfh7Fw0KMi27gEZrXG7iLMAbx66BGAl1Nr4fVHB30A4MVXqEBfOuhdAC+w3AC5Zegbz9s9t+X281qnFFYURbM+KayMmCa0S/YRu63jefvaHUd8dsDdSYesqN7Oyx/dyaYZ90cXa9eHp25fK+X/T90/Pzxvbdzn+mdjKaRqhvO0BztgpWctgj3c2WJtIOTelPisZW+C1FzgO115UkFznRMGQoqDL57Xp1kH0MsawSbVPLvtqsJmqQctFZWnPIb4Lta0kcBJ1W4jL70ruSkpYQzZr6W6F1JL1DjgfKJxFap2aiXgt8LbM3csfSUqzgQvjxoBnE7ObTGngE6FOZvUuhAsQhsIl4KXj2oPnFWx4qTwHjUVLGLMUVRSuc+SbqyD54ccaaKb8WRvyuo1e7FxxaAO4PFFfxJ8OVa8fCKofF6awvlgn/mArdtNicqN9tqKFWuJhYw9Vrw8FdZZRmVbymNDlkaueAIlleTZI2PSCRs90yy4Joovx4JiteTh6zUdy9LtOQHfGvN3IExqrhRbWQlpJWwd8CNrH5ES9wIjQN+CV7+tliKufShxb20E7rOVVlqKtvYh2oQAUFNsCoWf5tmhwSKGRuC91gJnlScGFaZVHt+5xsKVQeFpAftuPfCtsUf4ZtTaugqAN6VaD1xZ7VsB+OkVGgAOLNYhWU1rgbNih4bBsVvl8Z2jwkeGCY6k8ETZv+8CvbQSOKt75nlro9z0Exqj4iCP35+bwu+FWd9c+czQCHCQJ8tfnpG6yUrGQne/Vz5jsR8AP5Y2yGKUyUpksR9eAOsZL1Crcngi3XHL8HzfsS6NcTOw3E2bBfi6IbA3gf795Ex4fW5MQEnZsTCsKfQ4+He/Cd3sM1ImLwPB7xPFTroZesRBme9L4ZPI9LwLD1KkoMLvtuJu3TekGYvqJb83A6/Uwx2UJUP59Y5pZiZEweSIF/u+pltbHxCofNCkHuI2UvpnywytINhkh3dWdfOX0D1DT6lfStlR+6Ii2AOl+z9kUPeL1U7ePRay2kk914H/BsuiZ6EdIXUdU7fvdup5li8japHDWV2kwIeKmyaVRkqa6SoXI9MTdbWZ+LDapxWp/S15aE+yMeyeYEFpo4GfqPZtgU194XFEG2AnQq+YZW207g/Ghtx1yUNz/5QG+zHZxFJTKFtJKnj+bZ4HdBvxeym07pG1C2dsbyUMlJTVwzz7xg/UHMKeB/Iy7yDvhQfw02D/9fx53jZwX8r/JcFeFAEbwE+rpMjfvQJwvWgWOipyhwB+CPhN2W4L895LiEHz+MBJk65tWTEUwCsuAAdwAEcBOICjABzAUQAO4ACOAnAARwE4gKMAHMDbUH8EGABZtyoqqLbafgAAAABJRU5ErkJggg==) center center no-repeat; +} + +.gallery-item--video .gallery-item__thumbnail { + background: #fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAjFJREFUeNrs3UFOwkAUxvFi2MMN9Abq3kRuoDegC/eyZmPduLXuSYATiCegJOzFE1huQE+Ar+E1BBITF/I60/l/yYTEhW1+TvoN00lsbbfbiNjlDALAASeAA04AB5wADjjgBHDACeCAE8ABB5wADjgBHHBSpV3XhW8eXjL5uJXxJWOwHA2zEMBbdRyTEOyefMyPfryQEQt8ziPFJuVs/5Y/xkTGBeB26ctYCXoiowu4TToynmTkgh4Dbgs/FvRcn/uAG+W8LNlyZSPjCnDbYv30uVh9/eLT1xWNd8Xq+zfNqlgHgNsW66sW6z3gtsX6rsXaA9y2WOeuFmuTdwurYk1dKtYQtmcftVgTwI23CrRYY8Bti3VcZ7GG+sanKtaZdbGG/ortLtrvwXcBt13R5BZbBYAfFWu0e/kRA25frKtTbAUD/nsuZaSA24YZbpwB4DYpz8hcL0fDyX//4ja2B1lHu8NI2akuAPgeOjnFjAb8MIWuRFLB3lhcMGTwabQ7RLqxvGiI4LUeGg0J3Ilj0SGAmxVi6OCFlmHi0k01FfxNZ/XGtRtrGviHPqdzV2+wKeALndGZ6zfqO7hThdhk8EKhU99u3EfwZ8uv4iGDT3VW55HH8QHcm0L0HXytS7xZk9atLoIXCj2JGpi2Y9Cme9Mhga8UuNOkQvxLWnX9Dwg9RFmOPATo2sFDDcckAAecAA44ARxwAjjggBPAASeAA04ABxxwAjjgBHDACeB15UeAAQBIj8DeaiiktQAAAABJRU5ErkJggg==) center center no-repeat; +} + +.gallery-item--document .gallery-item__thumbnail { + background: #fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAsFJREFUeNrs3c1qE1EYxvF3JjNNbUQjaEs2re4URMGVUIrQhVtxJ+hCvARdWXAjgrioKy9ARNdegEWEXoAgBXWT0m5Cq2hsPptpEicpgguVJM15T4/n/8CQTWc6/fXMc85MUhp0u10heolG2alYLObTl+fpds2FHzKOY4mi6F6hUHhq+1zCEfd75wr2rwRBsFwqle46B56O7tvpy0UXL+fDgD7KCD/tcofaRg/Fw9hE9xLcJrq34LbQvQa3ge49uDY64MrogCujA66MDrgyOuDK6IArowOujA64MjrgyuiAK6MDrowOuDI64MrokcmT+vqjJqsf1o0c++zstJybmx7oa6v1plQaOyZOY3nYTwIYBf9Srsnr1TUjx76+cH5g8GyckUq9I9XGrvUrw5tKOXk8J0ePZAH3Dd27SdM2utEOn5vJy/2bi0aOfSqfOxB6fzK10OlGwacmJwae2GyMdBvoXq/DbdSL9zc+2ujcaSqjG+3wjxvb8vjVW+d+AQ/vXGWE/y8B/A8xWS+AK3e60Q7PTcb9p3quoptYpxsFn505IUu3Fp0e6eNGp1KU6wVwZXTAldGNdni92ZKNrbJzuH974DaOTjcK3sN28U7zxdINYxMplaJcLxF8B1syMsIPObqzb7G5Gm/fYrMVKgVwwIkrHb659V1evnlv5NgLF870N8B/S62ZyKfNbdXbbyqFAA44k+b4evZfT94Y4QRwwAnggBPAAQecAA44ARxwAjjggBPAASeAA04ABxxwAjjgBHDAiQHwcrUxAdt+mq098+CN3STu8I+r+2klCuBJuxN+26mDnbR7V/vQ+4306dne35nvtTtybCorYejfNNBoJVKpNWWUK31o8EBkfb+/kv7md4Kq8Uq5cvnSs/QbfabBRTJh8ERlWZiNM/NhEKz4PLIzYfggHXyPht6zy4pDNT8FGAAqQOmy57wEGAAAAABJRU5ErkJggg==) center center no-repeat; +} + +.gallery-item--false .gallery-item__thumbnail { + background: #fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAfdJREFUeNrs3TtOw0AYReGZiU3EQ0BBk44dIFEhUbAEtsAaoKajoYCKBbAQCrZBE8p0CCUmTuIkxknEAmwpd7D+cyTLlfP4NB6PpTx8WZaOdCVNDur3+8fV7rXartvwJtM0dUmS3PV6vefYryU0PO69Ldh/ee+fBoPBbevAq9F9U+3O2ng6/wf0JiP8tM1zaGz04AwWE90keEx0s+Cx0E2Dx0A3D65GB1yMDrgYHXAxOuBidMDF6ICL0QEXowMuRgdcjA64GB1wMTrgYnTAxeiJBZxsPHGjfLiNh36q+0kAE+DdtONG46XL8mn012JmSjk52ncHu13AraGbu2jGRje5SomJbnZZGAvd9Do8Brr5Gx81OneaYnTAxeiAi9EBF6MDLkYHXIwOuBgdcDE64GJ0wMXogIvRARejAy5GT+Brjs4IbwE64OIABxxwAhxwAhxwAhxwwAlwwAlwwAlwwAEnwAEnwAEnwAEHnAAHnAAHnAAHHHACHHACHHACvGXg31m+A9umyWy+ffB8WqRL/rh63awQgBeLZfgajsEuFquzvfZxjb6JvPpZ6Pli6Q73ui4Ee5eBfFa40c/ENTnTa4N75z4381ex3mzns61PKVcX5y/VE30wgzvXCf5Rsizspp3L4P2b5ZHdCeG+GnwPtY8sWXFI+xVgAB+AqE72La37AAAAAElFTkSuQmCC) center center no-repeat; +} + +.gallery-item__upload-progress { + height: 18px; + width: 75%; + position: absolute; + top: calc(50% - 40px / 2); + left: 50%; + transform: translateX(-50%) translateY(-50%); + border-radius: 10px; + overflow: hidden; + background-color: rgb(174.4886363636, 186.3068181818, 205.5113636364); +} +.gallery-item__upload-progress + .gallery-item__title .gallery-item__checkbox-label:before { + color: #43536d; +} + +.gallery-item__progress-bar { + height: 100%; + background: #0071c4; + transition: width 0.5s ease; + width: 0%; +} + +.gallery-item__status-flags { + grid-column: 1; + grid-row: 1; +} + +.gallery-item__status-icons { + grid-column: 2; + grid-row: 1; + display: flex; + flex-direction: column; + margin: 8px 8px 0 auto; + text-align: right; +} +.gallery-item__status-icons .file-status-icon { + cursor: pointer; +} +.gallery-item__status-icons .file-status-icon + .file-status-icon { + margin-top: 6px; +} + +.gallery-item--draft, +.gallery-item--modified { + display: block; + width: 8px; + height: 8px; + box-shadow: 0 0 1px 0.5px #fff; + border-radius: 100%; + z-index: 1; + margin: 5px 0 0 5px; +} +.gallery-item--draft:hover:after, +.gallery-item--modified:hover:after { + font-size: 0.75rem; + font-weight: 200; + position: absolute; + top: 0; + left: 0; + color: #fff; + margin: 3px 0 0 18px; +} + +.gallery-item--draft { + background-color: #ff7f22; + border: 1px solid #cf3f00; +} +.gallery-item--draft:hover:after { + content: "DRAFT"; +} + +.gallery-item--modified { + background-color: #fff7f0; + border: 1px solid #cf3f00; +} +.gallery-item--modified:hover:after { + content: "MODIFIED"; +} + +.gallery-item--max-selected { + opacity: 0.2; +} +.gallery-item--max-selected .gallery-item__checkbox-label, .gallery-item--max-selected .gallery-item__checkbox-label:before { + cursor: not-allowed; +} + +.gallery-item--dragging { + opacity: 0.2; +} +.gallery-item--dragging.gallery-item { + cursor: grabbing; +} +.gallery-item__drag-layer-item .gallery-item--dragging { + opacity: 1; +} + +.gallery-item__drag-layer { + position: fixed; + inset: 0; + pointer-events: none; + z-index: 100; +} + +.gallery-item__drag-layer-preview { + transform: scale(0.4); + border: 1px solid #29abe2; +} +.gallery-item__drag-layer-preview .gallery-item__thumbnail, +.gallery-item__drag-layer-preview .gallery-item__drag-layer-count { + transform: scale(2.5); +} + +.gallery-item__drag-layer-item { + display: inline-block; + position: relative; + opacity: 1; +} +.gallery-item__drag-layer-item .gallery-item { + border-width: 2px; + z-index: 104; + height: 134px; +} +.gallery-item__drag-layer-item .gallery-item__title { + display: none; +} + +.gallery-item__drag-layer-count { + display: inline-block; + position: absolute; + font-size: 1rem; + top: 0; + right: 0; + z-index: 105; +} + +.gallery-item__badge { + display: inline-block; + position: absolute; + font-size: 1rem; + top: -0.5rem; + right: -0.5rem; + z-index: 99; +} + +.gallery-item__drag-shadow { + display: inline-block; + position: absolute; + inset: 0; + transform: translate(0.75rem, -0.75rem); + z-index: 103; + border: 2px solid #29abe2; + background: #fff; +} +.gallery-item__drag-shadow.gallery-item__drag-shadow--second { + transform: translate(1.5rem, -1.5rem); + z-index: 102; +} + +.bulk-actions { + display: flex; + flex-wrap: wrap; + align-items: flex-start; + justify-content: flex-start; + width: 100%; + padding: 0.76925rem 1.5385rem; + margin: 0 auto; + position: absolute; + height: 53px; + z-index: 2; + bottom: 0; + background-color: rgb(243.9761363636, 245.5943181818, 248.2238636364); + transition: top 0.5s ease-in-out, transform 0.5s ease-in-out; + transform: scale(1); + min-width: 160px; + border-top: 1px solid rgb(218.7079545455, 224.0352272727, 232.6920454545); +} +.bulk-actions-enter { + bottom: -53px; +} +.bulk-actions-enter-active { + bottom: 0; + transition: bottom 0.2s ease-out; +} +.bulk-actions-leave { + bottom: 0; +} +.bulk-actions-leave-active { + bottom: -53px; + transition: bottom 0.2s ease-in-out 0.1s; +} +.bulk-actions .bulk-actions-counter { + vertical-align: middle; + padding: 5px 12px 5px 8px; + margin-right: 8px; + line-height: 1.5384; + color: #fff; + text-align: center; + background-color: #0071c4; + border-radius: 0.23rem; + font-weight: bold; +} +.bulk-actions .bulk-actions-counter.btn-secondary:hover, .bulk-actions .bulk-actions-counter.btn-secondary:focus, .bulk-actions .bulk-actions-counter.btn-secondary:focus-visible { + background-color: #005a93; + border-color: #005a93; + color: #fff; +} +.bulk-actions .bulk-actions-select-all button { + color: #0071c4; + font-weight: bold; +} +.bulk-actions .bulk-actions__action.ss-ui-button { + line-height: 1.5384; + margin-bottom: 0; + height: 32px; +} +.bulk-actions .bulk-actions__action.ss-ui-button[class*=font-icon-]:before { + font-size: 20px; + line-height: 18px; + position: relative; + top: -1px; + vertical-align: middle; +} +.bulk-actions .chosen-single { + border-radius: 5px 0 0 5px; + border: 0; + filter: none; + background: none; + box-shadow: none; + color: inherit; +} +.bulk-actions .chosen-single:focus { + box-shadow: 0 0 3px rgba(0, 0, 0, 0.2); +} +.bulk-actions .chosen-single > span { + text-align: left; + display: inline-block; + margin-right: 0; +} +.bulk-actions .chosen-single > div { + position: static; + display: inline-block; +} +.bulk-actions .chosen-drop { + border-radius: 3px; + box-shadow: 0 0 3px rgba(0, 0, 0, 0.2); + border: 0; +} +.bulk-actions .search-choice-close { + display: none; +} +.bulk-actions .chosen-results li { + padding-left: 22px; + position: relative; +} +.bulk-actions .chosen-results li:before { + position: absolute; + font-family: "silverstripe"; + left: 4px; + font-size: 14px; + vertical-align: middle; + margin-right: 4px; +} +.bulk-actions .chosen-results li:nth-child(1):before { + content: "g"; +} + +.asset-dropzone:after { + position: absolute; + inset: 0 -1.5385rem 0 -1.5385rem; + background: rgba(250.2931818182, 250.9840909091, 252.1068181818, 0.9) url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSItMzU1IDIyMi41IDMxMiAzMjQuNSIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAtMzU1IDIyMi41IDMxMiAzMjQuNSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8cGF0aCBmaWxsPSIjMkM3RUIwIiBkPSJNLTE0Mi43LDM3NC40Yy0yLjgsMC01LjYsMC4yLTguMywwLjdjLTYuNy0yMi0yNy42LTM4LTUyLjMtMzhjLTMwLjEsMC01NC41LDIzLjktNTQuNSw1My4zDQoJYzAsMi42LDAuMiw1LjIsMC42LDcuN2MtMS40LTAuMi0yLjktMC4zLTQuNC0wLjNjLTIwLjUsMC0zNy4xLDE2LjItMzcuMSwzNi4zYzAsMjAsMTYuNiwzNi4zLDM3LjEsMzYuM2g1MS4xdi0zOC42bC0yMS41LTAuMw0KCWwzNS45LTUxLjNsMzUuOSw1MS4zbC0yMS41LDAuM3YzOC42aDM5LjFjMjcuMSwwLDQ5LjEtMjEuNSw0OS4xLTQ4Qy05My42LDM5NS45LTExNS42LDM3NC40LTE0Mi43LDM3NC40eiIvPg0KPHBhdGggZmlsbD0iIzJDN0VCMCIgZD0iTS0yNzcuMSw1MzcuNHYtMjIuOWg3LjljMS44LDAsMy4xLDAuMSw0LjEsMC4zYzEuMywwLjMsMi40LDAuOCwzLjQsMS42YzEuMiwxLDIuMSwyLjMsMi43LDMuOQ0KCWMwLjYsMS42LDAuOSwzLjQsMC45LDUuNGMwLDEuNy0wLjIsMy4zLTAuNiw0LjZzLTAuOSwyLjUtMS42LDMuM2MtMC42LDAuOS0xLjMsMS42LTIuMSwyLjFjLTAuOCwwLjUtMS43LDAuOS0yLjcsMS4xDQoJYy0xLjEsMC4zLTIuMywwLjQtMy43LDAuNGgtOC4zVjUzNy40eiBNLTI3NCw1MzQuN2g0LjljMS41LDAsMi43LTAuMSwzLjYtMC40czEuNS0wLjcsMi4xLTEuMmMwLjctMC43LDEuMy0xLjcsMS43LTIuOQ0KCWMwLjQtMS4yLDAuNi0yLjcsMC42LTQuNGMwLTIuNC0wLjQtNC4yLTEuMi01LjVjLTAuOC0xLjMtMS43LTIuMS0yLjktMi42Yy0wLjgtMC4zLTIuMS0wLjUtMy45LTAuNWgtNC44djE3LjVILTI3NHogTS0yNTUuNCw1MzcuNA0KCXYtMTYuNmgyLjV2Mi41YzAuNi0xLjIsMS4yLTIsMS44LTIuM3MxLjEtMC42LDEuOC0wLjZjMC45LDAsMS45LDAuMywyLjksMC45bC0xLDIuNmMtMC43LTAuNC0xLjQtMC42LTIuMS0wLjYNCgljLTAuNiwwLTEuMiwwLjItMS43LDAuNmMtMC41LDAuNC0wLjgsMC45LTEsMS41Yy0wLjMsMS0wLjUsMi4xLTAuNSwzLjN2OC43TC0yNTUuNCw1MzcuNEwtMjU1LjQsNTM3LjR6IE0tMjM0LjQsNTM1LjQNCgljLTEsMC45LTIsMS41LTMsMS45cy0yLDAuNS0zLjEsMC41Yy0xLjgsMC0zLjItMC40LTQuMi0xLjNjLTEtMC45LTEuNS0yLTEuNS0zLjRjMC0wLjgsMC4yLTEuNiwwLjYtMi4yYzAuNC0wLjcsMC45LTEuMiwxLjUtMS42DQoJYzAuNi0wLjQsMS4zLTAuNywyLTAuOWMwLjYtMC4xLDEuNC0wLjMsMi41LTAuNGMyLjMtMC4zLDMuOS0wLjYsNS0xYzAtMC40LDAtMC42LDAtMC43YzAtMS4xLTAuMy0yLTAuOC0yLjRjLTAuNy0wLjYtMS44LTEtMy4yLTENCgljLTEuMywwLTIuMywwLjItMi45LDAuN2MtMC42LDAuNS0xLjEsMS4zLTEuNCwyLjVsLTIuOC0wLjRjMC4yLTEuMiwwLjctMi4xLDEuMi0yLjljMC42LTAuNywxLjQtMS4zLDIuNS0xLjdzMi4zLTAuNiwzLjgtMC42DQoJYzEuNCwwLDIuNiwwLjIsMy41LDAuNXMxLjUsMC44LDIsMS4zYzAuNCwwLjUsMC43LDEuMSwwLjksMS45YzAuMSwwLjUsMC4xLDEuMywwLjEsMi42djMuOGMwLDIuNiwwLjEsNC4zLDAuMiw1DQoJYzAuMSwwLjcsMC40LDEuNCwwLjcsMmgtMi45Qy0yMzQuMSw1MzYuOS0yMzQuMyw1MzYuMi0yMzQuNCw1MzUuNHogTS0yMzQuNiw1MjkuMWMtMSwwLjQtMi42LDAuOC00LjYsMS4xYy0xLjIsMC4yLTIsMC40LTIuNSwwLjYNCgljLTAuNSwwLjItMC44LDAuNS0xLjEsMC45cy0wLjQsMC44LTAuNCwxLjNjMCwwLjgsMC4zLDEuNCwwLjksMS45YzAuNiwwLjUsMS40LDAuOCwyLjUsMC44czItMC4yLDIuOS0wLjdjMC44LTAuNSwxLjUtMS4xLDEuOS0xLjkNCgljMC4zLTAuNiwwLjUtMS42LDAuNS0yLjhMLTIzNC42LDUyOS4xTC0yMzQuNiw1MjkuMXogTS0yMjguNCw1MzguOGwyLjcsMC40YzAuMSwwLjgsMC40LDEuNSwxLDEuOGMwLjcsMC41LDEuNywwLjgsMi45LDAuOA0KCWMxLjMsMCwyLjMtMC4zLDMtMC44czEuMi0xLjIsMS40LTIuMmMwLjEtMC42LDAuMi0xLjgsMC4yLTMuNmMtMS4yLDEuNC0yLjgsMi4yLTQuNiwyLjJjLTIuMywwLTQtMC44LTUuMy0yLjUNCgljLTEuMi0xLjYtMS45LTMuNi0xLjktNS45YzAtMS42LDAuMy0zLDAuOS00LjRjMC42LTEuMywxLjQtMi40LDIuNS0zLjFjMS4xLTAuNywyLjQtMS4xLDMuOC0xLjFjMiwwLDMuNiwwLjgsNC44LDIuNHYtMmgyLjZ2MTQuMw0KCWMwLDIuNi0wLjMsNC40LTAuOCw1LjVzLTEuNCwxLjktMi41LDIuNnMtMi41LDAuOS00LjIsMC45Yy0yLDAtMy42LTAuNC00LjgtMS4zUy0yMjguNCw1NDAuNi0yMjguNCw1MzguOHogTS0yMjYsNTI4LjgNCgljMCwyLjIsMC40LDMuOCwxLjMsNC44YzAuOSwxLDEuOSwxLjUsMy4yLDEuNXMyLjQtMC41LDMuMi0xLjVjMC45LTEsMS4zLTIuNiwxLjMtNC43YzAtMi0wLjUtMy42LTEuNC00LjZzLTItMS41LTMuMy0xLjUNCgljLTEuMiwwLTIuMywwLjUtMy4yLDEuNVMtMjI2LDUyNi44LTIyNiw1MjguOHogTS0xODksNTM0LjdjLTAuOSwxLTEuOSwxLjgtMywyLjNzLTIuMywwLjgtMy41LDAuOGMtMi4zLDAtNC4yLTAuOC01LjYtMi40DQoJYy0xLjEtMS4zLTEuNy0yLjctMS43LTQuM2MwLTEuNCwwLjUtMi43LDEuNC0zLjhzMi4zLTIuMSw0LjEtM2MtMS0xLjItMS43LTIuMi0yLjEtMi45Yy0wLjMtMC43LTAuNS0xLjUtMC41LTIuMQ0KCWMwLTEuNCwwLjUtMi42LDEuNi0zLjZzMi40LTEuNSw0LjEtMS41YzEuNiwwLDIuOCwwLjUsMy44LDEuNGMxLDEsMS41LDIuMSwxLjUsMy41YzAsMi4yLTEuNCw0LTQuMyw1LjZsNC4xLDUuMg0KCWMwLjUtMC45LDAuOC0yLDEuMS0zLjJsMi45LDAuNmMtMC41LDItMS4yLDMuNi0yLDQuOWMxLjEsMS40LDIuMiwyLjYsMy42LDMuNWwtMS45LDIuMkMtMTg2LjYsNTM3LjItMTg3LjgsNTM2LjItMTg5LDUzNC43eg0KCSBNLTE5MC43LDUzMi41bC01LjItNi40Yy0xLjUsMC45LTIuNSwxLjctMy4xLDIuNWMtMC41LDAuOC0wLjgsMS41LTAuOCwyLjNjMCwwLjksMC40LDEuOSwxLjEsMi45YzAuNywxLDEuOCwxLjUsMy4xLDEuNQ0KCWMwLjgsMCwxLjctMC4zLDIuNi0wLjhDLTE5Miw1MzQtMTkxLjMsNTMzLjMtMTkwLjcsNTMyLjV6IE0tMTk0LjcsNTIyLjhjMS4yLTAuNywyLTEuMywyLjQtMS45YzAuNC0wLjUsMC41LTEuMSwwLjUtMS44DQoJYzAtMC44LTAuMi0xLjQtMC43LTEuOXMtMS4xLTAuNy0xLjktMC43Yy0wLjgsMC0xLjQsMC4yLTEuOSwwLjdzLTAuOCwxLjEtMC44LDEuOGMwLDAuNCwwLjEsMC43LDAuMywxLjFjMC4yLDAuNCwwLjUsMC44LDAuOCwxLjINCglMLTE5NC43LDUyMi44eiBNLTE2Miw1MzcuNHYtMi4xYy0xLjEsMS42LTIuNiwyLjUtNC42LDIuNWMtMS4zLDAtMi41LTAuNC0zLjYtMS4xcy0yLTEuNy0yLjYtMy4xYy0wLjYtMS4zLTAuOS0yLjgtMC45LTQuNQ0KCXMwLjMtMy4yLDAuOC00LjVjMC42LTEuMywxLjQtMi40LDIuNS0zLjFjMS4xLTAuNywyLjMtMS4xLDMuNy0xLjFjMSwwLDEuOSwwLjIsMi43LDAuNnMxLjQsMSwxLjksMS42di04LjJoMi44djIyLjlMLTE2Miw1MzcuNA0KCUwtMTYyLDUzNy40eiBNLTE3MC45LDUyOS4yYzAsMi4xLDAuNCwzLjcsMS4zLDQuOGMwLjksMS4xLDIsMS42LDMuMiwxLjZzMi4zLTAuNSwzLjEtMS41YzAuOS0xLDEuMy0yLjUsMS4zLTQuNg0KCWMwLTIuMy0wLjQtMy45LTEuMy01cy0yLTEuNi0zLjItMS42cy0yLjMsMC41LTMuMSwxLjVDLTE3MC40LDUyNS4zLTE3MC45LDUyNy0xNzAuOSw1MjkuMnogTS0xNTUuNCw1MzcuNHYtMTYuNmgyLjV2Mi41DQoJYzAuNi0xLjIsMS4yLTIsMS44LTIuM3MxLjEtMC42LDEuOC0wLjZjMC45LDAsMS45LDAuMywyLjksMC45bC0xLDIuNmMtMC43LTAuNC0xLjQtMC42LTIuMS0wLjZjLTAuNiwwLTEuMiwwLjItMS43LDAuNg0KCWMtMC41LDAuNC0wLjgsMC45LTEsMS41Yy0wLjMsMS0wLjUsMi4xLTAuNSwzLjN2OC43TC0xNTUuNCw1MzcuNEwtMTU1LjQsNTM3LjR6IE0tMTQ2LjIsNTI5LjFjMC0zLjEsMC45LTUuMywyLjYtNi44DQoJYzEuNC0xLjIsMy4yLTEuOCw1LjItMS44YzIuMywwLDQuMSwwLjcsNS42LDIuMmMxLjQsMS41LDIuMiwzLjYsMi4yLDYuMmMwLDIuMS0wLjMsMy44LTEsNWMtMC42LDEuMi0xLjYsMi4yLTIuOCwyLjlzLTIuNiwxLTQsMQ0KCWMtMi4zLDAtNC4yLTAuNy01LjYtMi4yQy0xNDUuNSw1MzQuMS0xNDYuMiw1MzEuOS0xNDYuMiw1MjkuMXogTS0xNDMuMyw1MjkuMWMwLDIuMSwwLjUsMy43LDEuNCw0LjhzMi4xLDEuNiwzLjUsMS42DQoJczIuNi0wLjUsMy41LTEuNnMxLjQtMi43LDEuNC00LjljMC0yLjEtMC41LTMuNi0xLjQtNC43Yy0wLjktMS4xLTIuMS0xLjYtMy41LTEuNnMtMi42LDAuNS0zLjUsMS42DQoJQy0xNDIuOSw1MjUuNC0xNDMuMyw1MjctMTQzLjMsNTI5LjF6IE0tMTI3LjgsNTQzLjh2LTIzaDIuNnYyLjJjMC42LTAuOCwxLjMtMS41LDItMS45YzAuOC0wLjQsMS43LTAuNiwyLjgtMC42DQoJYzEuNCwwLDIuNywwLjQsMy44LDEuMWMxLjEsMC43LDEuOSwxLjgsMi41LDMuMXMwLjgsMi44LDAuOCw0LjRjMCwxLjctMC4zLDMuMi0wLjksNC42cy0xLjUsMi40LTIuNywzLjFjLTEuMiwwLjctMi40LDEuMS0zLjcsMS4xDQoJYy0wLjksMC0xLjgtMC4yLTIuNS0wLjZjLTAuNy0wLjQtMS40LTAuOS0xLjgtMS41djguMUwtMTI3LjgsNTQzLjhMLTEyNy44LDU0My44eiBNLTEyNS4zLDUyOS4yYzAsMi4xLDAuNCwzLjcsMS4zLDQuNw0KCXMxLjksMS41LDMuMSwxLjVzMi4zLTAuNSwzLjItMS42YzAuOS0xLjEsMS4zLTIuNywxLjMtNC45YzAtMi4xLTAuNC0zLjctMS4zLTQuOHMtMS45LTEuNi0zLjEtMS42cy0yLjMsMC42LTMuMiwxLjcNCglDLTEyNC44LDUyNS41LTEyNS4zLDUyNy4xLTEyNS4zLDUyOS4yeiIvPg0KPHBhdGggZmlsbD0iIzJDN0VCMCIgZD0iTS0xNzIuNSwyNDEuNWwtMi44LTE2LjFsLTU2LjUsOS45bDguMyw0Ny4ybDUuNi0wLjl2NC4xaDU3LjR2LTQ0LjFoLTEyVjI0MS41eiBNLTIxNy45LDI3Ni44bC0xLjgsMC4zDQoJbC02LjctMzguMWw0Ny40LTguNGwxLjksMTAuOGgtNDAuN3YzNS40SC0yMTcuOXogTS0xNjUuMiwyODAuOWgtNDguMXYtMzQuOGg0OC4xVjI4MC45eiBNLTIxMC4xLDI0OS4yVjI3NWw5LjgtNi41bDYsMy44bDE0LjctMTYuMQ0KCWwxLjksMC44bDkuNSwxMXYtMTguN0wtMjEwLjEsMjQ5LjJMLTIxMC4xLDI0OS4yeiBNLTIwMC44LDI2MC40Yy0yLjIsMC00LjEtMS45LTQuMS00LjFjMC0yLjIsMS45LTQuMSw0LjEtNC4xDQoJYzIuMiwwLDQuMSwxLjksNC4xLDQuMUMtMTk2LjcsMjU4LjUtMTk4LjYsMjYwLjQtMjAwLjgsMjYwLjR6Ii8+DQo8cGF0aCBmaWxsPSIjMkM3RUIwIiBkPSJNLTMzMS41LDI3Ny44djM1LjRjLTItMC45LTQuNi0xLjEtNy4xLTAuNmMtNS40LDEuMi05LjEsNS42LTguMyw5LjhjMC43LDMuNCw0LjMsNS45LDguNyw1LjkNCgljMC45LDAsMS44LTAuMSwyLjctMC4zYzQuNy0xLDguMi00LjUsOC40LTguM3YtMzMuMWwyNi4xLTMuOXYyNS44Yy0yLTAuOS00LjYtMS4xLTcuMS0wLjZjLTUuNCwxLjItOS4xLDUuNi04LjMsOS44DQoJYzAuNywzLjQsNC4zLDUuOSw4LjcsNS45bDAsMGMwLjksMCwxLjgtMC4xLDIuNy0wLjNjNC43LTEsOC4yLTQuNSw4LjQtOC4zdi00Mi4xTC0zMzEuNSwyNzcuOHoiLz4NCjxwYXRoIGZpbGw9IiMyQzdFQjAiIGQ9Ik0tNTIuNywzMTkuM3YtNi43aDYuN3YtNy41aC02Ljd2LTYuN2g2Ljd2LTYuN2gtNi43di03LjVoNi43di02LjdoLTY1LjF2Ni43aDYuN3Y3LjVoLTYuN3Y2LjdoNi43djYuN2gtNi43DQoJdjcuNWg2Ljd2Ni43aC02Ljd2Ni43SC00NnYtNi43SC01Mi43eiBNLTgyLjgsMzA5LjF2LTEzLjlsMTIuMSw3TC04Mi44LDMwOS4xeiIvPg0KPC9zdmc+DQo=) center center no-repeat; + background-size: 312px 325px; + z-index: 100; +} +.asset-dropzone.dragging:after { + content: ""; +} + +.asset-dropzone--button { + position: static; +} + +.uploadfield__dropzone { + position: relative; + inset: 0 auto auto 0; + margin: 0 0 10px; + border-width: 2px; + border-style: dashed; + border-color: rgb(193.4397727273, 202.4761363636, 217.1602272727); + border-radius: 5px; + padding: 0; + background: white; + height: 78px; +} +.uploadfield__dropzone:after { + inset: 0; + box-shadow: inset 0 0 10px 0 rgba(0, 0, 0, 0.2); + background: rgba(0, 0, 0, 0.03); +} + +.uploadfield__dropzone--hidden { + display: none; +} + +.uploadfield__backdrop { + position: absolute; + inset: 0; + cursor: pointer; +} + +.uploadfield__join:before, .uploadfield__join:after { + content: " "; + display: inline; +} + +.uploadfield__upload-button, +.uploadfield__add-button { + border: 0; + margin: 0; + padding: 0; + background: none; + text-decoration: none; + color: #0071c4; +} +.uploadfield__upload-button:hover, +.uploadfield__add-button:hover { + color: rgb(0, 98.2984693878, 170.5); + text-decoration: underline; +} + +.uploadfield__droptext { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + display: inline-block; + text-align: center; +} +.uploadfield__droptext a, .uploadfield__droptext button { + cursor: pointer; +} +.uploadfield__droptext:before { + font-family: "silverstripe", sans-serif; + content: "v"; + font-size: 1.7em; + padding-right: 20px; + vertical-align: middle; +} + +.uploadfield-item { + position: relative; + margin: 0; + background-color: #fff; + border: 1px solid; + border-color: rgb(206.0738636364, 213.2556818182, 224.9261363636); + border-bottom-width: 0; + width: auto; + transition: box-shadow 0.3s; + height: 61px; +} +.uploadfield-item:first-child { + border-top-left-radius: 0.192rem; + border-top-right-radius: 0.192rem; +} +.uploadfield-item:last-child { + border-bottom-width: 1px; + height: 62px; + border-bottom-left-radius: 0.192rem; + border-bottom-right-radius: 0.192rem; +} +.uploadfield-item:not(.uploadfield-item--error, .uploadfield-item--folder):hover .uploadfield-item--overlay { + opacity: 1; + display: block; +} + +.uploadfield__dropzone + .uploadfield-item { + border-top-left-radius: 0.192rem; + border-top-right-radius: 0.192rem; +} + +.uploadfield-item__thumbnail { + height: 60px; + width: 60px; + margin: 0; + background-repeat: no-repeat; + background-position: center center; + background-size: cover; + border-radius: 0.192rem 0.192rem 0 0; +} + +.uploadfield-item--folder .uploadfield-item__thumbnail { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGFJREFUeNpi1Jhy/D8D6cDxRo7lAQYaACYy9Tkw0AiQ6yD7weYgB83VjwRo4SBGoMH/GQYRYGIYZGDUQaMOGnXQqINGHTTqoFEHjTpo1EGjDhp10KiDRh006qDB7SCAAAMAe8YKeWd2MukAAAAASUVORK5CYII=) 12px 14px no-repeat; + background-size: 27px 24px; +} + +.uploadfield-item__thumbnail--small { + background-size: auto; + background-color: #fff; +} + +.uploadfield-item__details { + padding: 11px 0 11px 12px; + height: 100%; + margin: 0; + box-sizing: border-box; + position: relative; + width: 50px; + justify-content: center; +} + +.uploadfield-item__title { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.uploadfield-item__meta { + font-size: 0.846rem; + text-transform: uppercase; + display: flex; + align-items: center; +} +.uploadfield-item__meta .file-status-icon { + margin-left: 6px; +} + +.uploadfield-item__specs { + color: rgb(86.4147727273, 107.0511363636, 140.5852272727); +} + +.uploadfield-item__remove-btn { + margin: 0; +} + +.uploadfield-item--archive .uploadfield-item__thumbnail { + background: #fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAArlJREFUeNrs3c9qE1EUx/F7JxmDf/APSCWbancK/kFXQi1CXkDciKCIz6ArC+6k4KKufAARBXe+QBGhDyAUF7pJoZtgF1aamEkzTeIkBdf3jp1z7/V+fxCyOZMMH2ZO7klmiJ5MJorIRduCt9vt08XTm+Jx5zB3ZOXdJ/Vta9uo9tmDlrp0fs6oNk1TVa/XnzabzVc+gCcltvl82NiVH1Var3Y6nSfBgRdH9+Pi6VqQp7In6LZH+IWg+6cH6ImKLK7RowN3jR4luEv0aMFdoUcN7gI9enBp9HqIQOsbm8ZT6b3WdRt0VfVE6g348sOWce2jlQ/GtabgUui0FOH2ArgwOuDC6IALowMujA64MDrgwuiAC6MDLozuzaT5cf2rce3F+Tkf0EtNpEGCv12+b1zb6w9UN9utYpdXgwavKo20prr9seple17sTxQ9/Oyp4+rE0QbgMaJHtUrxAT26ZaFr9CjX4S7Rox18XKFHPWm6QI9+tJdG92bwubt0uZKp1OR1p+izqVRgOAoS3OZXe9PXlULn20Lh9gK4MDrgwuiAC6MDLowOuDA64MLogAujAy6M7s2kaXPr99LVhb+ToQv0f5lIg/wR+daVBeN77atEp6UEgA64cAAHHHACOOAktHX4YLhvXLv1Y8e41uV63Wvw7Z2uce37tS/GtTaXNkfVUubPnaGHE8ABJ4CzLDTJ9Dtu35Zw/z04LYUADjgBHHACOOCAE8ABJ4ADTgAHHHACOOAEcMAJ4IADTjwB/9XLjkB2EJvLq0uDZ3t5OuZPq2cZ5gLg+Wic/Nztg52Ppmd7qW2tr7ya3vK8Pxqrk8caKkni+wjIhrnq/h6osme6FbhWavOgf+WzR9zRvcpbyu2bN14Xb/SdDq5ULdEvRZaFjbS2mGi9FvORXUuS58XB96LU1hNWHaL5I8AAi1XlrYdFnTIAAAAASUVORK5CYII=) center center no-repeat; +} + +.uploadfield-item--audio .uploadfield-item__thumbnail { + background: #fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABH1JREFUeNrsnE9u2kAUxp2oe7gB9AThAJVwThB6Alype8i2m7Dqtsm+UuAG9ASxpe4DNzA3ICdI50mvKYV5D57/xcbfk6wqUDz2z998881gc/H6+hqgqqsLAAdwAEcBOICjABzAUQAO4ACOAnAARwE4gKMAHMABHAXgJdanr99nO39uf//8dg/g5QLfh7Fw0KMi27gEZrXG7iLMAbx66BGAl1Nr4fVHB30A4MVXqEBfOuhdAC+w3AC5Zegbz9s9t+X281qnFFYURbM+KayMmCa0S/YRu63jefvaHUd8dsDdSYesqN7Oyx/dyaYZ90cXa9eHp25fK+X/T90/Pzxvbdzn+mdjKaRqhvO0BztgpWctgj3c2WJtIOTelPisZW+C1FzgO115UkFznRMGQoqDL57Xp1kH0MsawSbVPLvtqsJmqQctFZWnPIb4Lta0kcBJ1W4jL70ruSkpYQzZr6W6F1JL1DjgfKJxFap2aiXgt8LbM3csfSUqzgQvjxoBnE7ObTGngE6FOZvUuhAsQhsIl4KXj2oPnFWx4qTwHjUVLGLMUVRSuc+SbqyD54ccaaKb8WRvyuo1e7FxxaAO4PFFfxJ8OVa8fCKofF6awvlgn/mArdtNicqN9tqKFWuJhYw9Vrw8FdZZRmVbymNDlkaueAIlleTZI2PSCRs90yy4Joovx4JiteTh6zUdy9LtOQHfGvN3IExqrhRbWQlpJWwd8CNrH5ES9wIjQN+CV7+tliKufShxb20E7rOVVlqKtvYh2oQAUFNsCoWf5tmhwSKGRuC91gJnlScGFaZVHt+5xsKVQeFpAftuPfCtsUf4ZtTaugqAN6VaD1xZ7VsB+OkVGgAOLNYhWU1rgbNih4bBsVvl8Z2jwkeGCY6k8ETZv+8CvbQSOKt75nlro9z0Exqj4iCP35+bwu+FWd9c+czQCHCQJ8tfnpG6yUrGQne/Vz5jsR8AP5Y2yGKUyUpksR9eAOsZL1Crcngi3XHL8HzfsS6NcTOw3E2bBfi6IbA3gf795Ex4fW5MQEnZsTCsKfQ4+He/Cd3sM1ImLwPB7xPFTroZesRBme9L4ZPI9LwLD1KkoMLvtuJu3TekGYvqJb83A6/Uwx2UJUP59Y5pZiZEweSIF/u+pltbHxCofNCkHuI2UvpnywytINhkh3dWdfOX0D1DT6lfStlR+6Ii2AOl+z9kUPeL1U7ePRay2kk914H/BsuiZ6EdIXUdU7fvdup5li8japHDWV2kwIeKmyaVRkqa6SoXI9MTdbWZ+LDapxWp/S15aE+yMeyeYEFpo4GfqPZtgU194XFEG2AnQq+YZW207g/Ghtx1yUNz/5QG+zHZxFJTKFtJKnj+bZ4HdBvxeym07pG1C2dsbyUMlJTVwzz7xg/UHMKeB/Iy7yDvhQfw02D/9fx53jZwX8r/JcFeFAEbwE+rpMjfvQJwvWgWOipyhwB+CPhN2W4L895LiEHz+MBJk65tWTEUwCsuAAdwAEcBOICjABzAUQAO4ACOAnAARwE4gKMAHMDbUH8EGABZtyoqqLbafgAAAABJRU5ErkJggg==) center center no-repeat; +} + +.uploadfield-item--video .uploadfield-item__thumbnail { + background: #fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAjFJREFUeNrs3UFOwkAUxvFi2MMN9Abq3kRuoDegC/eyZmPduLXuSYATiCegJOzFE1huQE+Ar+E1BBITF/I60/l/yYTEhW1+TvoN00lsbbfbiNjlDALAASeAA04AB5wADjjgBHDACeCAE8ABB5wADjgBHHBSpV3XhW8eXjL5uJXxJWOwHA2zEMBbdRyTEOyefMyPfryQEQt8ziPFJuVs/5Y/xkTGBeB26ctYCXoiowu4TToynmTkgh4Dbgs/FvRcn/uAG+W8LNlyZSPjCnDbYv30uVh9/eLT1xWNd8Xq+zfNqlgHgNsW66sW6z3gtsX6rsXaA9y2WOeuFmuTdwurYk1dKtYQtmcftVgTwI23CrRYY8Bti3VcZ7GG+sanKtaZdbGG/ortLtrvwXcBt13R5BZbBYAfFWu0e/kRA25frKtTbAUD/nsuZaSA24YZbpwB4DYpz8hcL0fDyX//4ja2B1lHu8NI2akuAPgeOjnFjAb8MIWuRFLB3lhcMGTwabQ7RLqxvGiI4LUeGg0J3Ilj0SGAmxVi6OCFlmHi0k01FfxNZ/XGtRtrGviHPqdzV2+wKeALndGZ6zfqO7hThdhk8EKhU99u3EfwZ8uv4iGDT3VW55HH8QHcm0L0HXytS7xZk9atLoIXCj2JGpi2Y9Cme9Mhga8UuNOkQvxLWnX9Dwg9RFmOPATo2sFDDcckAAecAA44ARxwAjjggBPAASeAA04ABxxwAjjgBHDACeB15UeAAQBIj8DeaiiktQAAAABJRU5ErkJggg==) center center no-repeat; +} + +.uploadfield-item--document .uploadfield-item__thumbnail { + background: #fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAsFJREFUeNrs3c1qE1EYxvF3JjNNbUQjaEs2re4URMGVUIrQhVtxJ+hCvARdWXAjgrioKy9ARNdegEWEXoAgBXWT0m5Cq2hsPptpEicpgguVJM15T4/n/8CQTWc6/fXMc85MUhp0u10heolG2alYLObTl+fpds2FHzKOY4mi6F6hUHhq+1zCEfd75wr2rwRBsFwqle46B56O7tvpy0UXL+fDgD7KCD/tcofaRg/Fw9hE9xLcJrq34LbQvQa3ge49uDY64MrogCujA66MDrgyOuDK6IArowOujA64MjrgyuiAK6MDrowOuDI64MrokcmT+vqjJqsf1o0c++zstJybmx7oa6v1plQaOyZOY3nYTwIYBf9Srsnr1TUjx76+cH5g8GyckUq9I9XGrvUrw5tKOXk8J0ePZAH3Dd27SdM2utEOn5vJy/2bi0aOfSqfOxB6fzK10OlGwacmJwae2GyMdBvoXq/DbdSL9zc+2ujcaSqjG+3wjxvb8vjVW+d+AQ/vXGWE/y8B/A8xWS+AK3e60Q7PTcb9p3quoptYpxsFn505IUu3Fp0e6eNGp1KU6wVwZXTAldGNdni92ZKNrbJzuH974DaOTjcK3sN28U7zxdINYxMplaJcLxF8B1syMsIPObqzb7G5Gm/fYrMVKgVwwIkrHb659V1evnlv5NgLF870N8B/S62ZyKfNbdXbbyqFAA44k+b4evZfT94Y4QRwwAnggBPAAQecAA44ARxwAjjggBPAASeAA04ABxxwAjjgBHDAiQHwcrUxAdt+mq098+CN3STu8I+r+2klCuBJuxN+26mDnbR7V/vQ+4306dne35nvtTtybCorYejfNNBoJVKpNWWUK31o8EBkfb+/kv7md4Kq8Uq5cvnSs/QbfabBRTJh8ERlWZiNM/NhEKz4PLIzYfggHXyPht6zy4pDNT8FGAAqQOmy57wEGAAAAABJRU5ErkJggg==) center center no-repeat; +} + +.uploadfield-item--false .uploadfield-item__thumbnail { + background: #fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAfdJREFUeNrs3TtOw0AYReGZiU3EQ0BBk44dIFEhUbAEtsAaoKajoYCKBbAQCrZBE8p0CCUmTuIkxknEAmwpd7D+cyTLlfP4NB6PpTx8WZaOdCVNDur3+8fV7rXartvwJtM0dUmS3PV6vefYryU0PO69Ldh/ee+fBoPBbevAq9F9U+3O2ng6/wf0JiP8tM1zaGz04AwWE90keEx0s+Cx0E2Dx0A3D65GB1yMDrgYHXAxOuBidMDF6ICL0QEXowMuRgdcjA64GB1wMTrgYnTAxeiJBZxsPHGjfLiNh36q+0kAE+DdtONG46XL8mn012JmSjk52ncHu13AraGbu2jGRje5SomJbnZZGAvd9Do8Brr5Gx81OneaYnTAxeiAi9EBF6MDLkYHXIwOuBgdcDE64GJ0wMXogIvRARejAy5GT+Brjs4IbwE64OIABxxwAhxwAhxwAhxwwAlwwAlwwAlwwAEnwAEnwAEnwAEHnAAHnAAHnAAHHHACHHACHHACvGXg31m+A9umyWy+ffB8WqRL/rh63awQgBeLZfgajsEuFquzvfZxjb6JvPpZ6Pli6Q73ui4Ee5eBfFa40c/ENTnTa4N75z4381ex3mzns61PKVcX5y/VE30wgzvXCf5Rsizspp3L4P2b5ZHdCeG+GnwPtY8sWXFI+xVgAB+AqE72La37AAAAAElFTkSuQmCC) center center no-repeat; +} + +.uploadfield-item__upload-progress { + height: 16px; + margin: 22px 5px; + width: 30%; + border-radius: 10px; + overflow: hidden; +} +.uploadfield-item__upload-progress + .uploadfield-item__title .uploadfield-item__checkbox-label:before { + color: #43536d; +} + +.uploadfield-item__progress-bar { + height: 100%; + background: #0071c4; + transition: width 0.5s ease; + width: 0%; +} + +.uploadfield-item__error-message { + line-height: 28px; + height: 28px; + margin: 16px 5px; + padding: 0 10px; + color: #fff; + background: #d40404; + border-radius: 14px; + max-width: 50%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.uploadfield-item__complete-icon { + line-height: 38px; + padding: 11px 5px; +} +.uploadfield-item__complete-icon:after { + color: #3fa142; + font-size: 30px; + display: inline; + font-family: "silverstripe", sans-serif; + content: "I"; +} + +.uploadfield-item__status { + margin: 0 0 0 0.6154rem; + color: #cf3f00; + text-transform: uppercase; +} + +.preview-image-field__container { + position: relative; +} + +.preview-image-field__toolbar { + position: absolute; + top: 50%; + right: 0; + transform: translateY(-50%); + height: auto; + max-height: 100%; + border-bottom-left-radius: 0.23rem; + border-top-left-radius: 0.23rem; + overflow: hidden; +} + +.preview-image-field__toolbar-button--link:before { + content: "="; +} + +.preview-image-field__toolbar-button--replace:before { + content: "b"; +} + +.preview-image-field__toolbar-button { + padding: 11px 0; + height: 47px; + width: 47px; + overflow: hidden; + background: #000; + opacity: 0.55; + color: #fff; + border: 0; +} +.preview-image-field__toolbar-button:hover, .preview-image-field__toolbar-button:active, .preview-image-field__toolbar-button:focus { + color: rgb(178.5, 178.5, 178.5); + text-decoration: none; +} +.preview-image-field__toolbar-button:before { + padding: 0 11px; + font-family: "silverstripe"; + font-style: normal; + speak: none; + line-height: 1; + font-size: 25px; + height: 25px; + width: 25px; + vertical-align: middle; +} + +.preview-image-field__progress { + height: 18px; + width: 75%; + position: absolute; + top: 50%; + left: 50%; + transform: translateX(-50%) translateY(-50%); + border-radius: 10px; + overflow: hidden; + background: rgb(229.5, 229.5, 229.5); +} + +.preview-image-field__progress-bar { + height: 100%; + background: #0071c4; + transition: width 0.5s ease; + width: 0; +} + +.preview-image-field__message { + position: absolute; + bottom: 0; + left: 0; + right: 0; + padding: 1.5385rem 1.5385rem; +} +@media (min-width: 992px) { + .preview-image-field__message { + display: flex; + } +} + +.preview-image-field__message-button { + margin-left: 0.76925rem; +} + +.preview-image-field__message--error { + color: #fff; + background: #d40404; +} + +.preview-image-field__message--success { + color: #fff; + background: #3fa142; +} + +.insert-embed-modal .modal-content { + height: auto; + max-height: 100%; +} +.insert-embed-modal .modal-body { + display: flex; + justify-items: stretch; + flex-direction: column; + background-color: #fff; +} + +.insert-embed-modal--edit { + width: 100%; +} +@media (min-width: 768px) { + .insert-embed-modal--edit .btn-toolbar { + margin-left: 30%; + } +} + +.insert-embed-modal--create { + flex: 1; + width: 100%; +} +.alert + .insert-embed-modal--create { + padding-top: 0; +} + +.insert-embed-modal__url-create .form-control.text { + padding: 0.75rem 1.25rem; + font-size: 1.231rem; + line-height: 1.3333333333; + border-radius: 0.5rem; +} + +@media (min-width: 768px) { + .insert-embed-modal__fields--fill-width { + width: 100%; + display: flex; + flex-direction: row; + } +} + +.insert-embed-modal__preview-container { + padding-bottom: 1.2308rem; +} +@media (min-width: 768px) { + .insert-embed-modal__preview-container { + order: 2; + padding-left: 1.2308rem; + width: 30%; + } +} + +.insert-embed-modal__preview { + display: block; + max-width: 100%; + margin: 0 auto; + max-height: 198px; +} + +.insert-embed-modal__placement .form__field-holder > div { + display: flex; + flex-direction: row; + justify-items: stretch; +} +.insert-embed-modal__placement .form-check { + flex: 1; + margin-bottom: 0; + padding-left: 0; +} +.insert-embed-modal__placement .form-check:first-of-type .form-check-label span:before { + border-top-left-radius: 0.23rem; + border-bottom-left-radius: 0.23rem; +} +.insert-embed-modal__placement .form-check:last-of-type .form-check-label span:before { + border-top-right-radius: 0.23rem; + border-bottom-right-radius: 0.23rem; +} +.insert-embed-modal__placement .form-check .form-check-label { + display: block; + cursor: pointer; +} +.insert-embed-modal__placement .form-check .form-check-label span { + display: block; + color: rgba(67, 83, 109, 0); + font-size: 0.9rem; + letter-spacing: 1px; + text-align: center; + text-transform: uppercase; + transition: color 0.1s ease-out; +} +.insert-embed-modal__placement .form-check .form-check-label span:before { + content: " "; + display: block; + box-sizing: content-box; + height: 36px; + padding: 5px 0; + border: 1px solid rgb(218.7079545455, 224.0352272727, 232.6920454545); + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAFoCAYAAAAl0bm1AAAACXBIWXMAAAsSAAALEgHS3X78AAAB7klEQVR42u3cwW3CQBBAURu5DRqgHoqgAAqgAAqgCOqhAQox173YAuPdsTVvblFE9JV9WmmiVfpxHLstz6Hb+Gw+cCi/OD3fq57363zsHbFAgQIFChQoUKDAf6a3k9hJAqbcZRhkkEEGGWRQoECB7e7B2/2x6p1zu178jVqgQIECBQoUKFDgX2MvtpNETLnLMMgggwwyyKBAgQLb3YNzE/XG2hELFChQoECBAgXmDrQX59pJvB9kkEEGGWSQQYECc9+DcxP1xtoRCxQoUKBAgQIF5g60F+faSbwfZJBBBhlkkEGBAnPfg0un5htrRyxQoECBAgUKFJg70F6cayfxfpBBBhlkkEEGBQrMfQ8unZpvrB2xQIECBQoUKFBg7kB7ca6dxPtBBhlkkEEGGRQoMPc9WPM99C8/u/zc0Oo38e0/yGawqsGawyCDDDLIIIMM7tOgvdhOEjEMMsgggwwyKFCgwJh7sOZ76F9+dvm5ZkvTt/8gm8Hd7sUMMsgggwwyyOA+DdqL7SQRwyCDDDLIIIMCBQqMuQeXvm2p+f56mPqGI2awEQcGGWSQQQYZZDDWoL2YwYjxfpBBBhlkkEGBAgXG3INL37bUfH89TH3DETPYiAODDDLIIIMMMhhr0F7MYMR4P8gggwwyyKDA7cwHteyC9AjuZNIAAAAASUVORK5CYII=) center top no-repeat content-box; + transition: background-color 0.1s ease-out; +} +.insert-embed-modal__placement .form-check .form-check-label:hover span, .insert-embed-modal__placement .form-check .form-check-label:focus span { + color: #43536d; +} +.insert-embed-modal__placement .form-check .form-check-input { + position: absolute; + left: -9999px; +} +.insert-embed-modal__placement .form-check .form-check-input.checked + span { + color: #29abe2; +} +.insert-embed-modal__placement .form-check .form-check-input.checked + span:before { + border: 1px solid #29abe2; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAFoCAYAAAAl0bm1AAAACXBIWXMAAAsSAAALEgHS3X78AAAB7klEQVR42u3cwW3CQBBAURu5DRqgHoqgAAqgAAqgCOqhAQox173YAuPdsTVvblFE9JV9WmmiVfpxHLstz6Hb+Gw+cCi/OD3fq57363zsHbFAgQIFChQoUKDAf6a3k9hJAqbcZRhkkEEGGWRQoECB7e7B2/2x6p1zu178jVqgQIECBQoUKFDgX2MvtpNETLnLMMgggwwyyKBAgQLb3YNzE/XG2hELFChQoECBAgXmDrQX59pJvB9kkEEGGWSQQYECc9+DcxP1xtoRCxQoUKBAgQIF5g60F+faSbwfZJBBBhlkkEGBAnPfg0un5htrRyxQoECBAgUKFJg70F6cayfxfpBBBhlkkEEGBQrMfQ8unZpvrB2xQIECBQoUKFBg7kB7ca6dxPtBBhlkkEEGGRQoMPc9WPM99C8/u/zc0Oo38e0/yGawqsGawyCDDDLIIIMM7tOgvdhOEjEMMsgggwwyKFCgwJh7sOZ76F9+dvm5ZkvTt/8gm8Hd7sUMMsgggwwyyOA+DdqL7SQRwyCDDDLIIIMCBQqMuQeXvm2p+f56mPqGI2awEQcGGWSQQQYZZDDWoL2YwYjxfpBBBhlkkEGBAgXG3INL37bUfH89TH3DETPYiAODDDLIIIMMMhhr0F7MYMR4P8gggwwyyKDA7cwHteyC9AjuZNIAAAAASUVORK5CYII=) center top no-repeat content-box, rgb(231.7, 245.1331632653, 255) padding-box; +} +.insert-embed-modal__placement .form-check .option-val--leftAlone + span:before { + background-position-y: -36px; +} +.insert-embed-modal__placement .form-check .option-val--leftAlone.checked + span:before { + background-position-y: 0; +} +.insert-embed-modal__placement .form-check .option-val--center + span:before { + background-position-y: -108px; +} +.insert-embed-modal__placement .form-check .option-val--center.checked + span:before { + background-position-y: -72px; +} +.insert-embed-modal__placement .form-check .option-val--rightAlone + span:before { + background-position-y: -180px; +} +.insert-embed-modal__placement .form-check .option-val--rightAlone.checked + span:before { + background-position-y: -144px; +} +.insert-embed-modal__placement .form-check .option-val--left + span:before { + background-position-y: -252px; +} +.insert-embed-modal__placement .form-check .option-val--left.checked + span:before { + background-position-y: -216px; +} +.insert-embed-modal__placement .form-check .option-val--right + span:before { + background-position-y: -324px; +} +.insert-embed-modal__placement .form-check .option-val--right.checked + span:before { + background-position-y: -288px; +} + +.image-size-preset-list { + display: block; + padding-left: 0; + margin-bottom: 0; + width: 100%; +} +.image-size-preset-list__list-item { + display: inline-block; + list-style: none; +} +.image-size-preset-list__list-item .btn { + padding-left: 0; +} +.image-size-preset-list__list-item .btn:disabled { + text-decoration: none; + pointer-events: all; +} + +.gallery { + position: relative; +} + +.gallery__outer { + position: relative; +} + +.gallery__main { + height: 100%; + position: relative; +} +@media (max-width: 991.98px) { + .gallery__main.gallery__main--has-opened-item { + display: none; + } +} + +.gallery__no-item-notice { + text-align: center; + font-size: 1.231rem; + margin-top: 1.2308rem; +} + +.gallery__back { + position: relative; +} +.gallery__back.ss-ui-button:before { + font-size: 23px; +} +.gallery__back .gallery__back-badge { + display: inline-block; + position: absolute; + font-size: 1rem; + top: -0.5rem; + right: -1rem; +} + +.gallery__back--droppable-hover { + background-color: rgb(234.5005681818, 237.5096590909, 242.3994318182); + transform: scale(1.3); + border: 1px solid #29abe2; +} + +.gallery__main--selectable { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + margin: -1.5385rem -1.5385rem; + padding: 1.5385rem 1.5385rem; +} + +.gallery__back-container { + display: inline-block; +} +.gallery__back-container .gallery-item__droppable { + margin: 0; +} + +.gallery__folders, +.gallery__files { + display: flex; + flex-flow: row wrap; +} + +@media (max-width: 991.98px) { + .gallery__files { + margin-bottom: 53px; + } +} +.gallery__load { + width: 100%; + display: inline-block; +} + +.gallery__load-more { + display: block; + color: #fff; + cursor: pointer; + margin: 8px auto 24px; + padding: 4px; + width: 200px; + font-size: 16px; + height: 44px; + background-color: #29abe2; + border: 0; + border-radius: 4px; +} + +.gallery__sort { + display: inline-block; + vertical-align: middle; + padding: 0 0.7692rem; +} +@media (max-width: 767.98px) { + .gallery__sort .chosen-container { + width: auto !important; + } +} +.gallery__sort .chosen-single { + display: flex; + align-items: center; + justify-content: flex-end; +} +.gallery__sort .chosen-single:focus { + box-shadow: 0 0 3px rgba(0, 0, 0, 0.2); +} +.gallery__sort .chosen-single > span { + text-align: right; + color: inherit; +} +@media (max-width: 767.98px) { + .gallery__sort .chosen-single > span { + font-size: 0; + } +} +.gallery__sort .chosen-single > span:before { + content: "\e003"; + font-family: "silverstripe"; + color: rgb(86.4147727273, 107.0511363636, 140.5852272727); + margin-right: 5px; + position: relative; + top: 1px; + font-size: 0.923rem; +} +@media (max-width: 767.98px) { + .gallery__sort .chosen-single > span:before { + font-size: 1.231rem; + } +} +.gallery__sort .chosen-container-active .chosen-single { + outline: 5px auto -webkit-focus-ring-color; +} +.gallery .gallery__sort .chosen-single { + border: 0; + filter: none; + background: none; + box-shadow: none; + color: inherit; + margin-top: -1px; +} +.gallery__sort .chosen-drop { + min-width: 160px; + right: 0; + border-radius: 3px; + box-shadow: 0 0 3px rgba(0, 0, 0, 0.2); + border: 0; +} +.gallery__sort .active-result { + text-transform: capitalize; +} + +.gallery__error { + display: table; + width: 100%; + height: 100%; +} + +.gallery__error-message { + display: table-cell; + vertical-align: middle; + text-align: center; +} + +.gallery__view-change-button .icon:before { + vertical-align: middle; +} + +.gallery__btn-toolbar .btn-toolbar:first-child { + margin-left: -10px; +} + +@media (min-width: 544px) { + .gallery__state-buttons { + margin-right: -0.7693rem; + } +} +.gallery__state-buttons .btn-group:last-child { + margin-right: 0; +} + +.gallery__view-change-button { + margin-right: -0.76925rem; +} + +.griddle-footer > div { + display: flex; +} + +.griddle-page { + flex: 1; + text-align: center; + margin-top: -3px; +} +.griddle-page select { + height: calc(1.5384 + 1.2308rem); + padding: 0.3846rem 0.7692rem; + line-height: 1.5384; + color: rgb(86.4147727273, 107.0511363636, 140.5852272727); + border: 1px solid rgb(206.0738636364, 213.2556818182, 224.9261363636); + background-color: #fff; + background-image: none; + text-align: center; + display: inline; +} +.griddle-page select:focus { + color: rgb(86.4147727273, 107.0511363636, 140.5852272727); + background-color: #fff; + border-color: #66afe9; + outline: 0; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), rgba(102, 175, 233, 0.6); +} + +.griddle-footer { + width: 200px; + margin: 0 auto; +} + +.griddle-previous button:before { + content: "'"; +} + +.griddle-next button:before { + content: "&"; +} + +.griddle-previous, +.griddle-next { + width: 36px; +} +.griddle-previous button, +.griddle-next button { + white-space: nowrap; + border: 0; + background: transparent; + width: 36px; + height: 30px; + position: relative; + border-radius: 0.23rem; + overflow: hidden; +} +.griddle-previous button:before, +.griddle-next button:before { + font-family: "silverstripe"; + color: rgb(86.4147727273, 107.0511363636, 140.5852272727); + width: 36px; + height: 30px; + background-color: rgb(250.2931818182, 250.9840909091, 252.1068181818); + position: absolute; + top: 0; + left: 0; + padding: 0.3846rem; + transition: all 0.2s ease-in-out; + font-size: 1.231rem; + -webkit-font-smoothing: antialiased; + line-height: 1.5384; +} +.griddle-previous button:hover, +.griddle-next button:hover { + background-color: rgb(206.0738636364, 213.2556818182, 224.9261363636); + border-color: transparent; +} +.griddle-previous button:hover:before, +.griddle-next button:hover:before { + background-color: rgb(206.0738636364, 213.2556818182, 224.9261363636); +} + +.gallery__search-message-clear { + padding-left: 0.6154rem; +} + +th.sort--disabled > span:after { + content: ""; +} + +.gallery__table { + margin-bottom: -1.5385rem; +} +.gallery__table td, +.gallery__table th { + word-wrap: break-word; +} +.gallery__table td { + word-break: break-all; +} +.gallery__table td.gallery__table-column-image { + padding: 0; +} +.gallery__table th { + cursor: pointer; +} +.gallery__table th > span { + display: inline; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.gallery__table th > span:after { + color: rgb(142.9034090909, 159.3579545455, 186.0965909091); + content: ")"; + display: inline-block; + font-family: "silverstripe"; + margin-left: 4px; +} +.gallery__table tbody td { + padding-top: 1.8462rem; + padding-bottom: 1.8462rem; +} +@media (max-width: 767.98px) { + .gallery__table tbody td:nth-child(n+4) { + display: none; + } +} +.gallery__table thead th, +.gallery__table thead td { + height: 52px; +} +.gallery__table thead th:hover { + background-color: rgb(243.9761363636, 245.5943181818, 248.2238636364); +} +@media (max-width: 767.98px) { + .gallery__table thead th:nth-child(n+4) { + display: none; + } +} +.gallery__table .sort-descending, +.gallery__table .sort-ascending { + border-bottom: 1px solid #29abe2; +} +.gallery__table .sort-descending > span:after, +.gallery__table .sort-ascending > span:after { + color: #29abe2; +} +.gallery__table .sort-descending > span:after { + content: "*"; +} +.gallery__table .sort-ascending > span:after { + content: "("; +} +.gallery__table .footer-container, +.gallery__table .footer-container:hover { + background-color: rgb(250.2931818182, 250.9840909091, 252.1068181818); + border-bottom: 0; +} + +.gallery__table-row { + cursor: pointer; +} + +.gallery__table-column--title .flexbox-area-grow { + display: flex; +} +.gallery__table-column--title .file-status-icon { + cursor: pointer; + margin-left: 6px; +} +.gallery__table-column--title .file-status-icon:last-of-type { + margin-right: 6px; +} + +.gallery__table-column--select { + width: 1%; +} +.gallery__table-column--select input[type=checkbox] { + width: 14px; + height: 14px; +} + +.gallery__table-row--highlighted { + border-color: #29abe2; + background-color: rgb(231.7, 245.1331632653, 255); +} + +.gallery__table-column--image { + width: 68px; + max-width: 68px; + height: 69px; + text-align: center; +} +.gallery__table .gallery__table-row > .gallery__table-column--image { + padding: 0; + vertical-align: middle; +} +.gallery__table .gallery__table-row > .gallery__table-column--image:first-child { + max-width: none; + padding-left: 1.5385rem; +} + +.gallery__table-image { + background-repeat: no-repeat; + background-position: center center; + height: 68px; + width: 68px; + background-size: calc(68px - 1.5385rem) auto; +} + +.gallery__table-image--image { + background-size: 68px auto; +} + +.gallery__table-image--folder { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGYAAAB6CAYAAABNyyaCAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAXxJREFUeNrs2q9Ow0AcwPEdXQerAY3FDBQBNbcQwCJnwE4jAD83Am+A4AHgBXgKLJLAE2D4Y3ocvAPJL/TzTbra9j69a3NZyjn3FK8lQwBGYMAIDBiBERgwAgNGYAQGjMD8l9Lo5vGy9/V5EeFi8sf7+dPZ3jWWnxkTBOX3KRk2V6PFwwJLxKVsZXiwMT6uwERbW+vBTjk1YALWPzo5BBPxi2SwPAETsaoag4k4Y/r1bvkAaMAErJ7O9sHEnDUTMDHfM9Ot+9c1MNFq2/Xy+1xwtrsIkzbvXmL+eTm35eo6ucf6Vo7TuHeeOrvxvVqOW9v+3jECA0ZgwAiMwIARGDACIzBgBAaMwIARGIEBIzBgBEZgwAgMGIEBIzACA0ZgwAiMwIARGDACA8YQgBEYMAIDRmAEBozAgBEYgQEjMGAEBozACAwYgQEjMAIDRmDACAwYgREYMALTIZi5YQjXPOWcDYOlTGDACAwYgREYMAIDRmAEBozAgNHf9S3AAJeuKdi1sikAAAAAAElFTkSuQmCC); +} + +.gallery__table-image--archive { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAArlJREFUeNrs3c9qE1EUx/F7JxmDf/APSCWbancK/kFXQi1CXkDciKCIz6ArC+6k4KKufAARBXe+QBGhDyAUF7pJoZtgF1aamEkzTeIkBdf3jp1z7/V+fxCyOZMMH2ZO7klmiJ5MJorIRduCt9vt08XTm+Jx5zB3ZOXdJ/Vta9uo9tmDlrp0fs6oNk1TVa/XnzabzVc+gCcltvl82NiVH1Var3Y6nSfBgRdH9+Pi6VqQp7In6LZH+IWg+6cH6ImKLK7RowN3jR4luEv0aMFdoUcN7gI9enBp9HqIQOsbm8ZT6b3WdRt0VfVE6g348sOWce2jlQ/GtabgUui0FOH2ArgwOuDC6IALowMujA64MDrgwuiAC6MDLozuzaT5cf2rce3F+Tkf0EtNpEGCv12+b1zb6w9UN9utYpdXgwavKo20prr9seple17sTxQ9/Oyp4+rE0QbgMaJHtUrxAT26ZaFr9CjX4S7Rox18XKFHPWm6QI9+tJdG92bwubt0uZKp1OR1p+izqVRgOAoS3OZXe9PXlULn20Lh9gK4MDrgwuiAC6MDLowOuDA64MLogAujAy6M7s2kaXPr99LVhb+ToQv0f5lIg/wR+daVBeN77atEp6UEgA64cAAHHHACOOAktHX4YLhvXLv1Y8e41uV63Wvw7Z2uce37tS/GtTaXNkfVUubPnaGHE8ABJ4CzLDTJ9Dtu35Zw/z04LYUADjgBHHACOOCAE8ABJ4ADTgAHHHACOOAEcMAJ4IADTjwB/9XLjkB2EJvLq0uDZ3t5OuZPq2cZ5gLg+Wic/Nztg52Ppmd7qW2tr7ya3vK8Pxqrk8caKkni+wjIhrnq/h6osme6FbhWavOgf+WzR9zRvcpbyu2bN14Xb/SdDq5ULdEvRZaFjbS2mGi9FvORXUuS58XB96LU1hNWHaL5I8AAi1XlrYdFnTIAAAAASUVORK5CYII=); +} + +.gallery__table-image--audio { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABH1JREFUeNrsnE9u2kAUxp2oe7gB9AThAJVwThB6Alype8i2m7Dqtsm+UuAG9ASxpe4DNzA3ICdI50mvKYV5D57/xcbfk6wqUDz2z998881gc/H6+hqgqqsLAAdwAEcBOICjABzAUQAO4ACOAnAARwE4gKMAHMABHAXgJdanr99nO39uf//8dg/g5QLfh7Fw0KMi27gEZrXG7iLMAbx66BGAl1Nr4fVHB30A4MVXqEBfOuhdAC+w3AC5Zegbz9s9t+X281qnFFYURbM+KayMmCa0S/YRu63jefvaHUd8dsDdSYesqN7Oyx/dyaYZ90cXa9eHp25fK+X/T90/Pzxvbdzn+mdjKaRqhvO0BztgpWctgj3c2WJtIOTelPisZW+C1FzgO115UkFznRMGQoqDL57Xp1kH0MsawSbVPLvtqsJmqQctFZWnPIb4Lta0kcBJ1W4jL70ruSkpYQzZr6W6F1JL1DjgfKJxFap2aiXgt8LbM3csfSUqzgQvjxoBnE7ObTGngE6FOZvUuhAsQhsIl4KXj2oPnFWx4qTwHjUVLGLMUVRSuc+SbqyD54ccaaKb8WRvyuo1e7FxxaAO4PFFfxJ8OVa8fCKofF6awvlgn/mArdtNicqN9tqKFWuJhYw9Vrw8FdZZRmVbymNDlkaueAIlleTZI2PSCRs90yy4Joovx4JiteTh6zUdy9LtOQHfGvN3IExqrhRbWQlpJWwd8CNrH5ES9wIjQN+CV7+tliKufShxb20E7rOVVlqKtvYh2oQAUFNsCoWf5tmhwSKGRuC91gJnlScGFaZVHt+5xsKVQeFpAftuPfCtsUf4ZtTaugqAN6VaD1xZ7VsB+OkVGgAOLNYhWU1rgbNih4bBsVvl8Z2jwkeGCY6k8ETZv+8CvbQSOKt75nlro9z0Exqj4iCP35+bwu+FWd9c+czQCHCQJ8tfnpG6yUrGQne/Vz5jsR8AP5Y2yGKUyUpksR9eAOsZL1Crcngi3XHL8HzfsS6NcTOw3E2bBfi6IbA3gf795Ex4fW5MQEnZsTCsKfQ4+He/Cd3sM1ImLwPB7xPFTroZesRBme9L4ZPI9LwLD1KkoMLvtuJu3TekGYvqJb83A6/Uwx2UJUP59Y5pZiZEweSIF/u+pltbHxCofNCkHuI2UvpnywytINhkh3dWdfOX0D1DT6lfStlR+6Ii2AOl+z9kUPeL1U7ePRay2kk914H/BsuiZ6EdIXUdU7fvdup5li8japHDWV2kwIeKmyaVRkqa6SoXI9MTdbWZ+LDapxWp/S15aE+yMeyeYEFpo4GfqPZtgU194XFEG2AnQq+YZW207g/Ghtx1yUNz/5QG+zHZxFJTKFtJKnj+bZ4HdBvxeym07pG1C2dsbyUMlJTVwzz7xg/UHMKeB/Iy7yDvhQfw02D/9fx53jZwX8r/JcFeFAEbwE+rpMjfvQJwvWgWOipyhwB+CPhN2W4L895LiEHz+MBJk65tWTEUwCsuAAdwAEcBOICjABzAUQAO4ACOAnAARwE4gKMAHMDbUH8EGABZtyoqqLbafgAAAABJRU5ErkJggg==); +} + +.gallery__table-image--video { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAjFJREFUeNrs3UFOwkAUxvFi2MMN9Abq3kRuoDegC/eyZmPduLXuSYATiCegJOzFE1huQE+Ar+E1BBITF/I60/l/yYTEhW1+TvoN00lsbbfbiNjlDALAASeAA04AB5wADjjgBHDACeCAE8ABB5wADjgBHHBSpV3XhW8eXjL5uJXxJWOwHA2zEMBbdRyTEOyefMyPfryQEQt8ziPFJuVs/5Y/xkTGBeB26ctYCXoiowu4TToynmTkgh4Dbgs/FvRcn/uAG+W8LNlyZSPjCnDbYv30uVh9/eLT1xWNd8Xq+zfNqlgHgNsW66sW6z3gtsX6rsXaA9y2WOeuFmuTdwurYk1dKtYQtmcftVgTwI23CrRYY8Bti3VcZ7GG+sanKtaZdbGG/ortLtrvwXcBt13R5BZbBYAfFWu0e/kRA25frKtTbAUD/nsuZaSA24YZbpwB4DYpz8hcL0fDyX//4ja2B1lHu8NI2akuAPgeOjnFjAb8MIWuRFLB3lhcMGTwabQ7RLqxvGiI4LUeGg0J3Ilj0SGAmxVi6OCFlmHi0k01FfxNZ/XGtRtrGviHPqdzV2+wKeALndGZ6zfqO7hThdhk8EKhU99u3EfwZ8uv4iGDT3VW55HH8QHcm0L0HXytS7xZk9atLoIXCj2JGpi2Y9Cme9Mhga8UuNOkQvxLWnX9Dwg9RFmOPATo2sFDDcckAAecAA44ARxwAjjggBPAASeAA04ABxxwAjjgBHDACeB15UeAAQBIj8DeaiiktQAAAABJRU5ErkJggg==); +} + +.gallery__table-image--document { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAsFJREFUeNrs3c1qE1EYxvF3JjNNbUQjaEs2re4URMGVUIrQhVtxJ+hCvARdWXAjgrioKy9ARNdegEWEXoAgBXWT0m5Cq2hsPptpEicpgguVJM15T4/n/8CQTWc6/fXMc85MUhp0u10heolG2alYLObTl+fpds2FHzKOY4mi6F6hUHhq+1zCEfd75wr2rwRBsFwqle46B56O7tvpy0UXL+fDgD7KCD/tcofaRg/Fw9hE9xLcJrq34LbQvQa3ge49uDY64MrogCujA66MDrgyOuDK6IArowOujA64MjrgyuiAK6MDrowOuDI64MrokcmT+vqjJqsf1o0c++zstJybmx7oa6v1plQaOyZOY3nYTwIYBf9Srsnr1TUjx76+cH5g8GyckUq9I9XGrvUrw5tKOXk8J0ePZAH3Dd27SdM2utEOn5vJy/2bi0aOfSqfOxB6fzK10OlGwacmJwae2GyMdBvoXq/DbdSL9zc+2ujcaSqjG+3wjxvb8vjVW+d+AQ/vXGWE/y8B/A8xWS+AK3e60Q7PTcb9p3quoptYpxsFn505IUu3Fp0e6eNGp1KU6wVwZXTAldGNdni92ZKNrbJzuH974DaOTjcK3sN28U7zxdINYxMplaJcLxF8B1syMsIPObqzb7G5Gm/fYrMVKgVwwIkrHb659V1evnlv5NgLF870N8B/S62ZyKfNbdXbbyqFAA44k+b4evZfT94Y4QRwwAnggBPAAQecAA44ARxwAjjggBPAASeAA04ABxxwAjjgBHDAiQHwcrUxAdt+mq098+CN3STu8I+r+2klCuBJuxN+26mDnbR7V/vQ+4306dne35nvtTtybCorYejfNNBoJVKpNWWUK31o8EBkfb+/kv7md4Kq8Uq5cvnSs/QbfabBRTJh8ERlWZiNM/NhEKz4PLIzYfggHXyPht6zy4pDNT8FGAAqQOmy57wEGAAAAABJRU5ErkJggg==); +} + +.gallery__table-image--error { + background: #d40404; + height: 68px; + width: 68px; +} +.gallery__table-image--error:after { + content: "<"; + line-height: 68px; + font-size: 30px; + display: inline; + font-family: "silverstripe", sans-serif; + color: #fff; + opacity: 0.8; +} + +.gallery__progress-bar-progress { + height: 100%; + background: #0071c4; + transition: width 0.5s ease; + width: 0%; +} + +.gallery__progress-bar { + height: 16px; + width: 30%; + border-radius: 10px; + overflow: hidden; +} + +.gallery__progress-bar--complete:after { + color: #3fa142; + font-size: 20px; + display: inline; + font-family: "silverstripe", sans-serif; + content: "I"; +} + +.editor-header { + display: flex; + flex-wrap: nowrap; + justify-content: flex-start; + align-items: flex-start; + margin-bottom: 0.76925rem; +} +.editor-header__back-button { + flex: 0 0 auto; + align-self: center; +} +.editor-header__back-button--md-below { + display: none; +} +@media (max-width: 991.98px) { + .editor-header__back-button--md-below { + display: block; + margin-left: 0; + } +} +.editor-header__edit { + flex: 0 0 auto; + margin: 0; +} +.editor-header__field { + flex: 1 1 auto; + min-width: 0; + overflow: hidden; +} +.editor-header__field .field { + margin-bottom: 0; +} +.editor-header__cancel-button { + align-self: center; + flex: 0 0 auto; + margin: 0; +} +.editor-header__cancel-button--lg-above { + display: none; +} +@media (min-width: 992px) { + .editor-header__cancel-button--lg-above { + display: block; + } +} + +.editor { + background-color: rgb(250.2931818182, 250.9840909091, 252.1068181818); + z-index: 2; + position: absolute; + height: 100%; + left: 0; +} +@media (min-width: 992px) { + .editor { + width: 300px; + border-left: 1px solid rgb(206.0738636364, 213.2556818182, 224.9261363636); + position: relative; + padding-bottom: 0; + } +} +@media (min-width: 1200px) { + .editor { + width: 448px; + } +} +.editor .nav-tabs { + z-index: 1; + position: relative; +} +.editor .editor__details { + transform: translateZ(0); +} +.editor .editor__details fieldset { + overflow-y: auto; +} +.editor--asset-dropzone--disable .asset-dropzone { + pointer-events: none; +} +.editor h2 { + margin-bottom: 0; + margin-top: 1.2308rem; +} + +.editor__heading { + font-size: 19px; + line-height: 2rem; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + margin-bottom: 2px; +} + +.editor__status-flag { + color: #f46b00; + background-color: #fff7f2; + border-color: #f46b00; + clear: both; + text-transform: uppercase; + display: inline-block; + position: relative; + line-height: 1rem; + margin-left: 3px; +} + +.editor-header__field .file-status-icon { + margin-left: 6px; +} +.editor-header__field .file-status-icon:last-of-type { + margin-right: 6px; +} +.editor-header__field .file-status-icon + .editor__status-flag { + margin-left: 0; +} +.editor-header__field .field-group-component__small-holder.editor-header-folder { + width: 100%; + display: flex; +} +.editor-header__field .field-group-component__small-holder.editor-header-folder .field { + max-width: calc(100% - 30px); +} +.editor-header__field .field-group-component__small-holder.editor-header-folder .file-status-icon { + margin-top: 5px; +} + +.editor__specs { + color: rgb(86.4147727273, 107.0511363636, 140.5852272727); + font-size: 0.75rem; + display: flex; + align-items: center; +} + +.editor__top-message { + margin: -0.76925rem -1.5385rem 1.2308rem; +} + +.editor__thumbnail { + display: block; + max-width: 100%; + max-height: 336px; + min-height: 80px; + margin: auto; + transform: scale(1); + transition: all 0.5s; +} + +.editor__file-preview { + text-align: center; + margin: 0 -1.5385rem 0.76925rem; + position: relative; + max-height: 336px; + min-height: 60px; + overflow: hidden; + display: block; + align-items: center; + text-decoration: none; +} +.editor__file-preview:not(.editor__file-preview--folder):hover .editor__thumbnail { + transform: scale(1.04); +} + +.editor__file-preview--folder { + margin-left: 0; + margin-right: 0; + width: 100%; +} + +.editor__file-preview-link:before { + position: absolute; + top: 50%; + left: 50%; + margin-top: -25px; + margin-left: -25px; + padding: 11px; + height: 50px; + width: 50px; + border-radius: 50%; + background-color: rgba(0, 0, 0, 0.6); + color: #fff; + font-size: 22px; + opacity: 0; + content: "="; + font-family: "silverstripe"; + line-height: 27px; + z-index: 1; + transition: all 0.5s; +} +.editor__file-preview-link:hover, .editor__file-preview-link:hover:before, .editor__file-preview-link:active:before { + text-decoration: none; + opacity: 1; +} + +.editor__file-preview-message--file-missing { + margin: 2.4616rem 0 1.2308rem; + font-size: 1.231rem; + color: #d40404; + text-align: center; +} + +@media (max-width: 991.98px) { + .editor__heading, + .editor__specs { + text-align: center; + margin-right: 36px; + display: flex; + justify-content: center; + } +} +#Form_fileInsertForm .tab-pane .show { + display: flex; + flex-wrap: wrap; + margin-top: -10px; +} +#Form_fileInsertForm .tab-pane .show > div { + width: 100%; +} +#Form_fileInsertForm .tab-pane .show #Form_fileInsertForm_Dimensions_Holder { + width: 67%; +} +#Form_fileInsertForm .tab-pane .show #Form_fileInsertForm_Dimensions_Holder .field-group-component { + display: flex; + flex-wrap: wrap; +} +#Form_fileInsertForm .tab-pane .show #Form_fileInsertForm_Dimensions_Holder .field-group-component .field { + margin-bottom: 0; +} +#Form_fileInsertForm .tab-pane .show #Form_fileInsertForm_Loading_Holder { + width: 33%; +} + +.asset-admin .popover-field .popover { + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1), 0 2px 10px 0 rgba(0, 0, 0, 0.1); + font-size: 1rem; + min-width: 230px; +} +.asset-admin .popover-field .popover:focus { + outline: none; +} +.asset-admin .popover-field .popover.top .arrow, .asset-admin .popover-field .popover.bottom .arrow { + margin-left: -5px; +} +.asset-admin .popover-field .popover.top { + margin-top: -10px; +} +.asset-admin .popover-field .popover.left .arrow, .asset-admin .popover-field .popover.right .arrow { + margin-top: -3px; +} +.asset-admin .popover-field .popover.left { + margin-left: -10px; +} +.asset-admin .popover-field .popover-body { + padding: 0.5rem 0.75rem; +} +.asset-admin .popover-field .popover-body ul { + padding-left: 0 !important; + list-style-type: none; + margin-left: -1.2308rem1px; + margin-right: -1.2308rem1px; + margin-bottom: 0; +} +.asset-admin .popover-field .popover-body a { + display: block; + padding: 0.3077rem 1.2308rem; + color: #43536d; +} +.asset-admin .popover-field .popover-body a:hover { + text-decoration: none; + background-color: rgb(206.0738636364, 213.2556818182, 224.9261363636); + color: #43536d; +} +.asset-admin .popover-field .popover-body .btn { + padding-left: calc(1.2308rem - 1px); + padding-right: calc(1.2308rem - 1px); + margin-left: calc(-0.75rem + 1px); + margin-right: calc(-0.75rem + 1px); + display: block; + width: calc(100% + 1.5rem - 2px); + text-align: left; + border-radius: 0; +} +.asset-admin .popover-field .popover-body .btn:hover { + background-color: rgb(232.8559322034, 239.6694915254, 243.6440677966); +} + +.asset-admin__toolbar-extra { + width: auto; +} +.asset-admin__toolbar-extra button:last-of-type { + margin-right: -10px; +} + +.insert-media-modal.modal-lg { + width: calc(100% - 0.76925rem); + max-width: 1600px; + margin-top: 0; + margin-left: auto; + margin-right: auto; + height: calc(100% - 53px); +} +@media (max-width: 991.98px) { + .insert-media-modal.modal-lg { + width: calc(100% - 1rem); + height: calc(100% - 0.5rem); + margin: 0 auto; + } +} +.insert-media-modal .modal-content { + height: 100%; + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.insert-media-modal .modal-body { + padding: 0; + height: 100%; +} +@media (max-width: 991.98px) { + .insert-media-modal .editor__details { + height: 100%; + } +} +@media (min-width: 992px) { + .insert-media-modal .btn--close-panel { + display: none; + } +} +.insert-media-modal .tab-content { + margin-bottom: 1.2308rem; +} +.insert-media-modal .fieldgroup.fill-width .field.flexbox-area-grow:first-child { + margin-right: 1.5385rem; +} +.insert-media-modal .asset-admin--multi-select [name=action_insert] { + display: none; +} +@media (min-width: 992px) { + .insert-media-modal .asset-admin--single-select [name=action_insert] { + display: none; + } +} +@media (max-width: 991.98px) { + .insert-media-modal .asset-admin--multi-select [name=action_insert] { + display: block; + } +} + +.insert-media-modal__main { + height: calc(100vh - 106px); +} + +.insert-media-modal__close-button { + float: right; + height: 32px; + margin: 10px -10px 10px 0; +} +.insert-media-modal__close-button:before { + top: 0; +} + +.history-item { + padding-top: 1rem; +} +.history-item:hover, .history-item:focus { + background-color: rgb(243.9761363636, 245.5943181818, 248.2238636364); +} +.history-item p { + margin-bottom: 0; +} +.list-group-flush:first-child .history-item:first-child { + border-top: 1px solid rgb(206.0738636364, 213.2556818182, 224.9261363636); +} + +.history-item__date, +.history-item__version { + opacity: 0.7; + font-size: 0.846rem; + margin-bottom: 1px; +} + +.history-item__date { + display: block; +} + +.history-item__version { + position: absolute; + right: 1.5385rem; + top: 0.9231rem; + font-size: 0.846rem; + opacity: 0.7; +} + +.history-item__status-flag { + color: #3fa142; + text-transform: uppercase; + font-size: 0.923rem; +} + +.history-list { + position: relative; + min-height: 50vh; +} +.history-list > form { + display: block; +} +.history-list > .list-group { + margin-top: calc(-1.5385rem - 1px); +} +.history-list .form { + margin-left: 10px; +} +.history-list .editor__file-preview-link, +.history-list .editor__file-preview-message--file-missing { + max-width: 50%; + position: relative; + display: block; + text-align: center; + font-size: 10px; + padding: 10px; + background: rgb(243.9761363636, 245.5943181818, 248.2238636364); + border: 1px solid rgb(218.7079545455, 224.0352272727, 232.6920454545); + margin: 0 auto 10px; +} +.history-list .editor__specs { + text-align: center; +} + +.history-list__back { + padding: 5px; + position: absolute; + top: 0; + left: -0.76925rem; + z-index: 2; +} + +/*# sourceMappingURL=bundle.css.map*/ \ No newline at end of file diff --git a/client/src/components/BackButton/BackButton.js b/client/src/components/BackButton/BackButton.js index 1bc2d4d38..73051a31a 100644 --- a/client/src/components/BackButton/BackButton.js +++ b/client/src/components/BackButton/BackButton.js @@ -54,4 +54,4 @@ BackButton.propTypes = { export { BackButton as Component }; -export default droppable('GalleryItem')(BackButton); +export default droppable(BackButton, 'back-button'); diff --git a/client/src/components/GalleryItem/GalleryItem.js b/client/src/components/GalleryItem/GalleryItem.js index 7b83fde14..53b5e07d0 100644 --- a/client/src/components/GalleryItem/GalleryItem.js +++ b/client/src/components/GalleryItem/GalleryItem.js @@ -603,10 +603,9 @@ function mapDispatchToProps(dispatch) { } const ConnectedGalleryItem = connect(mapStateToProps, mapDispatchToProps)(GalleryItem); -const type = 'GalleryItem'; -const File = createSelectable(draggable(type)(ConnectedGalleryItem)); -const Folder = createSelectable(droppable(type)(File)); +const File = createSelectable(draggable(ConnectedGalleryItem)); +const Folder = createSelectable(droppable(File)); export { GalleryItem as Component, Folder, diff --git a/client/src/components/GalleryItem/GalleryItem.scss b/client/src/components/GalleryItem/GalleryItem.scss index 4162d9365..836fa7691 100644 --- a/client/src/components/GalleryItem/GalleryItem.scss +++ b/client/src/components/GalleryItem/GalleryItem.scss @@ -434,11 +434,12 @@ $gallery-item-label-height: 40px; } .gallery-item__drag-layer-preview { - transform: scale(0.4) translate(-100%, -160%); + transform: scale(0.4); border: 1px solid $component-active-border-color; - .gallery-item__thumbnail { - transform: scale(2.5) translate(22px, 16px); + .gallery-item__thumbnail, + .gallery-item__drag-layer-count { + transform: scale(2.5); } } @@ -462,8 +463,8 @@ $gallery-item-label-height: 40px; display: inline-block; position: absolute; font-size: 1rem; - top: -45%; - left: 25%; + top: 0; + right: 0; z-index: 105; } diff --git a/client/src/components/GalleryItem/GalleryItemDragLayer.js b/client/src/components/GalleryItem/GalleryItemDragLayer.js index bf06fc66d..1585d3a2a 100644 --- a/client/src/components/GalleryItem/GalleryItemDragLayer.js +++ b/client/src/components/GalleryItem/GalleryItemDragLayer.js @@ -1,76 +1,50 @@ -import React, { Component } from 'react'; +import React from 'react'; import PropTypes from 'prop-types'; -import { DragLayer } from 'react-dnd'; import Badge from 'components/Badge/Badge'; import GalleryItem from './GalleryItem'; -class GalleryItemDragLayer extends Component { - getOffset() { - const { - offset, - dragged, - } = this.props; - return { - transform: offset && `translate(${offset.x + dragged.x}px, ${offset.y + dragged.y}px)`, - }; - } +function GalleryItemDragLayer(props) { + const { draggingItems, draggingItemProps } = props; + const selectionCount = draggingItems.length; + const shadows = [ + selectionCount > 1 + ?
+ : null, + selectionCount > 2 + ?
+ : null, + ]; - render() { - if (!this.props.isDragging) { - return null; - } - const { item } = this.props; - if (!item.selected) { - return null; - } - const selectionCount = item.selected.length; - const shadows = [ - selectionCount > 1 - ?
- : null, - selectionCount > 2 - ?
- : null, - ]; + // Depending on whether the dragging item is a folder, the badge showing how many + // items are currently being dragged needs to be in a different spot in the DOM + // so it correctly renders in the corner of the drag preview + const isFolder = draggingItemProps.item.type === 'folder'; + let badge = null; + if (selectionCount > 1) { + badge = ; + } - return ( -
-
-
- {shadows} - -
- {selectionCount > 1 - ? ( - - ) - : null - } + return ( +
+
+
+ {shadows} + + {isFolder && badge}
+ {!isFolder && badge}
- ); - } +
+ ); } GalleryItemDragLayer.propTypes = { - item: PropTypes.object, - offset: PropTypes.shape({ - x: PropTypes.number.isRequired, - y: PropTypes.number.isRequired, - }), - isDragging: PropTypes.bool.isRequired, + draggingItems: PropTypes.arrayOf(PropTypes.number), + draggingItemProps: PropTypes.object, }; -const collect = (monitor) => ({ - item: monitor.getItem(), - offset: monitor.getInitialClientOffset(), - dragged: monitor.getDifferenceFromInitialOffset(), - isDragging: monitor.isDragging(), -}); - -// eslint-disable-next-line new-cap -export default DragLayer(collect)(GalleryItemDragLayer); +export default GalleryItemDragLayer; diff --git a/client/src/components/GalleryItem/README.md b/client/src/components/GalleryItem/README.md index f54c3679a..0055ad8d0 100644 --- a/client/src/components/GalleryItem/README.md +++ b/client/src/components/GalleryItem/README.md @@ -29,7 +29,7 @@ Helps apply react-dnd to Files, so that the file can interact with dragging. ## Example ```js -const draggableComponent = draggable('Item')(Component); +const draggableComponent = draggable(Component); ``` ## Properties @@ -44,7 +44,7 @@ Helps apply react-dnd to Folders, so that a file could be dragged on it with the ## Example ```js -const droppableComponent = droppable('Item')(Component); +const droppableComponent = droppable(Component); ``` ## Properties diff --git a/client/src/components/GalleryItem/draggable.js b/client/src/components/GalleryItem/draggable.js index 720d909f1..d097010d3 100644 --- a/client/src/components/GalleryItem/draggable.js +++ b/client/src/components/GalleryItem/draggable.js @@ -1,75 +1,35 @@ -import React, { Component } from 'react'; +import React from 'react'; import PropTypes from 'prop-types'; -import { DragSource } from 'react-dnd'; -import { getEmptyImage } from 'react-dnd-html5-backend'; +import { useDraggable } from '@dnd-kit/core'; -export default function draggable(type) { - const spec = { - canDrag(props) { - return props.canDrag; - }, - beginDrag(props) { - const { id } = props.item; - if (typeof props.onDrag === 'function') { - props.onDrag(true, id); - } - const selected = props.selectedFiles.concat([]); - if (!selected.includes(id)) { - selected.push(id); - } - - return { selected, props }; - }, - endDrag(props) { - const { id } = props.item; - if (typeof props.onDrag === 'function') { - props.onDrag(false, id); - } - }, - }; - - const collect = (connect, monitor) => ({ - connectDragPreview: connect.dragPreview(), - connectDragSource: connect.dragSource(), - isDragging: monitor.isDragging(), - }); - - // eslint-disable-next-line new-cap - const dragItem = DragSource(type, spec, collect); - - return (Item) => { - class DraggableItem extends Component { - componentDidMount() { - // Use empty image as a drag preview so browsers don't draw it - // and we can draw whatever we want on the custom drag layer instead. - this.props.connectDragPreview(getEmptyImage(), { - // IE fallback: specify that we'd rather screenshot the node - // when it already knows it's being dragged so we can hide it with CSS. - captureDraggingState: true, - }); - } - - render() { - const { connectDragSource } = this.props; - const item = ; - - if (typeof item.type === 'string') { - return connectDragSource(item); - } - return connectDragSource(
{ item }
); - } +export default function draggable(Item, uniqueID = null) { + function DraggableItem(props) { + let id = uniqueID; + if (id === null) { + id = props.item.id; } - DraggableItem.propTypes = { - connectDragSource: PropTypes.func.isRequired, - connectDragPreview: PropTypes.func.isRequired, - item: PropTypes.shape({ - id: PropTypes.number.isRequired, - }).isRequired, - onDrag: PropTypes.func, - selectedFiles: PropTypes.arrayOf(PropTypes.number), - }; - - return dragItem(DraggableItem); + const canDrag = typeof props.canDrag === 'boolean' ? props.canDrag : true; + const { attributes, listeners, setNodeRef } = useDraggable({ disabled: !canDrag, id, data: { props } }); + const item = ; + + return
{ item }
; + } + + DraggableItem.propTypes = { + item: PropTypes.shape({ + id: PropTypes.number.isRequired, + }).isRequired, + onDrag: PropTypes.func, + canDrag: PropTypes.bool, + selectedFiles: PropTypes.arrayOf(PropTypes.number), }; + + return DraggableItem; } diff --git a/client/src/components/GalleryItem/droppable.js b/client/src/components/GalleryItem/droppable.js index ee84302d9..abc78129d 100644 --- a/client/src/components/GalleryItem/droppable.js +++ b/client/src/components/GalleryItem/droppable.js @@ -1,55 +1,26 @@ -import React, { Component } from 'react'; +import React from 'react'; import PropTypes from 'prop-types'; -import { DropTarget } from 'react-dnd'; +import { useDroppable } from '@dnd-kit/core'; -export default function droppable(types) { - const spec = { - drop(props, monitor) { - if (monitor.canDrop()) { - const item = monitor.getItem(); - props.onDropFiles(props.item.id, item.selected); - } - }, - canDrop(props, monitor) { - const item = monitor.getItem(); - - // check that it is not a folder by itself dragged onto itself - return !item.selected.includes(props.item.id); - }, - }; - - const collect = (connect, monitor) => { - const over = monitor.isOver(); - return { - isDropping: over && monitor.canDrop(), - connectDropTarget: connect.dropTarget(), - isOver: over, - }; - }; - - // eslint-disable-next-line new-cap - const dropItem = DropTarget(types, spec, collect); - - return (Item) => { - class DroppableItem extends Component { - render() { - const { connectDropTarget } = this.props; - const item = ; - - if (typeof item.type === 'string') { - return connectDropTarget(item); - } - return connectDropTarget(
{ item }
); - } +export default function droppable(Item, uniqueID = null) { + function DroppableItem(props) { + let id = uniqueID; + if (id === null) { + id = props.item.id; } - DroppableItem.propTypes = { - connectDropTarget: PropTypes.func.isRequired, - item: PropTypes.shape({ - id: PropTypes.number.isRequired, - }).isRequired, - }; + const { setNodeRef, isOver } = useDroppable({ id }); + const item = ; - return dropItem(DroppableItem); + return
{ item }
; + } + + DroppableItem.propTypes = { + connectDropTarget: PropTypes.func.isRequired, + item: PropTypes.shape({ + id: PropTypes.number.isRequired, + }).isRequired, }; + + return DroppableItem; } diff --git a/client/src/containers/Gallery/Gallery.js b/client/src/containers/Gallery/Gallery.js index a55879ef2..abd746cac 100644 --- a/client/src/containers/Gallery/Gallery.js +++ b/client/src/containers/Gallery/Gallery.js @@ -952,7 +952,7 @@ class Gallery extends Component { ref={gallery => { this.gallery = gallery; }} > {this.renderTransitionBulkActions()} - + {this.renderToolbar()} { + setDragging(true); + setDraggingItemID(event.active.id); + setDraggingItemProps(event.active.data.current.props); + }); - componentDidUpdate() { - setTimeout(() => { - if (!this.mounted || !this.context.dragDropManager) { - return; - } - const manager = this.context.dragDropManager; - // isDragging only updates after one render cycle, which makes this throttle necessary - const dragging = manager.monitor.isDragging(); - if (this.state.dragging !== dragging) { - this.setState({ dragging }); + const handleDragEnd = useCallback((event) => { + setDragging(false); + setDraggingItemID(null); + setDraggingItemProps(null); + }); + + const sensors = useSensors( + // Pointer sensor is for touch and mouse. + // The activation constraint allows clicking and small twitches without starting a "drag". + useSensor(PointerSensor, { + activationConstraint: { + distance: 10 } - }); - } + }), + ); - componentWillUnmount() { - this.mounted = false; - window.removeEventListener('drop', this.handleDrop, true); - } + // componentDidMount() { + // window.addEventListener('drop', this.handleDrop, true); + // } - handleDrop() { - const manager = this.context.dragDropManager; - const backend = manager && manager.backend; + // componentWillUnmount() { + // window.removeEventListener('drop', this.handleDrop, true); + // } - if (backend && backend.isDraggingNativeItem()) { - backend.endDragNativeItem(); - } + const draggingItems = [...selectedFiles]; + if (!draggingItems.includes(draggingItemID)) { + draggingItems.push(draggingItemID); } - render() { - const { - className, - children, - } = this.props; - - return ( -
+ return ( +
+ {children} - -
- ); - } + {dragging && } + +
+ ); } GalleryDND.contextTypes = { dragDropManager: PropTypes.object, }; GalleryDND.propTypes = { + selectedFiles: PropTypes.arrayOf(PropTypes.number), className: PropTypes.string, children: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.node), @@ -77,4 +71,4 @@ GalleryDND.propTypes = { ]), }; -export default context(GalleryDND); +export default GalleryDND; diff --git a/package.json b/package.json index a97ec9687..02f470a2d 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,9 @@ }, "dependencies": { "@deltablot/dropzone": "^7.2.0", + "@dnd-kit/core": "^6.3.1", + "@dnd-kit/modifiers": "^9.0.0", + "@dnd-kit/utilities": "^3.2.2", "@popperjs/core": "^2.11.6", "bootstrap": "^4.6.2", "classnames": "^2.3.2", diff --git a/yarn.lock b/yarn.lock index abf8cc6ab..4a84a7f55 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1000,6 +1000,37 @@ resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== +"@dnd-kit/accessibility@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@dnd-kit/accessibility/-/accessibility-3.1.1.tgz#3b4202bd6bb370a0730f6734867785919beac6af" + integrity sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw== + dependencies: + tslib "^2.0.0" + +"@dnd-kit/core@^6.3.1": + version "6.3.1" + resolved "https://registry.yarnpkg.com/@dnd-kit/core/-/core-6.3.1.tgz#4c36406a62c7baac499726f899935f93f0e6d003" + integrity sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ== + dependencies: + "@dnd-kit/accessibility" "^3.1.1" + "@dnd-kit/utilities" "^3.2.2" + tslib "^2.0.0" + +"@dnd-kit/modifiers@^9.0.0": + version "9.0.0" + resolved "https://registry.yarnpkg.com/@dnd-kit/modifiers/-/modifiers-9.0.0.tgz#96a0280c77b10c716ef79d9792ce7ad04370771d" + integrity sha512-ybiLc66qRGuZoC20wdSSG6pDXFikui/dCNGthxv4Ndy8ylErY0N3KVxY2bgo7AWwIbxDmXDg3ylAFmnrjcbVvw== + dependencies: + "@dnd-kit/utilities" "^3.2.2" + tslib "^2.0.0" + +"@dnd-kit/utilities@^3.2.2": + version "3.2.2" + resolved "https://registry.yarnpkg.com/@dnd-kit/utilities/-/utilities-3.2.2.tgz#5a32b6af356dc5f74d61b37d6f7129a4040ced7b" + integrity sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg== + dependencies: + tslib "^2.0.0" + "@dual-bundle/import-meta-resolve@^4.1.0": version "4.1.0" resolved "https://registry.yarnpkg.com/@dual-bundle/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz#519c1549b0e147759e7825701ecffd25e5819f7b" @@ -7976,7 +8007,7 @@ tsconfig-paths@^3.15.0: minimist "^1.2.6" strip-bom "^3.0.0" -tslib@^2.8.0: +tslib@^2.0.0, tslib@^2.8.0: version "2.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==