diff --git a/client/dist/js/TinyMCE_ssembed.js b/client/dist/js/TinyMCE_ssembed.js index 3437abfd5..1d853b961 100644 --- a/client/dist/js/TinyMCE_ssembed.js +++ b/client/dist/js/TinyMCE_ssembed.js @@ -1 +1 @@ -!function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=184)}({0:function(e,t){e.exports=React},1:function(e,t){e.exports=i18n},155:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 a(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)}function s(e,t){var r=e.config.sections.find(function(e){return e.name===w}),n=t.fileAttributes?t.fileAttributes.Url:"",i=r.form.remoteEditForm.schemaUrl,o=n&&i+"/?embedurl="+encodeURIComponent(n),a=r.form.remoteCreateForm.schemaUrl;return{sectionConfig:r,schemaUrl:o||a,targetUrl:n}}function l(e){return{actions:{schema:(0,m.bindActionCreators)(_,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var d=function(){function e(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function e(e,t){for(var r=0;r"+e.content+"");t.find(b).each(function(){var e=(0,o.default)(this),t=e.find("img.placeholder");if(0===t.length)return e.removeAttr("data-url"),void e.removeAttr("data-shortcode");var r=e.find(".caption").text(),n=parseInt(t.attr("width"),10),i=parseInt(t.attr("height"),10),a=e.data("url"),s={url:a,thumbnail:t.prop("src"),class:e.prop("class"),width:isNaN(n)?null:n,height:isNaN(i)?null:i,caption:r},l=p.default.serialise({name:"embed",properties:s,wrapped:!0,content:a});e.replaceWith(l)}),e.content=t.html()}),e.on("BeforeSetContent",function(e){for(var t=e.content,r=p.default.match("embed",!0,t);r;){var n=r.properties,i=(0,o.default)("
").attr("data-url",n.url||r.content).attr("data-shortcode","embed").addClass(n.class).addClass("ss-htmleditorfield-file embed"),a=(0,o.default)("").attr("src",n.thumbnail).addClass("placeholder");if(n.width&&(i.width(n.width),a.attr("width",n.width)),n.height&&a.attr("height",n.height),i.append(a),n.caption){var s=(0,o.default)("

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

").append(i).html()),r=p.default.match("embed",!0,t)}e.content=t})}};tinymce.PluginManager.add("ssembed",function(t){return e.init(t)})}(),o.default.entwine("ss",function(e){e("#insert-embed-react__dialog-wrapper").entwine({Element:null,Data:{},onunmatch:function(){this._clearModal()},_clearModal:function(){d.default.unmountComponentAtNode(this[0])},open:function(){this._renderModal(!0)},close:function(){this.setData({}),this._renderModal(!1)},_renderModal:function(e){var t=this,r=function(){return t.close()},n=function(){return t._handleInsert.apply(t,arguments)},i=function(){return t._handleCreate.apply(t,arguments)},o=function(){return t._handleLoadingError.apply(t,arguments)},a=this.getOriginalAttributes();d.default.render(s.default.createElement(v,{show:e,onCreate:i,onInsert:n,onHide:r,onLoadingError:o,bodyClassName:"modal__dialog modal__dialog--scrollable",className:"insert-embed-react__dialog-wrapper",fileAttributes:a}),this[0])},_handleLoadingError:function(){this.setData({}),this.open()},_handleInsert:function(e){var t=this.getData();this.setData(Object.assign({Url:t.Url},e)),this.insertRemote(),this.close()},_handleCreate:function(e){this.setData(Object.assign({},this.getData(),e)),this.open()},getOriginalAttributes:function(){var t=this.getData(),r=this.getElement();if(!r)return t;var n=e(r.getEditor().getSelectedNode());if(!n.length)return t;var i=n.closest(b).add(n.filter(b));if(!i.length)return t;var o=i.find("img.placeholder");if(0===o.length)return t;var a=i.find(".caption").text(),s=parseInt(o.width(),10),l=parseInt(o.height(),10);return{Url:i.data("url")||t.Url,CaptionText:a,PreviewUrl:o.attr("src"),Width:isNaN(s)?null:s,Height:isNaN(l)?null:l,Placement:this.findPosition(i.prop("class"))}},findPosition:function(e){var t=["leftAlone","center","rightAlone","left","right"];if("string"!=typeof e)return"";var r=e.split(" ");return t.find(function(e){return r.indexOf(e)>-1})},insertRemote:function(){var t=this.getElement();if(!t)return!1;var r=t.getEditor();if(!r)return!1;var n=this.getData(),i=(0,o.default)("
").attr("data-url",n.Url).attr("data-shortcode","embed").addClass(n.Placement).addClass("ss-htmleditorfield-file embed"),a=(0,o.default)("").attr("src",n.PreviewUrl).addClass("placeholder");if(n.Width&&(i.width(n.Width),a.attr("width",n.Width)),n.Height&&a.attr("height",n.Height),i.append(a),n.CaptionText){var s=(0,o.default)("

").addClass("caption").text(n.CaptionText);i.append(s)}var l=e(r.getSelectedNode()),d=e(null);return l.length&&(d=l.filter(b),0===d.length&&(d=l.closest(b)),0===d.length&&(d=l.filter("img.placeholder"))),d.length?d.replaceWith(i):(r.repaint(),r.insertContent(e("

").append(i.clone()).html(),{skip_undo:1})),r.addUndo(),r.repaint(),!0}})})},26:function(e,t){e.exports=FormBuilderModal},3:function(e,t){e.exports=ReactRedux},4:function(e,t){e.exports=Injector},5:function(e,t){e.exports=ReactDom},55:function(e,t){e.exports=SchemaActions},6:function(e,t){e.exports=Redux},7:function(e,t){e.exports=jQuery}}); \ No newline at end of file +!function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=184)}({0:function(e,t){e.exports=React},1:function(e,t){e.exports=i18n},155:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 a(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)}function s(e,t){var r=e.config.sections.find(function(e){return e.name===w}),n=t.fileAttributes?t.fileAttributes.Url:"",i=r.form.remoteEditForm.schemaUrl,o=n&&i+"/?embedurl="+encodeURIComponent(n),a=r.form.remoteCreateForm.schemaUrl;return{sectionConfig:r,schemaUrl:o||a,targetUrl:n}}function l(e){return{actions:{schema:(0,m.bindActionCreators)(_,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var d=function(){function e(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function e(e,t){for(var r=0;r"+e.content+"
");t.find(b).each(function(){var e=(0,o.default)(this),t=e.find("img.placeholder");if(0===t.length)return e.removeAttr("data-url"),void e.removeAttr("data-shortcode");var r=e.find(".caption").text(),n=parseInt(t.attr("width"),10),i=parseInt(t.attr("height"),10),a=e.data("url"),s={url:a,thumbnail:t.prop("src"),class:e.prop("class"),width:isNaN(n)?null:n,height:isNaN(i)?null:i,caption:r},l=p.default.serialise({name:"embed",properties:s,wrapped:!0,content:a});e.replaceWith(l)}),e.content=t.html()}),e.on("BeforeSetContent",function(e){for(var t=e.content,r=p.default.match("embed",!0,t);r;){var n=r.properties,i=(0,o.default)("
").attr("data-url",n.url||r.content).attr("data-shortcode","embed").addClass(n.class).addClass("ss-htmleditorfield-file embed"),a=(0,o.default)("").attr("src",n.thumbnail).addClass("placeholder");if(n.width&&(i.width(n.width),a.attr("width",n.width)),n.height&&a.attr("height",n.height),i.append(a),n.caption){var s=(0,o.default)("

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

").append(i).html()),r=p.default.match("embed",!0,t)}e.content=t})}};tinymce.PluginManager.add("ssembed",function(t){return e.init(t)})}(),o.default.entwine("ss",function(e){e(".js-injector-boot #insert-embed-react__dialog-wrapper").entwine({Element:null,Data:{},onunmatch:function(){this._clearModal()},_clearModal:function(){d.default.unmountComponentAtNode(this[0])},open:function(){this._renderModal(!0)},close:function(){this.setData({}),this._renderModal(!1)},_renderModal:function(e){var t=this,r=function(){return t.close()},n=function(){return t._handleInsert.apply(t,arguments)},i=function(){return t._handleCreate.apply(t,arguments)},o=function(){return t._handleLoadingError.apply(t,arguments)},a=this.getOriginalAttributes();d.default.render(s.default.createElement(v,{show:e,onCreate:i,onInsert:n,onHide:r,onLoadingError:o,bodyClassName:"modal__dialog modal__dialog--scrollable",className:"insert-embed-react__dialog-wrapper",fileAttributes:a}),this[0])},_handleLoadingError:function(){this.setData({}),this.open()},_handleInsert:function(e){var t=this.getData();this.setData(Object.assign({Url:t.Url},e)),this.insertRemote(),this.close()},_handleCreate:function(e){this.setData(Object.assign({},this.getData(),e)),this.open()},getOriginalAttributes:function(){var t=this.getData(),r=this.getElement();if(!r)return t;var n=e(r.getEditor().getSelectedNode());if(!n.length)return t;var i=n.closest(b).add(n.filter(b));if(!i.length)return t;var o=i.find("img.placeholder");if(0===o.length)return t;var a=i.find(".caption").text(),s=parseInt(o.width(),10),l=parseInt(o.height(),10);return{Url:i.data("url")||t.Url,CaptionText:a,PreviewUrl:o.attr("src"),Width:isNaN(s)?null:s,Height:isNaN(l)?null:l,Placement:this.findPosition(i.prop("class"))}},findPosition:function(e){var t=["leftAlone","center","rightAlone","left","right"];if("string"!=typeof e)return"";var r=e.split(" ");return t.find(function(e){return r.indexOf(e)>-1})},insertRemote:function(){var t=this.getElement();if(!t)return!1;var r=t.getEditor();if(!r)return!1;var n=this.getData(),i=(0,o.default)("
").attr("data-url",n.Url).attr("data-shortcode","embed").addClass(n.Placement).addClass("ss-htmleditorfield-file embed"),a=(0,o.default)("").attr("src",n.PreviewUrl).addClass("placeholder");if(n.Width&&(i.width(n.Width),a.attr("width",n.Width)),n.Height&&a.attr("height",n.Height),i.append(a),n.CaptionText){var s=(0,o.default)("

").addClass("caption").text(n.CaptionText);i.append(s)}var l=e(r.getSelectedNode()),d=e(null);return l.length&&(d=l.filter(b),0===d.length&&(d=l.closest(b)),0===d.length&&(d=l.filter("img.placeholder"))),d.length?d.replaceWith(i):(r.repaint(),r.insertContent(e("

").append(i.clone()).html(),{skip_undo:1})),r.addUndo(),r.repaint(),!0}})})},26:function(e,t){e.exports=FormBuilderModal},3:function(e,t){e.exports=ReactRedux},4:function(e,t){e.exports=Injector},5:function(e,t){e.exports=ReactDom},55:function(e,t){e.exports=SchemaActions},6:function(e,t){e.exports=Redux},7:function(e,t){e.exports=jQuery}}); \ 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 553a98ff5..e5c39b11f 100644 --- a/client/dist/js/TinyMCE_sslink-file.js +++ b/client/dist/js/TinyMCE_sslink-file.js @@ -1 +1 @@ -!function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},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=185)}({0:function(e,t){e.exports=React},1:function(e,t){e.exports=i18n},159:function(e,t){e.exports=TinyMCEActionRegistrar},16:function(e,t){e.exports=ShortcodeSerialiser},185:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=i(r),a=n(159),l=i(a),s=n(0),u=i(s),c=n(5),d=i(c),f=n(7),p=i(f),g=n(16),m=i(g),_=n(21),k=i(_),h=n(4);l.default.addAction("sslink",{text:o.default._t("AssetAdmin.LINKLABEL_FILE","Link to a file"),onclick:function(e){return e.execCommand("sslinkfile")}}).addCommandWithUrlTest("sslinkfile",/^\[file_link/);var x={init:function(e){e.addCommand("sslinkfile",function(){(0,p.default)("#"+e.id).entwine("ss").openLinkFileDialog()})}},b="insert-link__dialog-wrapper--file",v=(0,h.loadComponent)(k.default);p.default.entwine("ss",function(e){e(".insert-link__dialog-wrapper--internal .nav-link, .insert-media-react__dialog-wrapper .breadcrumb__container a").entwine({onclick:function(e){return e.preventDefault()}}),e("textarea.htmleditor").entwine({openLinkFileDialog:function(){var t=e("#"+b);t.length||(t=e('
'),e("body").append(t)),t.addClass("insert-link__dialog-wrapper"),t.setElement(this),t.open()}}),e("#"+b).entwine({renderModal:function(e){var t=this,n=function(){return t.close()},i=function(){return t.handleInsert.apply(t,arguments)},r=this.getOriginalAttributes(),o=tinymce.activeEditor.selection,a=o.getContent()||"",l=o.getNode().tagName,s="A"!==l&&""===a.trim();d.default.render(u.default.createElement(v,{show:e,type:"insert-link",onInsert:i,onHide:n,title:!1,bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--internal",fileAttributes:r,requireLinkText:s}),this[0])},buildAttributes:function(e){return{href:m.default.serialise({name:"file_link",properties:{id:e.ID}},!0)+(e.Anchor&&e.Anchor.length?"#"+e.Anchor:""),target:e.TargetBlank?"_blank":"",title:e.Description}},getOriginalAttributes:function(){var t=this.getElement().getEditor(),n=e(t.getSelectedNode()),i=(n.attr("href")||"").split("#");if(!i[0])return{};var r=m.default.match("file_link",!1,i[0]);return r?{ID:r.properties.id?parseInt(r.properties.id,10):0,Anchor:i[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}:{}}})}),tinymce.PluginManager.add("sslinkfile",function(e){return x.init(e)}),t.default=x},21:function(e,t){e.exports=InsertMediaModal},4:function(e,t){e.exports=Injector},5:function(e,t){e.exports=ReactDom},7:function(e,t){e.exports=jQuery}}); \ No newline at end of file +!function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},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=185)}({0:function(e,t){e.exports=React},1:function(e,t){e.exports=i18n},159:function(e,t){e.exports=TinyMCEActionRegistrar},16:function(e,t){e.exports=ShortcodeSerialiser},185:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=i(r),a=n(159),l=i(a),s=n(0),u=i(s),c=n(5),d=i(c),f=n(7),p=i(f),g=n(16),m=i(g),_=n(21),k=i(_),h=n(4);l.default.addAction("sslink",{text:o.default._t("AssetAdmin.LINKLABEL_FILE","Link to a file"),onclick:function(e){return e.execCommand("sslinkfile")}}).addCommandWithUrlTest("sslinkfile",/^\[file_link/);var x={init:function(e){e.addCommand("sslinkfile",function(){(0,p.default)("#"+e.id).entwine("ss").openLinkFileDialog()})}},b="insert-link__dialog-wrapper--file",v=(0,h.loadComponent)(k.default);p.default.entwine("ss",function(e){e(".insert-link__dialog-wrapper--internal .nav-link, .insert-media-react__dialog-wrapper .breadcrumb__container a").entwine({onclick:function(e){return e.preventDefault()}}),e("textarea.htmleditor").entwine({openLinkFileDialog:function(){var t=e("#"+b);t.length||(t=e('
'),e("body").append(t)),t.addClass("insert-link__dialog-wrapper"),t.setElement(this),t.open()}}),e(".js-injector-boot #"+b).entwine({renderModal:function(e){var t=this,n=function(){return t.close()},i=function(){return t.handleInsert.apply(t,arguments)},r=this.getOriginalAttributes(),o=tinymce.activeEditor.selection,a=o.getContent()||"",l=o.getNode().tagName,s="A"!==l&&""===a.trim();d.default.render(u.default.createElement(v,{show:e,type:"insert-link",onInsert:i,onHide:n,title:!1,bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--internal",fileAttributes:r,requireLinkText:s}),this[0])},buildAttributes:function(e){return{href:m.default.serialise({name:"file_link",properties:{id:e.ID}},!0)+(e.Anchor&&e.Anchor.length?"#"+e.Anchor:""),target:e.TargetBlank?"_blank":"",title:e.Description}},getOriginalAttributes:function(){var t=this.getElement().getEditor(),n=e(t.getSelectedNode()),i=(n.attr("href")||"").split("#");if(!i[0])return{};var r=m.default.match("file_link",!1,i[0]);return r?{ID:r.properties.id?parseInt(r.properties.id,10):0,Anchor:i[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}:{}}})}),tinymce.PluginManager.add("sslinkfile",function(e){return x.init(e)}),t.default=x},21:function(e,t){e.exports=InsertMediaModal},4:function(e,t){e.exports=Injector},5:function(e,t){e.exports=ReactDom},7:function(e,t){e.exports=jQuery}}); \ No newline at end of file diff --git a/client/dist/js/TinyMCE_ssmedia.js b/client/dist/js/TinyMCE_ssmedia.js index aad0f4384..394a3b2b8 100644 --- a/client/dist/js/TinyMCE_ssmedia.js +++ b/client/dist/js/TinyMCE_ssmedia.js @@ -1 +1 @@ -!function(t){function e(n){if(i[n])return i[n].exports;var a=i[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=186)}({0:function(t,e){t.exports=React},1:function(t,e){t.exports=i18n},16:function(t,e){t.exports=ShortcodeSerialiser},186:function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}var a=i(7),r=n(a),o=i(1),s=n(o),d=i(0),l=n(d),c=i(5),u=n(c),f=i(4),m=i(21),p=n(m),g=i(16),h=n(g),v=(0,f.loadComponent)(p.default),I='img[data-shortcode="image"]';!function(){var t={init:function(t){var e=s.default._t("AssetAdmin.INSERT_FROM_FILES","Insert from Files");t.addButton("ssmedia",{icon:"image",title:e,cmd:"ssmedia"}),t.addMenuItem("ssmedia",{icon:"image",text:e,cmd:"ssmedia"}),t.addCommand("ssmedia",function(){(0,r.default)("#"+t.id).entwine("ss").openMediaDialog()}),t.on("BeforeExecCommand",function(e){var i=e.command,n=e.ui,a=e.value;"mceAdvImage"!==i&&"mceImage"!==i||(e.preventDefault(),t.execCommand("ssmedia",n,a))}),t.on("SaveContent",function(t){var e=(0,r.default)(t.content);e.find(I).add(e.filter(I)).each(function(){var t=(0,r.default)(this),e={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")},i=h.default.serialise({name:"image",properties:e,wrapped:!1});t.replaceWith(i)}),t.content="",e.each(function(){void 0!==this.outerHTML&&(t.content+=this.outerHTML)})}),t.on("BeforeSetContent",function(t){for(var e=t.content,i=h.default.match("image",!1,e);i;){var n=i.properties,a=(0,r.default)("").attr(Object.assign({},n,{id:void 0,"data-id":n.id,"data-shortcode":"image"})).addClass("ss-htmleditorfield-file image");e=e.replace(i.original,(0,r.default)("
").append(a).html()),i=h.default.match("image",!1,e)}t.content=e})}};tinymce.PluginManager.add("ssmedia",function(e){return t.init(e)})}(),r.default.entwine("ss",function(t){t(".insert-media-react__dialog-wrapper .nav-link, .insert-media-react__dialog-wrapper .breadcrumb__container a").entwine({onclick:function(t){return t.preventDefault()}}),t("#insert-media-react__dialog-wrapper").entwine({Element:null,Data:{},onunmatch:function(){this._clearModal()},_clearModal:function(){u.default.unmountComponentAtNode(this[0])},open:function(){this._renderModal(!0)},close:function(){this._renderModal(!1)},_renderModal:function(t){var e=this,i=function(){return e.close()},n=function(){return e._handleInsert.apply(e,arguments)},a=this.getOriginalAttributes(),r=tinymce.activeEditor.selection,o=r.getContent()||"",s=r.getNode().tagName,d="A"!==s&&("IMG"===s||""===o.trim());delete a.url,u.default.render(l.default.createElement(v,{title:!1,type:"insert-media",show:t,onInsert:n,onHide:i,bodyClassName:"modal__dialog",className:"insert-media-react__dialog-wrapper",requireLinkText:d,fileAttributes:a}),this[0])},_handleInsert:function(t,e){var i=!1;this.setData(Object.assign({},t,e));try{switch(e?e.category:"image"){case"image":i=this.insertImage();break;default:i=this.insertFile()}}catch(t){this.statusMessage(t,"bad")}return i&&this.close(),Promise.resolve()},getOriginalAttributes:function(){var e=this.getElement();if(!e)return{};var i=e.getEditor().getSelectedNode();if(!i)return{};var n=t(i),a=(n.attr("href")||"").split("#");if(a[0]){var r=h.default.match("file_link",!1,a[0]);if(r)return{ID:r.properties.id?parseInt(r.properties.id,10):0,Anchor:a[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}}var o=n.parent(".captionImage").find(".caption"),s={url:n.attr("src"),AltText:n.attr("alt"),InsertWidth:n.attr("width"),InsertHeight:n.attr("height"),TitleTooltip:n.attr("title"),Alignment:this.findPosition(n.attr("class")),Caption:o.text(),ID:n.attr("data-id")};return["InsertWidth","InsertHeight","ID"].forEach(function(t){s[t]="string"==typeof s[t]?parseInt(s[t],10):null}),s},findPosition:function(t){return["leftAlone","center","rightAlone","left","right"].find(function(e){return new RegExp("\\b"+e+"\\b").test(t)})},getAttributes:function(){var t=this.getData();return{src:t.url,alt:t.AltText,width:t.InsertWidth,height:t.InsertHeight,title:t.TitleTooltip,class:t.Alignment,"data-id":t.ID,"data-shortcode":"image"}},getExtraData:function(){var t=this.getData();return{CaptionText:t&&t.Caption}},insertFile:function(){var e=this.getData(),i=this.getElement().getEditor(),n=t(i.getSelectedNode()),a=h.default.serialise({name:"file_link",properties:{id:e.ID}},!0),r=tinymce.activeEditor.selection,o=r.getContent()||"",s=o||e.Text||e.filename;n.is("a")&&n.html()&&(s="");var d={href:a,target:e.TargetBlank?"_blank":"",title:e.Description};if(n.is("img")){s=e.Text||e.filename;var l=t("").attr(d).text(s);n.replaceWith(l),i.addUndo(),i.repaint()}else this.insertLinkInEditor(d,s);return!0},insertImage:function(){var e=this.getElement();if(!e)return!1;var i=e.getEditor();if(!i)return!1;var n=t(i.getSelectedNode()),a=this.getAttributes(),r=this.getExtraData(),o=n&&n.is("img,a")?n:null;o&&o.parent().is(".captionImage")&&(o=o.parent());var s=n&&n.is("img")?n:t("");s.attr(a).addClass("ss-htmleditorfield-file image");var d=s.parent(".captionImage"),l=d.find(".caption");r.CaptionText?(d.length||(d=t("
")),d.attr("class","captionImage "+a.class).removeAttr("data-mce-style").width(a.width),l.length||(l=t('

').appendTo(d)),l.attr("class","caption "+a.class).text(r.CaptionText)):(d=null,l=null);var c=d||s;return o&&o.not(c).length&&o.replaceWith(c),d&&d.prepend(s),o||(i.repaint(),i.insertContent(t("
").append(c).html(),{skip_undo:1})),i.addUndo(),i.repaint(),!0},statusMessage:function(e,i){var n=t("
").text(e).html();t.noticeAdd({text:n,type:i,stayTime:5e3,inEffect:{left:"0",opacity:"show"}})}})})},21:function(t,e){t.exports=InsertMediaModal},4:function(t,e){t.exports=Injector},5:function(t,e){t.exports=ReactDom},7:function(t,e){t.exports=jQuery}}); \ No newline at end of file +!function(t){function e(n){if(i[n])return i[n].exports;var a=i[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=186)}({0:function(t,e){t.exports=React},1:function(t,e){t.exports=i18n},16:function(t,e){t.exports=ShortcodeSerialiser},186:function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}var a=i(7),r=n(a),o=i(1),s=n(o),d=i(0),l=n(d),c=i(5),u=n(c),f=i(4),m=i(21),p=n(m),g=i(16),h=n(g),v=(0,f.loadComponent)(p.default),I='img[data-shortcode="image"]';!function(){var t={init:function(t){var e=s.default._t("AssetAdmin.INSERT_FROM_FILES","Insert from Files");t.addButton("ssmedia",{icon:"image",title:e,cmd:"ssmedia"}),t.addMenuItem("ssmedia",{icon:"image",text:e,cmd:"ssmedia"}),t.addCommand("ssmedia",function(){(0,r.default)("#"+t.id).entwine("ss").openMediaDialog()}),t.on("BeforeExecCommand",function(e){var i=e.command,n=e.ui,a=e.value;"mceAdvImage"!==i&&"mceImage"!==i||(e.preventDefault(),t.execCommand("ssmedia",n,a))}),t.on("SaveContent",function(t){var e=(0,r.default)(t.content);e.find(I).add(e.filter(I)).each(function(){var t=(0,r.default)(this),e={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")},i=h.default.serialise({name:"image",properties:e,wrapped:!1});t.replaceWith(i)}),t.content="",e.each(function(){void 0!==this.outerHTML&&(t.content+=this.outerHTML)})}),t.on("BeforeSetContent",function(t){for(var e=t.content,i=h.default.match("image",!1,e);i;){var n=i.properties,a=(0,r.default)("").attr(Object.assign({},n,{id:void 0,"data-id":n.id,"data-shortcode":"image"})).addClass("ss-htmleditorfield-file image");e=e.replace(i.original,(0,r.default)("
").append(a).html()),i=h.default.match("image",!1,e)}t.content=e})}};tinymce.PluginManager.add("ssmedia",function(e){return t.init(e)})}(),r.default.entwine("ss",function(t){t(".insert-media-react__dialog-wrapper .nav-link, .insert-media-react__dialog-wrapper .breadcrumb__container a").entwine({onclick:function(t){return t.preventDefault()}}),t(".js-injector-boot #insert-media-react__dialog-wrapper").entwine({Element:null,Data:{},onunmatch:function(){this._clearModal()},_clearModal:function(){u.default.unmountComponentAtNode(this[0])},open:function(){this._renderModal(!0)},close:function(){this._renderModal(!1)},_renderModal:function(t){var e=this,i=function(){return e.close()},n=function(){return e._handleInsert.apply(e,arguments)},a=this.getOriginalAttributes(),r=tinymce.activeEditor.selection,o=r.getContent()||"",s=r.getNode().tagName,d="A"!==s&&("IMG"===s||""===o.trim());delete a.url,u.default.render(l.default.createElement(v,{title:!1,type:"insert-media",show:t,onInsert:n,onHide:i,bodyClassName:"modal__dialog",className:"insert-media-react__dialog-wrapper",requireLinkText:d,fileAttributes:a}),this[0])},_handleInsert:function(t,e){var i=!1;this.setData(Object.assign({},t,e));try{switch(e?e.category:"image"){case"image":i=this.insertImage();break;default:i=this.insertFile()}}catch(t){this.statusMessage(t,"bad")}return i&&this.close(),Promise.resolve()},getOriginalAttributes:function(){var e=this.getElement();if(!e)return{};var i=e.getEditor().getSelectedNode();if(!i)return{};var n=t(i),a=(n.attr("href")||"").split("#");if(a[0]){var r=h.default.match("file_link",!1,a[0]);if(r)return{ID:r.properties.id?parseInt(r.properties.id,10):0,Anchor:a[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}}var o=n.parent(".captionImage").find(".caption"),s={url:n.attr("src"),AltText:n.attr("alt"),InsertWidth:n.attr("width"),InsertHeight:n.attr("height"),TitleTooltip:n.attr("title"),Alignment:this.findPosition(n.attr("class")),Caption:o.text(),ID:n.attr("data-id")};return["InsertWidth","InsertHeight","ID"].forEach(function(t){s[t]="string"==typeof s[t]?parseInt(s[t],10):null}),s},findPosition:function(t){return["leftAlone","center","rightAlone","left","right"].find(function(e){return new RegExp("\\b"+e+"\\b").test(t)})},getAttributes:function(){var t=this.getData();return{src:t.url,alt:t.AltText,width:t.InsertWidth,height:t.InsertHeight,title:t.TitleTooltip,class:t.Alignment,"data-id":t.ID,"data-shortcode":"image"}},getExtraData:function(){var t=this.getData();return{CaptionText:t&&t.Caption}},insertFile:function(){var e=this.getData(),i=this.getElement().getEditor(),n=t(i.getSelectedNode()),a=h.default.serialise({name:"file_link",properties:{id:e.ID}},!0),r=tinymce.activeEditor.selection,o=r.getContent()||"",s=o||e.Text||e.filename;n.is("a")&&n.html()&&(s="");var d={href:a,target:e.TargetBlank?"_blank":"",title:e.Description};if(n.is("img")){s=e.Text||e.filename;var l=t("").attr(d).text(s);n.replaceWith(l),i.addUndo(),i.repaint()}else this.insertLinkInEditor(d,s);return!0},insertImage:function(){var e=this.getElement();if(!e)return!1;var i=e.getEditor();if(!i)return!1;var n=t(i.getSelectedNode()),a=this.getAttributes(),r=this.getExtraData(),o=n&&n.is("img,a")?n:null;o&&o.parent().is(".captionImage")&&(o=o.parent());var s=n&&n.is("img")?n:t("");s.attr(a).addClass("ss-htmleditorfield-file image");var d=s.parent(".captionImage"),l=d.find(".caption");r.CaptionText?(d.length||(d=t("
")),d.attr("class","captionImage "+a.class).removeAttr("data-mce-style").width(a.width),l.length||(l=t('

').appendTo(d)),l.attr("class","caption "+a.class).text(r.CaptionText)):(d=null,l=null);var c=d||s;return o&&o.not(c).length&&o.replaceWith(c),d&&d.prepend(s),o||(i.repaint(),i.insertContent(t("
").append(c).html(),{skip_undo:1})),i.addUndo(),i.repaint(),!0},statusMessage:function(e,i){var n=t("
").text(e).html();t.noticeAdd({text:n,type:i,stayTime:5e3,inEffect:{left:"0",opacity:"show"}})}})})},21:function(t,e){t.exports=InsertMediaModal},4:function(t,e){t.exports=Injector},5:function(t,e){t.exports=ReactDom},7:function(t,e){t.exports=jQuery}}); \ No newline at end of file diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index db68c2a81..6205727d2 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1 +1 @@ -!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={};t.m=e,t.c=n,t.i=function(e){return e},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=163)}([function(e,t){e.exports=React},function(e,t){e.exports=i18n},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){e.exports=ReactRedux},function(e,t){e.exports=Injector},function(e,t){e.exports=ReactDom},function(e,t){e.exports=Redux},function(e,t){e.exports=jQuery},function(e,t){function n(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n0}).length)return alert(o.default._t("AssetAdmin.BULK_ACTIONS_DELETE_FOLDER","These folders contain files which are currently in use, you must move or delete their contents before you can delete the folder.")),void n("cancelled");var r=e.filter(function(e){return"folder"!==e.type&&e.inUseCount>0}),i=o.default._t("AssetAdmin.BULK_ACTIONS_DELETE_CONFIRM","Are you sure you want to delete these files?");1===e.length&&1===r.length?i=o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SINGLE_CONFIRM","This file is currently used in %s place(s), are you sure you want to delete it?"),e[0].inUseCount):r.length>0&&(i=o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_DELETE_MULTI_CONFIRM","There are %s files currently in use, are you sure you want to delete these files?"),r.length)),r.length>0&&(i+="\n\n",i+=o.default._t("AssetAdmin.BULK_ACTIONS_DELETE_WARNING","Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.")),confirm(i)?t():n("cancelled")})})},{value:"edit",label:o.default._t("AssetAdmin.BULK_ACTIONS_EDIT","Edit"),className:"font-icon-edit",destructive:!1,canApply:function(e){return 1===e.length},callback:null},{value:"move",label:o.default._t("AssetAdmin.BULK_ACTIONS_MOVE","Move"),className:"font-icon-folder-move",canApply:function(e){return e.every(function(e){return 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:function(e){return e.some(function(e){return e&&!e.published})&&e.every(function(e){return 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:function(e){return e.some(function(e){return e.published})&&e.every(function(e){return e.canEdit&&"folder"!==e.type})},confirm:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){return new Promise(function(t,n){var r=e.filter(function(e){return e.inUseCount>0}),i=o.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH_CONFIRM","Are you sure you want to unpublish these files?");1===e.length&&1===r.length?i=o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH_SINGLE_CONFIRM","This file is currently used in %s place(s), are you sure you want to unpublish it?"),e[0].inUseCount):r.length>0&&(i=o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH_MULTI_CONFIRM","There are %s files currently in use, are you sure you want to unpublish these files?"),r.length)),confirm(i)?t():n("cancelled")})})}],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"}},function(e,t,n){function r(e){return s(e)?o(e):i(e)}var o=n(107),i=n(116),s=n(10);e.exports=r},function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},function(e,t){e.exports=ReactApollo},,function(e,t,n){function r(e){return null==e?void 0===e?l:a:u&&u in Object(e)?i(e):s(e)}var o=n(22),i=n(276),s=n(304),a="[object Null]",l="[object Undefined]",u=o?o.toStringTag:void 0;e.exports=r},function(e,t,n){function r(e,t,n,r){var s=!n;n||(n={});for(var a=-1,l=t.length;++a0}},{key:"getMetadataColumnProperty",value:function(e,t,n){var r=this.getColumnMetadataByName(e);return void 0===r||null===r?n:r.hasOwnProperty(t)?r[t]:n}},{key:"orderColumns",value:function(e){var t=this;return l(e,function(e){var n=a(t.columnMetadata,{columnName:e});return void 0===n||null===n||isNaN(n.order)?100:n.order})}},{key:"getColumns",value:function(){var e=0===this.filteredColumns.length?this.allColumns:this.filteredColumns;return e=u(e,this.metadataColumns),e=this.orderColumns(e)}}]),e}();e.exports=p},function(e,t,n){function r(e,t,n){var r=e[t];a.call(e,t)&&i(r,n)&&(void 0!==n||t in e)||o(e,t,n)}var o=n(109),i=n(34),s=Object.prototype,a=s.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){return"function"==typeof e?e:null==e?s:"object"==typeof e?a(e)?i(e[0],e[1]):o(e):l(e)}var o=n(239),i=n(240),s=n(35),a=n(2),l=n(144);e.exports=r},function(e,t){function n(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r-1&&e%1==0&&e-1}},{key:"toggleSelectConcat",value:function(e){this.props.actions.gallery.setConcatenateSelect(e.metaKey||e.ctrlKey)}},{key:"itemIsHighlighted",value:function(e){return this.props.fileId===e}},{key:"hasOpenedItem",value:function(){return!!this.props.fileId}},{key:"handleClearSearch",value:function(e){this.props.onClearSearch(e)}},{key:"handleGroupSelect",value:function(e){var t=this.props.actions.gallery,n=t.deselectFiles,r=t.selectFiles;this.props.concatenateSelect||n(null),r(e.filter(function(t,n){return e.indexOf(t)===n}))}},{key:"handleClearSelection",value:function(){this.props.actions.gallery.deselectFiles(null)}},{key:"handleOpenFolder",value:function(e,t){e.preventDefault(),this.props.actions.gallery.setErrorMessage(null),this.props.actions.gallery.setNoticeMessage(null),this.props.onOpenFolder(t.id)}},{key:"handleOpenFile",value:function(e,t){e.preventDefault(),null!==t.created&&this.props.onOpenFile(t.id,t)}},{key:"handleSelect",value:function(e,t){-1===this.props.selectedFiles.indexOf(t.id)?this.props.actions.gallery.selectFiles([t.id]):this.props.actions.gallery.deselectFiles([t.id])}},{key:"handleEnableDropzone",value:function(e){this.props.actions.gallery.setEnableDropzone(e)}},{key:"handleMoveFiles",value:function(e,t){var n=this;this.props.actions.files.moveFiles(e,t).then(function(){var r=L.default.MOVE_SUCCESS_DURATION,o="+"+t.length;n.props.actions.gallery.setFileBadge(e,o,"success",r),"function"==typeof n.props.onMoveFilesSuccess&&n.props.onMoveFilesSuccess(e,t)}).catch(function(){n.props.actions.gallery.setErrorMessage(g.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))})}},{key:"handleBulkEdit",value:function(e){this.props.onOpenFile(e[0].id)}},{key:"handleBulkMove",value:function(){this.props.actions.gallery.activateModal(L.default.MODAL_MOVE)}},{key:"renderSearchAlert",value:function(){var e=this.props.filters;if(!e||0===Object.keys(e).length)return null;var t=this.getSearchMessage(e);if(""===t)return null;var n=v.default.createElement("div",null,v.default.createElement("button",{onClick:this.handleClearSearch,className:"btn btn-info font-icon-cancel form-alert__btn--right"},g.default._t("AssetAdmin.SEARCHCLEARRESULTS","Clear results")),t);return v.default.createElement(M.default,{value:{react:n},type:"warning"})}},{key:"renderTransitionBulkActions",value:function(){return"admin"===this.props.type?v.default.createElement(P.default,{transitionName:"bulk-actions",transitionEnterTimeout:L.default.CSS_TRANSITION_TIME,transitionLeaveTimeout:L.default.CSS_TRANSITION_TIME},this.renderBulkActions()):null}},{key:"renderBulkActions",value:function(){var e=this,t=L.default.BULK_ACTIONS.map(function(t){if(!t.callback)switch(t.value){case"delete":return c({},t,{callback:e.handleBulkDelete});case"edit":return c({},t,{callback:e.handleBulkEdit});case"move":return c({},t,{callback:e.handleBulkMove});case"publish":return c({},t,{callback:e.handleBulkPublish});case"unpublish":return c({},t,{callback:e.handleBulkUnpublish});default:return t}return t}),n=[].concat(i(this.props.files),i(this.props.queuedFiles.items)),r=this.props.selectedFiles.map(function(e){return n.find(function(t){return t&&e===t.id})}).filter(function(e){return e});return r.length>0&&"admin"===this.props.type?v.default.createElement(A.default,{actions:t,items:r,key:r.length>0}):null}},{key:"renderGalleryView",value:function(){var e=this,t="table"===this.props.view?k.default:D.default,n=this.props.queuedFiles.items.filter(function(t){return!t.id||!e.props.files.find(function(e){return e.id===t.id})}).map(function(e){return Object.assign({},e,{uploading:!(e.id>0)})}),r=[].concat(i(n),i(this.props.files)).map(function(t){return Object.assign({},t||{},{selected:e.itemIsSelected(t.id),highlighted:e.itemIsHighlighted(t.id)})}),o=this.props,s=o.type,a=o.loading,l=o.page,u=o.totalCount,p=o.limit,c=o.sort,d=o.selectedFiles,f=o.badges,h={selectableItems:"admin"===s,files:r,loading:a,page:l,totalCount:u,limit:p,sort:c,selectedFiles:d,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:this.props.sectionConfig};return v.default.createElement(t,h)}},{key:"renderToolbar",value:function(){var e=this.props,t=e.GalleryToolbar,n=e.sort,r=e.view,o=e.folder,i=e.onCreateFolder,s=e.onOpenFolder,a=e.onViewChange,l={onMoveFiles:this.handleMoveFiles,onSort:this.handleSort,onCreateFolder:i,onOpenFolder:s,onViewChange:a,view:r,sort:n,folder:o};return v.default.createElement(t,l)}},{key:"render",value:function(){if(!this.props.folder)return this.props.errorMessage||this.props.graphQLErrors?v.default.createElement("div",{className:"gallery__error flexbox-area-grow"},v.default.createElement("div",{className:"gallery__error-message"},v.default.createElement("h3",null,g.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error.")),this.props.errorMessage&&v.default.createElement("p",null,this.props.errorMessage),this.props.graphQLErrors&&this.props.graphQLErrors.map(function(e,t){return v.default.createElement("p",{key:t},e)}))):this.props.loading?v.default.createElement("div",{className:"flexbox-area-grow"},v.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),v.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})):v.default.createElement("div",{className:"flexbox-area-grow"},v.default.createElement("div",{className:"editor__file-preview-message--file-missing m-t-3"},g.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")));var e=v.default.createElement("div",{className:"gallery_messages"},this.props.errorMessage&&v.default.createElement(M.default,{value:this.props.errorMessage,type:"danger"}),this.props.noticeMessage&&v.default.createElement(M.default,{value:this.props.noticeMessage,type:"success"}),this.renderSearchAlert()),t={height:L.default.THUMBNAIL_HEIGHT,width:L.default.THUMBNAIL_WIDTH},n=c({url:this.props.createFileApiUrl,method:this.props.createFileApiMethod,paramName:"Upload",clickable:"#upload-button"},this.props.sectionConfig.dropzoneOptions),r=this.props.securityId,o=this.props.folder.canEdit&&this.props.enableDropzone,i=["panel","panel--padded","panel--scrollable","gallery__main","fill-height"];"insert"===this.props.type&&i.push("insert-media-modal__main");var s=i;return this.hasOpenedItem()&&s.push("gallery__main--has-opened-item"),v.default.createElement("div",{className:"flexbox-area-grow gallery__outer"},v.default.createElement(ee.default,{sectionConfig:this.props.sectionConfig,folderId:this.props.folderId,onSuccess:this.props.onMoveFilesSuccess,onOpenFolder:this.props.onOpenFolder}),this.renderTransitionBulkActions(),v.default.createElement(Y.default,{className:i.join(" ")},this.renderToolbar(),v.default.createElement(Q.SelectableGroup,{enabled:"tile"===this.props.view&&"admin"===this.props.type,className:"flexbox-area-grow fill-height gallery__main--selectable",onSelection:this.handleGroupSelect,onNonItemClick:this.handleClearSelection,preventDefault:!1,fixedPosition:!0},v.default.createElement(F.default,{name:"gallery-container",className:"flexbox-area-grow",canUpload:o,onAddedFile:this.handleAddedFile,onPreviewLoaded:this.handlePreviewLoaded,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:t,folderId:this.props.folderId,options:n,securityID:r,uploadButton:!1},e,this.renderGalleryView()))),this.props.loading&&[v.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),v.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})])}}]),t}(y.Component),re={page:1,limit:15},oe={sectionConfig:Z.default,loading:y.PropTypes.bool,sort:y.PropTypes.string,files:y.PropTypes.arrayOf(y.PropTypes.shape({id:y.PropTypes.number,parent:y.PropTypes.shape({id:y.PropTypes.number})})).isRequired,selectedFiles:y.PropTypes.arrayOf(y.PropTypes.number),totalCount:y.PropTypes.number,page:y.PropTypes.number,limit:y.PropTypes.number,badges:y.PropTypes.arrayOf(y.PropTypes.shape({id:y.PropTypes.number,message:y.PropTypes.node,status:y.PropTypes.string})),onOpenFile:y.PropTypes.func.isRequired,onOpenFolder:y.PropTypes.func.isRequired,onSort:y.PropTypes.func.isRequired,onSetPage:y.PropTypes.func.isRequired},ie=Object.assign({},re,{selectableItems:!1}),se=Object.assign({},oe,{selectableItems:y.PropTypes.bool,onSelect:y.PropTypes.func,onCancelUpload:y.PropTypes.func,onDelete:v.default.PropTypes.func,onRemoveErroredUpload:y.PropTypes.func,onEnableDropzone:y.PropTypes.func});ne.defaultProps=Object.assign({},re,{type:"admin",view:"tile",enableDropzone:!0}),ne.propTypes=Object.assign({},oe,{onUploadSuccess:v.default.PropTypes.func,onCreateFolder:v.default.PropTypes.func,onMoveFilesSuccess:v.default.PropTypes.func,onDelete:v.default.PropTypes.func,onPublish:v.default.PropTypes.func,onUnpublish:v.default.PropTypes.func,type:y.PropTypes.oneOf(["insert-media","insert-link","select","admin"]),view:y.PropTypes.oneOf(["tile","table"]),dialog:y.PropTypes.bool,fileId:y.PropTypes.number,folderId:y.PropTypes.number.isRequired,folder:y.PropTypes.shape({id:y.PropTypes.number,title:y.PropTypes.string,parentId:y.PropTypes.number,canView:y.PropTypes.bool,canEdit:y.PropTypes.bool}),queuedFiles:y.PropTypes.shape({items:y.PropTypes.array.isRequired}),errorMessage:y.PropTypes.string,graphQLErrors:y.PropTypes.arrayOf(y.PropTypes.string),actions:y.PropTypes.object,securityId:y.PropTypes.string,onViewChange:y.PropTypes.func.isRequired,createFileApiUrl:y.PropTypes.string,createFileApiMethod:y.PropTypes.string,search:y.PropTypes.object,enableDropzone:y.PropTypes.bool,concatenateSelect:y.PropTypes.bool,GalleryToolbar:y.PropTypes.func,sorters:y.PropTypes.arrayOf(y.PropTypes.shape({field:y.PropTypes.string.isRequired,direction:y.PropTypes.oneOf(["asc","desc"]).isRequired,label:y.PropTypes.string.isRequired})).isRequired}),t.Component=ne,t.galleryViewPropTypes=se,t.galleryViewDefaultProps=ie,t.default=(0,O.compose)((0,te.inject)(["GalleryToolbar"],null,function(){return"AssetAdmin.Gallery"}),(0,w.connect)(u,p),W.default,z.default,function(e){return(0,K.withApollo)(e)})(ne)},function(e,t,n){"use strict";function r(e,t){return function(n){n({type:g.default.LOAD_FILE_SUCCESS,payload:{id:e,file:t}})}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t({type:g.default.SELECT_FILES,payload:{ids:e}})}}function i(e){return function(t){return t({type:g.default.CONCATENATE_SELECT,payload:!!e})}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t({type:g.default.DESELECT_FILES,payload:{ids:e}})}}function a(e){return function(t){return t({type:g.default.SET_NOTICE_MESSAGE,payload:{message:e}})}}function l(e){return function(t){return t({type:g.default.SET_ERROR_MESSAGE,payload:{message:e}})}}function u(e){return function(t){return t({type:g.default.SET_ENABLE_DROPZONE,payload:{enableDropzone:e}})}}function p(e){return function(t){t({type:g.default.CLEAR_FILE_BADGE,payload:{id:e}})}}function c(e,t,n,r){return function(o,i){var s=i(),a=s.assetAdmin,l=a.gallery.badges.find(function(t){return t.id===e});l&&l.timer&&clearTimeout(l.timer);var u=r>0?setTimeout(function(){return p(e)(o)},r):null;o({type:g.default.SET_FILE_BADGE,payload:{id:e,message:t,status:n,timer:u}})}}function d(e){return function(t){t({type:g.default.ACTIVATE_MODAL,payload:e})}}function f(){return function(e){e({type:g.default.DEACTIVATE_MODAL})}}function h(e){return function(t){t({type:g.default.SET_LOADING,payload:!!e})}}Object.defineProperty(t,"__esModule",{value:!0}),t.loadFile=r,t.selectFiles=o,t.setConcatenateSelect=i,t.deselectFiles=s,t.setNoticeMessage=a,t.setErrorMessage=l,t.setEnableDropzone=u,t.clearFileBadge=p,t.setFileBadge=c,t.activateModal=d,t.deactivateModal=f,t.setLoading=h;var m=n(90),g=function(e){return e&&e.__esModule?e:{default:e}}(m)},function(e,t,n){var r=n(19),o=n(9),i=r(o,"Map");e.exports=i},function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t0&&n(p)?t>1?r(p,t-1,n,s,a):o(a,p):s||(a[a.length]=p)}return a}var o=n(63),i=n(287);e.exports=r},function(e,t){function n(e,t){return e.has(t)}e.exports=n},function(e,t,n){function r(e){var t=new e.constructor(e.byteLength);return new o(t).set(new o(e)),t}var o=n(101);e.exports=r},function(e,t,n){var r=n(132),o=r(Object.getPrototypeOf,Object);e.exports=o},function(e,t,n){var r=n(104),o=n(145),i=Object.prototype,s=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,l=a?function(e){return null==e?[]:(e=Object(e),r(a(e),function(t){return s.call(e,t)}))}:o;e.exports=l},function(e,t,n){function r(e,t){if(o(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!s.test(e)||null!=t&&e in Object(t)}var o=n(2),i=n(25),s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=r},function(e,t){function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}e.exports=n},function(e,t,n){var r=n(269),o=n(322),i=r(o);e.exports=i},function(e,t,n){function r(e){return i(e)&&o(e)}var o=n(10),i=n(14);e.exports=r},function(e,t){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}var r=9007199254740991;e.exports=n},function(e,t,n){var r=n(237),o=n(43),i=n(303),s=i&&i.isTypedArray,a=s?o(s):r;e.exports=a},function(e,t,n){function r(e){return s(e)?o(e,!0):i(e)}var o=n(107),i=n(238),s=n(10);e.exports=r},function(e,t,n){function r(e){return null==e?"":o(e)}var o=n(250);e.exports=r},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=Badge},function(e,t){e.exports=FormBuilderLoader},function(e,t){e.exports=classnames},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)}function a(e){return e.item.thumbnail&&"image"===e.item.category&&e.item.exists&&!e.item.uploading&&e.sectionConfig.imageRetry.minRetry&&e.sectionConfig.imageRetry.maxRetry}function l(e,t){if(a(t)){var n=e.assetAdmin.imageLoad,r=n.files.find(function(e){return t.item.thumbnail===e.url});return{loadState:r&&r.status||k.default.NONE}}return{loadState:k.default.DISABLED}}function u(e){return{actions:{imageLoad:(0,I.bindActionCreators)(D,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.File=t.Folder=t.Component=void 0;var p=Object.assign||function(e){for(var t=1;t0}},{key:"uploading",value:function(){return this.props.item.uploading}},{key:"exists",value:function(){return this.props.item.exists}},{key:"isImage",value:function(){return"image"===this.props.item.category}},{key:"canBatchSelect",value:function(){return this.props.selectable&&this.props.item.canEdit}},{key:"hasError",value:function(){var e=!1;return this.props.item.message&&(e="error"===this.props.item.message.type),e}},{key:"handleActivate",value:function(e){e.stopPropagation(),"function"!=typeof this.props.onActivate||this.uploading()||this.props.onActivate(e,this.props.item)}},{key:"handleSelect",value:function(e){e.stopPropagation(),e.preventDefault(),"function"==typeof this.props.onSelect&&this.props.onSelect(e,this.props.item)}},{key:"handleKeyDown",value:function(e){y.default.SPACE_KEY_CODE===e.keyCode&&(e.preventDefault(),this.canBatchSelect()&&this.handleSelect(e)),y.default.RETURN_KEY_CODE===e.keyCode&&this.handleActivate(e)}},{key:"handleCancelUpload",value:function(e){e.stopPropagation(),e.preventDefault(),this.hasError()?this.props.onRemoveErroredUpload(this.props.item):this.props.onCancelUpload&&this.props.onCancelUpload(this.props.item)}},{key:"render",value:function(){var e=this,t=null,n=null,r=null,o=this.props.item,i=o.id,s=o.queuedId,a=i?"item-"+i:"queued-"+s;if(this.props.selectable&&(this.canBatchSelect()&&(t=this.handleSelect),n="font-icon-tick"),this.uploading())t=this.handleCancelUpload,n="font-icon-cancel";else if(this.exists()){var l=f.default._t("AssetAdmin.DETAILS","Details");r=m.default.createElement("div",{className:"gallery-item--overlay font-icon-edit"},l)}var u=this.props.badge,c={className:"gallery-item__checkbox",type:"checkbox",title:f.default._t("AssetAdmin.SELECT","Select"),tabIndex:-1,onMouseDown:R,id:a},d=["gallery-item__checkbox-label",n];this.canBatchSelect()||(c.disabled=!0,d.push("gallery-item__checkbox-label--disabled"));var h={className:d.join(" "),onClick:t};return m.default.createElement("div",{className:this.getItemClassNames(),"data-id":this.props.item.id,tabIndex:0,role:"button",onKeyDown:this.handleKeyDown,onClick:this.handleActivate},!!u&&m.default.createElement(w.default,{className:"gallery-item__badge",status:u.status,message:u.message}),m.default.createElement("div",{ref:function(t){e.thumbnail=t},className:this.getThumbnailClassNames(),style:this.getThumbnailStyles()},r,this.getStatusFlags()),this.getProgressBar(),this.getErrorMessage(),m.default.createElement("div",{className:"gallery-item__title",ref:function(t){e.title=t}},m.default.createElement("label",p({},h,{htmlFor:a}),m.default.createElement("input",c)),this.props.item.title))}}]),t}(h.Component);L.propTypes={sectionConfig:T.default,item:b.default,loadState:h.PropTypes.oneOf(Object.values(k.default)),highlighted:h.PropTypes.bool,selected:h.PropTypes.bool,enlarged:h.PropTypes.bool,message:h.PropTypes.shape({value:h.PropTypes.string,type:h.PropTypes.string}),selectable:h.PropTypes.bool,onActivate:h.PropTypes.func,onSelect:h.PropTypes.func,onCancelUpload:h.PropTypes.func,onRemoveErroredUpload:h.PropTypes.func,badge:h.PropTypes.shape({status:h.PropTypes.string,message:h.PropTypes.string})},L.defaultProps={item:{},sectionConfig:{imageRetry:{}}};var U=(0,F.connect)(l,u)(L),M=(0,A.createSelectable)((0,E.default)("GalleryItem")(U)),j=(0,A.createSelectable)((0,C.default)("GalleryItem")(M));t.Component=L,t.Folder=j,t.File=M,t.default=U},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 i(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)}function s(e){var t={drop:function(e,t){if(t.canDrop()){var n=t.getItem();e.onDropFiles(e.item.id,n.selected)}},canDrop:function(e,t){return!t.getItem().selected.includes(e.item.id)}},n=function(e,t){var n=t.isOver();return{enlarged:n&&t.canDrop(),connectDropTarget:e.dropTarget(),isOver:n}},s=(0,p.DropTarget)(e,t,n);return function(e){var t=function(t){function n(){return r(this,n),o(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return i(n,t),a(n,[{key:"render",value:function(){var t=this.props.connectDropTarget,n=u.default.createElement(e,this.props);return t("string"==typeof n.type?n:u.default.createElement("div",{className:"gallery-item__droppable"},n))}}]),n}(l.Component);return t.propTypes={connectDropTarget:l.PropTypes.func.isRequired,item:l.PropTypes.shape({id:l.PropTypes.number.isRequired}).isRequired},s(t)}}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n0}function l(e,t){var n=e.form.formSchemas[t.searchFormSchemaUrl];if(!n||!n.name)return{formData:{}};var r=(0,O.default)((0,A.default)(e),n.name);return{formData:r&&r.values||{}}}function u(e){return{actions:{schema:(0,v.bindActionCreators)(C,e),reduxForm:(0,v.bindActionCreators)({reset:P.reset,initialize:P.initialize},e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.hasFilters=t.Component=void 0;var p=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1])||arguments[1];return b.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:this.props.securityId}}:{}))}},{key:"handleBackButtonClick",value:function(e){e.preventDefault(),this.props.actions.gallery.deselectFiles(),this.props.folder?this.handleOpenFolder(this.props.folder.parentId||0):this.handleOpenFolder(0)}},{key:"compare",value:function(e,t){return!!(e&&!t||t&&!e)||e&&t&&(e.id!==t.id||e.name!==t.name)}},{key:"resetFile",value:function(e){e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId),this.props.fileId===e.id&&(this.handleCloseFile(),this.handleOpenFile(e.id))}},{key:"handleFolderIcon",value:function(e){e.preventDefault(),this.handleOpenFile(this.getFolderId())}},{key:"handleOpenFile",value:function(e){this.handleBrowse(this.getFolderId(),e,this.props.query)}},{key:"handleSubmitEditor",value:function(e,t,n){var r=this,o=null;if("function"==typeof this.props.onSubmitEditor){var i=this.findFile(this.props.fileId);o=this.props.onSubmitEditor(e,t,n,i)}else o=n();if(!o)throw new Error("Promise was not returned for submitting");return o.then(function(e){return"action_createfolder"===t&&"admin"===r.props.type&&r.handleOpenFile(e.record.id),r.props.actions.files.readFiles().then(function(){return"action_createfolder"===t&&"admin"!==r.props.type&&r.handleOpenFolder(r.getFolderId()),e})})}},{key:"handleCloseFile",value:function(){this.handleBrowse(this.getFolderId(),null,this.props.query)}},{key:"handleOpenFolder",value:function(e){var t=Object.assign({},this.props.query);delete t.page,delete t.filter,this.handleBrowse(e,null,t)}},{key:"handleDelete",value:function(e){var t=this,n=e.map(function(e){var n=t.findFile(e);if(!n)throw new Error("File selected for deletion cannot be found: "+e);return n.queuedId&&t.props.actions.queuedFiles.removeQueuedFile(n.queuedId),n}),r=n.map(function(e){var n=e.__typename,r=e.id;return t.props.client.dataId({__typename:n,id:r})}),o=n.map(function(e){return e.id}),i=this.props.folder?this.props.folder.id:0;return this.props.actions.files.deleteFiles(o,r).then(function(e){var n=e.data.deleteFiles;return t.handleBrowse(i,null,t.props.query),n})}},{key:"doUnpublish",value:function(e){var t=this,n=e.map(function(e){var n=t.findFile(e);if(!n)throw new Error("File selected for unpublishing cannot be found: "+e);if("folder"===n.type)throw new Error("Cannot unpublish folders");return n}),r=n.map(function(e){return e.id});return this.props.actions.files.unpublishFiles(r).then(function(e){return e.data.unpublishFiles.map(function(e){return t.resetFile(e),e})})}},{key:"handleUnpublish",value:function(e){var t=this;return this.doUnpublish(e).then(function(e){var n=t.props.fileId;t.props.actions.files.readFiles().then(function(){n&&e.find(function(e){return e.id===n})&&(t.handleCloseFile(),t.handleOpenFile(n))})})}},{key:"doPublish",value:function(e){var t=this,n=e.map(function(e){var n=t.findFile(e);if(!n)throw new Error("File selected for publishing cannot be found: "+e);if("folder"===n.type)throw new Error("Cannot publish folders");return n}),r=n.map(function(e){return e.id});return this.props.actions.files.publishFiles(r).then(function(e){return e.data.publishFiles.map(function(e){return t.resetFile(e),e})})}},{key:"findFile",value:function(e){return[].concat(i(this.props.files),i(this.props.queuedFiles.items)).find(function(t){return t.id===parseInt(e,10)})}},{key:"handleUpload",value:function(){}},{key:"handleCreateFolder",value:function(){this.props.onBrowse(this.getFolderId(),null,this.props.query,Q.default.ACTIONS.CREATE_FOLDER)}},{key:"handleMoveFilesSuccess",value:function(e,t){var n=this;this.props.queuedFiles.items.filter(function(e){return t.includes(e.id)}).forEach(function(e){e.queuedId&&n.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}),this.props.actions.gallery.deselectFiles(),this.props.actions.files.readFiles()}},{key:"renderGallery",value:function(){var e=this.props.sectionConfig,t=e.createFileEndpoint.url,n=e.createFileEndpoint.method,r=this.props.query&&parseInt(this.props.query.limit||e.limit,10),o=this.props.query&&parseInt(this.props.query.page||1,10),i=this.props.query&&this.props.query.sort,s=this.props.query&&this.props.query.view,a=this.props.query.filter||{};return m.default.createElement(x.default,{files:this.props.files,fileId:this.props.fileId,folderId:this.getFolderId(),folder:this.props.folder,type:this.props.type,limit:r,page:o,totalCount:this.props.filesTotalCount,view:s,filters:a,graphQLErrors:this.props.graphQLErrors,createFileApiUrl:t,createFileApiMethod:n,onDelete:this.handleDelete,onPublish:this.doPublish,onUnpublish:this.doUnpublish,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSuccessfulUpload:this.handleUpload,onCreateFolder:this.handleCreateFolder,onMoveFilesSuccess:this.handleMoveFilesSuccess,onClearSearch:this.handleClearSearch,onSort:this.handleSort,onSetPage:this.handleSetPage,onViewChange:this.handleViewChange,sort:i,sectionConfig:e,loading:this.props.loading})}},{key:"renderEditor",value:function(){var e=this.props.sectionConfig,t=u({config:e,viewAction:this.props.viewAction,folderId:this.getFolderId(),type:this.props.type,fileId:this.props.fileId}),n=t.schemaUrl,r=t.targetId;return n?m.default.createElement(I.default,{className:this.props.dialog?"editor--dialog":"",targetId:r,file:this.findFile(r),onClose:this.handleCloseFile,schemaUrl:n,schemaUrlQueries:this.props.requireLinkText?[{name:"requireLinkText",value:!0}]:[],onSubmit:this.handleSubmitEditor,onDelete:this.handleDelete,onUnpublish:this.handleUnpublish,addToCampaignSchemaUrl:e.form.addToCampaignForm.schemaUrl}):null}},{key:"render",value:function(){var e=!(!this.props.folderId&&!(0,U.hasFilters)(this.props.query.filter)),t=this.props.sectionConfig.form.fileSearchForm.schemaUrl,n=this.props.query.filter||{};return m.default.createElement("div",{className:"fill-height"},m.default.createElement(R.default,{showBackButton:e,onBackButtonClick:this.handleBackButtonClick},m.default.createElement(N.default,{multiline:!0}),m.default.createElement("div",{className:"asset-admin__toolbar-extra pull-xs-right fill-width vertical-align-items"},m.default.createElement(M.default,{onSearch:this.handleDoSearch,id:"AssetSearchForm",searchFormSchemaUrl:t,folderId:this.getFolderId(),filters:n}),this.props.toolbarChildren)),m.default.createElement("div",{className:"flexbox-area-grow fill-width fill-height gallery"},this.renderGallery(),this.renderEditor()))}}]),t}(h.Component);X.propTypes={dialog:h.PropTypes.bool,sectionConfig:Y.default,fileId:h.PropTypes.number,folderId:h.PropTypes.number,onBrowse:h.PropTypes.func,onReplaceUrl:h.PropTypes.func,graphQLErrors:h.PropTypes.arrayOf(h.PropTypes.string),getUrl:h.PropTypes.func,query:h.PropTypes.shape({sort:h.PropTypes.string,limit:h.PropTypes.oneOfType([h.PropTypes.number,h.PropTypes.string]),page:h.PropTypes.oneOfType([h.PropTypes.number,h.PropTypes.string]),filter:h.PropTypes.object}),onSubmitEditor:h.PropTypes.func,type:h.PropTypes.oneOf(["insert-media","insert-link","select","admin"]),files:h.PropTypes.array,queuedFiles:h.PropTypes.shape({items:h.PropTypes.array.isRequired}),filesTotalCount:h.PropTypes.number,folder:h.PropTypes.shape({id:h.PropTypes.number,title:h.PropTypes.string,parents:h.PropTypes.array,parentId:h.PropTypes.number,canView:h.PropTypes.bool,canEdit:h.PropTypes.bool}),loading:h.PropTypes.bool,actions:h.PropTypes.object},X.defaultProps={type:"admin",query:{sort:"",limit:null,page:0,filter:{}}},t.Component=X,t.getFormSchema=u,t.default=(0,y.compose)((0,g.connect)(p,c),B.default,H.default,z.default,W.default,function(e){return(0,L.withApollo)(e)})(X)},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)}function a(e){var t=e.base,n=e.folderId,r=e.fileId,o=e.query,i=e.action;if(i&&-1===P.indexOf(i))throw new Error("Invalid action provided: "+i);var s=null;return s=r?t+"/show/"+n+"/"+_.default.ACTIONS.EDIT_FILE+"/"+r:n?t+"/show/"+n:t+"/",i===_.default.ACTIONS.CREATE_FOLDER&&(s=t+"/show/"+(n||0)+"/"+i),o&&Object.keys(o).length>0&&(s=s+"?"+v.default.stringify(o)),s}function l(e){return{sectionConfig:e.config.sections.find(function(e){return e.name===C})}}Object.defineProperty(t,"__esModule",{value:!0}),t.buildUrl=t.Component=void 0;var u=function(){function e(e,t){for(var n=0;n0&&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]:_.default.ACTIONS.EDIT_FILE,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,a({base:this.props.sectionConfig.url,folderId:o,fileId:i,query:l,action:r})}},{key:"getFolderId",value:function(){return this.props.params&&this.props.params.folderId?parseInt(this.props.params.folderId,10):0}},{key:"getFileId",value:function(){return this.props.params&&this.props.params.fileId?parseInt(this.props.params.fileId,10):0}},{key:"getViewAction",value:function(){return this.props.params&&this.props.params.viewAction?this.props.params.viewAction:_.default.ACTIONS.EDIT_FILE}},{key:"getSectionProps",value:function(){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}}},{key:"getQuery",value:function(){return(0,g.decodeQuery)(this.props.location.search)}},{key:"handleBrowse",value:function(e,t,n,r){var o=this.getUrl(e,t,n,r);this.props.router.push(o)}},{key:"handleReplaceUrl",value:function(e,t,n,r){var o=this.getUrl(e,t,n,r);this.props.router.replace(o)}},{key:"render",value:function(){return this.props.sectionConfig?c.default.createElement(m.default,this.getSectionProps()):null}}]),t}(p.Component);w.propTypes={sectionConfig:S.default,location:p.PropTypes.shape({pathname:p.PropTypes.string,query:p.PropTypes.object,search:p.PropTypes.string}),params:p.PropTypes.object,router:p.PropTypes.object},t.Component=w,t.buildUrl=a,t.default=(0,f.withRouter)((0,d.connect)(l)(w))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(53),o=function(e){return e&&e.__esModule?e:{default:e}}(r),i=(0,o.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=i},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t=0)return!0;return!1})},defaultColumnFilter:function(e,t){return D(y.getObjectValues(e),function(e){return e.toString().toLowerCase().indexOf(t.toLowerCase())>=0}).length>0},filterByColumnFilters:function(e){var t=this.defaultColumnFilter,n=Object.keys(e).reduce(function(n,r){return D(n,function(n){var o=y.getAt(n,r||""),i=e[r];return t(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=I(n,t);else{var r={};r[t]=e,n=x({},n,r)}this.filterByColumnFilters(n)},setFilter:function(e){if(this.props.useExternal)return void this.props.externalSetFilter(e);var t=this,n={page:0,filter:e};n.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,e):this.defaultFilter(this.props.results,e),n.maxPage=t.getMaxPage(n.filteredResults),(F(e)||T(e)||O(e))&&(n.filter=e,n.filteredResults=null),t.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 void 0===e||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)return void this.props.externalSetPage(e);if(e*this.state.resultsPerPage<=this.state.resultsPerPage*this.state.maxPage){var t=this,n={page:e};t.setState(n)}this.props.enableInfiniteScroll&&this.setState({isSelectAllChecked:!1})},setColumns:function(e){this.columnSettings.filteredColumns=w(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=_(this.props.columnMetadata,{columnName:e})||{},r=n.sortDirectionCycle?n.sortDirectionCycle:[null,"asc","desc"],o=null,i=r.indexOf(this.state.sortDirection&&e===this.state.sortColumn?this.state.sortDirection:null);i=(i+1)%r.length,o=r[i]?r[i]:null;var s={page:0,sortColumn:e,sortDirection:o};this.setState(s)}},componentWillReceiveProps:function(e){if(this.setMaxPage(e.results),e.resultsPerPage!==this.props.resultsPerPage&&this.setPageSize(e.resultsPerPage),this.columnSettings.columnMetadata=e.columnMetadata,e.results.length>0){var t=y.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,A(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 m(this.props.results.length>0?y.keys(this.props.results[0]):[],this.props.columns,this.props.childrenColumnName,this.props.columnMetadata,this.props.metadataColumns),this.rowSettings=new g(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.state.sortColumn){var i,s=this.state.sortColumn,a=D(this.props.columnMetadata,{columnName:s}),l={columns:[],orders:[]};if(a.length>0&&(i=a[0].hasOwnProperty("customCompareFn")&&a[0].customCompareFn,a[0].multiSort&&(l=a[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=N(e,function(e){return i(k(e,s))},[this.state.sortDirection]));else{var u=[function(e){return(k(e,s)||"").toString().toLowerCase()}],p=[this.state.sortDirection];l.columns.forEach(function(e,t){u.push(function(t){return(k(t,e)||"").toString().toLowerCase()}),"asc"===l.orders[t]||"desc"===l.orders[t]?p.push(l.orders[t]):p.push(r.state.sortDirection)}),e=N(e,u,p)}}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(e,(c+1)*this.state.resultsPerPage);else{var d=v(e,c*this.state.resultsPerPage);e=(b||C)(d,d.length-this.state.resultsPerPage)}for(var f=(this.columnSettings.getMetadataColumns,[]),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;S(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,A(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===_(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===P(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:!_(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(h,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText,customFilterComponent:this.props.customFilterComponent,results:this.props.results,currentResults:this.getCurrentResults()}):o.createElement(s,{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(f,{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(a,{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(l,{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(d,{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,s){var a=this.getSortObject(),l=this.getMultipleSelectionObject(),u=this.shouldShowNoDataSection(e),p=this.getNoDataSection();return o.createElement("div",{className:"griddle-body"},o.createElement(i,{useGriddleStyles:this.props.useGriddleStyles,noDataSection:p,showNoData:u,columnSettings:this.columnSettings,rowSettings:this.rowSettings,sortSettings:a,multipleSelectionSettings:l,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:s,onRowClick:this.props.onRowClick}))},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(u,{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(),a=this.getDataForRender(e,s,!0),l=this.columnSettings.getMetadataColumns();this.props.columnMetadata?S(this.props.columnMetadata,function(e){"boolean"==typeof e.visible&&!1===e.visible||i.push(e.columnName)}):i=y.keys(I(e[0],l)),i=this.columnSettings.orderColumns(i);var u=this.getCurrentPage(),p=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))}});c.Griddle=e.exports=R},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n-1}var o=n(114);e.exports=r},function(e,t){function n(e,t,n){for(var r=-1,o=null==e?0:e.length;++r=p&&(d=u,f=!1,t=new o(t));e:for(;++c1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(o--,s):void 0,a&&i(n[0],n[1],a)&&(s=o<3?void 0:s,o=1),t=Object(t);++rd))return!1;var h=p.get(e);if(h&&p.get(t))return h==t;var m=-1,g=!0,y=n&l?new o:void 0;for(p.set(e,t),p.set(t,e);++mn+a||t+o-lr+s)};t.default=function(e,t,n){var r=e instanceof HTMLElement?(0,o.default)(e):e,s=t instanceof HTMLElement?(0,o.default)(t):t;return i(r.top,r.left,s.top,s.left,r.offsetWidth,r.offsetHeight,s.offsetWidth,s.offsetHeight,n)}},function(e,t){(function(t){"use strict";function n(e,t,n){function r(t){var n=m,r=g;return m=g=void 0,E=t,v=e.apply(r,n)}function i(e){return E=e,b=setTimeout(p,t),w?r(e):v}function s(e){var n=e-_,r=e-E,o=t-n;return O?C(o,y-r):o}function l(e){var n=e-_,r=e-E;return void 0===_||n>=t||n<0||O&&r>=y}function p(){var e=P();if(l(e))return c(e);b=setTimeout(p,s(e))}function c(e){return b=void 0,T&&m?r(e):(m=g=void 0,v)}function d(){void 0!==b&&clearTimeout(b),E=0,m=_=g=b=void 0}function f(){return void 0===b?v:c(P())}function h(){var e=P(),n=l(e);if(m=arguments,g=this,_=e,n){if(void 0===b)return i(_);if(O)return b=setTimeout(p,t),r(_)}return void 0===b&&(b=setTimeout(p,t)),v}var m,g,y,v,b,_,E=0,w=!1,O=!1,T=!0;if("function"!=typeof e)throw new TypeError(u);return t=a(t)||0,o(n)&&(w=!!n.leading,O="maxWait"in n,y=O?S(a(n.maxWait)||0,t):y,T="trailing"in n?!!n.trailing:T),h.cancel=d,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":l(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==(void 0===e?"undefined":l(e))}function s(e){return"symbol"==(void 0===e?"undefined":l(e))||i(e)&&E.call(e)==c}function a(e){if("number"==typeof e)return e;if(s(e))return p;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(d,"");var n=h.test(e);return n||m.test(e)?g(e.slice(2),n?2:8):f.test(e)?p:+e}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u="Expected a function",p=NaN,c="[object Symbol]",d=/^\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":l(t))&&t&&t.Object===Object&&t,v="object"==("undefined"==typeof self?"undefined":l(self))&&self&&self.Object===Object&&self,b=y||v||Function("return this")(),_=Object.prototype,E=_.toString,S=Math.max,C=Math.min,P=function(){return b.Date.now()};e.exports=r}).call(t,function(){return this}())},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 a=function(){function e(e,t){for(var n=0;n
');this.before(n),t=n[0]}return t},onunmatch:function(){this._super(),p.default.unmountComponentAtNode(this.getContainer())},onmatch:function(){this._super(),this.hide(),this.refresh()},onclick:function(e){e.preventDefault()},refresh:function(){var t=this.getAttributes(),n=e(this).closest("form"),r=function(){setTimeout(function(){n.trigger("change")},0)};p.default.render(l.default.createElement(f,o({},t,{onChange:r,noHolder:!0})),this.getContainer())},getAttributes:function(){var t=e(this).data("state"),n=e(this).data("schema");return(0,c.schemaMerge)(n,t)}})})},function(e,t,n){(function(t){e.exports=t.InsertEmbedModal=n(202)}).call(t,n(78))},function(e,t,n){(function(t){e.exports=t.InsertMediaModal=n(203)}).call(t,n(78))},,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t0?l.default._t("AssetAdmin.UPDATE_FILE","Update file"):l.default._t("AssetAdmin.INSERT_FILE","Insert file");return e.mutateField("action_insert",function(e){return o({},e,{title:r||e.title})}),e.getState()},m=function(e){return function(t){var n=t.disabledIDs,r=t.findTreeByPath||c.findTreeByPath,i=o({},t,{findTreeByPath:function(e,t){var i=r(e,t),s=t.some(function(e){return n.includes(e)});return i?o({},i,{children:i.children.map(function(e){return o({},e,{disabled:s||n.includes(e.id)})})}):null}});return s.default.createElement(e,i)}},g=(0,f.compose)((0,d.connect)(function(e){return{disabledIDs:e.assetAdmin.gallery.selectedFiles}}),m),y=function(){p.default.transform("insert-media-modal",function(e){e.form.alterSchema("AssetAdmin.EditForm.fileInsertForm",h)}),p.default.transform("move-form-disabled",function(e){e.component("TreeDropdownField.AssetAdmin.MoveForm",g)})};t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),i=r(o),s=n(174),a=r(s),l=n(172),u=r(l),p=n(173),c=r(p),d=n(180),f=r(d),h=n(171),m=r(h),g=function(){i.default.component.register("UploadField",a.default),i.default.component.register("PreviewImageField",u.default),i.default.component.register("HistoryList",f.default),i.default.component.register("ProportionConstraintField",c.default),i.default.component.register("GalleryToolbar",m.default)};t.default=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),i=r(o),s=n(6),a=n(192),l=r(a),u=n(199),p=r(u),c=n(201),d=r(c),f=n(198),h=r(f),m=n(196),g=r(m),y=function(){i.default.reducer.register("assetAdmin",(0,s.combineReducers)({gallery:l.default,queuedFiles:p.default,uploadField:d.default,previewField:h.default,imageLoad:g.default}))};t.default=y},function(e,t,n){"use strict";n(158),n(157),n(154),n(156)},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}),t.Component=void 0;var a=function(){function e(e,t){for(var n=0;n2});return d.default.createElement("button",{type:"button",className:r,key:t.value,onClick:e.handleChangeValue,value:t.value},t.label)}).filter(function(e){return e});if(!t.length)return null;var n=this.props.PopoverField;return d.default.createElement("div",{className:"bulk-actions fieldholder-small btn-group"},d.default.createElement("div",{className:"bulk-actions-counter"},this.props.items.length),t.slice(0,2),t.length>2&&n?d.default.createElement(n,{id:"BulkActions",popoverClassName:"bulk-actions__more-actions-menu",container:this,data:{placement:"bottom"}},t.slice(2)):t.slice(2))}}]),t}(c.Component);E.propTypes={items:d.default.PropTypes.array,actions:d.default.PropTypes.arrayOf(d.default.PropTypes.shape({value:d.default.PropTypes.string.isRequired,label:d.default.PropTypes.string.isRequired,className:d.default.PropTypes.string,destructive:d.default.PropTypes.bool,callback:d.default.PropTypes.func,canApply:d.default.PropTypes.func,confirm:d.default.PropTypes.func})),PopoverField:d.default.PropTypes.oneOfType([d.default.PropTypes.node,d.default.PropTypes.func])},E.defaultProps={items:[],actions:[],PopoverField:null};var S=(0,y.connect)(a)(E);t.Component=E,t.default=(0,v.inject)(["PopoverField"],function(e){return{PopoverField:e}},function(){return"BulkActions"})(S)},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 a=function(){function e(e,t){for(var n=0;n1&&[u.default.createElement("div",{key:"1",className:"gallery-item__drag-shadow"}),u.default.createElement("div",{key:"2",className:"gallery-item__drag-shadow gallery-item__drag-shadow--second"}),u.default.createElement("div",{key:"3",className:"gallery-item__drag-shadow gallery-item__drag-shadow--third"})],u.default.createElement(d.default,e.props),t>1&&u.default.createElement(h.default,{className:"gallery-item__drag-layer-count",status:"primary",message:t})))}}]),t}(l.Component);m.propTypes={item:l.PropTypes.object,offset:l.PropTypes.shape({x:l.PropTypes.number.isRequired,y:l.PropTypes.number.isRequired}),isDragging:l.PropTypes.bool.isRequired};var g=function(e){return{item:e.getItem(),offset:e.getSourceClientOffset(),isDragging:e.isDragging()}};t.default=(0,p.DragLayer)(g)(m)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 i(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)}function s(e){var t={beginDrag:function(e){"function"==typeof e.onDrag&&e.onDrag(!0);var t=e.selectedFiles.concat([]);return 0===t.length&&t.push(e.item.id),{selected:t,props:e}},endDrag:function(e){"function"==typeof e.onDrag&&e.onDrag(!1)}},n=function(e,t){return{connectDragPreview:e.dragPreview(),connectDragSource:e.dragSource(),isDragging:t.isDragging()}},s=(0,p.DragSource)(e,t,n);return function(e){var t=function(t){function n(){return r(this,n),o(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return i(n,t),a(n,[{key:"componentDidMount",value:function(){this.props.connectDragPreview((0,c.getEmptyImage)(),{captureDraggingState:!0})}},{key:"render",value:function(){var t=this.props.connectDragSource,n=u.default.createElement(e,this.props);return t("string"==typeof n.type?n:u.default.createElement("div",{className:"gallery-item__draggable"},n))}}]),n}(l.Component);return t.propTypes={connectDragSource:l.PropTypes.func.isRequired,connectDragPreview:l.PropTypes.func.isRequired,item:l.PropTypes.shape({id:l.PropTypes.number.isRequired}).isRequired,onDrag:l.PropTypes.func,selectedFiles:l.PropTypes.arrayOf(l.PropTypes.number)},s(t)}}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n0&&o<100?f.default.createElement("div",{className:"preview-image-field__progress"},f.default.createElement("div",{className:"preview-image-field__progress-bar",style:{width:o+"%"}})):null,a=this.props.upload.message,l=null;return a?l=f.default.createElement("div",{className:"preview-image-field__message preview-image-field__message--"+a.type},a.value):100===o&&(l=f.default.createElement("div",{className:"preview-image-field__message preview-image-field__message--success"},c.default._t("AssetAdmin.REPlACE_FILE_SUCCESS","Upload successful, the file will be replaced when you Save."))),f.default.createElement("div",{className:"editor__thumbnail-container"},i||r,s,l)}},{key:"renderToolbar",value:function(){var e=this.canEdit();return this.props.data.url||e?f.default.createElement("div",{className:"preview-image-field__toolbar fill-height"},this.props.data.url?f.default.createElement("a",{href:this.props.data.url,target:"_blank",className:this.getButtonClasses("link")},"Open"):null,e?f.default.createElement("button",{id:"preview-replace-button",onClick:this.preventDefault,className:this.getButtonClasses("replace"),type:"button"},"Replace"):null,this.props.upload.progress||this.props.upload.message?f.default.createElement("button",{onClick:this.handleCancelUpload,className:this.getButtonClasses("remove"),type:"button"},"Remove"):null):null}},{key:"render",value:function(){var e=this.getDropzoneProps();if(this.canEdit())return f.default.createElement(m.default,e,this.renderImage(),this.renderToolbar());var t=["preview-image-field__container",this.props.className,this.props.extraClass];return f.default.createElement("div",{className:t.join(" ")},this.renderImage(),this.renderToolbar())}}]),t}(d.Component);F.propTypes={id:d.PropTypes.string.isRequired,name:d.PropTypes.string,className:d.PropTypes.string,extraClass:d.PropTypes.string,readOnly:d.PropTypes.bool,disabled:d.PropTypes.bool,onAutofill:d.PropTypes.func,formid:d.PropTypes.string,nameValue:d.PropTypes.string,data:d.PropTypes.shape({id:d.PropTypes.number,parentid:d.PropTypes.number,version:d.PropTypes.number,url:d.PropTypes.string,mock:d.PropTypes.bool,exists:d.PropTypes.bool,preview:d.PropTypes.string,category:d.PropTypes.string,nameField:d.PropTypes.string,uploadFileEndpoint:d.PropTypes.shape({url:d.PropTypes.string.isRequired,method:d.PropTypes.string.isRequired,payloadFormat:d.PropTypes.string}),initialValues:d.PropTypes.object}).isRequired,upload:d.PropTypes.shape({url:d.PropTypes.string,progress:d.PropTypes.number,xhr:d.PropTypes.object,category:d.PropTypes.string,message:d.PropTypes.shape({type:d.PropTypes.string.isRequired,value:d.PropTypes.string.isRequired})}),actions:d.PropTypes.object,securityID:d.PropTypes.string,confirm:d.PropTypes.func},F.defaultProps={extraClass:"",className:"",data:{},upload:{},confirm:function(e){return window.confirm(e)}},t.Component=F,t.default=(0,v.connect)(a,l)(F)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 i(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}),t.Component=void 0;var s=function(){function e(e,t){for(var n=0;n0}},{key:"isImageSmallerThanThumbnail",value:function(){if(!this.isImage()||!this.exists()&&!this.uploading())return!1;var e=this.props.item.width,t=this.props.item.height;return t&&e&&t0&&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]:h.default.ACTIONS.EDIT_FILE,o=parseInt(e||0,10),i=parseInt(t||0,10),s=this.getFolderId(),a=o!==s&&null!==s,l=Object.assign({},n);return(a||l.page<=1)&&delete l.page,(0,d.buildUrl)({base:this.props.sectionConfig.url,folderId:o,fileId:i,query:l,action:r})}},{key:"getFolderId",value:function(){return null===this.state.folderId?null:parseInt(this.state.folderId||0,10)}},{key:"getFileId",value:function(){return parseInt(this.state.fileId||this.props.fileId||0,10)}},{key:"getViewAction",value:function(){return this.state.action||h.default.ACTIONS.EDIT_FILE}},{key:"getSectionProps",value:function(){var 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}},{key:"handleBrowse",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.default.ACTIONS.EDIT_FILE;if(r&&-1===Object.values(h.default.ACTIONS).indexOf(r))throw new Error("Invalid action provided: "+r);this.setState({folderId:e,fileId:t,query:n,action:r})}},{key:"render",value:function(){var e=this.getSectionProps(),t=this.props.Component;return p.default.createElement(t,e)}}]),t}(u.Component);y.propTypes={Component:u.PropTypes.oneOfType([u.PropTypes.element,u.PropTypes.func]),sectionConfig:u.PropTypes.shape({url:u.PropTypes.string.isRequired}).isRequired,fileId:u.PropTypes.number},t.AssetAdminStateRouter=y,t.default=a},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)}function a(e){return{actions:{unsavedForms:(0,d.bindActionCreators)(S,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var l=function(){function e(e,t){for(var n=0;n0&&(o=p.default.sprintf(p.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SINGLE_CONFIRM","This file is currently used in %s place(s), are you sure you want to delete it?"),this.props.file.inUseCount),o+="\n\n",o+=p.default._t("AssetAdmin.BULK_ACTIONS_DELETE_WARNING","Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.")),confirm(o)&&(this.props.actions.unsavedForms.removeFormChanged("AssetAdmin.EditForm"),this.props.onDelete([t.ID])),e.preventDefault()}}},{key:"handleCancelKeyDown",value:function(e){e.keyCode!==g.default.SPACE_KEY_CODE&&e.keyCode!==g.default.RETURN_KEY_CODE||this.handleClose(e)}},{key:"handleSubmit",value:function(e,t,n){return"function"==typeof this.props.onSubmit?this.props.onSubmit(e,t,n):n()}},{key:"handleClose",value:function(e){this.props.onClose(),this.closeModal(),e&&e.preventDefault()}},{key:"openModal",value:function(){this.setState({openModal:!0})}},{key:"closeModal",value:function(){this.setState({openModal:!1})}},{key:"handleLoadingError",value:function(e){this.setState({loadingForm:!1,loadingError:e.errors[0]})}},{key:"handleLoadingSuccess",value:function(){this.setState({loadingForm:!1,loadingError:null})}},{key:"handleFetchingSchema",value:function(){this.setState({loadingForm:!0})}},{key:"renderCancelButton",value:function(){return h.default.createElement("a",{role:"button",tabIndex:0,className:"btn btn--close-panel btn--no-text font-icon-cancel btn--icon-xl",onClick:this.handleClose,onKeyDown:this.handleCancelKeyDown,type:"button","aria-label":p.default._t("AssetAdmin.CANCEL")})}},{key:"render",value:function(){var e=this.props.schemaUrlQueries.map(function(e){return e.name+"="+e.value}).join("&").trim();e=e?"?"+e:"";var t=this.props.schemaUrl+"/"+this.props.targetId+e,n=this.props.addToCampaignSchemaUrl+"/"+this.props.targetId,r=["panel","form--no-dividers","editor"];this.props.className&&r.push(this.props.className);var o=null;if(this.state.loadingError){var i=this.state.loadingError.value;404===this.state.loadingError.code&&(i=p.default._t("AssetAdmin.FILE_MISSING","File cannot be found")),i||(i=p.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")),o=h.default.createElement("div",{className:"editor__file-preview-message--file-missing"},i)}var s=p.default._t("Admin.ADD_TO_CAMPAIGN","Add to campaign");return h.default.createElement("div",{className:r.join(" ")},h.default.createElement("div",{className:"editor__details fill-height"},h.default.createElement(v.default,{identifier:"AssetAdmin.EditForm",schemaUrl:t,afterMessages:this.renderCancelButton(),onSubmit:this.handleSubmit,onAction:this.handleAction,onLoadingSuccess:this.handleLoadingSuccess,onLoadingError:this.handleLoadingError,onFetchingSchema:this.handleFetchingSchema}),o,h.default.createElement(_.default,{title:s,identifier:"AssetAdmin.AddToCampaign",show:this.state.openModal,onHide:this.closeModal,schemaUrl:n,bodyClassName:"modal__dialog",responseClassBad:"modal__response modal__response--error",responseClassGood:"modal__response modal__response--good"}),this.state.loadingForm&&[h.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),h.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})]))}}]),t}(f.Component);w.propTypes={file:P.default,className:f.PropTypes.string,targetId:f.PropTypes.number.isRequired,onClose:f.PropTypes.func.isRequired,onSubmit:f.PropTypes.func.isRequired,onDelete:f.PropTypes.func.isRequired,schemaUrl:f.PropTypes.string.isRequired,schemaUrlQueries:f.PropTypes.arrayOf(f.PropTypes.shape({name:f.PropTypes.string,value:f.PropTypes.any})),addToCampaignSchemaUrl:f.PropTypes.string,actions:f.PropTypes.object},t.Component=w,t.default=(0,c.connect)(function(){return{}},a)(w)},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 a=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1])||arguments[1];return h.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:g.default.get("SecurityID")}}:{}))},C=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={detailView:null,history:[],loadedDetails:!1},n.handleClick=n.handleClick.bind(n),n.handleBack=n.handleBack.bind(n),n.timer=null,n.api=S(e.sectionConfig.historyEndpoint),n}return s(t,e),u(t,[{key:"componentDidMount",value:function(){this.refreshHistoryIfNeeded()}},{key:"componentWillReceiveProps",value:function(e){this.refreshHistoryIfNeeded(e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timer),this.timer=null}},{key:"refreshHistoryIfNeeded",value:function(e){var t=this;if(!e&&!this.state.loadedDetails||e.data.fileId!==this.props.data.fileId||e.data.latestVersionId!==this.props.data.latestVersionId){this.setState({loadedDetails:!1});var n=e?e.data.fileId:this.props.data.fileId;clearTimeout(this.timer),this.timer=setTimeout(function(){t.api({fileId:n}).then(function(e){t.timer&&t.setState({history:e,loadedDetails:!0})})},250)}}},{key:"handleClick",value:function(e){this.setState({viewDetails:e})}},{key:"handleBack",value:function(e){e.preventDefault(),this.setState({viewDetails:null})}},{key:"render",value:function(){var e=this;if(!this.state.loadedDetails)return c.default.createElement("div",{className:"history-list history-list--loading"},"Loading...");if(this.state.viewDetails){var t=[this.props.historySchemaUrl,this.props.data.fileId,this.state.viewDetails].join("/"),n=["btn","btn-secondary","btn--icon-xl","btn--no-text","font-icon-left-open-big","history-list__back"].join(" ");return c.default.createElement("div",{className:"history-list"},c.default.createElement("a",{href:"#",className:n,onClick:this.handleBack}),c.default.createElement(_.default,{identifier:"AssetAdmin.HistoryList",schemaUrl:t}))}var r=this.state.history||[];return c.default.createElement("div",{className:"history-list"},c.default.createElement("ul",{className:"list-group list-group-flush history-list__list"},r.map(function(t){return c.default.createElement(v.default,l({key:t.versionid},t,{onClick:e.handleClick}))})))}}]),t}(p.Component);C.propTypes={sectionConfig:c.default.PropTypes.shape({form:c.default.PropTypes.object,historyEndpoint:c.default.PropTypes.shape({url:c.default.PropTypes.string,method:c.default.PropTypes.string,responseFormat:c.default.PropTypes.string})}),historySchemaUrl:c.default.PropTypes.string,data:c.default.PropTypes.object},C.defaultProps={data:{fieldId:0}},t.Component=C,t.default=(0,d.connect)(a)(C)},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)}function a(e){var t=e.assetAdmin.gallery,n=t.modal,r=t.selectedFiles;return{show:n===y.default.MODAL_MOVE,selectedFiles:r,title:m.default.sprintf(m.default._t("AssetAdmin.MOVE_ITEMS_TO","Move %s item(s) to..."),r.length)}}function l(e){return{onHide:function(){e((0,v.deactivateModal)())},setNotice:function(t){e((0,v.setNoticeMessage)(t))},setError:function(t){e((0,v.setErrorMessage)(t))},setBadge:function(){e(v.setFileBadge.apply(void 0,arguments))}}}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n0)return c.default.createElement("div",{className:"gallery__progress-bar--complete"});var t={className:"gallery__progress-bar-progress",style:{width:e.progress+"%"}};return c.default.createElement("div",{className:"gallery__progress-bar"},c.default.createElement("div",t))}},{key:"renderTitle",value:function(e){var t=this.renderProgressBar(e.rowData);return c.default.createElement("div",{className:"fill-width"},c.default.createElement("div",{className:"flexbox-area-grow"},e.data),t)}},{key:"renderSelect",value:function(e){return c.default.createElement("input",{type:"checkbox",title:m.default._t("AssetAdmin.SELECT"),checked:e.data,tabIndex:"-1",onMouseDown:this.preventFocus})}},{key:"renderDate",value:function(e){return"folder"===e.rowData.type?null:c.default.createElement("span",null,e.data)}},{key:"renderThumbnail",value:function(e){var t=e.data||e.rowData.url,n=e.rowData.uploading,r=e.rowData.category||"false",o="gallery__table-image",i=[o],s={};return i.push(o+"--"+r),"image"===r&&t&&(s.backgroundImage='url("'+t+'")'),n||t||"folder"===r||i.push(o+"--error"),c.default.createElement("div",{className:i.join(" "),style:s})}},{key:"render",value:function(){return c.default.createElement(f.default,this.getTableProps())}}]),t}(p.Component);v.defaultProps=g.galleryViewDefaultProps,v.propTypes=a({},g.galleryViewPropTypes,{sort:p.PropTypes.string.isRequired}),t.Component=v,t.default=v},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 a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.type,r=t.payload;switch(n){case u.default.SET_FILE_BADGE:return i({},e,{badges:e.badges.filter(function(e){return e.id!==r.id}).concat([r])});case u.default.CLEAR_FILE_BADGE:return i({},e,{badges:e.badges.filter(function(e){return e.id!==r.id})});case u.default.SET_ENABLE_DROPZONE:return i({},e,{enableDropzone:r.enableDropzone});case u.default.SET_NOTICE_MESSAGE:return i({},e,{noticeMessage:r.message});case u.default.SET_ERROR_MESSAGE:return i({},e,{errorMessage:r.message});case u.default.LOAD_FILE_SUCCESS:var o=e.files.find(function(e){return e.id===r.id});if(o){var s=i({},o,r.file);return(0,a.default)(i({},e,{files:e.files.map(function(e){return e.id===s.id?s:e})}))}return e.folder.id===r.id?(0,a.default)(i({},e,{folder:i({},e.folder,r.file)})):e;case u.default.SELECT_FILES:var l=null;return l=null===r.ids?e.files.map(function(e){return e.id}):e.selectedFiles.concat(r.ids.filter(function(t){return-1===e.selectedFiles.indexOf(t)})),(0,a.default)(i({},e,{selectedFiles:l}));case u.default.DESELECT_FILES:var p=null;return p=null===r.ids?[]:e.selectedFiles.filter(function(e){return-1===r.ids.indexOf(e)}),(0,a.default)(i({},e,{selectedFiles:p}));case u.default.ACTIVATE_MODAL:return(0,a.default)(i({},e,{modal:r}));case u.default.DEACTIVATE_MODAL:return(0,a.default)(i({},e,{modal:null}));case u.default.CONCATENATE_SELECT:return(0,a.default)(i({},e,{concatenateSelect:r}));case u.default.SET_LOADING:return(0,a.default)(i({},e,{loading:r}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:d;o(this,e),this.options=i({},c,t),this.factory=n}return s(e,[{key:"loadImage",value:function(e){return this.options.minRetry&&p.default.lock(e)?this.loadImageLoop(e,this.options.minRetry):null}},{key:"loadImageLoop",value:function(e,t){var n=this;return this.options.onStatusChange(e,l.default.LOADING),new Promise(function(t,r){return n.factory(e,t,r)}).then(function(){return n.handleSuccess(e)}).catch(function(){return n.handleError(e,t)})}},{key:"handleReset",value:function(e,t){this.options.onReset(e),t()}},{key:"handleTimeout",value:function(e,t){var n=setTimeout(e,t);return this.options.onTimeout(n,t),n}},{key:"handleSuccess",value:function(e){p.default.unlock(e),this.options.onStatusChange(e,l.default.SUCCESS)}},{key:"handleFailure",value:function(e){var t=this;return p.default.unlock(e),this.options.onStatusChange(e,l.default.FAILED),this.options.expiry?new Promise(function(n){t.handleTimeout(function(){return t.handleReset(e,n)},1e3*t.options.expiry)}):null}},{key:"handleError",value:function(e,t){return t>this.options.maxRetry?this.handleFailure(e):(this.options.onStatusChange(e,l.default.WAITING),this.handleRetry(e,t))}},{key:"handleRetry",value:function(e,t){var n=this,r=new Promise(function(r){n.handleTimeout(function(){return r(n.loadImageLoop(e,2*t))},1e3*t)});return this.options.onRetry(e,t,r),r}},{key:"setOnRetry",value:function(e){this.options.onRetry=e}},{key:"setOnReset",value:function(e){this.options.onReset=e}},{key:"setOnStatusChange",value:function(e){this.options.onStatusChange=e}},{key:"setOnTimeout",value:function(e){this.options.onTimeout=e}}]),e}();t.defaultImageFactory=d,t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){return function(n,r){if(!e)return null;if(r().assetAdmin.imageLoad.files.find(function(t){return t.url===e}))return null;var o=i({},t,{onStatusChange:function(e,t){return n({type:a.default.SET_STATUS,payload:{status:t,url:e}})},onReset:function(e){return n({type:a.default.RESET,payload:{url:e}})}});return new u.default(o).loadImage(e)}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t=0||(this.urls=[].concat(r(this.urls),[e]),0))}},{key:"unlock",value:function(e){this.urls=this.urls.filter(function(t){return t!==e})}}]),e}();window.ss=window.ss||{},window.ss.imagelocker=window.ss.imagelocker||new s,t.Component=s,t.default=window.ss.imagelocker},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.type,o=t.payload;switch(n){case a.default.SET_STATUS:return i({},e,{files:[].concat(r(e.files.filter(function(e){return e.url!==o.url})),[o])});case a.default.RESET:return i({},e,{files:[].concat(r(e.files.filter(function(e){return e.url!==o.url})))});default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:p,t=arguments[1];switch(t.type){case u.default.PREVIEWFIELD_ADD_FILE:return(0,a.default)(Object.assign({},e,o({},t.payload.id,t.payload.file)));case u.default.PREVIEWFIELD_FAIL_UPLOAD:return(0,a.default)(Object.assign({},e,o({},t.payload.id,Object.assign({},e[t.payload.id],t.payload.message))));case u.default.PREVIEWFIELD_REMOVE_FILE:return(0,a.default)(Object.assign({},e,o({},t.payload.id,void 0)));case u.default.PREVIEWFIELD_UPDATE_FILE:return(0,a.default)(Object.assign({},e,o({},t.payload.id,Object.assign({},e[t.payload.id],t.payload.data))));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=n(53),a=r(s),l=n(93),u=r(l),p={};t.default=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:m,t=arguments[1];switch(t.type){case p.default.ADD_QUEUED_FILE:return(0,l.default)(s({},e,{items:[].concat(o(e.items),[s({},d.default,t.payload.file)])}));case p.default.FAIL_UPLOAD:return(0,l.default)(s({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?s({},e,{message:t.payload.message}):e})}));case p.default.PURGE_UPLOAD_QUEUE:return(0,l.default)(s({},e,{items:e.items.filter(function(e){return!e.id})}));case p.default.REMOVE_QUEUED_FILE:return(0,l.default)(s({},e,{items:e.items.filter(function(e){return e.queuedId!==t.payload.queuedId})}));case p.default.SUCCEED_UPLOAD:return(0,l.default)(s({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?s({},e,t.payload.json,{messages:[{value:h.default._t("AssetAdmin.DROPZONE_SUCCESS_UPLOAD"),type:"success",extraClass:"success"}]}):e})}));case p.default.UPDATE_QUEUED_FILE:return(0,l.default)(s({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?s({},e,t.payload.updates):e})}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:d,t=arguments[1],n=(0,c.default)(e,t,f);switch(t.type){case a.default.UPLOADFIELD_ADD_FILE:return n(function(e){return{files:[].concat(o(e.files),[Object.assign({},u.default,t.payload.file)])}});case a.default.UPLOADFIELD_SET_FILES:return n(function(){return{files:t.payload.files}});case a.default.UPLOADFIELD_UPLOAD_FAILURE:return n(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,{message:t.payload.message}):e})}});case a.default.UPLOADFIELD_REMOVE_FILE:return n(function(e){return{files:e.files.filter(function(e){return!(t.payload.file.queuedId&&e.queuedId===t.payload.file.queuedId||t.payload.file.id&&e.id===t.payload.file.id)})}});case a.default.UPLOADFIELD_UPLOAD_SUCCESS:return n(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.json):e})}});case a.default.UPLOADFIELD_UPDATE_QUEUED_FILE:return n(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.updates):e})}});default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=n(96),a=r(s),l=n(87),u=r(l),p=n(362),c=r(p),d={fields:{}},f={files:[]};t.default=i},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)}function a(e,t){var n=e.config.sections.find(function(e){return e.name===E}),r=t.fileAttributes?t.fileAttributes.Url:"",o=n.form.remoteEditForm.schemaUrl,i=r&&o+"/?embedurl="+encodeURIComponent(r),s=n.form.remoteCreateForm.schemaUrl;return{sectionConfig:n,schemaUrl:i||s,targetUrl:r}}function l(e){return{actions:{schema:(0,m.bindActionCreators)(_,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var u=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(){function e(e,t){for(var n=0;n
'),this.element.appendChild(n)),r=n.getElementsByTagName("span")[0],r&&(null!=r.textContent?r.textContent=this.options.dictFallbackMessage:null!=r.innerText&&(r.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e){var t,n,r;return t={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},n=e.width/e.height,t.optWidth=this.options.thumbnailWidth,t.optHeight=this.options.thumbnailHeight,null==t.optWidth&&null==t.optHeight?(t.optWidth=t.srcWidth,t.optHeight=t.srcHeight):null==t.optWidth?t.optWidth=n*t.optHeight:null==t.optHeight&&(t.optHeight=1/n*t.optWidth),r=t.optWidth/t.optHeight,e.heightr?(t.srcHeight=e.height,t.srcWidth=t.srcHeight*r):(t.srcWidth=e.width,t.srcHeight=t.srcWidth/r),t.srcX=(e.width-t.srcWidth)/2,t.srcY=(e.height-t.srcHeight)/2,t},drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:l,dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:l,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var n,r,o,i,s,a,l,u,p,c,d,f,h;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(e.previewElement=t.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),c=e.previewElement.querySelectorAll("[data-dz-name]"),i=0,l=c.length;i'+this.options.dictRemoveFile+"
"),e.previewElement.appendChild(e._removeLink)),r=function(n){return function(r){return r.preventDefault(),r.stopPropagation(),e.status===t.UPLOADING?t.confirm(n.options.dictCancelUploadConfirmation,function(){return n.removeFile(e)}):n.options.dictRemoveFileConfirmation?t.confirm(n.options.dictRemoveFileConfirmation,function(){return n.removeFile(e)}):n.removeFile(e)}}(this),f=e.previewElement.querySelectorAll("[data-dz-remove]"),h=[],a=0,p=f.length;a\n
\n
\n
\n
\n
\n
\n
\n
\n \n Check\n \n \n \n \n \n
\n
\n \n Error\n \n \n \n \n \n \n \n
\n
'},n=function(){var e,t,n,r,o,i,s;for(r=arguments[0],n=2<=arguments.length?p.call(arguments,1):[],i=0,s=n.length;i'+this.options.dictDefaultMessage+"
")),this.clickableElements.length&&(r=function(e){return function(){return e.hiddenFileInput&&e.hiddenFileInput.parentNode.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(null==e.options.maxFiles||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",null!=e.options.acceptedFiles&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),null!=e.options.capture&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",document.querySelector(e.options.hiddenInputContainer).appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var t,n,o,i;if(n=e.hiddenFileInput.files,n.length)for(o=0,i=n.length;o',this.options.dictFallbackText&&(r+="

"+this.options.dictFallbackText+"

"),r+='
',n=t.createElement(r),"FORM"!==this.element.tagName?(o=t.createElement('
'),o.appendChild(n)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=o?o:n)},t.prototype.getExistingFallback=function(){var e,t,n,r,o,i;for(t=function(e){var t,n,r;for(n=0,r=e.length;n0){for(s=["TB","GB","MB","KB","b"],n=a=0,l=s.length;a=t){r=e/Math.pow(this.options.filesizeBase,4-n),o=i;break}r=Math.round(10*r)/10}return""+r+" "+o},t.prototype._updateMaxFilesReachedClass=function(){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")},t.prototype.drop=function(e){var t,n;e.dataTransfer&&(this.emit("drop",e),t=e.dataTransfer.files,this.emit("addedfiles",t),t.length&&(n=e.dataTransfer.items,n&&n.length&&null!=n[0].webkitGetAsEntry?this._addFilesFromItems(n):this.handleFiles(t)))},t.prototype.paste=function(e){var t,n;if(null!=(null!=e&&null!=(n=e.clipboardData)?n.items:void 0))return this.emit("paste",e),t=e.clipboardData.items,t.length?this._addFilesFromItems(t):void 0},t.prototype.handleFiles=function(e){var t,n,r,o;for(o=[],n=0,r=e.length;n0){for(i=0,s=n.length;i1024*this.options.maxFilesize*1024?n(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):t.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(n(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,n):n(this.options.dictInvalidFileType)},t.prototype.addFile=function(e){return e.upload={progress:0,total:e.size,bytesSent:0},this.files.push(e),e.status=t.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(t){return function(n){return n?(e.accepted=!1,t._errorProcessing([e],n)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass()}}(this))},t.prototype.enqueueFiles=function(e){var t,n,r;for(n=0,r=e.length;n=t)&&(r=this.getQueuedFiles(),r.length>0)){if(this.options.uploadMultiple)return this.processFiles(r.slice(0,t-n));for(;e=U;p=0<=U?++x:--x)i.append(this._getParamName(p),e[p],this._renameFilename(e[p].name));return this.submitRequest(S,i,e)},t.prototype.submitRequest=function(e,t,n){return e.send(t)},t.prototype._finished=function(e,n,r){var o,i,s;for(i=0,s=e.length;iu;)t=o[4*(a-1)+3],0===t?i=a:u=a,a=i+u>>1;return l=a/s,0===l?1:l},a=function(e,t,n,r,o,i,a,l,u,p){var c;return c=s(t),e.drawImage(t,n,r,o,i,a,l,u,p/c)},i=function(e,t){var n,r,o,i,s,a,l,u,p;if(o=!1,p=!0,r=e.document,u=r.documentElement,n=r.addEventListener?"addEventListener":"attachEvent",l=r.addEventListener?"removeEventListener":"detachEvent",a=r.addEventListener?"":"on",i=function(n){if("readystatechange"!==n.type||"complete"===r.readyState)return("load"===n.type?e:r)[l](a+n.type,i,!1),!o&&(o=!0)?t.call(e,n.type||n):void 0},s=function(){try{u.doScroll("left")}catch(e){return void setTimeout(s,50)}return i("poll")},"complete"!==r.readyState){if(r.createEventObject&&u.doScroll){try{p=!e.frameElement}catch(e){}p&&s()}return r[n](a+"DOMContentLoaded",i,!1),r[n](a+"readystatechange",i,!1),e[n](a+"load",i,!1)}},n._autoDiscoverFunction=function(){if(n.autoDiscover)return n.discover()},i(window,n._autoDiscoverFunction)}).call(this)}).call(t,n(7),n(52)(e))},function(e,t,n){"use strict";var r=n(0),o=r.createClass({displayName:"CustomFilterContainer",getDefaultProps:function(){return{placeholderText:""}},render:function(){var e=this;return"function"!=typeof e.props.customFilterComponent?(console.log("Couldn't find valid template."),r.createElement("div",null)):r.createElement(e.props.customFilterComponent,{changeFilter:this.props.changeFilter,results:this.props.results,currentResults:this.props.currentResults,placeholderText:this.props.placeholderText})}});e.exports=o},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,i=null,s=null;if(!0===this.props.useGriddleStyles){var a={float:"left",minHeight:"1px",marginTop:"5px"};s=o({textAlign:"right",width:"34%"},a),i=o({textAlign:"center",width:"33%"},a),n=o({width:"33%"},a)}for(var l=[],u=1;u<=this.props.maxPage;u++)l.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:i},r.createElement("select",{value:this.props.currentPage+1,onChange:this.pageChange},l)," / ",this.props.maxPage),r.createElement("div",{className:this.props.nextClassName,style:s},t))}});e.exports=i},function(e,t,n){"use strict";var r=n(0),o=(n(29),n(97)),i=n(51),s=n(346),a=n(48),l=n(318),u=n(342),p=n(146),c=r.createClass({displayName:"GridRow",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}},handleClick:function(e){null!==this.props.onRowClick&&i(this.props.onRowClick)?this.props.onRowClick(this,e):this.props.hasChildren&&this.props.toggleChildren()},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 c=this.props.columnSettings.getColumns(),d=s(c,[]),f=a({},this.props.data);l(f,d);var h,m,g=u(o.pick(f,p(c,"children"))),y=g.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()&&void 0!==s&&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,className:s.cssClassName,key:o,style:n},u)}else i=r.createElement("td",{onClick:e.handleClick,className:s.cssClassName,key:o,style:n},l,e.formatData(t[1]));return i||r.createElement("td",{onClick:e.handleClick,key:o,style:n},l,t[1])});null!==this.props.onRowClick&&i(this.props.onRowClick)?(h=null,m=this.handleSelectClick):this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection?(h=this.handleSelectClick,m=null):(h=null,m=null),y&&this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection&&(this.props.multipleSelectionSettings.getSelectedRowIds(),y.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 v=t.props.rowSettings&&t.props.rowSettings.getBodyRowMetadataClass(t.props.data)||"standard-row";return t.props.isChildRow?v="child-row":t.props.hasChildren&&(v=t.props.showChildren?this.props.parentRowExpandedClassName:this.props.parentRowCollapsedClassName),r.createElement("tr",{onClick:h,className:v},y)}});e.exports=c},function(e,t,n){"use strict";var r=n(0),o=n(325),i=n(146),s=n(72),a=r.createClass({displayName:"GridSettings",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===o(this.props.selectedColumns,t)?(this.props.selectedColumns.push(t),this.props.setColumns(this.props.selectedColumns)):this.props.setColumns(i(this.props.selectedColumns,t))},render:function(){var e=this,t=[];!1===e.props.useCustomComponent&&(t=this.props.columns.map(function(t,n){var i=o(e.props.selectedColumns,t),a=s(e.props.columnMetadata,{columnName:t}),l=t;return void 0!==a&&void 0!==a.displayName&&null!=a.displayName&&(l=a.displayName),void 0!==a&&null!=a&&a.locked?r.createElement("div",{className:"column checkbox"},r.createElement("label",null,r.createElement("input",{type:"checkbox",disabled:!0,name:"check",checked:i,"data-name":t}),l)):void 0!==a&&null!=a&&void 0!==a.visible&&!1===a.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:i,"data-name":t}),l))}));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)):"",i=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),i,n)}});e.exports=a},function(e,t,n){"use strict";var r=n(0),o=n(215),i=n(98),s=(n(29),n(100),r.createClass({displayName:"GridTable",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}},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,s=null;if(this.props.enableInfiniteScroll&&null!==this.props.rowHeight&&void 0!==this.refs.scrollable){var a=e.getAdjustedRowHeight(),l=Math.ceil(e.state.clientHeight/a),u=Math.max(0,Math.floor(e.state.scrollTop/a)-.25*l),p=Math.min(u+1.25*l,this.props.data.length-1);n=n.slice(u,p+1);var c={height:u*a+"px"};o=r.createElement("tr",{key:"above-"+c.height,style:c});var d={height:(this.props.data.length-p)*a+"px"};s=r.createElement("tr",{key:"below-"+d.height,style:d})}var f=n.map(function(n,o){var s=void 0!==n.children&&n.children.length>0,a=e.props.rowSettings.getRowKey(n,o);return s&&(t=s),r.createElement(i,{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:a+"-container",uniqueId:a,columnSettings:e.props.columnSettings,rowSettings:e.props.rowSettings,paddingHeight:e.props.paddingHeight,multipleSelectionSettings:e.props.multipleSelectionSettings,rowHeight:e.props.rowHeight,hasChildren:s,tableClassName:e.props.className,onRowClick:e.props.onRowClick})});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),s&&f.push(s),{nodes:f,anyHasChildren:t}}return null},render:function(){var e=[],t=!1,n=this.getNodeContent();n&&(e=n.nodes,t=n.anyHasChildren);var i=null,s=null,a={width:"100%"};if(this.props.useFixedLayout&&(a.tableLayout="fixed"),this.props.enableInfiniteScroll&&(i={position:"relative",overflowY:"scroll",height:this.props.bodyHeight+"px",width:"100%"}),this.props.externalIsLoading){var l=null,u=null;this.props.useGriddleStyles&&(l={textAlign:"center",paddingBottom:"40px"}),u=this.props.columnSettings.getVisibleColumnCount();var p=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:l,colSpan:u},p)))}var c=this.props.showTableHeading?r.createElement(o,{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 d=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;d=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&&(a.tableLayout="fixed"),r.createElement("div",null,r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&a||null},c),r.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:i},r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&a||null},e,s,d)))):r.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:i},r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&a||null},c,e,s,d))}}));e.exports=s},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t=120&&y.length>=120)?new o(f&&y):void 0}y=e[0];var v=-1,b=h[0];e:for(;++vt||s&&a&&u&&!l&&!p||r&&a&&u||!n&&u||!i)return 1;if(!r&&!s&&!p&&e=l?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}var o=n(262);e.exports=r},function(e,t,n){function r(e,t){return o(e,i(e),t)}var o=n(18),i=n(69);e.exports=r},function(e,t,n){function r(e,t){return o(e,i(e),t)}var o=n(18),i=n(128);e.exports=r},function(e,t,n){var r=n(9),o=r["__core-js_shared__"];e.exports=o},function(e,t,n){function r(e,t){return function(n,r){if(null==n)return n;if(!o(n))return e(n,r);for(var i=n.length,s=t?i:-1,a=Object(n);(t?s--:++s-1?a[l?t[u]:u]:void 0}}var o=n(31),i=n(10),s=n(13);e.exports=r},function(e,t,n){function r(e){return function(t){var n=i(t);return n==l?s(t):n==u?a(t):o(t,e(t))}}var o=n(249),i=n(45),s=n(71),a=n(308),l="[object Map]",u="[object Set]";e.exports=r},function(e,t,n){function r(e,t,n,r){return void 0===e||o(e,i[n])&&!s.call(r,n)?t:e}var o=n(34),i=Object.prototype,s=i.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){return o(e)?void 0:e}var o=n(142);e.exports=r},function(e,t,n){function r(e,t,n,r,o,C,w){switch(n){case S:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case E:return!(e.byteLength!=t.byteLength||!C(new i(e),new i(t)));case d:case f:case g:return s(+e,+t);case h:return e.name==t.name&&e.message==t.message;case y:case b:return e==t+"";case m:var O=l;case v:var T=r&p;if(O||(O=u),e.size!=t.size&&!T)return!1;var F=w.get(e);if(F)return F==t;r|=c,w.set(e,t);var I=a(O(e),O(t),r,o,C,w);return w.delete(e),I;case _:if(P)return P.call(e)==P.call(t)}return!1}var o=n(22),i=n(101),s=n(34),a=n(123),l=n(71),u=n(134),p=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",m="[object Map]",g="[object Number]",y="[object RegExp]",v="[object Set]",b="[object String]",_="[object Symbol]",E="[object ArrayBuffer]",S="[object DataView]",C=o?o.prototype:void 0,P=C?C.valueOf:void 0;e.exports=r},function(e,t,n){function r(e,t,n,r,s,l){var u=n&i,p=o(e),c=p.length;if(c!=o(t).length&&!u)return!1;for(var d=c;d--;){var f=p[d];if(!(u?f in t:a.call(t,f)))return!1}var h=l.get(e);if(h&&l.get(t))return h==t;var m=!0;l.set(e,t),l.set(t,e);for(var g=u;++d-1}var o=n(41);e.exports=r},function(e,t,n){function r(e,t){var n=this.__data__,r=o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var o=n(41);e.exports=r},function(e,t,n){function r(){this.size=0,this.__data__={hash:new o,map:new(s||i),string:new o}}var o=n(217),i=n(40),s=n(59);e.exports=r},function(e,t,n){function r(e){var t=o(this,e).delete(e);return this.size-=t?1:0,t}var o=n(44);e.exports=r},function(e,t,n){function r(e){return o(this,e).get(e)}var o=n(44);e.exports=r},function(e,t,n){function r(e){return o(this,e).has(e)}var o=n(44);e.exports=r},function(e,t,n){function r(e,t){var n=o(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var o=n(44);e.exports=r},function(e,t,n){function r(e){var t=o(e,function(e){return n.size===i&&n.clear(),e}),n=t.cache;return t}var o=n(333),i=500;e.exports=r},function(e,t,n){var r=n(132),o=r(Object.keys,Object);e.exports=o},function(e,t){function n(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}e.exports=n},function(e,t,n){(function(e){var r=n(125),o="object"==typeof t&&t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=i&&i.exports===o,a=s&&r.process,l=function(){try{return a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=l}).call(t,n(52)(e))},function(e,t){function n(e){return o.call(e)}var r=Object.prototype,o=r.toString;e.exports=n},function(e,t,n){function r(e,t){return t.length<2?e:o(e,i(t,0,-1))}var o=n(42),i=n(32);e.exports=r},function(e,t){function n(e){return this.__data__.set(e,r),this}var r="__lodash_hash_undefined__";e.exports=n},function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},function(e,t){function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}e.exports=n},function(e,t){function n(e){var t=0,n=0;return function(){var s=i(),a=o-(s-n);if(n=s,a>0){if(++t>=r)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var r=800,o=16,i=Date.now;e.exports=n},function(e,t,n){function r(){this.__data__=new o,this.size=0}var o=n(40);e.exports=r},function(e,t){function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}e.exports=n},function(e,t){function n(e){return this.__data__.get(e)}e.exports=n},function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},function(e,t,n){function r(e,t){var n=this.__data__;if(n instanceof o){var r=n.__data__;if(!i||r.length-1:!!p&&o(e,t,n)>-1}var o=n(114),i=n(10),s=n(330),a=n(36),l=n(345),u=Math.max;e.exports=r},function(e,t,n){function r(e){return(null==e?0:e.length)?o(e,0,-1):[]}var o=n(32);e.exports=r},function(e,t,n){var r=n(8),o=n(231),i=n(23),s=n(254),a=i(function(e){var t=r(e,s);return t.length&&t[0]===e[0]?o(t):[]});e.exports=a},function(e,t,n){function r(e){if(null==e)return!0;if(l(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||c(e)||s(e)))return!e.length;var t=i(e);if(t==d||t==f)return!e.size;if(p(e))return!o(e).length;for(var n in e)if(m.call(e,n))return!1;return!0}var o=n(116),i=n(45),s=n(49),a=n(2),l=n(10),u=n(50),p=n(33),c=n(75),d="[object Map]",f="[object Set]",h=Object.prototype,m=h.hasOwnProperty;e.exports=r},function(e,t){function n(e){return null===e}e.exports=n},function(e,t,n){function r(e){return"string"==typeof e||!i(e)&&s(e)&&o(e)==a}var o=n(17),i=n(2),s=n(14),a="[object String]";e.exports=r},function(e,t){function n(e){return void 0===e}e.exports=n},function(e,t){function n(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}e.exports=n},function(e,t,n){function r(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(i);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(r.Cache||o),n}var o=n(60),i="Expected a function";r.Cache=o,e.exports=r},function(e,t,n){var r=n(8),o=n(226),i=n(251),s=n(24),a=n(18),l=n(272),u=n(124),p=n(127),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}),a(e,p(e),n),u&&(n=o(n,7,l));for(var c=t.length;c--;)i(n,t[c]);return n});e.exports=c},function(e,t,n){function r(e,t,n,r){return null==e?[]:(i(t)||(t=null==t?[]:[t]),n=r?void 0:n,i(n)||(n=null==n?[]:[n]),o(e,t,n))}var o=n(118),i=n(2);e.exports=r},function(e,t,n){var r=n(241),o=n(124),i=o(function(e,t){return null==e?{}:r(e,t)});e.exports=i},function(e,t,n){var r=n(65),o=n(118),i=n(23),s=n(129),a=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=a},function(e,t){function n(){return!1}e.exports=n},function(e,t,n){function r(e,t,n){return e&&e.length?(t=n||void 0===t?1:i(t),o(e,0,t<0?0:t)):[]}var o=n(32),i=n(36);e.exports=r},function(e,t,n){function r(e){return e?(e=o(e))===i||e===-i?(e<0?-1:1)*s:e===e?e:0:0===e?e:0}var o=n(341),i=1/0,s=1.7976931348623157e308;e.exports=r},function(e,t,n){function r(e){if("number"==typeof e)return e;if(i(e))return s;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(a,"");var n=u.test(e);return n||p.test(e)?c(e.slice(2),n?2:8):l.test(e)?s:+e}var o=n(11),i=n(25),s=NaN,a=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,p=/^0o[0-7]+$/i,c=parseInt;e.exports=r},function(e,t,n){var r=n(270),o=n(13),i=r(o);e.exports=i},function(e,t,n){function r(e){return s(e)?o(e,u):a(e)?[e]:i(l(p(e)))}var o=n(8),i=n(120),s=n(2),a=n(25),l=n(136),u=n(20),p=n(77);e.exports=r},function(e,t,n){function r(e){var t=++i;return o(e)+t}var o=n(77),i=0;e.exports=r},function(e,t,n){function r(e){return null==e?[]:o(e,i(e))}var o=n(252),i=n(13);e.exports=r},function(e,t,n){function r(e,t){return i(e||[],t||[],o)}var o=n(30),i=n(253);e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(343),o=function(e){return e&&e.__esModule?e:{default:e}}(r),i=function(e,t){if(!e)return e;var n=(0,o.default)(t),r=n.length;if(r){for(var i=e,s=0;s0}).length)return alert(o.default._t("AssetAdmin.BULK_ACTIONS_DELETE_FOLDER","These folders contain files which are currently in use, you must move or delete their contents before you can delete the folder.")),void n("cancelled");var r=e.filter(function(e){return"folder"!==e.type&&e.inUseCount>0}),i=o.default._t("AssetAdmin.BULK_ACTIONS_DELETE_CONFIRM","Are you sure you want to delete these files?");1===e.length&&1===r.length?i=o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SINGLE_CONFIRM","This file is currently used in %s place(s), are you sure you want to delete it?"),e[0].inUseCount):r.length>0&&(i=o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_DELETE_MULTI_CONFIRM","There are %s files currently in use, are you sure you want to delete these files?"),r.length)),r.length>0&&(i+="\n\n",i+=o.default._t("AssetAdmin.BULK_ACTIONS_DELETE_WARNING","Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.")),confirm(i)?t():n("cancelled")})})},{value:"edit",label:o.default._t("AssetAdmin.BULK_ACTIONS_EDIT","Edit"),className:"font-icon-edit",destructive:!1,canApply:function(e){return 1===e.length},callback:null},{value:"move",label:o.default._t("AssetAdmin.BULK_ACTIONS_MOVE","Move"),className:"font-icon-folder-move",canApply:function(e){return e.every(function(e){return 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:function(e){return e.some(function(e){return e&&!e.published})&&e.every(function(e){return 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:function(e){return e.some(function(e){return e.published})&&e.every(function(e){return e.canEdit&&"folder"!==e.type})},confirm:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){return new Promise(function(t,n){var r=e.filter(function(e){return e.inUseCount>0}),i=o.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH_CONFIRM","Are you sure you want to unpublish these files?");1===e.length&&1===r.length?i=o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH_SINGLE_CONFIRM","This file is currently used in %s place(s), are you sure you want to unpublish it?"),e[0].inUseCount):r.length>0&&(i=o.default.sprintf(o.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH_MULTI_CONFIRM","There are %s files currently in use, are you sure you want to unpublish these files?"),r.length)),confirm(i)?t():n("cancelled")})})}],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"}},function(e,t,n){function r(e){return s(e)?o(e):i(e)}var o=n(107),i=n(116),s=n(10);e.exports=r},function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},function(e,t){e.exports=ReactApollo},,function(e,t,n){function r(e){return null==e?void 0===e?l:a:u&&u in Object(e)?i(e):s(e)}var o=n(22),i=n(276),s=n(304),a="[object Null]",l="[object Undefined]",u=o?o.toStringTag:void 0;e.exports=r},function(e,t,n){function r(e,t,n,r){var s=!n;n||(n={});for(var a=-1,l=t.length;++a0}},{key:"getMetadataColumnProperty",value:function(e,t,n){var r=this.getColumnMetadataByName(e);return void 0===r||null===r?n:r.hasOwnProperty(t)?r[t]:n}},{key:"orderColumns",value:function(e){var t=this;return l(e,function(e){var n=a(t.columnMetadata,{columnName:e});return void 0===n||null===n||isNaN(n.order)?100:n.order})}},{key:"getColumns",value:function(){var e=0===this.filteredColumns.length?this.allColumns:this.filteredColumns;return e=u(e,this.metadataColumns),e=this.orderColumns(e)}}]),e}();e.exports=p},function(e,t,n){function r(e,t,n){var r=e[t];a.call(e,t)&&i(r,n)&&(void 0!==n||t in e)||o(e,t,n)}var o=n(109),i=n(34),s=Object.prototype,a=s.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){return"function"==typeof e?e:null==e?s:"object"==typeof e?a(e)?i(e[0],e[1]):o(e):l(e)}var o=n(239),i=n(240),s=n(35),a=n(2),l=n(144);e.exports=r},function(e,t){function n(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r-1&&e%1==0&&e-1}},{key:"toggleSelectConcat",value:function(e){this.props.actions.gallery.setConcatenateSelect(e.metaKey||e.ctrlKey)}},{key:"itemIsHighlighted",value:function(e){return this.props.fileId===e}},{key:"hasOpenedItem",value:function(){return!!this.props.fileId}},{key:"handleClearSearch",value:function(e){this.props.onClearSearch(e)}},{key:"handleGroupSelect",value:function(e){var t=this.props.actions.gallery,n=t.deselectFiles,r=t.selectFiles;this.props.concatenateSelect||n(null),r(e.filter(function(t,n){return e.indexOf(t)===n}))}},{key:"handleClearSelection",value:function(){this.props.actions.gallery.deselectFiles(null)}},{key:"handleOpenFolder",value:function(e,t){e.preventDefault(),this.props.actions.gallery.setErrorMessage(null),this.props.actions.gallery.setNoticeMessage(null),this.props.onOpenFolder(t.id)}},{key:"handleOpenFile",value:function(e,t){e.preventDefault(),null!==t.created&&this.props.onOpenFile(t.id,t)}},{key:"handleSelect",value:function(e,t){-1===this.props.selectedFiles.indexOf(t.id)?this.props.actions.gallery.selectFiles([t.id]):this.props.actions.gallery.deselectFiles([t.id])}},{key:"handleEnableDropzone",value:function(e){this.props.actions.gallery.setEnableDropzone(e)}},{key:"handleMoveFiles",value:function(e,t){var n=this;this.props.actions.files.moveFiles(e,t).then(function(){var r=L.default.MOVE_SUCCESS_DURATION,o="+"+t.length;n.props.actions.gallery.setFileBadge(e,o,"success",r),"function"==typeof n.props.onMoveFilesSuccess&&n.props.onMoveFilesSuccess(e,t)}).catch(function(){n.props.actions.gallery.setErrorMessage(g.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))})}},{key:"handleBulkEdit",value:function(e){this.props.onOpenFile(e[0].id)}},{key:"handleBulkMove",value:function(){this.props.actions.gallery.activateModal(L.default.MODAL_MOVE)}},{key:"renderSearchAlert",value:function(){var e=this.props.filters;if(!e||0===Object.keys(e).length)return null;var t=this.getSearchMessage(e);if(""===t)return null;var n=v.default.createElement("div",null,v.default.createElement("button",{onClick:this.handleClearSearch,className:"btn btn-info font-icon-cancel form-alert__btn--right"},g.default._t("AssetAdmin.SEARCHCLEARRESULTS","Clear results")),t);return v.default.createElement(M.default,{value:{react:n},type:"warning"})}},{key:"renderTransitionBulkActions",value:function(){return"admin"===this.props.type?v.default.createElement(P.default,{transitionName:"bulk-actions",transitionEnterTimeout:L.default.CSS_TRANSITION_TIME,transitionLeaveTimeout:L.default.CSS_TRANSITION_TIME},this.renderBulkActions()):null}},{key:"renderBulkActions",value:function(){var e=this,t=L.default.BULK_ACTIONS.map(function(t){if(!t.callback)switch(t.value){case"delete":return c({},t,{callback:e.handleBulkDelete});case"edit":return c({},t,{callback:e.handleBulkEdit});case"move":return c({},t,{callback:e.handleBulkMove});case"publish":return c({},t,{callback:e.handleBulkPublish});case"unpublish":return c({},t,{callback:e.handleBulkUnpublish});default:return t}return t}),n=[].concat(i(this.props.files),i(this.props.queuedFiles.items)),r=this.props.selectedFiles.map(function(e){return n.find(function(t){return t&&e===t.id})}).filter(function(e){return e});return r.length>0&&"admin"===this.props.type?v.default.createElement(A.default,{actions:t,items:r,key:r.length>0}):null}},{key:"renderGalleryView",value:function(){var e=this,t="table"===this.props.view?k.default:D.default,n=this.props.queuedFiles.items.filter(function(t){return!t.id||!e.props.files.find(function(e){return e.id===t.id})}).map(function(e){return Object.assign({},e,{uploading:!(e.id>0)})}),r=[].concat(i(n),i(this.props.files)).map(function(t){return Object.assign({},t||{},{selected:e.itemIsSelected(t.id),highlighted:e.itemIsHighlighted(t.id)})}),o=this.props,s=o.type,a=o.loading,l=o.page,u=o.totalCount,p=o.limit,c=o.sort,d=o.selectedFiles,f=o.badges,h={selectableItems:"admin"===s,files:r,loading:a,page:l,totalCount:u,limit:p,sort:c,selectedFiles:d,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:this.props.sectionConfig};return v.default.createElement(t,h)}},{key:"renderToolbar",value:function(){var e=this.props,t=e.GalleryToolbar,n=e.sort,r=e.view,o=e.folder,i=e.onCreateFolder,s=e.onOpenFolder,a=e.onViewChange,l={onMoveFiles:this.handleMoveFiles,onSort:this.handleSort,onCreateFolder:i,onOpenFolder:s,onViewChange:a,view:r,sort:n,folder:o};return v.default.createElement(t,l)}},{key:"render",value:function(){if(!this.props.folder)return this.props.errorMessage||this.props.graphQLErrors?v.default.createElement("div",{className:"gallery__error flexbox-area-grow"},v.default.createElement("div",{className:"gallery__error-message"},v.default.createElement("h3",null,g.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error.")),this.props.errorMessage&&v.default.createElement("p",null,this.props.errorMessage),this.props.graphQLErrors&&this.props.graphQLErrors.map(function(e,t){return v.default.createElement("p",{key:t},e)}))):this.props.loading?v.default.createElement("div",{className:"flexbox-area-grow"},v.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),v.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})):v.default.createElement("div",{className:"flexbox-area-grow"},v.default.createElement("div",{className:"editor__file-preview-message--file-missing m-t-3"},g.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")));var e=v.default.createElement("div",{className:"gallery_messages"},this.props.errorMessage&&v.default.createElement(M.default,{value:this.props.errorMessage,type:"danger"}),this.props.noticeMessage&&v.default.createElement(M.default,{value:this.props.noticeMessage,type:"success"}),this.renderSearchAlert()),t={height:L.default.THUMBNAIL_HEIGHT,width:L.default.THUMBNAIL_WIDTH},n=c({url:this.props.createFileApiUrl,method:this.props.createFileApiMethod,paramName:"Upload",clickable:"#upload-button"},this.props.sectionConfig.dropzoneOptions),r=this.props.securityId,o=this.props.folder.canEdit&&this.props.enableDropzone,i=["panel","panel--padded","panel--scrollable","gallery__main","fill-height"];"insert"===this.props.type&&i.push("insert-media-modal__main");var s=i;return this.hasOpenedItem()&&s.push("gallery__main--has-opened-item"),v.default.createElement("div",{className:"flexbox-area-grow gallery__outer"},v.default.createElement(ee.default,{sectionConfig:this.props.sectionConfig,folderId:this.props.folderId,onSuccess:this.props.onMoveFilesSuccess,onOpenFolder:this.props.onOpenFolder}),this.renderTransitionBulkActions(),v.default.createElement(Y.default,{className:i.join(" ")},this.renderToolbar(),v.default.createElement(Q.SelectableGroup,{enabled:"tile"===this.props.view&&"admin"===this.props.type,className:"flexbox-area-grow fill-height gallery__main--selectable",onSelection:this.handleGroupSelect,onNonItemClick:this.handleClearSelection,preventDefault:!1,fixedPosition:!0},v.default.createElement(F.default,{name:"gallery-container",className:"flexbox-area-grow",canUpload:o,onAddedFile:this.handleAddedFile,onPreviewLoaded:this.handlePreviewLoaded,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:t,folderId:this.props.folderId,options:n,securityID:r,uploadButton:!1},e,this.renderGalleryView()))),this.props.loading&&[v.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),v.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})])}}]),t}(y.Component),re={page:1,limit:15},oe={sectionConfig:Z.default,loading:y.PropTypes.bool,sort:y.PropTypes.string,files:y.PropTypes.arrayOf(y.PropTypes.shape({id:y.PropTypes.number,parent:y.PropTypes.shape({id:y.PropTypes.number})})).isRequired,selectedFiles:y.PropTypes.arrayOf(y.PropTypes.number),totalCount:y.PropTypes.number,page:y.PropTypes.number,limit:y.PropTypes.number,badges:y.PropTypes.arrayOf(y.PropTypes.shape({id:y.PropTypes.number,message:y.PropTypes.node,status:y.PropTypes.string})),onOpenFile:y.PropTypes.func.isRequired,onOpenFolder:y.PropTypes.func.isRequired,onSort:y.PropTypes.func.isRequired,onSetPage:y.PropTypes.func.isRequired},ie=Object.assign({},re,{selectableItems:!1}),se=Object.assign({},oe,{selectableItems:y.PropTypes.bool,onSelect:y.PropTypes.func,onCancelUpload:y.PropTypes.func,onDelete:v.default.PropTypes.func,onRemoveErroredUpload:y.PropTypes.func,onEnableDropzone:y.PropTypes.func});ne.defaultProps=Object.assign({},re,{type:"admin",view:"tile",enableDropzone:!0}),ne.propTypes=Object.assign({},oe,{onUploadSuccess:v.default.PropTypes.func,onCreateFolder:v.default.PropTypes.func,onMoveFilesSuccess:v.default.PropTypes.func,onDelete:v.default.PropTypes.func,onPublish:v.default.PropTypes.func,onUnpublish:v.default.PropTypes.func,type:y.PropTypes.oneOf(["insert-media","insert-link","select","admin"]),view:y.PropTypes.oneOf(["tile","table"]),dialog:y.PropTypes.bool,fileId:y.PropTypes.number,folderId:y.PropTypes.number.isRequired,folder:y.PropTypes.shape({id:y.PropTypes.number,title:y.PropTypes.string,parentId:y.PropTypes.number,canView:y.PropTypes.bool,canEdit:y.PropTypes.bool}),queuedFiles:y.PropTypes.shape({items:y.PropTypes.array.isRequired}),errorMessage:y.PropTypes.string,graphQLErrors:y.PropTypes.arrayOf(y.PropTypes.string),actions:y.PropTypes.object,securityId:y.PropTypes.string,onViewChange:y.PropTypes.func.isRequired,createFileApiUrl:y.PropTypes.string,createFileApiMethod:y.PropTypes.string,search:y.PropTypes.object,enableDropzone:y.PropTypes.bool,concatenateSelect:y.PropTypes.bool,GalleryToolbar:y.PropTypes.func,sorters:y.PropTypes.arrayOf(y.PropTypes.shape({field:y.PropTypes.string.isRequired,direction:y.PropTypes.oneOf(["asc","desc"]).isRequired,label:y.PropTypes.string.isRequired})).isRequired}),t.Component=ne,t.galleryViewPropTypes=se,t.galleryViewDefaultProps=ie,t.default=(0,O.compose)((0,te.inject)(["GalleryToolbar"],null,function(){return"AssetAdmin.Gallery"}),(0,w.connect)(u,p),W.default,z.default,function(e){return(0,K.withApollo)(e)})(ne)},function(e,t,n){"use strict";function r(e,t){return function(n){n({type:g.default.LOAD_FILE_SUCCESS,payload:{id:e,file:t}})}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t({type:g.default.SELECT_FILES,payload:{ids:e}})}}function i(e){return function(t){return t({type:g.default.CONCATENATE_SELECT,payload:!!e})}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t({type:g.default.DESELECT_FILES,payload:{ids:e}})}}function a(e){return function(t){return t({type:g.default.SET_NOTICE_MESSAGE,payload:{message:e}})}}function l(e){return function(t){return t({type:g.default.SET_ERROR_MESSAGE,payload:{message:e}})}}function u(e){return function(t){return t({type:g.default.SET_ENABLE_DROPZONE,payload:{enableDropzone:e}})}}function p(e){return function(t){t({type:g.default.CLEAR_FILE_BADGE,payload:{id:e}})}}function c(e,t,n,r){return function(o,i){var s=i(),a=s.assetAdmin,l=a.gallery.badges.find(function(t){return t.id===e});l&&l.timer&&clearTimeout(l.timer);var u=r>0?setTimeout(function(){return p(e)(o)},r):null;o({type:g.default.SET_FILE_BADGE,payload:{id:e,message:t,status:n,timer:u}})}}function d(e){return function(t){t({type:g.default.ACTIVATE_MODAL,payload:e})}}function f(){return function(e){e({type:g.default.DEACTIVATE_MODAL})}}function h(e){return function(t){t({type:g.default.SET_LOADING,payload:!!e})}}Object.defineProperty(t,"__esModule",{value:!0}),t.loadFile=r,t.selectFiles=o,t.setConcatenateSelect=i,t.deselectFiles=s,t.setNoticeMessage=a,t.setErrorMessage=l,t.setEnableDropzone=u,t.clearFileBadge=p,t.setFileBadge=c,t.activateModal=d,t.deactivateModal=f,t.setLoading=h;var m=n(90),g=function(e){return e&&e.__esModule?e:{default:e}}(m)},function(e,t,n){var r=n(19),o=n(9),i=r(o,"Map");e.exports=i},function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t0&&n(p)?t>1?r(p,t-1,n,s,a):o(a,p):s||(a[a.length]=p)}return a}var o=n(63),i=n(287);e.exports=r},function(e,t){function n(e,t){return e.has(t)}e.exports=n},function(e,t,n){function r(e){var t=new e.constructor(e.byteLength);return new o(t).set(new o(e)),t}var o=n(101);e.exports=r},function(e,t,n){var r=n(132),o=r(Object.getPrototypeOf,Object);e.exports=o},function(e,t,n){var r=n(104),o=n(145),i=Object.prototype,s=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,l=a?function(e){return null==e?[]:(e=Object(e),r(a(e),function(t){return s.call(e,t)}))}:o;e.exports=l},function(e,t,n){function r(e,t){if(o(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!s.test(e)||null!=t&&e in Object(t)}var o=n(2),i=n(25),s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=r},function(e,t){function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}e.exports=n},function(e,t,n){var r=n(269),o=n(322),i=r(o);e.exports=i},function(e,t,n){function r(e){return i(e)&&o(e)}var o=n(10),i=n(14);e.exports=r},function(e,t){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}var r=9007199254740991;e.exports=n},function(e,t,n){var r=n(237),o=n(43),i=n(303),s=i&&i.isTypedArray,a=s?o(s):r;e.exports=a},function(e,t,n){function r(e){return s(e)?o(e,!0):i(e)}var o=n(107),i=n(238),s=n(10);e.exports=r},function(e,t,n){function r(e){return null==e?"":o(e)}var o=n(250);e.exports=r},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=Badge},function(e,t){e.exports=FormBuilderLoader},function(e,t){e.exports=classnames},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)}function a(e){return e.item.thumbnail&&"image"===e.item.category&&e.item.exists&&!e.item.uploading&&e.sectionConfig.imageRetry.minRetry&&e.sectionConfig.imageRetry.maxRetry}function l(e,t){if(a(t)){var n=e.assetAdmin.imageLoad,r=n.files.find(function(e){return t.item.thumbnail===e.url});return{loadState:r&&r.status||k.default.NONE}}return{loadState:k.default.DISABLED}}function u(e){return{actions:{imageLoad:(0,I.bindActionCreators)(D,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.File=t.Folder=t.Component=void 0;var p=Object.assign||function(e){for(var t=1;t0}},{key:"uploading",value:function(){return this.props.item.uploading}},{key:"exists",value:function(){return this.props.item.exists}},{key:"isImage",value:function(){return"image"===this.props.item.category}},{key:"canBatchSelect",value:function(){return this.props.selectable&&this.props.item.canEdit}},{key:"hasError",value:function(){var e=!1;return this.props.item.message&&(e="error"===this.props.item.message.type),e}},{key:"handleActivate",value:function(e){e.stopPropagation(),"function"!=typeof this.props.onActivate||this.uploading()||this.props.onActivate(e,this.props.item)}},{key:"handleSelect",value:function(e){e.stopPropagation(),e.preventDefault(),"function"==typeof this.props.onSelect&&this.props.onSelect(e,this.props.item)}},{key:"handleKeyDown",value:function(e){y.default.SPACE_KEY_CODE===e.keyCode&&(e.preventDefault(),this.canBatchSelect()&&this.handleSelect(e)),y.default.RETURN_KEY_CODE===e.keyCode&&this.handleActivate(e)}},{key:"handleCancelUpload",value:function(e){e.stopPropagation(),e.preventDefault(),this.hasError()?this.props.onRemoveErroredUpload(this.props.item):this.props.onCancelUpload&&this.props.onCancelUpload(this.props.item)}},{key:"render",value:function(){var e=this,t=null,n=null,r=null,o=this.props.item,i=o.id,s=o.queuedId,a=i?"item-"+i:"queued-"+s;if(this.props.selectable&&(this.canBatchSelect()&&(t=this.handleSelect),n="font-icon-tick"),this.uploading())t=this.handleCancelUpload,n="font-icon-cancel";else if(this.exists()){var l=f.default._t("AssetAdmin.DETAILS","Details");r=m.default.createElement("div",{className:"gallery-item--overlay font-icon-edit"},l)}var u=this.props.badge,c={className:"gallery-item__checkbox",type:"checkbox",title:f.default._t("AssetAdmin.SELECT","Select"),tabIndex:-1,onMouseDown:R,id:a},d=["gallery-item__checkbox-label",n];this.canBatchSelect()||(c.disabled=!0,d.push("gallery-item__checkbox-label--disabled"));var h={className:d.join(" "),onClick:t};return m.default.createElement("div",{className:this.getItemClassNames(),"data-id":this.props.item.id,tabIndex:0,role:"button",onKeyDown:this.handleKeyDown,onClick:this.handleActivate},!!u&&m.default.createElement(w.default,{className:"gallery-item__badge",status:u.status,message:u.message}),m.default.createElement("div",{ref:function(t){e.thumbnail=t},className:this.getThumbnailClassNames(),style:this.getThumbnailStyles()},r,this.getStatusFlags()),this.getProgressBar(),this.getErrorMessage(),m.default.createElement("div",{className:"gallery-item__title",ref:function(t){e.title=t}},m.default.createElement("label",p({},h,{htmlFor:a}),m.default.createElement("input",c)),this.props.item.title))}}]),t}(h.Component);L.propTypes={sectionConfig:T.default,item:b.default,loadState:h.PropTypes.oneOf(Object.values(k.default)),highlighted:h.PropTypes.bool,selected:h.PropTypes.bool,enlarged:h.PropTypes.bool,message:h.PropTypes.shape({value:h.PropTypes.string,type:h.PropTypes.string}),selectable:h.PropTypes.bool,onActivate:h.PropTypes.func,onSelect:h.PropTypes.func,onCancelUpload:h.PropTypes.func,onRemoveErroredUpload:h.PropTypes.func,badge:h.PropTypes.shape({status:h.PropTypes.string,message:h.PropTypes.string})},L.defaultProps={item:{},sectionConfig:{imageRetry:{}}};var U=(0,F.connect)(l,u)(L),M=(0,A.createSelectable)((0,E.default)("GalleryItem")(U)),j=(0,A.createSelectable)((0,C.default)("GalleryItem")(M));t.Component=L,t.Folder=j,t.File=M,t.default=U},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 i(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)}function s(e){var t={drop:function(e,t){if(t.canDrop()){var n=t.getItem();e.onDropFiles(e.item.id,n.selected)}},canDrop:function(e,t){return!t.getItem().selected.includes(e.item.id)}},n=function(e,t){var n=t.isOver();return{enlarged:n&&t.canDrop(),connectDropTarget:e.dropTarget(),isOver:n}},s=(0,p.DropTarget)(e,t,n);return function(e){var t=function(t){function n(){return r(this,n),o(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return i(n,t),a(n,[{key:"render",value:function(){var t=this.props.connectDropTarget,n=u.default.createElement(e,this.props);return t("string"==typeof n.type?n:u.default.createElement("div",{className:"gallery-item__droppable"},n))}}]),n}(l.Component);return t.propTypes={connectDropTarget:l.PropTypes.func.isRequired,item:l.PropTypes.shape({id:l.PropTypes.number.isRequired}).isRequired},s(t)}}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n0}function l(e,t){var n=e.form.formSchemas[t.searchFormSchemaUrl];if(!n||!n.name)return{formData:{}};var r=(0,O.default)((0,A.default)(e),n.name);return{formData:r&&r.values||{}}}function u(e){return{actions:{schema:(0,v.bindActionCreators)(C,e),reduxForm:(0,v.bindActionCreators)({reset:P.reset,initialize:P.initialize},e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.hasFilters=t.Component=void 0;var p=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1])||arguments[1];return b.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:this.props.securityId}}:{}))}},{key:"handleBackButtonClick",value:function(e){e.preventDefault(),this.props.actions.gallery.deselectFiles(),this.props.folder?this.handleOpenFolder(this.props.folder.parentId||0):this.handleOpenFolder(0)}},{key:"compare",value:function(e,t){return!!(e&&!t||t&&!e)||e&&t&&(e.id!==t.id||e.name!==t.name)}},{key:"resetFile",value:function(e){e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId),this.props.fileId===e.id&&(this.handleCloseFile(),this.handleOpenFile(e.id))}},{key:"handleFolderIcon",value:function(e){e.preventDefault(),this.handleOpenFile(this.getFolderId())}},{key:"handleOpenFile",value:function(e){this.handleBrowse(this.getFolderId(),e,this.props.query)}},{key:"handleSubmitEditor",value:function(e,t,n){var r=this,o=null;if("function"==typeof this.props.onSubmitEditor){var i=this.findFile(this.props.fileId);o=this.props.onSubmitEditor(e,t,n,i)}else o=n();if(!o)throw new Error("Promise was not returned for submitting");return o.then(function(e){return"action_createfolder"===t&&"admin"===r.props.type&&r.handleOpenFile(e.record.id),r.props.actions.files.readFiles().then(function(){return"action_createfolder"===t&&"admin"!==r.props.type&&r.handleOpenFolder(r.getFolderId()),e})})}},{key:"handleCloseFile",value:function(){this.handleBrowse(this.getFolderId(),null,this.props.query)}},{key:"handleOpenFolder",value:function(e){var t=Object.assign({},this.props.query);delete t.page,delete t.filter,this.handleBrowse(e,null,t)}},{key:"handleDelete",value:function(e){var t=this,n=e.map(function(e){var n=t.findFile(e);if(!n)throw new Error("File selected for deletion cannot be found: "+e);return n.queuedId&&t.props.actions.queuedFiles.removeQueuedFile(n.queuedId),n}),r=n.map(function(e){var n=e.__typename,r=e.id;return t.props.client.dataId({__typename:n,id:r})}),o=n.map(function(e){return e.id}),i=this.props.folder?this.props.folder.id:0;return this.props.actions.files.deleteFiles(o,r).then(function(e){var n=e.data.deleteFiles;return t.handleBrowse(i,null,t.props.query),n})}},{key:"doUnpublish",value:function(e){var t=this,n=e.map(function(e){var n=t.findFile(e);if(!n)throw new Error("File selected for unpublishing cannot be found: "+e);if("folder"===n.type)throw new Error("Cannot unpublish folders");return n}),r=n.map(function(e){return e.id});return this.props.actions.files.unpublishFiles(r).then(function(e){return e.data.unpublishFiles.map(function(e){return t.resetFile(e),e})})}},{key:"handleUnpublish",value:function(e){var t=this;return this.doUnpublish(e).then(function(e){var n=t.props.fileId;t.props.actions.files.readFiles().then(function(){n&&e.find(function(e){return e.id===n})&&(t.handleCloseFile(),t.handleOpenFile(n))})})}},{key:"doPublish",value:function(e){var t=this,n=e.map(function(e){var n=t.findFile(e);if(!n)throw new Error("File selected for publishing cannot be found: "+e);if("folder"===n.type)throw new Error("Cannot publish folders");return n}),r=n.map(function(e){return e.id});return this.props.actions.files.publishFiles(r).then(function(e){return e.data.publishFiles.map(function(e){return t.resetFile(e),e})})}},{key:"findFile",value:function(e){return[].concat(i(this.props.files),i(this.props.queuedFiles.items)).find(function(t){return t.id===parseInt(e,10)})}},{key:"handleUpload",value:function(){}},{key:"handleCreateFolder",value:function(){this.props.onBrowse(this.getFolderId(),null,this.props.query,Q.default.ACTIONS.CREATE_FOLDER)}},{key:"handleMoveFilesSuccess",value:function(e,t){var n=this;this.props.queuedFiles.items.filter(function(e){return t.includes(e.id)}).forEach(function(e){e.queuedId&&n.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}),this.props.actions.gallery.deselectFiles(),this.props.actions.files.readFiles()}},{key:"renderGallery",value:function(){var e=this.props.sectionConfig,t=e.createFileEndpoint.url,n=e.createFileEndpoint.method,r=this.props.query&&parseInt(this.props.query.limit||e.limit,10),o=this.props.query&&parseInt(this.props.query.page||1,10),i=this.props.query&&this.props.query.sort,s=this.props.query&&this.props.query.view,a=this.props.query.filter||{};return m.default.createElement(x.default,{files:this.props.files,fileId:this.props.fileId,folderId:this.getFolderId(),folder:this.props.folder,type:this.props.type,limit:r,page:o,totalCount:this.props.filesTotalCount,view:s,filters:a,graphQLErrors:this.props.graphQLErrors,createFileApiUrl:t,createFileApiMethod:n,onDelete:this.handleDelete,onPublish:this.doPublish,onUnpublish:this.doUnpublish,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSuccessfulUpload:this.handleUpload,onCreateFolder:this.handleCreateFolder,onMoveFilesSuccess:this.handleMoveFilesSuccess,onClearSearch:this.handleClearSearch,onSort:this.handleSort,onSetPage:this.handleSetPage,onViewChange:this.handleViewChange,sort:i,sectionConfig:e,loading:this.props.loading})}},{key:"renderEditor",value:function(){var e=this.props.sectionConfig,t=u({config:e,viewAction:this.props.viewAction,folderId:this.getFolderId(),type:this.props.type,fileId:this.props.fileId}),n=t.schemaUrl,r=t.targetId;return n?m.default.createElement(I.default,{className:this.props.dialog?"editor--dialog":"",targetId:r,file:this.findFile(r),onClose:this.handleCloseFile,schemaUrl:n,schemaUrlQueries:this.props.requireLinkText?[{name:"requireLinkText",value:!0}]:[],onSubmit:this.handleSubmitEditor,onDelete:this.handleDelete,onUnpublish:this.handleUnpublish,addToCampaignSchemaUrl:e.form.addToCampaignForm.schemaUrl}):null}},{key:"render",value:function(){var e=!(!this.props.folderId&&!(0,U.hasFilters)(this.props.query.filter)),t=this.props.sectionConfig.form.fileSearchForm.schemaUrl,n=this.props.query.filter||{};return m.default.createElement("div",{className:"fill-height"},m.default.createElement(R.default,{showBackButton:e,onBackButtonClick:this.handleBackButtonClick},m.default.createElement(N.default,{multiline:!0}),m.default.createElement("div",{className:"asset-admin__toolbar-extra pull-xs-right fill-width vertical-align-items"},m.default.createElement(M.default,{onSearch:this.handleDoSearch,id:"AssetSearchForm",searchFormSchemaUrl:t,folderId:this.getFolderId(),filters:n}),this.props.toolbarChildren)),m.default.createElement("div",{className:"flexbox-area-grow fill-width fill-height gallery"},this.renderGallery(),this.renderEditor()))}}]),t}(h.Component);X.propTypes={dialog:h.PropTypes.bool,sectionConfig:Y.default,fileId:h.PropTypes.number,folderId:h.PropTypes.number,onBrowse:h.PropTypes.func,onReplaceUrl:h.PropTypes.func,graphQLErrors:h.PropTypes.arrayOf(h.PropTypes.string),getUrl:h.PropTypes.func,query:h.PropTypes.shape({sort:h.PropTypes.string,limit:h.PropTypes.oneOfType([h.PropTypes.number,h.PropTypes.string]),page:h.PropTypes.oneOfType([h.PropTypes.number,h.PropTypes.string]),filter:h.PropTypes.object}),onSubmitEditor:h.PropTypes.func,type:h.PropTypes.oneOf(["insert-media","insert-link","select","admin"]),files:h.PropTypes.array,queuedFiles:h.PropTypes.shape({items:h.PropTypes.array.isRequired}),filesTotalCount:h.PropTypes.number,folder:h.PropTypes.shape({id:h.PropTypes.number,title:h.PropTypes.string,parents:h.PropTypes.array,parentId:h.PropTypes.number,canView:h.PropTypes.bool,canEdit:h.PropTypes.bool}),loading:h.PropTypes.bool,actions:h.PropTypes.object},X.defaultProps={type:"admin",query:{sort:"",limit:null,page:0,filter:{}}},t.Component=X,t.getFormSchema=u,t.default=(0,y.compose)((0,g.connect)(p,c),B.default,H.default,z.default,W.default,function(e){return(0,L.withApollo)(e)})(X)},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)}function a(e){var t=e.base,n=e.folderId,r=e.fileId,o=e.query,i=e.action;if(i&&-1===P.indexOf(i))throw new Error("Invalid action provided: "+i);var s=null;return s=r?t+"/show/"+n+"/"+_.default.ACTIONS.EDIT_FILE+"/"+r:n?t+"/show/"+n:t+"/",i===_.default.ACTIONS.CREATE_FOLDER&&(s=t+"/show/"+(n||0)+"/"+i),o&&Object.keys(o).length>0&&(s=s+"?"+v.default.stringify(o)),s}function l(e){return{sectionConfig:e.config.sections.find(function(e){return e.name===C})}}Object.defineProperty(t,"__esModule",{value:!0}),t.buildUrl=t.Component=void 0;var u=function(){function e(e,t){for(var n=0;n0&&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]:_.default.ACTIONS.EDIT_FILE,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,a({base:this.props.sectionConfig.url,folderId:o,fileId:i,query:l,action:r})}},{key:"getFolderId",value:function(){return this.props.params&&this.props.params.folderId?parseInt(this.props.params.folderId,10):0}},{key:"getFileId",value:function(){return this.props.params&&this.props.params.fileId?parseInt(this.props.params.fileId,10):0}},{key:"getViewAction",value:function(){return this.props.params&&this.props.params.viewAction?this.props.params.viewAction:_.default.ACTIONS.EDIT_FILE}},{key:"getSectionProps",value:function(){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}}},{key:"getQuery",value:function(){return(0,g.decodeQuery)(this.props.location.search)}},{key:"handleBrowse",value:function(e,t,n,r){var o=this.getUrl(e,t,n,r);this.props.router.push(o)}},{key:"handleReplaceUrl",value:function(e,t,n,r){var o=this.getUrl(e,t,n,r);this.props.router.replace(o)}},{key:"render",value:function(){return this.props.sectionConfig?c.default.createElement(m.default,this.getSectionProps()):null}}]),t}(p.Component);w.propTypes={sectionConfig:S.default,location:p.PropTypes.shape({pathname:p.PropTypes.string,query:p.PropTypes.object,search:p.PropTypes.string}),params:p.PropTypes.object,router:p.PropTypes.object},t.Component=w,t.buildUrl=a,t.default=(0,f.withRouter)((0,d.connect)(l)(w))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(53),o=function(e){return e&&e.__esModule?e:{default:e}}(r),i=(0,o.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=i},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t=0)return!0;return!1})},defaultColumnFilter:function(e,t){return D(y.getObjectValues(e),function(e){return e.toString().toLowerCase().indexOf(t.toLowerCase())>=0}).length>0},filterByColumnFilters:function(e){var t=this.defaultColumnFilter,n=Object.keys(e).reduce(function(n,r){return D(n,function(n){var o=y.getAt(n,r||""),i=e[r];return t(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=I(n,t);else{var r={};r[t]=e,n=x({},n,r)}this.filterByColumnFilters(n)},setFilter:function(e){if(this.props.useExternal)return void this.props.externalSetFilter(e);var t=this,n={page:0,filter:e};n.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,e):this.defaultFilter(this.props.results,e),n.maxPage=t.getMaxPage(n.filteredResults),(F(e)||T(e)||O(e))&&(n.filter=e,n.filteredResults=null),t.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 void 0===e||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)return void this.props.externalSetPage(e);if(e*this.state.resultsPerPage<=this.state.resultsPerPage*this.state.maxPage){var t=this,n={page:e};t.setState(n)}this.props.enableInfiniteScroll&&this.setState({isSelectAllChecked:!1})},setColumns:function(e){this.columnSettings.filteredColumns=w(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=_(this.props.columnMetadata,{columnName:e})||{},r=n.sortDirectionCycle?n.sortDirectionCycle:[null,"asc","desc"],o=null,i=r.indexOf(this.state.sortDirection&&e===this.state.sortColumn?this.state.sortDirection:null);i=(i+1)%r.length,o=r[i]?r[i]:null;var s={page:0,sortColumn:e,sortDirection:o};this.setState(s)}},componentWillReceiveProps:function(e){if(this.setMaxPage(e.results),e.resultsPerPage!==this.props.resultsPerPage&&this.setPageSize(e.resultsPerPage),this.columnSettings.columnMetadata=e.columnMetadata,e.results.length>0){var t=y.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,A(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 m(this.props.results.length>0?y.keys(this.props.results[0]):[],this.props.columns,this.props.childrenColumnName,this.props.columnMetadata,this.props.metadataColumns),this.rowSettings=new g(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.state.sortColumn){var i,s=this.state.sortColumn,a=D(this.props.columnMetadata,{columnName:s}),l={columns:[],orders:[]};if(a.length>0&&(i=a[0].hasOwnProperty("customCompareFn")&&a[0].customCompareFn,a[0].multiSort&&(l=a[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=N(e,function(e){return i(k(e,s))},[this.state.sortDirection]));else{var u=[function(e){return(k(e,s)||"").toString().toLowerCase()}],p=[this.state.sortDirection];l.columns.forEach(function(e,t){u.push(function(t){return(k(t,e)||"").toString().toLowerCase()}),"asc"===l.orders[t]||"desc"===l.orders[t]?p.push(l.orders[t]):p.push(r.state.sortDirection)}),e=N(e,u,p)}}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(e,(c+1)*this.state.resultsPerPage);else{var d=v(e,c*this.state.resultsPerPage);e=(b||C)(d,d.length-this.state.resultsPerPage)}for(var f=(this.columnSettings.getMetadataColumns,[]),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;S(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,A(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===_(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===P(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:!_(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(h,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText,customFilterComponent:this.props.customFilterComponent,results:this.props.results,currentResults:this.getCurrentResults()}):o.createElement(s,{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(f,{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(a,{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(l,{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(d,{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,s){var a=this.getSortObject(),l=this.getMultipleSelectionObject(),u=this.shouldShowNoDataSection(e),p=this.getNoDataSection();return o.createElement("div",{className:"griddle-body"},o.createElement(i,{useGriddleStyles:this.props.useGriddleStyles,noDataSection:p,showNoData:u,columnSettings:this.columnSettings,rowSettings:this.rowSettings,sortSettings:a,multipleSelectionSettings:l,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:s,onRowClick:this.props.onRowClick}))},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(u,{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(),a=this.getDataForRender(e,s,!0),l=this.columnSettings.getMetadataColumns();this.props.columnMetadata?S(this.props.columnMetadata,function(e){"boolean"==typeof e.visible&&!1===e.visible||i.push(e.columnName)}):i=y.keys(I(e[0],l)),i=this.columnSettings.orderColumns(i);var u=this.getCurrentPage(),p=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))}});c.Griddle=e.exports=R},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n-1}var o=n(114);e.exports=r},function(e,t){function n(e,t,n){for(var r=-1,o=null==e?0:e.length;++r=p&&(d=u,f=!1,t=new o(t));e:for(;++c1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(o--,s):void 0,a&&i(n[0],n[1],a)&&(s=o<3?void 0:s,o=1),t=Object(t);++rd))return!1;var h=p.get(e);if(h&&p.get(t))return h==t;var m=-1,g=!0,y=n&l?new o:void 0;for(p.set(e,t),p.set(t,e);++mn+a||t+o-lr+s)};t.default=function(e,t,n){var r=e instanceof HTMLElement?(0,o.default)(e):e,s=t instanceof HTMLElement?(0,o.default)(t):t;return i(r.top,r.left,s.top,s.left,r.offsetWidth,r.offsetHeight,s.offsetWidth,s.offsetHeight,n)}},function(e,t){(function(t){"use strict";function n(e,t,n){function r(t){var n=m,r=g;return m=g=void 0,E=t,v=e.apply(r,n)}function i(e){return E=e,b=setTimeout(p,t),w?r(e):v}function s(e){var n=e-_,r=e-E,o=t-n;return O?C(o,y-r):o}function l(e){var n=e-_,r=e-E;return void 0===_||n>=t||n<0||O&&r>=y}function p(){var e=P();if(l(e))return c(e);b=setTimeout(p,s(e))}function c(e){return b=void 0,T&&m?r(e):(m=g=void 0,v)}function d(){void 0!==b&&clearTimeout(b),E=0,m=_=g=b=void 0}function f(){return void 0===b?v:c(P())}function h(){var e=P(),n=l(e);if(m=arguments,g=this,_=e,n){if(void 0===b)return i(_);if(O)return b=setTimeout(p,t),r(_)}return void 0===b&&(b=setTimeout(p,t)),v}var m,g,y,v,b,_,E=0,w=!1,O=!1,T=!0;if("function"!=typeof e)throw new TypeError(u);return t=a(t)||0,o(n)&&(w=!!n.leading,O="maxWait"in n,y=O?S(a(n.maxWait)||0,t):y,T="trailing"in n?!!n.trailing:T),h.cancel=d,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":l(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==(void 0===e?"undefined":l(e))}function s(e){return"symbol"==(void 0===e?"undefined":l(e))||i(e)&&E.call(e)==c}function a(e){if("number"==typeof e)return e;if(s(e))return p;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(d,"");var n=h.test(e);return n||m.test(e)?g(e.slice(2),n?2:8):f.test(e)?p:+e}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u="Expected a function",p=NaN,c="[object Symbol]",d=/^\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":l(t))&&t&&t.Object===Object&&t,v="object"==("undefined"==typeof self?"undefined":l(self))&&self&&self.Object===Object&&self,b=y||v||Function("return this")(),_=Object.prototype,E=_.toString,S=Math.max,C=Math.min,P=function(){return b.Date.now()};e.exports=r}).call(t,function(){return this}())},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 a=function(){function e(e,t){for(var n=0;n
');this.before(n),t=n[0]}return t},onunmatch:function(){this._super(),p.default.unmountComponentAtNode(this.getContainer())},onmatch:function(){this._super(),this.hide(),this.refresh()},onclick:function(e){e.preventDefault()},refresh:function(){var t=this.getAttributes(),n=e(this).closest("form"),r=function(){setTimeout(function(){n.trigger("change")},0)};p.default.render(l.default.createElement(f,o({},t,{onChange:r,noHolder:!0})),this.getContainer())},getAttributes:function(){var t=e(this).data("state"),n=e(this).data("schema");return(0,c.schemaMerge)(n,t)}})})},function(e,t,n){(function(t){e.exports=t.InsertEmbedModal=n(202)}).call(t,n(78))},function(e,t,n){(function(t){e.exports=t.InsertMediaModal=n(203)}).call(t,n(78))},,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t0?l.default._t("AssetAdmin.UPDATE_FILE","Update file"):l.default._t("AssetAdmin.INSERT_FILE","Insert file");return e.mutateField("action_insert",function(e){return o({},e,{title:r||e.title})}),e.getState()},m=function(e){return function(t){var n=t.disabledIDs,r=t.findTreeByPath||c.findTreeByPath,i=o({},t,{findTreeByPath:function(e,t){var i=r(e,t),s=t.some(function(e){return n.includes(e)});return i?o({},i,{children:i.children.map(function(e){return o({},e,{disabled:s||n.includes(e.id)})})}):null}});return s.default.createElement(e,i)}},g=(0,f.compose)((0,d.connect)(function(e){return{disabledIDs:e.assetAdmin.gallery.selectedFiles}}),m),y=function(){p.default.transform("insert-media-modal",function(e){e.form.alterSchema("AssetAdmin.EditForm.fileInsertForm",h)}),p.default.transform("move-form-disabled",function(e){e.component("TreeDropdownField.AssetAdmin.MoveForm",g)})};t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),i=r(o),s=n(174),a=r(s),l=n(172),u=r(l),p=n(173),c=r(p),d=n(180),f=r(d),h=n(171),m=r(h),g=function(){i.default.component.register("UploadField",a.default),i.default.component.register("PreviewImageField",u.default),i.default.component.register("HistoryList",f.default),i.default.component.register("ProportionConstraintField",c.default),i.default.component.register("GalleryToolbar",m.default)};t.default=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),i=r(o),s=n(6),a=n(192),l=r(a),u=n(199),p=r(u),c=n(201),d=r(c),f=n(198),h=r(f),m=n(196),g=r(m),y=function(){i.default.reducer.register("assetAdmin",(0,s.combineReducers)({gallery:l.default,queuedFiles:p.default,uploadField:d.default,previewField:h.default,imageLoad:g.default}))};t.default=y},function(e,t,n){"use strict";n(158),n(157),n(154),n(156)},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}),t.Component=void 0;var a=function(){function e(e,t){for(var n=0;n2});return d.default.createElement("button",{type:"button",className:r,key:t.value,onClick:e.handleChangeValue,value:t.value},t.label)}).filter(function(e){return e});if(!t.length)return null;var n=this.props.PopoverField;return d.default.createElement("div",{className:"bulk-actions fieldholder-small btn-group"},d.default.createElement("div",{className:"bulk-actions-counter"},this.props.items.length),t.slice(0,2),t.length>2&&n?d.default.createElement(n,{id:"BulkActions",popoverClassName:"bulk-actions__more-actions-menu",container:this,data:{placement:"bottom"}},t.slice(2)):t.slice(2))}}]),t}(c.Component);E.propTypes={items:d.default.PropTypes.array,actions:d.default.PropTypes.arrayOf(d.default.PropTypes.shape({value:d.default.PropTypes.string.isRequired,label:d.default.PropTypes.string.isRequired,className:d.default.PropTypes.string,destructive:d.default.PropTypes.bool,callback:d.default.PropTypes.func,canApply:d.default.PropTypes.func,confirm:d.default.PropTypes.func})),PopoverField:d.default.PropTypes.oneOfType([d.default.PropTypes.node,d.default.PropTypes.func])},E.defaultProps={items:[],actions:[],PopoverField:null};var S=(0,y.connect)(a)(E);t.Component=E,t.default=(0,v.inject)(["PopoverField"],function(e){return{PopoverField:e}},function(){return"BulkActions"})(S)},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 a=function(){function e(e,t){for(var n=0;n1&&[u.default.createElement("div",{key:"1",className:"gallery-item__drag-shadow"}),u.default.createElement("div",{key:"2",className:"gallery-item__drag-shadow gallery-item__drag-shadow--second"}),u.default.createElement("div",{key:"3",className:"gallery-item__drag-shadow gallery-item__drag-shadow--third"})],u.default.createElement(d.default,e.props),t>1&&u.default.createElement(h.default,{className:"gallery-item__drag-layer-count",status:"primary",message:t})))}}]),t}(l.Component);m.propTypes={item:l.PropTypes.object,offset:l.PropTypes.shape({x:l.PropTypes.number.isRequired,y:l.PropTypes.number.isRequired}),isDragging:l.PropTypes.bool.isRequired};var g=function(e){return{item:e.getItem(),offset:e.getSourceClientOffset(),isDragging:e.isDragging()}};t.default=(0,p.DragLayer)(g)(m)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 i(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)}function s(e){var t={beginDrag:function(e){"function"==typeof e.onDrag&&e.onDrag(!0);var t=e.selectedFiles.concat([]);return 0===t.length&&t.push(e.item.id),{selected:t,props:e}},endDrag:function(e){"function"==typeof e.onDrag&&e.onDrag(!1)}},n=function(e,t){return{connectDragPreview:e.dragPreview(),connectDragSource:e.dragSource(),isDragging:t.isDragging()}},s=(0,p.DragSource)(e,t,n);return function(e){var t=function(t){function n(){return r(this,n),o(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return i(n,t),a(n,[{key:"componentDidMount",value:function(){this.props.connectDragPreview((0,c.getEmptyImage)(),{captureDraggingState:!0})}},{key:"render",value:function(){var t=this.props.connectDragSource,n=u.default.createElement(e,this.props);return t("string"==typeof n.type?n:u.default.createElement("div",{className:"gallery-item__draggable"},n))}}]),n}(l.Component);return t.propTypes={connectDragSource:l.PropTypes.func.isRequired,connectDragPreview:l.PropTypes.func.isRequired,item:l.PropTypes.shape({id:l.PropTypes.number.isRequired}).isRequired,onDrag:l.PropTypes.func,selectedFiles:l.PropTypes.arrayOf(l.PropTypes.number)},s(t)}}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n0&&o<100?f.default.createElement("div",{className:"preview-image-field__progress"},f.default.createElement("div",{className:"preview-image-field__progress-bar",style:{width:o+"%"}})):null,a=this.props.upload.message,l=null;return a?l=f.default.createElement("div",{className:"preview-image-field__message preview-image-field__message--"+a.type},a.value):100===o&&(l=f.default.createElement("div",{className:"preview-image-field__message preview-image-field__message--success"},c.default._t("AssetAdmin.REPlACE_FILE_SUCCESS","Upload successful, the file will be replaced when you Save."))),f.default.createElement("div",{className:"editor__thumbnail-container"},i||r,s,l)}},{key:"renderToolbar",value:function(){var e=this.canEdit();return this.props.data.url||e?f.default.createElement("div",{className:"preview-image-field__toolbar fill-height"},this.props.data.url?f.default.createElement("a",{href:this.props.data.url,target:"_blank",className:this.getButtonClasses("link")},"Open"):null,e?f.default.createElement("button",{id:"preview-replace-button",onClick:this.preventDefault,className:this.getButtonClasses("replace"),type:"button"},"Replace"):null,this.props.upload.progress||this.props.upload.message?f.default.createElement("button",{onClick:this.handleCancelUpload,className:this.getButtonClasses("remove"),type:"button"},"Remove"):null):null}},{key:"render",value:function(){var e=this.getDropzoneProps();if(this.canEdit())return f.default.createElement(m.default,e,this.renderImage(),this.renderToolbar());var t=["preview-image-field__container",this.props.className,this.props.extraClass];return f.default.createElement("div",{className:t.join(" ")},this.renderImage(),this.renderToolbar())}}]),t}(d.Component);F.propTypes={id:d.PropTypes.string.isRequired,name:d.PropTypes.string,className:d.PropTypes.string,extraClass:d.PropTypes.string,readOnly:d.PropTypes.bool,disabled:d.PropTypes.bool,onAutofill:d.PropTypes.func,formid:d.PropTypes.string,nameValue:d.PropTypes.string,data:d.PropTypes.shape({id:d.PropTypes.number,parentid:d.PropTypes.number,version:d.PropTypes.number,url:d.PropTypes.string,mock:d.PropTypes.bool,exists:d.PropTypes.bool,preview:d.PropTypes.string,category:d.PropTypes.string,nameField:d.PropTypes.string,uploadFileEndpoint:d.PropTypes.shape({url:d.PropTypes.string.isRequired,method:d.PropTypes.string.isRequired,payloadFormat:d.PropTypes.string}),initialValues:d.PropTypes.object}).isRequired,upload:d.PropTypes.shape({url:d.PropTypes.string,progress:d.PropTypes.number,xhr:d.PropTypes.object,category:d.PropTypes.string,message:d.PropTypes.shape({type:d.PropTypes.string.isRequired,value:d.PropTypes.string.isRequired})}),actions:d.PropTypes.object,securityID:d.PropTypes.string,confirm:d.PropTypes.func},F.defaultProps={extraClass:"",className:"",data:{},upload:{},confirm:function(e){return window.confirm(e)}},t.Component=F,t.default=(0,v.connect)(a,l)(F)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 i(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}),t.Component=void 0;var s=function(){function e(e,t){for(var n=0;n0}},{key:"isImageSmallerThanThumbnail",value:function(){if(!this.isImage()||!this.exists()&&!this.uploading())return!1;var e=this.props.item.width,t=this.props.item.height;return t&&e&&t0&&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]:h.default.ACTIONS.EDIT_FILE,o=parseInt(e||0,10),i=parseInt(t||0,10),s=this.getFolderId(),a=o!==s&&null!==s,l=Object.assign({},n);return(a||l.page<=1)&&delete l.page,(0,d.buildUrl)({base:this.props.sectionConfig.url,folderId:o,fileId:i,query:l,action:r})}},{key:"getFolderId",value:function(){return null===this.state.folderId?null:parseInt(this.state.folderId||0,10)}},{key:"getFileId",value:function(){return parseInt(this.state.fileId||this.props.fileId||0,10)}},{key:"getViewAction",value:function(){return this.state.action||h.default.ACTIONS.EDIT_FILE}},{key:"getSectionProps",value:function(){var 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}},{key:"handleBrowse",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.default.ACTIONS.EDIT_FILE;if(r&&-1===Object.values(h.default.ACTIONS).indexOf(r))throw new Error("Invalid action provided: "+r);this.setState({folderId:e,fileId:t,query:n,action:r})}},{key:"render",value:function(){var e=this.getSectionProps(),t=this.props.Component;return p.default.createElement(t,e)}}]),t}(u.Component);y.propTypes={Component:u.PropTypes.oneOfType([u.PropTypes.element,u.PropTypes.func]),sectionConfig:u.PropTypes.shape({url:u.PropTypes.string.isRequired}).isRequired,fileId:u.PropTypes.number},t.AssetAdminStateRouter=y,t.default=a},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)}function a(e){return{actions:{unsavedForms:(0,d.bindActionCreators)(S,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var l=function(){function e(e,t){for(var n=0;n0&&(o=p.default.sprintf(p.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SINGLE_CONFIRM","This file is currently used in %s place(s), are you sure you want to delete it?"),this.props.file.inUseCount),o+="\n\n",o+=p.default._t("AssetAdmin.BULK_ACTIONS_DELETE_WARNING","Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.")),confirm(o)&&(this.props.actions.unsavedForms.removeFormChanged("AssetAdmin.EditForm"),this.props.onDelete([t.ID])),e.preventDefault()}}},{key:"handleCancelKeyDown",value:function(e){e.keyCode!==g.default.SPACE_KEY_CODE&&e.keyCode!==g.default.RETURN_KEY_CODE||this.handleClose(e)}},{key:"handleSubmit",value:function(e,t,n){return"function"==typeof this.props.onSubmit?this.props.onSubmit(e,t,n):n()}},{key:"handleClose",value:function(e){this.props.onClose(),this.closeModal(),e&&e.preventDefault()}},{key:"openModal",value:function(){this.setState({openModal:!0})}},{key:"closeModal",value:function(){this.setState({openModal:!1})}},{key:"handleLoadingError",value:function(e){this.setState({loadingForm:!1,loadingError:e.errors[0]})}},{key:"handleLoadingSuccess",value:function(){this.setState({loadingForm:!1,loadingError:null})}},{key:"handleFetchingSchema",value:function(){this.setState({loadingForm:!0})}},{key:"renderCancelButton",value:function(){return h.default.createElement("a",{role:"button",tabIndex:0,className:"btn btn--close-panel btn--no-text font-icon-cancel btn--icon-xl",onClick:this.handleClose,onKeyDown:this.handleCancelKeyDown,type:"button","aria-label":p.default._t("AssetAdmin.CANCEL")})}},{key:"render",value:function(){var e=this.props.schemaUrlQueries.map(function(e){return e.name+"="+e.value}).join("&").trim();e=e?"?"+e:"";var t=this.props.schemaUrl+"/"+this.props.targetId+e,n=this.props.addToCampaignSchemaUrl+"/"+this.props.targetId,r=["panel","form--no-dividers","editor"];this.props.className&&r.push(this.props.className);var o=null;if(this.state.loadingError){var i=this.state.loadingError.value;404===this.state.loadingError.code&&(i=p.default._t("AssetAdmin.FILE_MISSING","File cannot be found")),i||(i=p.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")),o=h.default.createElement("div",{className:"editor__file-preview-message--file-missing"},i)}var s=p.default._t("Admin.ADD_TO_CAMPAIGN","Add to campaign");return h.default.createElement("div",{className:r.join(" ")},h.default.createElement("div",{className:"editor__details fill-height"},h.default.createElement(v.default,{identifier:"AssetAdmin.EditForm",schemaUrl:t,afterMessages:this.renderCancelButton(),onSubmit:this.handleSubmit,onAction:this.handleAction,onLoadingSuccess:this.handleLoadingSuccess,onLoadingError:this.handleLoadingError,onFetchingSchema:this.handleFetchingSchema}),o,h.default.createElement(_.default,{title:s,identifier:"AssetAdmin.AddToCampaign",show:this.state.openModal,onHide:this.closeModal,schemaUrl:n,bodyClassName:"modal__dialog",responseClassBad:"modal__response modal__response--error",responseClassGood:"modal__response modal__response--good"}),this.state.loadingForm&&[h.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),h.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})]))}}]),t}(f.Component);w.propTypes={file:P.default,className:f.PropTypes.string,targetId:f.PropTypes.number.isRequired,onClose:f.PropTypes.func.isRequired,onSubmit:f.PropTypes.func.isRequired,onDelete:f.PropTypes.func.isRequired,schemaUrl:f.PropTypes.string.isRequired,schemaUrlQueries:f.PropTypes.arrayOf(f.PropTypes.shape({name:f.PropTypes.string,value:f.PropTypes.any})),addToCampaignSchemaUrl:f.PropTypes.string,actions:f.PropTypes.object},t.Component=w,t.default=(0,c.connect)(function(){return{}},a)(w)},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 a=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1])||arguments[1];return h.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:g.default.get("SecurityID")}}:{}))},C=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={detailView:null,history:[],loadedDetails:!1},n.handleClick=n.handleClick.bind(n),n.handleBack=n.handleBack.bind(n),n.timer=null,n.api=S(e.sectionConfig.historyEndpoint),n}return s(t,e),u(t,[{key:"componentDidMount",value:function(){this.refreshHistoryIfNeeded()}},{key:"componentWillReceiveProps",value:function(e){this.refreshHistoryIfNeeded(e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timer),this.timer=null}},{key:"refreshHistoryIfNeeded",value:function(e){var t=this;if(!e&&!this.state.loadedDetails||e.data.fileId!==this.props.data.fileId||e.data.latestVersionId!==this.props.data.latestVersionId){this.setState({loadedDetails:!1});var n=e?e.data.fileId:this.props.data.fileId;clearTimeout(this.timer),this.timer=setTimeout(function(){t.api({fileId:n}).then(function(e){t.timer&&t.setState({history:e,loadedDetails:!0})})},250)}}},{key:"handleClick",value:function(e){this.setState({viewDetails:e})}},{key:"handleBack",value:function(e){e.preventDefault(),this.setState({viewDetails:null})}},{key:"render",value:function(){var e=this;if(!this.state.loadedDetails)return c.default.createElement("div",{className:"history-list history-list--loading"},"Loading...");if(this.state.viewDetails){var t=[this.props.historySchemaUrl,this.props.data.fileId,this.state.viewDetails].join("/"),n=["btn","btn-secondary","btn--icon-xl","btn--no-text","font-icon-left-open-big","history-list__back"].join(" ");return c.default.createElement("div",{className:"history-list"},c.default.createElement("a",{href:"#",className:n,onClick:this.handleBack}),c.default.createElement(_.default,{identifier:"AssetAdmin.HistoryList",schemaUrl:t}))}var r=this.state.history||[];return c.default.createElement("div",{className:"history-list"},c.default.createElement("ul",{className:"list-group list-group-flush history-list__list"},r.map(function(t){return c.default.createElement(v.default,l({key:t.versionid},t,{onClick:e.handleClick}))})))}}]),t}(p.Component);C.propTypes={sectionConfig:c.default.PropTypes.shape({form:c.default.PropTypes.object,historyEndpoint:c.default.PropTypes.shape({url:c.default.PropTypes.string,method:c.default.PropTypes.string,responseFormat:c.default.PropTypes.string})}),historySchemaUrl:c.default.PropTypes.string,data:c.default.PropTypes.object},C.defaultProps={data:{fieldId:0}},t.Component=C,t.default=(0,d.connect)(a)(C)},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)}function a(e){var t=e.assetAdmin.gallery,n=t.modal,r=t.selectedFiles;return{show:n===y.default.MODAL_MOVE,selectedFiles:r,title:m.default.sprintf(m.default._t("AssetAdmin.MOVE_ITEMS_TO","Move %s item(s) to..."),r.length)}}function l(e){return{onHide:function(){e((0,v.deactivateModal)())},setNotice:function(t){e((0,v.setNoticeMessage)(t))},setError:function(t){e((0,v.setErrorMessage)(t))},setBadge:function(){e(v.setFileBadge.apply(void 0,arguments))}}}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n0)return c.default.createElement("div",{className:"gallery__progress-bar--complete"});var t={className:"gallery__progress-bar-progress",style:{width:e.progress+"%"}};return c.default.createElement("div",{className:"gallery__progress-bar"},c.default.createElement("div",t))}},{key:"renderTitle",value:function(e){var t=this.renderProgressBar(e.rowData);return c.default.createElement("div",{className:"fill-width"},c.default.createElement("div",{className:"flexbox-area-grow"},e.data),t)}},{key:"renderSelect",value:function(e){return c.default.createElement("input",{type:"checkbox",title:m.default._t("AssetAdmin.SELECT"),checked:e.data,tabIndex:"-1",onMouseDown:this.preventFocus})}},{key:"renderDate",value:function(e){return"folder"===e.rowData.type?null:c.default.createElement("span",null,e.data)}},{key:"renderThumbnail",value:function(e){var t=e.data||e.rowData.url,n=e.rowData.uploading,r=e.rowData.category||"false",o="gallery__table-image",i=[o],s={};return i.push(o+"--"+r),"image"===r&&t&&(s.backgroundImage='url("'+t+'")'),n||t||"folder"===r||i.push(o+"--error"),c.default.createElement("div",{className:i.join(" "),style:s})}},{key:"render",value:function(){return c.default.createElement(f.default,this.getTableProps())}}]),t}(p.Component);v.defaultProps=g.galleryViewDefaultProps,v.propTypes=a({},g.galleryViewPropTypes,{sort:p.PropTypes.string.isRequired}),t.Component=v,t.default=v},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 a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.type,r=t.payload;switch(n){case u.default.SET_FILE_BADGE:return i({},e,{badges:e.badges.filter(function(e){return e.id!==r.id}).concat([r])});case u.default.CLEAR_FILE_BADGE:return i({},e,{badges:e.badges.filter(function(e){return e.id!==r.id})});case u.default.SET_ENABLE_DROPZONE:return i({},e,{enableDropzone:r.enableDropzone});case u.default.SET_NOTICE_MESSAGE:return i({},e,{noticeMessage:r.message});case u.default.SET_ERROR_MESSAGE:return i({},e,{errorMessage:r.message});case u.default.LOAD_FILE_SUCCESS:var o=e.files.find(function(e){return e.id===r.id});if(o){var s=i({},o,r.file);return(0,a.default)(i({},e,{files:e.files.map(function(e){return e.id===s.id?s:e})}))}return e.folder.id===r.id?(0,a.default)(i({},e,{folder:i({},e.folder,r.file)})):e;case u.default.SELECT_FILES:var l=null;return l=null===r.ids?e.files.map(function(e){return e.id}):e.selectedFiles.concat(r.ids.filter(function(t){return-1===e.selectedFiles.indexOf(t)})),(0,a.default)(i({},e,{selectedFiles:l}));case u.default.DESELECT_FILES:var p=null;return p=null===r.ids?[]:e.selectedFiles.filter(function(e){return-1===r.ids.indexOf(e)}),(0,a.default)(i({},e,{selectedFiles:p}));case u.default.ACTIVATE_MODAL:return(0,a.default)(i({},e,{modal:r}));case u.default.DEACTIVATE_MODAL:return(0,a.default)(i({},e,{modal:null}));case u.default.CONCATENATE_SELECT:return(0,a.default)(i({},e,{concatenateSelect:r}));case u.default.SET_LOADING:return(0,a.default)(i({},e,{loading:r}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:d;o(this,e),this.options=i({},c,t),this.factory=n}return s(e,[{key:"loadImage",value:function(e){return this.options.minRetry&&p.default.lock(e)?this.loadImageLoop(e,this.options.minRetry):null}},{key:"loadImageLoop",value:function(e,t){var n=this;return this.options.onStatusChange(e,l.default.LOADING),new Promise(function(t,r){return n.factory(e,t,r)}).then(function(){return n.handleSuccess(e)}).catch(function(){return n.handleError(e,t)})}},{key:"handleReset",value:function(e,t){this.options.onReset(e),t()}},{key:"handleTimeout",value:function(e,t){var n=setTimeout(e,t);return this.options.onTimeout(n,t),n}},{key:"handleSuccess",value:function(e){p.default.unlock(e),this.options.onStatusChange(e,l.default.SUCCESS)}},{key:"handleFailure",value:function(e){var t=this;return p.default.unlock(e),this.options.onStatusChange(e,l.default.FAILED),this.options.expiry?new Promise(function(n){t.handleTimeout(function(){return t.handleReset(e,n)},1e3*t.options.expiry)}):null}},{key:"handleError",value:function(e,t){return t>this.options.maxRetry?this.handleFailure(e):(this.options.onStatusChange(e,l.default.WAITING),this.handleRetry(e,t))}},{key:"handleRetry",value:function(e,t){var n=this,r=new Promise(function(r){n.handleTimeout(function(){return r(n.loadImageLoop(e,2*t))},1e3*t)});return this.options.onRetry(e,t,r),r}},{key:"setOnRetry",value:function(e){this.options.onRetry=e}},{key:"setOnReset",value:function(e){this.options.onReset=e}},{key:"setOnStatusChange",value:function(e){this.options.onStatusChange=e}},{key:"setOnTimeout",value:function(e){this.options.onTimeout=e}}]),e}();t.defaultImageFactory=d,t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){return function(n,r){if(!e)return null;if(r().assetAdmin.imageLoad.files.find(function(t){return t.url===e}))return null;var o=i({},t,{onStatusChange:function(e,t){return n({type:a.default.SET_STATUS,payload:{status:t,url:e}})},onReset:function(e){return n({type:a.default.RESET,payload:{url:e}})}});return new u.default(o).loadImage(e)}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t=0||(this.urls=[].concat(r(this.urls),[e]),0))}},{key:"unlock",value:function(e){this.urls=this.urls.filter(function(t){return t!==e})}}]),e}();window.ss=window.ss||{},window.ss.imagelocker=window.ss.imagelocker||new s,t.Component=s,t.default=window.ss.imagelocker},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.type,o=t.payload;switch(n){case a.default.SET_STATUS:return i({},e,{files:[].concat(r(e.files.filter(function(e){return e.url!==o.url})),[o])});case a.default.RESET:return i({},e,{files:[].concat(r(e.files.filter(function(e){return e.url!==o.url})))});default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:p,t=arguments[1];switch(t.type){case u.default.PREVIEWFIELD_ADD_FILE:return(0,a.default)(Object.assign({},e,o({},t.payload.id,t.payload.file)));case u.default.PREVIEWFIELD_FAIL_UPLOAD:return(0,a.default)(Object.assign({},e,o({},t.payload.id,Object.assign({},e[t.payload.id],t.payload.message))));case u.default.PREVIEWFIELD_REMOVE_FILE:return(0,a.default)(Object.assign({},e,o({},t.payload.id,void 0)));case u.default.PREVIEWFIELD_UPDATE_FILE:return(0,a.default)(Object.assign({},e,o({},t.payload.id,Object.assign({},e[t.payload.id],t.payload.data))));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=n(53),a=r(s),l=n(93),u=r(l),p={};t.default=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:m,t=arguments[1];switch(t.type){case p.default.ADD_QUEUED_FILE:return(0,l.default)(s({},e,{items:[].concat(o(e.items),[s({},d.default,t.payload.file)])}));case p.default.FAIL_UPLOAD:return(0,l.default)(s({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?s({},e,{message:t.payload.message}):e})}));case p.default.PURGE_UPLOAD_QUEUE:return(0,l.default)(s({},e,{items:e.items.filter(function(e){return!e.id})}));case p.default.REMOVE_QUEUED_FILE:return(0,l.default)(s({},e,{items:e.items.filter(function(e){return e.queuedId!==t.payload.queuedId})}));case p.default.SUCCEED_UPLOAD:return(0,l.default)(s({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?s({},e,t.payload.json,{messages:[{value:h.default._t("AssetAdmin.DROPZONE_SUCCESS_UPLOAD"),type:"success",extraClass:"success"}]}):e})}));case p.default.UPDATE_QUEUED_FILE:return(0,l.default)(s({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?s({},e,t.payload.updates):e})}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:d,t=arguments[1],n=(0,c.default)(e,t,f);switch(t.type){case a.default.UPLOADFIELD_ADD_FILE:return n(function(e){return{files:[].concat(o(e.files),[Object.assign({},u.default,t.payload.file)])}});case a.default.UPLOADFIELD_SET_FILES:return n(function(){return{files:t.payload.files}});case a.default.UPLOADFIELD_UPLOAD_FAILURE:return n(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,{message:t.payload.message}):e})}});case a.default.UPLOADFIELD_REMOVE_FILE:return n(function(e){return{files:e.files.filter(function(e){return!(t.payload.file.queuedId&&e.queuedId===t.payload.file.queuedId||t.payload.file.id&&e.id===t.payload.file.id)})}});case a.default.UPLOADFIELD_UPLOAD_SUCCESS:return n(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.json):e})}});case a.default.UPLOADFIELD_UPDATE_QUEUED_FILE:return n(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.updates):e})}});default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=n(96),a=r(s),l=n(87),u=r(l),p=n(362),c=r(p),d={fields:{}},f={files:[]};t.default=i},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)}function a(e,t){var n=e.config.sections.find(function(e){return e.name===E}),r=t.fileAttributes?t.fileAttributes.Url:"",o=n.form.remoteEditForm.schemaUrl,i=r&&o+"/?embedurl="+encodeURIComponent(r),s=n.form.remoteCreateForm.schemaUrl;return{sectionConfig:n,schemaUrl:i||s,targetUrl:r}}function l(e){return{actions:{schema:(0,m.bindActionCreators)(_,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var u=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(){function e(e,t){for(var n=0;n
'),this.element.appendChild(n)),r=n.getElementsByTagName("span")[0],r&&(null!=r.textContent?r.textContent=this.options.dictFallbackMessage:null!=r.innerText&&(r.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e){var t,n,r;return t={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},n=e.width/e.height,t.optWidth=this.options.thumbnailWidth,t.optHeight=this.options.thumbnailHeight,null==t.optWidth&&null==t.optHeight?(t.optWidth=t.srcWidth,t.optHeight=t.srcHeight):null==t.optWidth?t.optWidth=n*t.optHeight:null==t.optHeight&&(t.optHeight=1/n*t.optWidth),r=t.optWidth/t.optHeight,e.heightr?(t.srcHeight=e.height,t.srcWidth=t.srcHeight*r):(t.srcWidth=e.width,t.srcHeight=t.srcWidth/r),t.srcX=(e.width-t.srcWidth)/2,t.srcY=(e.height-t.srcHeight)/2,t},drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:l,dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:l,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var n,r,o,i,s,a,l,u,p,c,d,f,h;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(e.previewElement=t.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),c=e.previewElement.querySelectorAll("[data-dz-name]"),i=0,l=c.length;i'+this.options.dictRemoveFile+""),e.previewElement.appendChild(e._removeLink)),r=function(n){return function(r){return r.preventDefault(),r.stopPropagation(),e.status===t.UPLOADING?t.confirm(n.options.dictCancelUploadConfirmation,function(){return n.removeFile(e)}):n.options.dictRemoveFileConfirmation?t.confirm(n.options.dictRemoveFileConfirmation,function(){return n.removeFile(e)}):n.removeFile(e)}}(this),f=e.previewElement.querySelectorAll("[data-dz-remove]"),h=[],a=0,p=f.length;a\n
\n
\n
\n
\n
\n
\n
\n
\n \n Check\n \n \n \n \n \n
\n
\n \n Error\n \n \n \n \n \n \n \n
\n
'},n=function(){var e,t,n,r,o,i,s;for(r=arguments[0],n=2<=arguments.length?p.call(arguments,1):[],i=0,s=n.length;i'+this.options.dictDefaultMessage+"
")),this.clickableElements.length&&(r=function(e){return function(){return e.hiddenFileInput&&e.hiddenFileInput.parentNode.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(null==e.options.maxFiles||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",null!=e.options.acceptedFiles&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),null!=e.options.capture&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",document.querySelector(e.options.hiddenInputContainer).appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var t,n,o,i;if(n=e.hiddenFileInput.files,n.length)for(o=0,i=n.length;o',this.options.dictFallbackText&&(r+="

"+this.options.dictFallbackText+"

"),r+='
',n=t.createElement(r),"FORM"!==this.element.tagName?(o=t.createElement('
'),o.appendChild(n)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=o?o:n)},t.prototype.getExistingFallback=function(){var e,t,n,r,o,i;for(t=function(e){var t,n,r;for(n=0,r=e.length;n0){for(s=["TB","GB","MB","KB","b"],n=a=0,l=s.length;a=t){r=e/Math.pow(this.options.filesizeBase,4-n),o=i;break}r=Math.round(10*r)/10}return""+r+" "+o},t.prototype._updateMaxFilesReachedClass=function(){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")},t.prototype.drop=function(e){var t,n;e.dataTransfer&&(this.emit("drop",e),t=e.dataTransfer.files,this.emit("addedfiles",t),t.length&&(n=e.dataTransfer.items,n&&n.length&&null!=n[0].webkitGetAsEntry?this._addFilesFromItems(n):this.handleFiles(t)))},t.prototype.paste=function(e){var t,n;if(null!=(null!=e&&null!=(n=e.clipboardData)?n.items:void 0))return this.emit("paste",e),t=e.clipboardData.items,t.length?this._addFilesFromItems(t):void 0},t.prototype.handleFiles=function(e){var t,n,r,o;for(o=[],n=0,r=e.length;n0){for(i=0,s=n.length;i1024*this.options.maxFilesize*1024?n(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):t.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(n(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,n):n(this.options.dictInvalidFileType)},t.prototype.addFile=function(e){return e.upload={progress:0,total:e.size,bytesSent:0},this.files.push(e),e.status=t.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(t){return function(n){return n?(e.accepted=!1,t._errorProcessing([e],n)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass()}}(this))},t.prototype.enqueueFiles=function(e){var t,n,r;for(n=0,r=e.length;n=t)&&(r=this.getQueuedFiles(),r.length>0)){if(this.options.uploadMultiple)return this.processFiles(r.slice(0,t-n));for(;e=U;p=0<=U?++x:--x)i.append(this._getParamName(p),e[p],this._renameFilename(e[p].name));return this.submitRequest(S,i,e)},t.prototype.submitRequest=function(e,t,n){return e.send(t)},t.prototype._finished=function(e,n,r){var o,i,s;for(i=0,s=e.length;iu;)t=o[4*(a-1)+3],0===t?i=a:u=a,a=i+u>>1;return l=a/s,0===l?1:l},a=function(e,t,n,r,o,i,a,l,u,p){var c;return c=s(t),e.drawImage(t,n,r,o,i,a,l,u,p/c)},i=function(e,t){var n,r,o,i,s,a,l,u,p;if(o=!1,p=!0,r=e.document,u=r.documentElement,n=r.addEventListener?"addEventListener":"attachEvent",l=r.addEventListener?"removeEventListener":"detachEvent",a=r.addEventListener?"":"on",i=function(n){if("readystatechange"!==n.type||"complete"===r.readyState)return("load"===n.type?e:r)[l](a+n.type,i,!1),!o&&(o=!0)?t.call(e,n.type||n):void 0},s=function(){try{u.doScroll("left")}catch(e){return void setTimeout(s,50)}return i("poll")},"complete"!==r.readyState){if(r.createEventObject&&u.doScroll){try{p=!e.frameElement}catch(e){}p&&s()}return r[n](a+"DOMContentLoaded",i,!1),r[n](a+"readystatechange",i,!1),e[n](a+"load",i,!1)}},n._autoDiscoverFunction=function(){if(n.autoDiscover)return n.discover()},i(window,n._autoDiscoverFunction)}).call(this)}).call(t,n(7),n(52)(e))},function(e,t,n){"use strict";var r=n(0),o=r.createClass({displayName:"CustomFilterContainer",getDefaultProps:function(){return{placeholderText:""}},render:function(){var e=this;return"function"!=typeof e.props.customFilterComponent?(console.log("Couldn't find valid template."),r.createElement("div",null)):r.createElement(e.props.customFilterComponent,{changeFilter:this.props.changeFilter,results:this.props.results,currentResults:this.props.currentResults,placeholderText:this.props.placeholderText})}});e.exports=o},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,i=null,s=null;if(!0===this.props.useGriddleStyles){var a={float:"left",minHeight:"1px",marginTop:"5px"};s=o({textAlign:"right",width:"34%"},a),i=o({textAlign:"center",width:"33%"},a),n=o({width:"33%"},a)}for(var l=[],u=1;u<=this.props.maxPage;u++)l.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:i},r.createElement("select",{value:this.props.currentPage+1,onChange:this.pageChange},l)," / ",this.props.maxPage),r.createElement("div",{className:this.props.nextClassName,style:s},t))}});e.exports=i},function(e,t,n){"use strict";var r=n(0),o=(n(29),n(97)),i=n(51),s=n(346),a=n(48),l=n(318),u=n(342),p=n(146),c=r.createClass({displayName:"GridRow",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}},handleClick:function(e){null!==this.props.onRowClick&&i(this.props.onRowClick)?this.props.onRowClick(this,e):this.props.hasChildren&&this.props.toggleChildren()},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 c=this.props.columnSettings.getColumns(),d=s(c,[]),f=a({},this.props.data);l(f,d);var h,m,g=u(o.pick(f,p(c,"children"))),y=g.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()&&void 0!==s&&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,className:s.cssClassName,key:o,style:n},u)}else i=r.createElement("td",{onClick:e.handleClick,className:s.cssClassName,key:o,style:n},l,e.formatData(t[1]));return i||r.createElement("td",{onClick:e.handleClick,key:o,style:n},l,t[1])});null!==this.props.onRowClick&&i(this.props.onRowClick)?(h=null,m=this.handleSelectClick):this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection?(h=this.handleSelectClick,m=null):(h=null,m=null),y&&this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection&&(this.props.multipleSelectionSettings.getSelectedRowIds(),y.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 v=t.props.rowSettings&&t.props.rowSettings.getBodyRowMetadataClass(t.props.data)||"standard-row";return t.props.isChildRow?v="child-row":t.props.hasChildren&&(v=t.props.showChildren?this.props.parentRowExpandedClassName:this.props.parentRowCollapsedClassName),r.createElement("tr",{onClick:h,className:v},y)}});e.exports=c},function(e,t,n){"use strict";var r=n(0),o=n(325),i=n(146),s=n(72),a=r.createClass({displayName:"GridSettings",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===o(this.props.selectedColumns,t)?(this.props.selectedColumns.push(t),this.props.setColumns(this.props.selectedColumns)):this.props.setColumns(i(this.props.selectedColumns,t))},render:function(){var e=this,t=[];!1===e.props.useCustomComponent&&(t=this.props.columns.map(function(t,n){var i=o(e.props.selectedColumns,t),a=s(e.props.columnMetadata,{columnName:t}),l=t;return void 0!==a&&void 0!==a.displayName&&null!=a.displayName&&(l=a.displayName),void 0!==a&&null!=a&&a.locked?r.createElement("div",{className:"column checkbox"},r.createElement("label",null,r.createElement("input",{type:"checkbox",disabled:!0,name:"check",checked:i,"data-name":t}),l)):void 0!==a&&null!=a&&void 0!==a.visible&&!1===a.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:i,"data-name":t}),l))}));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)):"",i=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),i,n)}});e.exports=a},function(e,t,n){"use strict";var r=n(0),o=n(215),i=n(98),s=(n(29),n(100),r.createClass({displayName:"GridTable",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}},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,s=null;if(this.props.enableInfiniteScroll&&null!==this.props.rowHeight&&void 0!==this.refs.scrollable){var a=e.getAdjustedRowHeight(),l=Math.ceil(e.state.clientHeight/a),u=Math.max(0,Math.floor(e.state.scrollTop/a)-.25*l),p=Math.min(u+1.25*l,this.props.data.length-1);n=n.slice(u,p+1);var c={height:u*a+"px"};o=r.createElement("tr",{key:"above-"+c.height,style:c});var d={height:(this.props.data.length-p)*a+"px"};s=r.createElement("tr",{key:"below-"+d.height,style:d})}var f=n.map(function(n,o){var s=void 0!==n.children&&n.children.length>0,a=e.props.rowSettings.getRowKey(n,o);return s&&(t=s),r.createElement(i,{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:a+"-container",uniqueId:a,columnSettings:e.props.columnSettings,rowSettings:e.props.rowSettings,paddingHeight:e.props.paddingHeight,multipleSelectionSettings:e.props.multipleSelectionSettings,rowHeight:e.props.rowHeight,hasChildren:s,tableClassName:e.props.className,onRowClick:e.props.onRowClick})});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),s&&f.push(s),{nodes:f,anyHasChildren:t}}return null},render:function(){var e=[],t=!1,n=this.getNodeContent();n&&(e=n.nodes,t=n.anyHasChildren);var i=null,s=null,a={width:"100%"};if(this.props.useFixedLayout&&(a.tableLayout="fixed"),this.props.enableInfiniteScroll&&(i={position:"relative",overflowY:"scroll",height:this.props.bodyHeight+"px",width:"100%"}),this.props.externalIsLoading){var l=null,u=null;this.props.useGriddleStyles&&(l={textAlign:"center",paddingBottom:"40px"}),u=this.props.columnSettings.getVisibleColumnCount();var p=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:l,colSpan:u},p)))}var c=this.props.showTableHeading?r.createElement(o,{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 d=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;d=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&&(a.tableLayout="fixed"),r.createElement("div",null,r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&a||null},c),r.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:i},r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&a||null},e,s,d)))):r.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:i},r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&a||null},c,e,s,d))}}));e.exports=s},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t=120&&y.length>=120)?new o(f&&y):void 0}y=e[0];var v=-1,b=h[0];e:for(;++vt||s&&a&&u&&!l&&!p||r&&a&&u||!n&&u||!i)return 1;if(!r&&!s&&!p&&e=l?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}var o=n(262);e.exports=r},function(e,t,n){function r(e,t){return o(e,i(e),t)}var o=n(18),i=n(69);e.exports=r},function(e,t,n){function r(e,t){return o(e,i(e),t)}var o=n(18),i=n(128);e.exports=r},function(e,t,n){var r=n(9),o=r["__core-js_shared__"];e.exports=o},function(e,t,n){function r(e,t){return function(n,r){if(null==n)return n;if(!o(n))return e(n,r);for(var i=n.length,s=t?i:-1,a=Object(n);(t?s--:++s-1?a[l?t[u]:u]:void 0}}var o=n(31),i=n(10),s=n(13);e.exports=r},function(e,t,n){function r(e){return function(t){var n=i(t);return n==l?s(t):n==u?a(t):o(t,e(t))}}var o=n(249),i=n(45),s=n(71),a=n(308),l="[object Map]",u="[object Set]";e.exports=r},function(e,t,n){function r(e,t,n,r){return void 0===e||o(e,i[n])&&!s.call(r,n)?t:e}var o=n(34),i=Object.prototype,s=i.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){return o(e)?void 0:e}var o=n(142);e.exports=r},function(e,t,n){function r(e,t,n,r,o,C,w){switch(n){case S:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case E:return!(e.byteLength!=t.byteLength||!C(new i(e),new i(t)));case d:case f:case g:return s(+e,+t);case h:return e.name==t.name&&e.message==t.message;case y:case b:return e==t+"";case m:var O=l;case v:var T=r&p;if(O||(O=u),e.size!=t.size&&!T)return!1;var F=w.get(e);if(F)return F==t;r|=c,w.set(e,t);var I=a(O(e),O(t),r,o,C,w);return w.delete(e),I;case _:if(P)return P.call(e)==P.call(t)}return!1}var o=n(22),i=n(101),s=n(34),a=n(123),l=n(71),u=n(134),p=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",m="[object Map]",g="[object Number]",y="[object RegExp]",v="[object Set]",b="[object String]",_="[object Symbol]",E="[object ArrayBuffer]",S="[object DataView]",C=o?o.prototype:void 0,P=C?C.valueOf:void 0;e.exports=r},function(e,t,n){function r(e,t,n,r,s,l){var u=n&i,p=o(e),c=p.length;if(c!=o(t).length&&!u)return!1;for(var d=c;d--;){var f=p[d];if(!(u?f in t:a.call(t,f)))return!1}var h=l.get(e);if(h&&l.get(t))return h==t;var m=!0;l.set(e,t),l.set(t,e);for(var g=u;++d-1}var o=n(41);e.exports=r},function(e,t,n){function r(e,t){var n=this.__data__,r=o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var o=n(41);e.exports=r},function(e,t,n){function r(){this.size=0,this.__data__={hash:new o,map:new(s||i),string:new o}}var o=n(217),i=n(40),s=n(59);e.exports=r},function(e,t,n){function r(e){var t=o(this,e).delete(e);return this.size-=t?1:0,t}var o=n(44);e.exports=r},function(e,t,n){function r(e){return o(this,e).get(e)}var o=n(44);e.exports=r},function(e,t,n){function r(e){return o(this,e).has(e)}var o=n(44);e.exports=r},function(e,t,n){function r(e,t){var n=o(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var o=n(44);e.exports=r},function(e,t,n){function r(e){var t=o(e,function(e){return n.size===i&&n.clear(),e}),n=t.cache;return t}var o=n(333),i=500;e.exports=r},function(e,t,n){var r=n(132),o=r(Object.keys,Object);e.exports=o},function(e,t){function n(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}e.exports=n},function(e,t,n){(function(e){var r=n(125),o="object"==typeof t&&t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=i&&i.exports===o,a=s&&r.process,l=function(){try{return a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=l}).call(t,n(52)(e))},function(e,t){function n(e){return o.call(e)}var r=Object.prototype,o=r.toString;e.exports=n},function(e,t,n){function r(e,t){return t.length<2?e:o(e,i(t,0,-1))}var o=n(42),i=n(32);e.exports=r},function(e,t){function n(e){return this.__data__.set(e,r),this}var r="__lodash_hash_undefined__";e.exports=n},function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},function(e,t){function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}e.exports=n},function(e,t){function n(e){var t=0,n=0;return function(){var s=i(),a=o-(s-n);if(n=s,a>0){if(++t>=r)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var r=800,o=16,i=Date.now;e.exports=n},function(e,t,n){function r(){this.__data__=new o,this.size=0}var o=n(40);e.exports=r},function(e,t){function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}e.exports=n},function(e,t){function n(e){return this.__data__.get(e)}e.exports=n},function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},function(e,t,n){function r(e,t){var n=this.__data__;if(n instanceof o){var r=n.__data__;if(!i||r.length-1:!!p&&o(e,t,n)>-1}var o=n(114),i=n(10),s=n(330),a=n(36),l=n(345),u=Math.max;e.exports=r},function(e,t,n){function r(e){return(null==e?0:e.length)?o(e,0,-1):[]}var o=n(32);e.exports=r},function(e,t,n){var r=n(8),o=n(231),i=n(23),s=n(254),a=i(function(e){var t=r(e,s);return t.length&&t[0]===e[0]?o(t):[]});e.exports=a},function(e,t,n){function r(e){if(null==e)return!0;if(l(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||c(e)||s(e)))return!e.length;var t=i(e);if(t==d||t==f)return!e.size;if(p(e))return!o(e).length;for(var n in e)if(m.call(e,n))return!1;return!0}var o=n(116),i=n(45),s=n(49),a=n(2),l=n(10),u=n(50),p=n(33),c=n(75),d="[object Map]",f="[object Set]",h=Object.prototype,m=h.hasOwnProperty;e.exports=r},function(e,t){function n(e){return null===e}e.exports=n},function(e,t,n){function r(e){return"string"==typeof e||!i(e)&&s(e)&&o(e)==a}var o=n(17),i=n(2),s=n(14),a="[object String]";e.exports=r},function(e,t){function n(e){return void 0===e}e.exports=n},function(e,t){function n(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}e.exports=n},function(e,t,n){function r(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(i);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(r.Cache||o),n}var o=n(60),i="Expected a function";r.Cache=o,e.exports=r},function(e,t,n){var r=n(8),o=n(226),i=n(251),s=n(24),a=n(18),l=n(272),u=n(124),p=n(127),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}),a(e,p(e),n),u&&(n=o(n,7,l));for(var c=t.length;c--;)i(n,t[c]);return n});e.exports=c},function(e,t,n){function r(e,t,n,r){return null==e?[]:(i(t)||(t=null==t?[]:[t]),n=r?void 0:n,i(n)||(n=null==n?[]:[n]),o(e,t,n))}var o=n(118),i=n(2);e.exports=r},function(e,t,n){var r=n(241),o=n(124),i=o(function(e,t){return null==e?{}:r(e,t)});e.exports=i},function(e,t,n){var r=n(65),o=n(118),i=n(23),s=n(129),a=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=a},function(e,t){function n(){return!1}e.exports=n},function(e,t,n){function r(e,t,n){return e&&e.length?(t=n||void 0===t?1:i(t),o(e,0,t<0?0:t)):[]}var o=n(32),i=n(36);e.exports=r},function(e,t,n){function r(e){return e?(e=o(e))===i||e===-i?(e<0?-1:1)*s:e===e?e:0:0===e?e:0}var o=n(341),i=1/0,s=1.7976931348623157e308;e.exports=r},function(e,t,n){function r(e){if("number"==typeof e)return e;if(i(e))return s;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(a,"");var n=u.test(e);return n||p.test(e)?c(e.slice(2),n?2:8):l.test(e)?s:+e}var o=n(11),i=n(25),s=NaN,a=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,p=/^0o[0-7]+$/i,c=parseInt;e.exports=r},function(e,t,n){var r=n(270),o=n(13),i=r(o);e.exports=i},function(e,t,n){function r(e){return s(e)?o(e,u):a(e)?[e]:i(l(p(e)))}var o=n(8),i=n(120),s=n(2),a=n(25),l=n(136),u=n(20),p=n(77);e.exports=r},function(e,t,n){function r(e){var t=++i;return o(e)+t}var o=n(77),i=0;e.exports=r},function(e,t,n){function r(e){return null==e?[]:o(e,i(e))}var o=n(252),i=n(13);e.exports=r},function(e,t,n){function r(e,t){return i(e||[],t||[],o)}var o=n(30),i=n(253);e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(343),o=function(e){return e&&e.__esModule?e:{default:e}}(r),i=function(e,t){if(!e)return e;var n=(0,o.default)(t),r=n.length;if(r){for(var i=e,s=0;s { - $('#insert-embed-react__dialog-wrapper').entwine({ + $('.js-injector-boot #insert-embed-react__dialog-wrapper').entwine({ Element: null, Data: {}, diff --git a/client/src/entwine/TinyMCE_sslink-file.js b/client/src/entwine/TinyMCE_sslink-file.js index e58861b4b..4faaa019d 100644 --- a/client/src/entwine/TinyMCE_sslink-file.js +++ b/client/src/entwine/TinyMCE_sslink-file.js @@ -58,7 +58,7 @@ jQuery.entwine('ss', ($) => { /** * Assumes that $('.insert-link__dialog-wrapper').entwine({}); is defined for shared functions */ - $(`#${modalId}`).entwine({ + $(`.js-injector-boot #${modalId}`).entwine({ renderModal(show) { const handleHide = () => this.close(); const handleInsert = (...args) => this.handleInsert(...args); diff --git a/client/src/entwine/TinyMCE_ssmedia.js b/client/src/entwine/TinyMCE_ssmedia.js index 542ec75b8..cc17e654c 100644 --- a/client/src/entwine/TinyMCE_ssmedia.js +++ b/client/src/entwine/TinyMCE_ssmedia.js @@ -128,7 +128,7 @@ jQuery.entwine('ss', ($) => { onclick: (e) => e.preventDefault(), }); - $('#insert-media-react__dialog-wrapper').entwine({ + $('.js-injector-boot #insert-media-react__dialog-wrapper').entwine({ Element: null, Data: {}, diff --git a/client/src/entwine/UploadField/UploadFieldEntwine.js b/client/src/entwine/UploadField/UploadFieldEntwine.js index 49e597527..4e97d43ad 100644 --- a/client/src/entwine/UploadField/UploadFieldEntwine.js +++ b/client/src/entwine/UploadField/UploadFieldEntwine.js @@ -14,7 +14,7 @@ jQuery.entwine('ss', ($) => { /** * See boot/index.js for `.react-boot` bootstrap */ - $('.js-react-boot input.entwine-uploadfield').entwine({ + $('.js-injector-boot input.entwine-uploadfield').entwine({ getContainer() { let container = this.siblings('.uploadfield-holder')[0]; if (!container) { diff --git a/package.json b/package.json index 21bb5ce74..eff4af95b 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ }, "author": "SilverStripe Ltd", "engines": { - "node": "^6.x" + "node": ">=6.x" }, "scripts": { "build": "yarn && yarn test && NODE_ENV=production webpack -p --bail --progress",