diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index 67459d0b..c14b07b9 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1 +1 @@ -!function(){"use strict";var e={2038:function(e,t,n){var r=a(n(4121)),o=a(n(1240));function a(e){return e&&e.__esModule?e:{default:e}}window.document.addEventListener("DOMContentLoaded",(()=>{(0,r.default)(),(0,o.default)()}))},4121:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=y(n(5207)),o=y(n(584)),a=y(n(7105)),l=y(n(6721)),i=y(n(2512)),u=y(n(5563)),d=y(n(5297)),s=y(n(7651)),c=y(n(1305)),f=y(n(7660)),p=y(n(7333)),m=y(n(2382)),g=y(n(8953)),h=y(n(1950)),b=y(n(6573));function y(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.component.registerMany({ElementEditor:l.default,ElementToolbar:u.default,ElementAddNewButton:d.default,ElementList:i.default,Element:o.default,ElementActions:a.default,ElementHeader:s.default,ElementContent:c.default,ElementSummary:f.default,ElementInlineEditForm:p.default,AddElementPopover:m.default,HoverBar:g.default,DragPositionIndicator:h.default,TextCheckboxGroupField:b.default})}},1240:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=c(n(5207)),o=c(n(2977)),a=c(n(3337)),l=c(n(4)),i=c(n(9283)),u=c(n(8501)),d=c(n(2221)),s=c(n(5904));function c(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.transform("elemental-fieldgroup",(e=>{e.component("FieldGroup.HistoryViewer.VersionDetail",o.default,"HistoricElement")}),{after:"field-holders"}),r.default.transform("blocks-history-revert",(e=>{e.component("HistoryViewerToolbar.VersionedAdmin.HistoryViewer.Element.HistoryViewerVersionDetail",a.default,"BlockRevertRequest")})),r.default.transform("element-actions",(e=>{e.component("ElementActions",u.default,"ElementActionsWithSave"),e.component("ElementActions",d.default,"ElementActionsWithPublish"),e.component("ElementActions",s.default,"ElementActionsWithUnpublish"),e.component("ElementActions",i.default,"ElementActionsWithDuplicate"),e.component("ElementActions",l.default,"ElementActionsWithArchive")}))}},26:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(1594)),o=u(n(6935)),a=u(n(6923)),l=n(3556),i=n(9791);function u(e){return e&&e.__esModule?e:{default:e}}const d=e=>{const{className:t,title:n,label:o}=e,i={className:(0,a.default)(t,"dropdown-item"),...e};return r.default.createElement(l.DropdownItem,i,o||n)};d.propTypes={disabled:o.default.bool,className:o.default.string,onClick:o.default.func,title:o.default.string,name:o.default.string,type:i.elementTypeType,active:o.default.bool,label:o.default.string},d.defaultProps={disabled:!1};t.default=d},4:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=c(n(26)),a=c(n(5815)),l=n(6721),i=c(n(5609)),u=c(n(6177)),d=n(1135),s=c(n(4014));function c(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}const p=e=>t=>{const{fetchElements:n}=(0,r.useContext)(l.ElementEditorContext),c=void 0!==t.element.canDelete&&!t.element.canDelete,f=a.default._t("ElementArchiveAction.ARCHIVE","Archive"),p={label:f,title:c?a.default._t("ElementArchiveAction.ARCHIVE_PERMISSION_DENY","Archive, insufficient permissions"):f,disabled:c,className:"element-editor__actions-archive",onClick:e=>{e.stopPropagation();const r=t.element.isPublished;let o=a.default._t("ElementArchiveAction.CONFIRM_DELETE","Are you sure you want to send this block to the archive?");if(r&&(o=a.default._t("ElementArchiveAction.CONFIRM_DELETE_AND_UNPUBLISH","Warning: This block will be unpublished before being sent to the archive. Are you sure you want to proceed?")),!window.confirm(o))return;const l=t.element.id,c=`${(0,d.getConfig)().controllerLink.replace(/\/$/,"")}/api/delete`;i.default.post(c,{id:l},{"X-SecurityID":u.default.get("SecurityID")}).then((()=>n())).catch((async e=>{const t=await(0,s.default)(e);window.jQuery.noticeAdd({text:t,stay:!0,type:"error"})}))},toggle:t.toggle};return r.default.createElement(e,t,t.children,r.default.createElement(o.default,p))};t.Component=p;t.default=p},9283:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=c(n(26)),a=c(n(5815)),l=n(6721),i=c(n(5609)),u=c(n(6177)),d=n(1135),s=c(n(4014));function c(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}const p=e=>t=>{const{fetchElements:n}=(0,r.useContext)(l.ElementEditorContext);if(t.type.broken)return r.default.createElement(e,t);const c=void 0!==t.element.canCreate&&!t.element.canCreate,f=a.default._t("ElementArchiveAction.DUPLICATE","Duplicate"),p={label:f,title:c?a.default._t("ElementArchiveAction.DUPLICATE_PERMISSION_DENY","Duplicate, insufficient permissions"):f,disabled:c,className:"element-editor__actions-duplicate",onClick:e=>{e.stopPropagation();const r=t.element.id,o=`${(0,d.getConfig)().controllerLink.replace(/\/$/,"")}/api/duplicate`;i.default.post(o,{id:r},{"X-SecurityID":u.default.get("SecurityID")}).then((()=>n())).catch((async e=>{const t=await(0,s.default)(e);window.jQuery.noticeAdd({text:t,stay:!0,type:"error"})}))},toggle:t.toggle};return r.default.createElement(e,t,t.children,r.default.createElement(o.default,p))};t.Component=p;t.default=p},2221:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=i(n(26)),a=i(n(5815)),l=n(584);function i(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}const d=e=>t=>{const{formDirty:n,onPublishButtonClick:i}=(0,r.useContext)(l.ElementContext),{element:u}=t,d=void 0!==t.element.canPublish&&!t.element.canPublish,s=a.default._t("ElementArchiveAction.PUBLISH","Publish"),c={label:s,title:d?a.default._t("ElementArchiveAction.PUBLISH_PERMISSION_DENY","Publish, insufficient permissions"):s,disabled:d,className:"element-editor__actions-publish",onClick:e=>{e.stopPropagation(),i()},toggle:t.toggle};return t.type.broken?r.default.createElement(e,t):r.default.createElement(e,t,t.children,(n||!u.isLiveVersion)&&r.default.createElement(o.default,c))};t.Component=d;t.default=d},8501:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=i(n(26)),a=i(n(5815)),l=n(584);function i(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}const d=e=>t=>{const{onSaveButtonClick:n,formDirty:i}=(0,r.useContext)(l.ElementContext),u={title:a.default._t("ElementSaveAction.SAVE","Save"),className:"element-editor__actions-save",onClick:e=>{e.stopPropagation(),n()},toggle:t.toggle};return!t.expandable||t.type.broken?r.default.createElement(e,t):r.default.createElement(e,t,t.children,i&&r.default.createElement(o.default,u))};t.Component=d;t.default=d},5904:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=s(n(26)),a=s(n(5815)),l=s(n(5609)),i=n(6721),u=s(n(6177)),d=n(1135);function s(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}const f=e=>t=>{const{fetchElements:n}=(0,r.useContext)(i.ElementEditorContext);if(t.type.broken)return r.default.createElement(e,t);const s=(e,t,n)=>{const r=a.default.inject(a.default._t("ElementHeader.NOTITLE","Untitled {type} block"),{type:e}),o=a.default.inject(a.default._t("ElementUnpublishAction.SUCCESS_NOTIFICATION","Removed '{title}' from the published page"),{title:t||r}),l=a.default.inject(a.default._t("ElementUnpublishAction.ERROR_NOTIFICATION","Error unpublishing '{title}'"),{title:t||r});window.jQuery.noticeAdd({text:n?o:l,stay:!1,type:n?"success":"error"})},c=void 0!==t.element.canUnpublish&&!t.element.canUnpublish,f=a.default._t("ElementArchiveAction.UNPUBLISH","Unpublish"),p={label:f,title:c?a.default._t("ElementArchiveAction.UNPUBLISH_PERMISSION_DENY","Unpublish, insufficient permissions"):f,disabled:c,className:"element-editor__actions-unpublish",onClick:e=>{e.stopPropagation(),(()=>{const e=t.element.id,r=`${(0,d.getConfig)().controllerLink.replace(/\/$/,"")}/api/unpublish`;l.default.post(r,{id:e},{"X-SecurityID":u.default.get("SecurityID")}).then((()=>n())).then((()=>s(t.type.title,t.element.title,!0))).catch((()=>s(t.type.title,t.element.title,!1)))})()},toggle:t.toggle};return r.default.createElement(e,t,t.children,t.element.isPublished&&r.default.createElement(o.default,p))};t.Component=f;t.default=f},2382:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=y(n(1594)),o=h(n(6935)),a=n(9040),l=n(9367),i=h(n(6923)),u=y(n(8918)),d=n(5207),s=n(9791),c=h(n(5815)),f=h(n(5609)),p=h(n(6177)),m=n(6721),g=h(n(4014));function h(e){return e&&e.__esModule?e:{default:e}}function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}class E extends r.Component{constructor(e){super(e),this.handleToggle=this.handleToggle.bind(this),E.contextType=m.ElementEditorContext}getElementButtonClickHandler(e){return t=>{t.preventDefault();const n=`${p.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController").controllerLink}/api/create`;f.default.post(n,{elementClass:e.class,elementalAreaID:this.props.areaId,insertAfterElementID:this.props.insertAfterElement},{"X-SecurityID":p.default.get("SecurityID")}).then((()=>{const{fetchElements:e}=this.context;return e()})).then((()=>{const e=window.jQuery(".cms-preview");e.entwine("ss.preview")._loadUrl(e.find("iframe").attr("src"))})).catch((async e=>{const t=await(0,g.default)(e);this.props.actions.toasts.error(t)})),this.handleToggle()}}handleToggle(){const{toggle:e}=this.props;e()}render(){const{PopoverOptionSetComponent:e,elementTypes:t,container:n,extraClass:o,isOpen:a,placement:l,target:u}=this.props,d=(0,i.default)("element-editor-add-element",o),s=t.map((e=>({content:e.title,key:e.name,className:(0,i.default)(e.icon,"btn--icon-xl","element-editor-add-element__button"),onClick:this.getElementButtonClickHandler(e)})));return r.default.createElement(e,{buttons:s,searchPlaceholder:c.default._t("ElementAddElementPopover.SEARCH_BLOCKS","Search blocks"),extraClass:d,container:n,isOpen:a,placement:l,target:u,toggle:this.handleToggle})}}t.Component=E,E.propTypes={container:o.default.oneOfType([o.default.string,o.default.func,o.default.object]),elementTypes:o.default.arrayOf(s.elementTypeType).isRequired,extraClass:o.default.oneOfType([o.default.string,o.default.array,o.default.object]),isOpen:o.default.bool.isRequired,placement:o.default.string,target:o.default.oneOfType([o.default.string,o.default.func,o.default.object]).isRequired,toggle:o.default.func.isRequired,areaId:o.default.number.isRequired,insertAfterElement:o.default.oneOfType([o.default.number,o.default.string])};const v=(0,d.inject)(["PopoverOptionSet"],(e=>({PopoverOptionSetComponent:e})),(()=>"ElementEditor"))(E);t.default=(0,l.compose)((0,a.connect)(null,(function(e){return{actions:{toasts:(0,l.bindActionCreators)(u,e)}}})))(v)},5297:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=d(n(6935)),a=n(3556),l=d(n(5815)),i=n(9791),u=n(5207);function d(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class c extends r.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={popoverOpen:!1}}toggle(){this.setState((e=>({popoverOpen:!e.popoverOpen})))}render(){const{AddElementPopoverComponent:e,elementTypes:t,areaId:n}=this.props,o={id:`ElementalArea${n}_AddButton`,color:"primary",onClick:this.toggle,className:"font-icon-plus"};return r.default.createElement("div",null,r.default.createElement(a.Button,o,l.default._t("ElementAddNewButton.ADD_BLOCK","Add block")),r.default.createElement(e,{placement:"bottom-start",target:o.id,isOpen:this.state.popoverOpen,elementTypes:t,toggle:this.toggle,areaId:n,insertAfterElement:0}))}}t.Component=c,c.defaultProps={},c.propTypes={elementTypes:o.default.arrayOf(i.elementTypeType).isRequired,areaId:o.default.number.isRequired};t.default=(0,u.inject)(["AddElementPopover"],(e=>({AddElementPopoverComponent:e})),(()=>"ElementEditor.ElementList.AddNewButton"))(c)},1305:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),a=(r=n(6935))&&r.__esModule?r:{default:r},l=n(5207),i=n(9367);function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}class d extends o.PureComponent{render(){const{id:e,fileUrl:t,fileTitle:n,content:r,previewExpanded:a,InlineEditFormComponent:l,SummaryComponent:i,activeTab:u,onFormInit:d,handleLoadingError:s,formDirty:c,broken:f,onFormSchemaSubmitResponse:p,ensureFormRendered:m,formHasRendered:g}=this.props,h=!a&&(m||g),b={"element-editor-editform--collapsed":!a,"element-editor-editform--rendered-not-visible":h};return o.default.createElement("div",{className:"element-editor-content"},!a&&o.default.createElement(i,{content:r,fileUrl:t,fileTitle:n,broken:f}),(a||m||g)&&o.default.createElement(l,{extraClass:b,onClick:e=>e.stopPropagation(),elementId:e,activeTab:u,onFormInit:d,handleLoadingError:s,onFormSchemaSubmitResponse:p,notVisible:h}),c&&o.default.createElement("input",{type:"hidden",name:"change-tracker",className:"element-form-dirty-state",value:"1"}))}}t.Component=d,d.propTypes={id:a.default.number,content:a.default.string,fileUrl:a.default.string,fileTitle:a.default.string,previewExpanded:a.default.bool,SummaryComponent:a.default.elementType,InlineEditFormComponent:a.default.elementType,handleLoadingError:a.default.func,broken:a.default.bool,onFormSchemaSubmitResponse:a.default.func,onFormInit:a.default.func,ensureFormRendered:a.default.bool,formHasRendered:a.default.bool,formDirty:a.default.object},d.defaultProps={};t.default=(0,i.compose)((0,l.inject)(["ElementSummary","ElementInlineEditForm"],((e,t)=>({SummaryComponent:e,InlineEditFormComponent:t})),(()=>"ElementEditor.ElementList.Element")))(d)},1950:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var i=a?Object.getOwnPropertyDescriptor(e,l):null;i&&(i.get||i.set)?Object.defineProperty(r,l,i):r[l]=e[l]}return r.default=e,n&&n.set(e,r),r}(n(1594));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}class a extends r.PureComponent{render(){return r.default.createElement("div",{className:"elemental-editor-drag-indicator"},r.default.createElement("div",{className:"elemental-editor-drag-indicator__ball"}))}}t.default=a},584:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ElementContext=t.Component=void 0;var r=w(n(1594)),o=D(n(6935)),a=n(455),l=n(9791),i=n(9367),u=n(5207),d=D(n(5815)),s=D(n(6923)),c=n(9040),f=n(5381),p=n(2153),m=n(7785),g=w(n(5034)),h=n(1820),b=n(8724),y=n(9306),E=w(n(8918)),v=n(9077),_=n(6721),O=n(1135),T=D(n(5609)),C=D(n(6177));function D(e){return e&&e.__esModule?e:{default:e}}function P(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(P=function(e){return e?n:t})(e)}function w(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=P(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}const S=t.ElementContext=(0,r.createContext)(null),j=e=>{const[t,n]=(0,r.useState)(!1),[o,a]=(0,r.useState)(""),[l,i]=(0,r.useState)(!1),[u,c]=(0,r.useState)(e.element.title),[f,p]=(0,r.useState)(!1),[m,g]=(0,r.useState)(!1),[h,y]=(0,r.useState)(!1),[E,v]=(0,r.useState)(!1),[D,P]=(0,r.useState)(!1),[w,j]=(0,r.useState)(!1),[k,I]=(0,r.useState)(!1),[M,A]=(0,r.useState)(!1),{fetchElements:N}=(0,r.useContext)(_.ElementEditorContext);(0,r.useEffect)((()=>{void 0!==e.formDirty&&!M&&A(!0)}),[e.formDirty]),(0,r.useEffect)((()=>{e.onChangeHasUnsavedChanges(M)}),[M]),(0,r.useEffect)((()=>{e.saveElement&&M&&!m&&g(!0)}),[e.saveElement,M,e.increment]),(0,r.useEffect)((()=>{e.connectDragPreview&&e.connectDragPreview((0,b.getEmptyImage)(),{captureDraggingState:!0})}),[]),(0,r.useEffect)((()=>{f&&w&&(p(!1),M?(e.submitForm(),v(!0)):y(!0))}),[f,w]),(0,r.useEffect)((()=>{k&&(I(!1),e.dispatchAddFormChanged())}),[k]);const R=()=>d.default.inject(d.default._t("ElementHeader.NOTITLE","Untitled {type} block"),{type:e.type.title}),x=t=>{(t=>{const n=u||R();if(t){const t=d.default.inject(d.default._t("ElementPublishAction.ERROR_NOTIFICATION","Error publishing '{title}'"),{title:n});e.actions.toasts.error(t)}else{const t=d.default.inject(d.default._t("ElementPublishAction.SUCCESS_NOTIFICATION","Published '{title}' successfully"),{title:n});e.actions.toasts.success(t)}})(t),y(!1),v(!1),N().then((()=>{setTimeout((()=>e.dispatchRemoveFormChanged()),250)}))};(0,r.useEffect)((()=>{w&&m&&(e.submitForm(),g(!1))}),[w,m]),(0,r.useEffect)((()=>{if(w&&h){const t=`${(0,O.getConfig)().controllerLink.replace(/\/$/,"")}/api/publish`;T.default.post(t,{id:e.element.id},{"X-SecurityID":C.default.get("SecurityID")}).then((()=>x(!1))).catch((()=>x(!0)))}}),[w,h]);const L=t=>{const{tabSetName:n,onActivateTab:r}=e;if(o||a(t),t||o)r(n,t||o);else{r(n,"Main")}},W=r=>{const{type:o,link:a}=e;o.broken||("button"!==r.target.type?!o.inlineEditable||l?window.location=a:n(!t):r.stopPropagation())},{element:F,type:B,areaId:H,HeaderComponent:$,ContentComponent:q,link:U,activeTab:V,connectDragSource:K,connectDropTarget:X,isDragging:Q,isOver:Y,onDragEnd:G,formDirty:J}=e;if(!F.id)return null;const z=(0,s.default)("element-editor__element",{"element-editor__element--broken":B.broken,"element-editor__element--expandable":B.inlineEditable&&!B.broken,"element-editor__element--dragging":Q,"element-editor__element--dragged-over":Y},(()=>{const{element:t}=e,n="element-editor__element";return t.isPublished?t.isPublished&&!t.isLiveVersion?`${n}--modified`:`${n}--published`:`${n}--draft`})()),Z={formDirty:J,onPublishButtonClick:()=>{p(!0),P(!0)},onSaveButtonClick:()=>{P(!0),g(!0)}},ee=X(r.default.createElement("div",{className:z,onClick:W,onKeyUp:e=>{const{nodeName:t}=e.target;" "!==e.key&&"Enter"!==e.key||["input","textarea"].includes(t.toLowerCase())||W(e)},role:"button",tabIndex:0,title:(e=>e.broken?d.default._t("ElementalElement.ARCHIVE_BROKEN","Archive this block"):d.default.inject(d.default._t("ElementalElement.TITLE","Edit this {type} block"),{type:e.title}))(B),key:F.id},r.default.createElement(S.Provider,{value:Z},r.default.createElement($,{element:F,type:B,areaId:H,expandable:B.inlineEditable,link:U,previewExpanded:t,handleEditTabsClick:t=>{const{activeTab:r}=e;t===r||l||(n(!0),L(t))},activeTab:V,disableTooltip:Q,onDragEnd:G}),r.default.createElement(q,{id:F.id,fileUrl:F.blockSchema.fileURL,fileTitle:F.blockSchema.fileTitle,content:((e,t)=>t.broken?e.title?d.default.inject(d.default._t("ElementalElement.BROKEN_DESCRIPTION_TITLE",'This block had the title "{title}". It is broken and will not display on the front-end. You can archive it to remove it from this elemental area.'),{title:e.title}):d.default._t("ElementalElement.BROKEN_DESCRIPTION","This block is broken and will not display on the front-end. You can archive it to remove it from this elemental area."):e.blockSchema.content)(F,B),previewExpanded:t&&!Q,ensureFormRendered:D,formHasRendered:w,activeTab:V,handleLoadingError:()=>{i(!0)},broken:B.broken,onFormSchemaSubmitResponse:(t,r)=>{if(t.id.match(/\/schema\/elemental-area\/([0-9]+)/))return e.type.inlineEditable&&n(!0),I(!0),E&&v(!1),void e.onAfterSubmitResponse(!1);A(!1),c(r),E&&(v(!1),y(!0)),h||E||(t=>{const n=t||R(),r=d.default.inject(d.default._t("ElementSaveAction.SUCCESS_NOTIFICATION","Saved '{title}' successfully"),{title:n});e.actions.toasts.success(r)})(r),e.onAfterSubmitResponse(!0),N()},onFormInit:()=>(e=>{L(e),j(!0)})(V)}))));return t?ee:K(ee)};t.Component=j,j.propTypes={element:a.elementType,type:l.elementTypeType.isRequired,areaId:o.default.number.isRequired,link:o.default.string.isRequired,activeTab:o.default.string,tabSetName:o.default.string,onActivateTab:o.default.func,connectDragSource:o.default.func.isRequired,connectDragPreview:o.default.func.isRequired,connectDropTarget:o.default.func.isRequired,isDragging:o.default.bool.isRequired,isOver:o.default.bool.isRequired,onDragOver:o.default.func,onDragEnd:o.default.func,onDragStart:o.default.func,saveElement:o.default.bool.isRequired,onBeforeSubmitForm:o.default.func.isRequired,onAfterSubmitResponse:o.default.func.isRequired,increment:o.default.number.isRequired},j.defaultProps={element:null};const k={drop(e,t,n){const{element:r}=e;return{target:r.id,dropSpot:(0,y.isOverTop)(t,n)?"top":"bottom"}},hover(e,t,n){const{element:r,onDragOver:o}=e;o&&o(r,(0,y.isOverTop)(t,n))}};t.default=(0,i.compose)((0,h.DropTarget)("element",k,((e,t)=>({connectDropTarget:e.dropTarget(),isOver:t.isOver()}))),(0,h.DragSource)("element",y.elementDragSource,((e,t)=>({connectDragSource:e.dragSource(),connectDragPreview:e.dragPreview(),isDragging:t.isDragging()}))),(0,c.connect)((function(e,t){const n=t.element.id,r=(0,p.loadElementFormStateName)(n),o=(0,m.loadElementSchemaValue)("schemaUrl",n),a=e.form&&e.form.formSchemas[o]&&e.form.formSchemas[o].schema&&e.form.formSchemas[o].schema.fields.find((e=>"Tabs"===e.component)),l=a&&a.id,i=`element.${r}__${l}`,u=e.unsavedForms.find((e=>e.name===`element.${r}`));return{tabSetName:l,activeTab:e.tabs&&e.tabs.fields&&e.tabs.fields[i]&&e.tabs.fields[i].activeTab,formDirty:u}}),(function(e,t){const n=(0,p.loadElementFormStateName)(t.element.id);return{onActivateTab(t,r){e(g.activateTab(`element.${n}__${t}`,r))},submitForm(){t.onBeforeSubmitForm(t.element.id),e((0,f.submit)(`element.${n}`))},dispatchAddFormChanged(){e((0,v.addFormChanged)(`element.${n}`))},dispatchRemoveFormChanged(){e((0,v.removeFormChanged)(`element.${n}`))},actions:{toasts:(0,i.bindActionCreators)(E,e)}}})),(0,u.inject)(["ElementHeader","ElementContent"],((e,t)=>({HeaderComponent:e,ContentComponent:t})),(()=>"ElementEditor.ElementList.Element")))(j)},7105:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=c(n(6935)),a=n(9367),l=n(3556),i=n(5207),u=n(455),d=n(9791),s=c(n(26));function c(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}class p extends r.Component{constructor(e){super(e),this.handleEditTabsClick=this.handleEditTabsClick.bind(this)}handleEditTabsClick(e){const{handleEditTabsClick:t}=this.props;t(e.target.name)}renderEditTabs(){const{editTabs:e,activeTab:t,type:n,expandable:o}=this.props;return!n.broken&&o&&e&&e.length?e.map((e=>{let{name:o,title:a}=e;return r.default.createElement(s.default,{key:o,name:o,title:a,type:n,onClick:this.handleEditTabsClick,active:o===t})})):null}renderDivider(){const{children:e,editTabs:t,expandable:n}=this.props;return n&&t&&t.length&&0!==r.default.Children.count(e)?r.default.createElement(l.DropdownItem,{divider:!0,role:"separator"}):null}render(){const{children:e,id:t,ActionMenuComponent:n}=this.props;return r.default.createElement(n,{id:`element-editor-actions-${t}`,className:"element-editor-header__actions-dropdown",dropdownMenuProps:{right:!0},dropdownToggleClassNames:["element-editor-header__actions-toggle","btn","btn-sm","btn--no-text","font-icon-dot-3"]},this.renderEditTabs(),this.renderDivider(),e)}}t.Component=p,p.propTypes={element:u.elementType,type:d.elementTypeType.isRequired,areaId:o.default.number.isRequired,activeTab:o.default.string,editTabs:o.default.arrayOf(o.default.shape({title:o.default.string,name:o.default.string})),handleEditTabsClick:o.default.func.isRequired,expandable:o.default.bool},p.defaultProps={editTabs:[],expandable:!0};t.default=(0,a.compose)((0,i.inject)(["ActionMenu"],(e=>({ActionMenuComponent:e})),(()=>"ElementEditor.ElementList.Element")))(p)},920:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=s(n(6935)),a=s(n(7651)),l=n(1820),i=n(455),u=n(9791),d=n(1135);function s(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}class f extends r.Component{render(){const{isDragging:e,element:t,elementTypes:n,currentOffset:o}=this.props;if(!e||!o)return null;const{x:l,y:i}=o,u=`translate(${l}px, ${i}px)`,s={transform:u,WebkitTransform:u},c=(0,d.getElementTypeConfig)(t,n);return r.default.createElement("div",{className:"element-editor-drag-preview",style:s},r.default.createElement(a.default,{element:t,type:c,simple:!0}))}}f.propTypes={element:i.elementType,elementTypes:o.default.arrayOf(u.elementTypeType),isDragging:o.default.bool,currentOffset:o.default.shape({x:o.default.number.isRequired,y:o.default.number.isRequired})};t.default=(0,l.DragLayer)((e=>({element:e.getItem(),currentOffset:e.getSourceClientOffset(),isDragging:e.isDragging()})))(f)},6721:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ElementEditorContext=t.Component=void 0;var r=E(n(1594)),o=b(n(6935)),a=n(9040),l=n(5207),i=n(9367),u=n(9791),d=n(1820),s=b(n(920)),c=b(n(5799)),f=b(n(5609)),p=b(n(6177)),m=n(1135),g=E(n(8918)),h=b(n(4014));function b(e){return e&&e.__esModule?e:{default:e}}function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}function E(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}const v=t.ElementEditorContext=(0,r.createContext)(null);class _ extends r.PureComponent{constructor(e){super(e),this.state={dragTargetElementId:null,dragSpot:null,elements:null,isLoading:!0},this.handleDragOver=this.handleDragOver.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.fetchElements=this.fetchElements.bind(this)}handleDragOver(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=!!e&&e.id;this.setState({dragTargetElementId:n,dragSpot:!1===t?"bottom":"top"})}handleDragEnd(e,t){const n=`${(0,m.getConfig)().controllerLink.replace(/\/$/,"")}/api/sort`;f.default.post(n,{id:e,afterBlockID:t},{"X-SecurityID":p.default.get("SecurityID")}).then((()=>this.fetchElements())).catch((async e=>{const t=await(0,h.default)(e);this.props.actions.toasts.error(t)})),this.setState({dragTargetElementId:null,dragSpot:null})}fetchElements(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.setState((e=>({...e,isLoading:!0})));const e=`${(0,m.getConfig)().controllerLink.replace(/\/$/,"")}/api/readElements/${this.props.areaId}`;return f.default.get(e).then((async e=>{const t=await e.json();this.setState((e=>({...e,elements:t,isLoading:!1})));const n=window.jQuery(".cms-preview");n&&n.entwine("ss.preview")._loadUrl(n.find("iframe").attr("src"))})).catch((async e=>{this.setState({elements:[],isLoading:!1});const t=await(0,h.default)(e);this.props.actions.toasts.error(t)}))}render(){const{ToolbarComponent:e,ListComponent:t,areaId:n,elementTypes:o,isDraggingOver:a,connectDropTarget:l,allowedElements:i,sharedObject:u,isLoading:d}=this.props,{dragTargetElementId:c,dragSpot:f,elements:p}=this.state;if(null===p)return this.fetchElements(!1),null;const m=i.map((e=>o.find((t=>t.class===e)))),g={fetchElements:this.fetchElements};return l(r.default.createElement("div",{className:"element-editor"},r.default.createElement(v.Provider,{value:g},r.default.createElement(e,{elementTypes:m,areaId:n,onDragOver:this.handleDragOver}),r.default.createElement(t,{allowedElementTypes:m,elementTypes:o,areaId:n,onDragOver:this.handleDragOver,onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,dragSpot:f,isDraggingOver:a,dragTargetElementId:c,sharedObject:u,elements:p,isLoading:d}),r.default.createElement(s.default,{elementTypes:o}))))}}t.Component=_,_.propTypes={elementTypes:o.default.arrayOf(u.elementTypeType).isRequired,allowedElements:o.default.arrayOf(o.default.string).isRequired,areaId:o.default.number.isRequired,actions:o.default.shape({handleSortBlock:o.default.func})};const O=[c.default,(0,d.DropTarget)("element",{},((e,t)=>({connectDropTarget:e.dropTarget(),isDraggingOver:t.isOver()}))),(0,l.inject)(["ElementToolbar","ElementList"],((e,t)=>({ToolbarComponent:e,ListComponent:t})),(()=>"ElementEditor"))];t.default=(0,i.compose)((0,a.connect)(null,(function(e){return{actions:{toasts:(0,i.bindActionCreators)(g,e)}}})),...O)(_)},2512:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.Component=h,t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=m(n(6935)),a=n(455),l=n(9791),i=n(9367),u=n(5207),d=m(n(6923)),s=m(n(5815)),c=n(1820),f=n(9306),p=n(1135);function m(e){return e&&e.__esModule?e:{default:e}}function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function h(e){let{elements:t,sharedObject:n,connectDropTarget:o,ElementComponent:a,HoverBarComponent:l,DragIndicatorComponent:i,allowedElementTypes:u,elementTypes:c,areaId:m,onDragEnd:g,onDragOver:h,onDragStart:b,isDraggingOver:y,dragTargetElementId:E,draggedItem:v,dragSpot:_,isLoading:O,LoadingComponent:T}=e;const[C,D]=(0,r.useState)(!1),[P,w]=(0,r.useState)(0),[S,j]=(0,r.useState)({}),[k,I]=(0,r.useState)({});n.setIncrement=w,n.setSaveAllElements=D;const M=(e,n)=>{const r={},o={};(t||[]).forEach((t=>{const a=parseInt(t.id,10);n?r[a]=!1:e.hasOwnProperty(a)?r[a]=e[a]:r[a]=!1,o[a]=null})),j(r),I(o)};(0,r.useEffect)((()=>{M({},!0)}),[]),(0,r.useEffect)((()=>{M(S,!1)}),[t]),(0,r.useEffect)((()=>{if(!t)return;if(!C)return;const e=t.map((e=>parseInt(e.id,10))).filter((e=>S[e]));let r=!0;for(let t=0;tk[e])),a={success:o,reason:o?"":"invalid"};n.entwineResolve(a),M(S,o),D(!1)}),[C,S]);const A=(0,d.default)("elemental-editor-list",{"elemental-editor-list--empty":!t||!t.length});return o(r.default.createElement("div",{className:A},O?r.default.createElement(T,null):null,(()=>{if(0===t.length)return r.default.createElement("div",null,s.default._t("ElementList.ADD_BLOCKS","Add blocks to place your content"));let e=t.map((e=>{const t=C&&S[e.id]&&null===k[e.id];return r.default.createElement("div",{key:e.id},r.default.createElement(a,{element:e,areaId:m,type:(0,p.getElementTypeConfig)(e,c),link:e.blockSchema.actions.edit,onDragOver:h,onDragEnd:g,onDragStart:b,saveElement:t,onChangeHasUnsavedChanges:t=>((e,t)=>{j({...S,[e]:t})})(e.id,t),onBeforeSubmitForm:()=>{return t=e.id,void I({...k,[t]:null});var t},onAfterSubmitResponse:t=>((e,t)=>{j({...S,[e]:!t}),I({...k,[e]:t})})(e.id,t),increment:P}),y||r.default.createElement(l,{key:`create-after-${e.id}`,areaId:m,elementId:e.id,elementTypes:u}))}));y||(e=[r.default.createElement(l,{key:0,areaId:m,elementId:0,elementTypes:u})].concat(e));const n=(0,f.getDragIndicatorIndex)(t.map((e=>e.id)),E,v&&v.id,_);return y&&null!==n&&e.splice(n,0,r.default.createElement(i,{key:"DropIndicator"})),e})()))}h.propTypes={elements:o.default.arrayOf(a.elementType).isRequired,elementTypes:o.default.arrayOf(l.elementTypeType).isRequired,allowedElementTypes:o.default.arrayOf(l.elementTypeType).isRequired,areaId:o.default.number.isRequired,dragTargetElementId:o.default.oneOfType([o.default.number,o.default.bool]),onDragOver:o.default.func,onDragStart:o.default.func,onDragEnd:o.default.func,sharedObject:o.default.object.isRequired},h.defaultProps={sharedObject:{entwineResolve:()=>{},setState:null},elements:[],isLoading:!1};const b={drop(e,t){const{elements:n}=e,r=t.getDropResult();if(!r)return{};const o=(0,f.getDragIndicatorIndex)(n.map((e=>e.id)),r.target,t.getItem(),r.dropSpot),a=n[o-1]?n[o-1].id:"0";return{...r,dropAfterID:a}}};t.default=(0,i.compose)((0,c.DropTarget)("element",b,((e,t)=>({connectDropTarget:e.dropTarget(),draggedItem:t.getItem()}))),(0,u.inject)(["Element","Loading","HoverBar","DragPositionIndicator"],((e,t,n,r)=>({ElementComponent:e,LoadingComponent:t,HoverBarComponent:n,DragIndicatorComponent:r})),(()=>"ElementEditor.ElementList")))(h)},7651:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=g(n(6935)),a=n(3556),l=n(455),i=n(9791),u=n(9367),d=n(5207),s=g(n(5815)),c=g(n(6923)),f=n(1820),p=n(9306),m=n(8724);function g(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}class b extends r.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={tooltipOpen:!1}}componentDidMount(){const{connectDragPreview:e}=this.props;e&&e((0,m.getEmptyImage)(),{captureDraggingState:!0})}componentDidUpdate(){const{tooltipOpen:e}=this.state,{disableTooltip:t}=this.props;e&&t&&this.setState({tooltipOpen:!1})}getBlockTitle(e,t){return t.broken?s.default.inject(s.default._t("ElementHeader.BROKEN","This element is of obsolete type {type}."),{type:t.obsoleteClassName}):e.title?e.title:s.default.inject(s.default._t("ElementHeader.NOTITLE","Untitled {type} block"),{type:t.title})}toggle(){this.setState((e=>({tooltipOpen:!e.tooltipOpen})))}renderVersionedStateMessage(){const{element:{isLiveVersion:e,isPublished:t}}=this.props;if(t&&e)return null;let n="";const o=["element-editor-header__version-state"];return t?e||(n=s.default._t("ElementHeader.STATE_MODIFIED","Item has unpublished changes"),o.push("element-editor-header__version-state--modified")):(n=s.default._t("ElementHeader.STATE_DRAFT","Item has not been published yet"),o.push("element-editor-header__version-state--draft")),r.default.createElement("span",{className:(0,c.default)(o),title:n})}renderStatusFlagBadges(){const e=this.props.element.statusFlags;if(!e)return null;const t=[];for(let[n,o]of Object.entries(e))n=`badge status-${n}`,"string"==typeof o&&(o={text:o}),o.title||(o.title=""),t.push(r.default.createElement("span",{key:n,className:n,title:o.title},o.text));return t}render(){const{connectDragSource:e,element:t,type:n,areaId:o,previewExpanded:l,simple:i,disableTooltip:u,activeTab:d,expandable:f,ElementActionsComponent:p,handleEditTabsClick:m}=this.props,g=this.getBlockTitle(t,n),h=(0,c.default)({"element-editor-header__title":!0,"element-editor-header__title--none":!t.title}),b=s.default._t("ElementHeader.EXPAND","Show editable fields"),y=(0,c.default)("element-editor-header",{"element-editor-header--simple":i}),E=(0,c.default)("element-editor-header__icon-container",{"element-editor-header__icon-container--broken":n.broken}),v=(0,c.default)("element-editor-header__expand",{"font-icon-right-open-big":!f,"font-icon-up-open-big":f&&l,"font-icon-down-open-big":f&&!l}),_=`element-icon-${t.id}`,O=r.default.createElement("div",{className:y},r.default.createElement("div",{className:"element-editor-header__drag-handle"},r.default.createElement("i",{className:"font-icon-drag-handle"})),r.default.createElement("div",{className:"element-editor-header__info"},r.default.createElement("div",{className:E},r.default.createElement("i",{className:n.icon,id:_}),this.renderVersionedStateMessage(),!n.broken&&!i&&r.default.createElement(a.Tooltip,{placement:"top",isOpen:this.state.tooltipOpen&&!u,target:_,toggle:this.toggle},n.title)),r.default.createElement("h3",{className:h},g),this.renderStatusFlagBadges()),!i&&r.default.createElement("div",{className:"element-editor-header__actions"},r.default.createElement("div",{role:"none",onClick:e=>e.stopPropagation()},r.default.createElement(p,{element:t,type:n,areaId:o,activeTab:d,editTabs:n.editTabs,handleEditTabsClick:m,expandable:f})),!n.broken&&r.default.createElement("i",{className:v,title:b})));return l?e(O):O}}t.Component=b,b.propTypes={element:l.elementType.isRequired,type:i.elementTypeType.isRequired,areaId:o.default.number,activeTab:o.default.string,simple:o.default.bool,ElementActionsComponent:o.default.elementType,previewExpanded:o.default.bool,disableTooltip:o.default.bool,connectDragSource:o.default.func.isRequired,connectDragPreview:o.default.func.isRequired,onDragEnd:o.default.func},b.defaultProps={expandable:!0};t.default=(0,u.compose)((0,f.DragSource)("element",p.elementDragSource,(e=>({connectDragSource:e.dragSource(),connectDragPreview:e.dragPreview()}))),(0,d.inject)(["ElementActions"],(e=>({ElementActionsComponent:e})),(()=>"ElementEditor.ElementList.Element")))(b)},8953:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=u(n(6935)),a=n(5207),l=n(9791),i=u(n(5815));function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}const s=(0,u(n(7577)).default)("element-editor__hover-bar");function c(e){let{AddElementPopoverComponent:t,elementTypes:n,elementId:o,areaId:a,popoverOpen:l,onToggle:u}=e;const d=`${s("-line")} font-icon-plus-circled`,c=i.default._t("ElementAddNewButton.ADD_BLOCK","Add block"),f={className:s("-area",{"-area--focus":l}),onClick:u,"aria-label":c,title:c,id:`AddBlockHoverBarArea_${a}_${o}`};return r.default.createElement("div",{className:s(""),id:`AddBlockHoverBar_${a}_${o}`},r.default.createElement("button",f,r.default.createElement("span",{className:s("-area-inner")},r.default.createElement("span",{className:d}))),r.default.createElement(t,{placement:"bottom",target:`AddBlockHoverBarArea_${a}_${o}`,isOpen:l,elementTypes:n,toggle:u,container:`#AddBlockHoverBar_${a}_${o}`,areaId:a,insertAfterElement:o}))}class f extends r.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={popoverOpen:!1}}toggle(){this.setState((e=>({popoverOpen:!e.popoverOpen})))}render(){const e={...this.state,...this.props,onToggle:this.toggle};return r.default.createElement(c,e)}}t.Component=f,f.propTypes={elementTypes:o.default.arrayOf(l.elementTypeType).isRequired,elementId:o.default.oneOfType([o.default.string,o.default.number]).isRequired,areaId:o.default.oneOfType([o.default.number,o.default.string]).isRequired};t.default=(0,a.inject)(["AddElementPopover"],(e=>({AddElementPopoverComponent:e})),(()=>"ElementEditor.ElementList.HoverBar"))(f)},7333:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=c(n(6935)),a=c(n(6923)),l=c(n(55)),i=n(7785),u=c(n(5815)),d=n(2153),s=n(9040);function c(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t.match(/PageElements_[0-9]+_Title/)&&(r=e[t])})),n().then((e=>this.props.onFormSchemaSubmitResponse(e,r)))}render(){const{elementId:e,extraClass:t,onClick:n,onFormInit:o,formHasState:u,notVisible:d}=this.props,{loadingError:s}=this.state,c=(0,a.default)("element-editor-editform",t),f={formTag:"form",schemaUrl:(0,i.loadElementSchemaValue)("schemaUrl",e),identifier:"element",refetchSchemaOnMount:!u,onLoadingError:this.handleLoadingError,onSubmit:this.handleSubmit};s&&(f.loading=!1),"function"==typeof o&&(f.onReduxFormInit=o);const m={};return d&&(m["aria-hidden"]="true"),r.default.createElement("div",p({className:c,onClick:n,role:"presentation"},m),r.default.createElement(l.default,f))}}m.propTypes={extraClass:o.default.oneOfType([o.default.string,o.default.object]),onClick:o.default.func,elementId:o.default.string,handleLoadingError:o.default.func,onFormSchemaSubmitResponse:o.default.func,notVisible:o.default.bool};t.default=(0,s.connect)((function(e,t){const n=(0,d.loadElementFormStateName)(t.elementId);return{formHasState:e.form.formState&&e.form.formState.element&&!!e.form.formState.element[n]}}))(m)},7660:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=i(n(6935)),a=i(n(6923)),l=i(n(5815));function i(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}class d extends r.PureComponent{render(){const{fileUrl:e,fileTitle:t,content:n,broken:o}=this.props,i=l.default._t("ElementSummary.NO_PREVIEW","No preview available"),u=(0,a.default)("element-editor-summary__content",{"element-editor-summary__content--broken":o});return r.default.createElement("div",{className:"element-editor-summary"},e&&r.default.createElement("img",{className:"element-editor-summary__thumbnail-image",src:e,alt:t}),(n||!e)&&r.default.createElement("p",{className:u},n||i))}}d.defaultProps={},d.propTypes={content:o.default.string,fileUrl:o.default.string,fileTitle:o.default.string,broken:o.default.bool};t.default=d},5563:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),a=(r=n(6935))&&r.__esModule?r:{default:r},l=n(5207),i=n(9791),u=n(1820);function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}class s extends o.PureComponent{render(){const{AddNewButtonComponent:e,elementTypes:t,areaId:n,connectDropTarget:r}=this.props;return r(o.default.createElement("div",{className:"element-editor__toolbar"},o.default.createElement(e,{elementTypes:t,areaId:n})))}}s.defaultProps={},s.propTypes={elementTypes:a.default.arrayOf(i.elementTypeType).isRequired,areaId:a.default.number.isRequired,AddNewButtonComponent:a.default.elementType.isRequired,connectDropTarget:a.default.func.isRequired,onDragOver:a.default.func,onDragDrop:a.default.func};const c={hover(e){const{onDragOver:t}=e;t&&t()}};t.default=(0,u.DropTarget)("element",c,(e=>({connectDropTarget:e.dropTarget()})))((0,l.inject)(["ElementAddNewButton"],(e=>({AddNewButtonComponent:e})),(()=>"ElementEditor.ElementToolbar"))(s))},2977:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(1594)),o=l(n(5815)),a=l(n(6923));function l(e){return e&&e.__esModule?e:{default:e}}t.default=e=>class extends e{getClassName(){const e=[super.getClassName()];return this.props.data.ElementID&&e.unshift("elemental-area__element--historic-inner"),(0,a.default)(e)}render(){const e=this.getLegend(),t=this.props.data.tag||"div",n=this.getClassName(),{data:a}=this.props;return a.ElementID?r.default.createElement(t,{className:n},e,r.default.createElement("div",{className:"elemental-preview elemental-preview--historic"},a.ElementEditLink&&r.default.createElement("a",{className:"elemental-preview__link",href:a.ElementEditLink},r.default.createElement("span",{className:"elemental-preview__link-text"},o.default._t("HistoricElementView.VIEW_BLOCK_HISTORY","Block history")),r.default.createElement("i",{className:"font-icon-angle-right btn--icon-lg elemental-preview__link-caret"})),r.default.createElement("div",{className:"elemental-preview__icon"},r.default.createElement("i",{className:a.ElementIcon})),r.default.createElement("div",{className:"elemental-preview__detail"},r.default.createElement("h3",null,a.ElementTitle," ",r.default.createElement("small",null,a.ElementType)))),this.props.children):super.render()}}},6573:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(1594)),o=n(3556),a=l(n(2623));function l(e){return e&&e.__esModule?e:{default:e}}t.default=(0,a.default)((e=>{const{children:t}=e,n=r.default.Children.toArray(r.default.Children.map(t,((t,n)=>{const o={};return 0===n?(o.id=e.id,o.title=null):1===n&&(o.noHolder=!0),r.default.cloneElement(t,o)})));return e.readOnly?r.default.createElement("div",{className:"text-checkbox-group-field--read-only"},n):1===n.length?n[0]:r.default.createElement(o.InputGroup,{className:"text-checkbox-group-field"},n[0],r.default.createElement(o.InputGroupAddon,{addonType:"append"},r.default.createElement(o.InputGroupText,null,n[1])))}))},51:function(e,t,n){var r=d(n(1669)),o=d(n(1594)),a=n(5145),l=n(5207),i=n(1135),u=n(5381);function d(e){return e&&e.__esModule?e:{default:e}}const s=()=>{setTimeout((()=>{const{store:e}=window.ss;e&&e.dispatch((0,u.destroy)(...Object.keys(e.getState().form.formState.element||{}).map((e=>`element.${e}`))))}),0)};r.default.entwine("ss",(e=>{e(".js-injector-boot .element-editor__container").entwine({ReactRoot:null,AreaIDsSharedObject:{},Increment:0,onmatch(){const e=(0,l.loadComponent)("ElementEditor",{}),t=this.data("schema"),n=(0,i.getConfig)().elementTypes,r=t["elemental-area-id"],u=this.getAreaIDsSharedObject();u.hasOwnProperty(r)||(u[r]={entwineResolve:null,setIncrement:null,setSaveAllElements:null});const d={areaId:r,allowedElements:t["allowed-elements"],elementTypes:n,sharedObject:u[r]};let s=this.getReactRoot();s||(s=(0,a.createRoot)(this[0]),this.setReactRoot(s)),s.render(o.default.createElement(e,d))},onunmatch(){e(".cms-edit-form").data("hasValidationErrors")||s(),this.unmountComponent()},unmountComponent(){const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))},"from .cms-edit-form":{onbeforesubmitform(e,t){if(!t||this.is(".elemental-area--read-only"))return;let n;const r=new Promise((e=>{n=e}));t.promises.push(r),t.onAjaxSuccessCallbacks.push(this.unmountComponent.bind(this));const o=this.data("schema")["elemental-area-id"],a=this.getAreaIDsSharedObject()[o],l=this.getIncrement()+1;this.setIncrement(l),a.entwineResolve=n,a.setIncrement(l),a.setSaveAllElements(!0)},onaftersubmitform(t,n){const r=JSON.parse(n.xhr.responseText).ValidationResult;JSON.parse(r.replace(/<\/?script[^>]*?>/g,"")).isValid?(e(".cms-edit-form").data("hasValidationErrors",!1),s()):e(".cms-edit-form").data("hasValidationErrors",!0)}}}),e(".js-injector-boot .element-editor__container .element-form-dirty-state").entwine({onmatch(){e(".cms-edit-form").trigger("change")},onunmatch(){e(".cms-edit-form").trigger("change")}}),e(".cms-edit-form").entwine({getChangeTrackerOptions(){const t=void 0===this.entwineData("ChangeTrackerOptions");let n=this._super();return t&&(n=e.extend({},n),n.ignoreFieldSelector+=", .elementalarea :input:not(.element-form-dirty-state)",this.setChangeTrackerOptions(n)),n}})}))},9306:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.isOverTop=t.getDragIndicatorIndex=t.elementDragSource=void 0;var r=n(4518);t.isOverTop=(e,t)=>{const n=e.getClientOffset(),o=(0,r.findDOMNode)(t).getBoundingClientRect();return n.y{if(null===t||!n)return null;let o=t?e.findIndex((e=>e===t)):0;const a=e.findIndex((e=>e===n));return"bottom"===r&&(o+=1),a===o||a+1===o?null:o};t.elementDragSource={beginDrag(e){return e.element},endDrag(e,t){const{onDragEnd:n}=e,r=t.getDropResult();if(!n||!r||!r.dropAfterID)return;const o=t.getItem().id,{dropAfterID:a}=r;o!==a&&n(o,a)}}},7577:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(6923))&&r.__esModule?r:{default:r};t.default=e=>function(){const t=t=>`${e}${t}`;for(var n=arguments.length,r=new Array(n),a=0;a!(!e&&""!==e)&&("object"==typeof e?Array.isArray(e)?e.map(t):Object.entries(e).reduce(((e,n)=>{let[r,o]=n;return Object.assign({},e,{[t(r)]:o})}),{}):t(e))));return(0,o.default)(...l)}},1135:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getElementTypeConfig=t.getConfig=void 0;var r,o=(r=n(6177))&&r.__esModule?r:{default:r};const a=()=>o.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController");t.getConfig=a;t.getElementTypeConfig=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=e.blockSchema.typeName;let r=(Array.isArray(t)?t:a().elementTypes).find((e=>e.class===n||e.name===n));return e.obsoleteClassName&&(r=Object.assign({obsoleteClassName:e.obsoleteClassName},r),Object.preventExtensions(r)),r}},2153:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.loadElementFormStateName=void 0;var r,o=(r=n(6177))&&r.__esModule?r:{default:r};t.loadElementFormStateName=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=o.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController").form.elementForm.formNameTemplate;return e?t.replace("{id}",e):t}},7785:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.loadElementSchemaValue=void 0;var r,o=(r=n(6177))&&r.__esModule?r:{default:r};t.loadElementSchemaValue=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=o.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController").form.elementForm[e]||"";return t?`${n}/${t}`:n}},3337:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(1594)),o=i(n(5609)),a=n(1135),l=i(n(6177));function i(e){return e&&e.__esModule?e:{default:e}}t.default=e=>t=>{const n={...t};return n.hasOwnProperty("actions")||(n.actions={}),n.actions.revertToVersion=(e,t,n,r)=>{const i=`${(0,a.getConfig)().controllerLink.replace(/\/$/,"")}/api/revert`;return o.default.post(i,{id:e,fromVersion:t,fromStage:n,toStage:r},{"X-SecurityID":l.default.get("SecurityID")})},r.default.createElement(e,n)}},455:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.elementType=void 0;var r,o=(r=n(6935))&&r.__esModule?r:{default:r};t.elementType=o.default.shape({id:o.default.number,title:o.default.string,blockSchema:o.default.object,inlineEditable:o.default.bool,published:o.default.bool,liveVersion:o.default.bool,version:o.default.number})},9791:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.elementTypeType=void 0;var r,o=(r=n(6935))&&r.__esModule?r:{default:r};t.elementTypeType=o.default.shape({name:o.default.string,title:o.default.string,icon:o.default.string,inlineEditable:o.default.bool,editTabs:o.default.arrayOf(o.default.shape({title:o.default.string,name:o.default.string})),config:o.default.object})},5609:function(e){e.exports=Backend},6177:function(e){e.exports=Config},2623:function(e){e.exports=FieldHolder},55:function(e){e.exports=FormBuilderLoader},5207:function(e){e.exports=Injector},6935:function(e){e.exports=PropTypes},1594:function(e){e.exports=React},1820:function(e){e.exports=ReactDND},8724:function(e){e.exports=ReactDNDHtml5Backend},4518:function(e){e.exports=ReactDom},5145:function(e){e.exports=ReactDomClient},9040:function(e){e.exports=ReactRedux},3556:function(e){e.exports=Reactstrap},9367:function(e){e.exports=Redux},5381:function(e){e.exports=ReduxForm},5034:function(e){e.exports=TabsActions},8918:function(e){e.exports=ToastsActions},9077:function(e){e.exports=UnsavedFormsActions},6923:function(e){e.exports=classnames},4014:function(e){e.exports=getJsonErrorMessage},5815:function(e){e.exports=i18n},1669:function(e){e.exports=jQuery},5799:function(e){e.exports=withDragDropContext}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n(51),n(2038)}(); \ No newline at end of file +!function(){"use strict";var e={6733:function(e,t,n){n.r(t),n.d(t,{AutoScrollActivator:function(){return we},DndContext:function(){return Je},DragOverlay:function(){return vt},KeyboardCode:function(){return ae},KeyboardSensor:function(){return ce},MeasuringFrequency:function(){return Se},MeasuringStrategy:function(){return xe},MouseSensor:function(){return be},PointerSensor:function(){return ge},TouchSensor:function(){return Ee},TraversalOrder:function(){return Ce},applyModifiers:function(){return Xe},closestCenter:function(){return D},closestCorners:function(){return T},defaultAnnouncements:function(){return p},defaultCoordinates:function(){return y},defaultDropAnimation:function(){return pt},defaultDropAnimationSideEffects:function(){return ft},defaultKeyboardCoordinateGetter:function(){return ue},defaultScreenReaderInstructions:function(){return f},getClientRect:function(){return F},getFirstCollision:function(){return x},getScrollableAncestors:function(){return B},pointerWithin:function(){return P},rectIntersection:function(){return M},useDndContext:function(){return nt},useDndMonitor:function(){return d},useDraggable:function(){return tt},useDroppable:function(){return at},useSensor:function(){return v},useSensors:function(){return b}});var r=n(1594),o=n.n(r),a=ReactDom,i=n(4979);const l={display:"none"};function s(e){let{id:t,value:n}=e;return o().createElement("div",{id:t,style:l},n)}function u(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return o().createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const c=(0,r.createContext)(null);function d(e){const t=(0,r.useContext)(c);(0,r.useEffect)((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)}),[e,t])}const f={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},p={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function m(e){let{announcements:t=p,container:n,hiddenTextDescribedById:l,screenReaderInstructions:c=f}=e;const{announce:m,announcement:g}=function(){const[e,t]=(0,r.useState)("");return{announce:(0,r.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),h=(0,i.useUniqueId)("DndLiveRegion"),[v,b]=(0,r.useState)(!1);if((0,r.useEffect)((()=>{b(!0)}),[]),d((0,r.useMemo)((()=>({onDragStart(e){let{active:n}=e;m(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&m(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;m(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;m(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;m(t.onDragCancel({active:n,over:r}))}})),[m,t])),!v)return null;const y=o().createElement(o().Fragment,null,o().createElement(s,{id:l,value:c.draggable}),o().createElement(u,{id:h,announcement:g}));return n?(0,a.createPortal)(y,n):y}var g;function h(){}function v(e,t){return(0,r.useMemo)((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}function b(){for(var e=arguments.length,t=new Array(e),n=0;n[...t].filter((e=>null!=e))),[...t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(g||(g={}));const y=Object.freeze({x:0,y:0});function E(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function w(e,t){const n=(0,i.getEventCoordinates)(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function C(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function _(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function O(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function x(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function S(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const D=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=S(t,t.left,t.top),a=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=E(S(r),o);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(C)},T=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=O(t),a=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=O(r),i=o.reduce(((e,t,r)=>e+E(n[r],t)),0),l=Number((i/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:l}})}}return a.sort(C)};function R(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),i=o-r,l=a-n;if(r{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,a=n.get(r);if(a){const n=R(a,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(_)};function k(e,t){const{top:n,left:r,bottom:o,right:a}=t;return n<=e.y&&e.y<=o&&r<=e.x&&e.x<=a}const P=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const o=[];for(const e of t){const{id:t}=e,a=n.get(t);if(a&&k(r,a)){const n=O(a).reduce(((e,t)=>e+E(r,t)),0),i=Number((n/4).toFixed(4));o.push({id:t,data:{droppableContainer:e,value:i}})}}return o.sort(C)};function I(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:y}function N(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const A=N(1);function j(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const L={ignoreTransform:!1};function F(e,t){void 0===t&&(t=L);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=(0,i.getWindow)(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=j(t);if(!r)return e;const{scaleX:o,scaleY:a,x:i,y:l}=r,s=e.left-i-(1-o)*parseFloat(n),u=e.top-l-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),c=o?e.width/o:e.width,d=a?e.height/a:e.height;return{width:c,height:d,top:u,right:s+c,bottom:u+d,left:s}}(n,t,r))}const{top:r,left:o,width:a,height:l,bottom:s,right:u}=n;return{top:r,left:o,width:a,height:l,bottom:s,right:u}}function W(e){return F(e,{ignoreTransform:!0})}function B(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if((0,i.isDocument)(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!(0,i.isHTMLElement)(o)||(0,i.isSVGElement)(o))return n;if(n.includes(o))return n;const a=(0,i.getWindow)(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=(0,i.getWindow)(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,a)&&n.push(o),function(e,t){return void 0===t&&(t=(0,i.getWindow)(e).getComputedStyle(e)),"fixed"===t.position}(o,a)?n:r(o.parentNode)}(e):n}function U(e){const[t]=B(e,1);return null!=t?t:null}function H(e){return i.canUseDOM&&e?(0,i.isWindow)(e)?e:(0,i.isNode)(e)?(0,i.isDocument)(e)||e===(0,i.getOwnerDocument)(e).scrollingElement?window:(0,i.isHTMLElement)(e)?e:null:null:null}function V(e){return(0,i.isWindow)(e)?e.scrollX:e.scrollLeft}function q(e){return(0,i.isWindow)(e)?e.scrollY:e.scrollTop}function $(e){return{x:V(e),y:q(e)}}var K;function z(e){return!(!i.canUseDOM||!e)&&e===document.scrollingElement}function X(e){const t={x:0,y:0},n=z(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(K||(K={}));const Y={x:.2,y:.2};function G(e,t,n,r,o){let{top:a,left:i,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=Y);const{isTop:u,isBottom:c,isLeft:d,isRight:f}=X(e),p={x:0,y:0},m={x:0,y:0},g=t.height*o.y,h=t.width*o.x;return!u&&a<=t.top+g?(p.y=K.Backward,m.y=r*Math.abs((t.top+g-a)/g)):!c&&s>=t.bottom-g&&(p.y=K.Forward,m.y=r*Math.abs((t.bottom-g-s)/g)),!f&&l>=t.right-h?(p.x=K.Forward,m.x=r*Math.abs((t.right-h-l)/h)):!d&&i<=t.left+h&&(p.x=K.Backward,m.x=r*Math.abs((t.left+h-i)/h)),{direction:p,speed:m}}function J(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Q(e){return e.reduce(((e,t)=>(0,i.add)(e,$(t))),y)}function Z(e,t){if(void 0===t&&(t=F),!e)return;const{top:n,left:r,bottom:o,right:a}=t(e);U(e)&&(o<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ee=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+V(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+q(t)),0)}]];class te{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=B(t),r=Q(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of ee)for(const a of t)Object.defineProperty(this,a,{get:()=>{const t=o(n),i=r[e]-t;return this.rect[a]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ne{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function re(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var oe,ae;function ie(e){e.preventDefault()}function le(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(oe||(oe={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(ae||(ae={}));const se={start:[ae.Space,ae.Enter],cancel:[ae.Esc],end:[ae.Space,ae.Enter,ae.Tab]},ue=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ae.Right:return{...n,x:n.x+25};case ae.Left:return{...n,x:n.x-25};case ae.Down:return{...n,y:n.y+25};case ae.Up:return{...n,y:n.y-25}}};class ce{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ne((0,i.getOwnerDocument)(t)),this.windowListeners=new ne((0,i.getWindow)(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(oe.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Z(n),t(y)}handleKeyDown(e){if((0,i.isKeyboardEvent)(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=se,coordinateGetter:a=ue,scrollBehavior:l="smooth"}=r,{code:s}=e;if(o.end.includes(s))return void this.handleEnd(e);if(o.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:u}=n.current,c=u?{x:u.left,y:u.top}:y;this.referenceCoordinates||(this.referenceCoordinates=c);const d=a(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=(0,i.subtract)(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:a,isRight:i,isLeft:s,isBottom:u,maxScroll:c,minScroll:f}=X(n),p=J(n),m={x:Math.min(o===ae.Right?p.right-p.width/2:p.right,Math.max(o===ae.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(o===ae.Down?p.bottom-p.height/2:p.bottom,Math.max(o===ae.Down?p.top:p.top+p.height/2,d.y))},g=o===ae.Right&&!i||o===ae.Left&&!s,h=o===ae.Down&&!u||o===ae.Up&&!a;if(g&&m.x!==d.x){const e=n.scrollLeft+t.x,a=o===ae.Right&&e<=c.x||o===ae.Left&&e>=f.x;if(a&&!t.y)return void n.scrollTo({left:e,behavior:l});r.x=a?n.scrollLeft-e:o===ae.Right?n.scrollLeft-c.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:l});break}if(h&&m.y!==d.y){const e=n.scrollTop+t.y,a=o===ae.Down&&e<=c.y||o===ae.Up&&e>=f.y;if(a&&!t.x)return void n.scrollTo({top:e,behavior:l});r.y=a?n.scrollTop-e:o===ae.Down?n.scrollTop-c.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:l});break}}this.handleMove(e,(0,i.add)((0,i.subtract)(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function de(e){return Boolean(e&&"distance"in e)}function fe(e){return Boolean(e&&"delay"in e)}ce.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=se,onActivation:o}=t,{active:a}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const t=a.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class pe{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=(0,i.getWindow)(e);return e instanceof t?e:(0,i.getOwnerDocument)(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:a}=o;this.props=e,this.events=t,this.document=(0,i.getOwnerDocument)(a),this.documentListeners=new ne(this.document),this.listeners=new ne(n),this.windowListeners=new ne((0,i.getWindow)(a)),this.initialCoordinates=null!=(r=(0,i.getEventCoordinates)(o))?r:y,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.DragStart,ie),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),this.windowListeners.add(oe.ContextMenu,ie),this.documentListeners.add(oe.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(fe(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(de(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(oe.Click,le,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oe.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:a,options:{activationConstraint:l}}=o;if(!r)return;const s=null!=(t=(0,i.getEventCoordinates)(e))?t:y,u=(0,i.subtract)(r,s);if(!n&&l){if(de(l)){if(null!=l.tolerance&&re(u,l.tolerance))return this.handleCancel();if(re(u,l.distance))return this.handleStart()}return fe(l)&&re(u,l.tolerance)?this.handleCancel():void this.handlePending(l,u)}e.cancelable&&e.preventDefault(),a(s)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===ae.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const me={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ge extends pe{constructor(e){const{event:t}=e,n=(0,i.getOwnerDocument)(t.target);super(e,me,n)}}ge.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const he={move:{name:"mousemove"},end:{name:"mouseup"}};var ve;!function(e){e[e.RightClick=2]="RightClick"}(ve||(ve={}));class be extends pe{constructor(e){super(e,he,(0,i.getOwnerDocument)(e.event.target))}}be.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==ve.RightClick&&(null==r||r({event:n}),!0)}}];const ye={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Ee extends pe{constructor(e){super(e,ye)}static setup(){return window.addEventListener(ye.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ye.move.name,e)};function e(){}}}var we,Ce;function _e(e){let{acceleration:t,activator:n=we.Pointer,canScroll:o,draggingRect:a,enabled:l,interval:s=5,order:u=Ce.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:f,delta:p,threshold:m}=e;const g=function(e){let{delta:t,disabled:n}=e;const r=(0,i.usePrevious)(t);return(0,i.useLazyMemo)((e=>{if(n||!r||!e)return Oe;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[K.Backward]:e.x[K.Backward]||-1===o.x,[K.Forward]:e.x[K.Forward]||1===o.x},y:{[K.Backward]:e.y[K.Backward]||-1===o.y,[K.Forward]:e.y[K.Forward]||1===o.y}}}),[n,t,r])}({delta:p,disabled:!l}),[h,v]=(0,i.useInterval)(),b=(0,r.useRef)({x:0,y:0}),y=(0,r.useRef)({x:0,y:0}),E=(0,r.useMemo)((()=>{switch(n){case we.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case we.DraggableRect:return a}}),[n,a,c]),w=(0,r.useRef)(null),C=(0,r.useCallback)((()=>{const e=w.current;if(!e)return;const t=b.current.x*y.current.x,n=b.current.y*y.current.y;e.scrollBy(t,n)}),[]),_=(0,r.useMemo)((()=>u===Ce.TreeOrder?[...d].reverse():d),[u,d]);(0,r.useEffect)((()=>{if(l&&d.length&&E){for(const e of _){if(!1===(null==o?void 0:o(e)))continue;const n=d.indexOf(e),r=f[n];if(!r)continue;const{direction:a,speed:i}=G(e,r,E,t,m);for(const e of["x","y"])g[e][a[e]]||(i[e]=0,a[e]=0);if(i.x>0||i.y>0)return v(),w.current=e,h(C,s),b.current=i,void(y.current=a)}b.current={x:0,y:0},y.current={x:0,y:0},v()}else v()}),[t,C,o,v,l,s,JSON.stringify(E),JSON.stringify(g),h,d,_,f,JSON.stringify(m)])}Ee.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(we||(we={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Ce||(Ce={}));const Oe={x:{[K.Backward]:!1,[K.Forward]:!1},y:{[K.Backward]:!1,[K.Forward]:!1}};var xe,Se;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(xe||(xe={})),function(e){e.Optimized="optimized"}(Se||(Se={}));const De=new Map;function Te(e,t){return(0,i.useLazyMemo)((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function Re(e){let{callback:t,disabled:n}=e;const o=(0,i.useEvent)(t),a=(0,r.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)}),[n]);return(0,r.useEffect)((()=>()=>null==a?void 0:a.disconnect()),[a]),a}function Me(e){return new te(F(e),e)}function ke(e,t,n){void 0===t&&(t=Me);const[o,a]=(0,r.useState)(null);function l(){a((r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const a=t(e);return JSON.stringify(r)===JSON.stringify(a)?r:a}))}const s=function(e){let{callback:t,disabled:n}=e;const o=(0,i.useEvent)(t),a=(0,r.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)}),[o,n]);return(0,r.useEffect)((()=>()=>null==a?void 0:a.disconnect()),[a]),a}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){l();break}}}}),u=Re({callback:l});return(0,i.useIsomorphicLayoutEffect)((()=>{l(),e?(null==u||u.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==u||u.disconnect(),null==s||s.disconnect())}),[e]),o}const Pe=[];function Ie(e,t){void 0===t&&(t=[]);const n=(0,r.useRef)(null);return(0,r.useEffect)((()=>{n.current=null}),t),(0,r.useEffect)((()=>{const t=e!==y;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?(0,i.subtract)(e,n.current):y}function Ne(e){return(0,r.useMemo)((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const Ae=[];function je(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return(0,i.isHTMLElement)(t)?t:e}const Le=[{sensor:ge,options:{}},{sensor:ce,options:{}}],Fe={current:{}},We={draggable:{measure:W},droppable:{measure:W,strategy:xe.WhileDragging,frequency:Se.Optimized},dragOverlay:{measure:F}};class Be extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Ue={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Be,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:h},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:We,measureDroppableContainers:h,windowRect:null,measuringScheduled:!1},He={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:h,draggableNodes:new Map,over:null,measureDroppableContainers:h},Ve=(0,r.createContext)(He),qe=(0,r.createContext)(Ue);function $e(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Be}}}function Ke(e,t){switch(t.type){case g.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case g.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case g.DragEnd:case g.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case g.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Be(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case g.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const i=new Be(e.droppable.containers);return i.set(n,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case g.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new Be(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function ze(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:a}=(0,r.useContext)(Ve),l=(0,i.usePrevious)(o),s=(0,i.usePrevious)(null==n?void 0:n.id);return(0,r.useEffect)((()=>{if(!t&&!o&&l&&null!=s){if(!(0,i.isKeyboardEvent)(l))return;if(document.activeElement===l.target)return;const e=a.get(s);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=(0,i.findFirstFocusableNode)(e);if(t){t.focus();break}}}))}}),[o,t,a,s,l]),null}function Xe(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}const Ye=(0,r.createContext)({...y,scaleX:1,scaleY:1});var Ge;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Ge||(Ge={}));const Je=(0,r.memo)((function(e){var t,n,l,s;let{id:u,accessibility:d,autoScroll:f=!0,children:p,sensors:h=Le,collisionDetection:v=M,measuring:b,modifiers:E,...w}=e;const C=(0,r.useReducer)(Ke,void 0,$e),[_,O]=C,[S,D]=function(){const[e]=(0,r.useState)((()=>new Set)),t=(0,r.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]);return[(0,r.useCallback)((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]),t]}(),[T,R]=(0,r.useState)(Ge.Uninitialized),k=T===Ge.Initialized,{draggable:{active:P,nodes:N,translate:j},droppable:{containers:L}}=_,W=null!=P?N.get(P):null,V=(0,r.useRef)({initial:null,translated:null}),q=(0,r.useMemo)((()=>{var e;return null!=P?{id:P,data:null!=(e=null==W?void 0:W.data)?e:Fe,rect:V}:null}),[P,W]),K=(0,r.useRef)(null),[X,Y]=(0,r.useState)(null),[G,J]=(0,r.useState)(null),Z=(0,i.useLatestValue)(w,Object.values(w)),ee=(0,i.useUniqueId)("DndDescribedBy",u),ne=(0,r.useMemo)((()=>L.getEnabled()),[L]),re=(oe=b,(0,r.useMemo)((()=>({draggable:{...We.draggable,...null==oe?void 0:oe.draggable},droppable:{...We.droppable,...null==oe?void 0:oe.droppable},dragOverlay:{...We.dragOverlay,...null==oe?void 0:oe.dragOverlay}})),[null==oe?void 0:oe.draggable,null==oe?void 0:oe.droppable,null==oe?void 0:oe.dragOverlay]));var oe;const{droppableRects:ae,measureDroppableContainers:ie,measuringScheduled:le}=function(e,t){let{dragging:n,dependencies:o,config:a}=t;const[l,s]=(0,r.useState)(null),{frequency:u,measure:c,strategy:d}=a,f=(0,r.useRef)(e),p=function(){switch(d){case xe.Always:return!1;case xe.BeforeDragging:return n;default:return!n}}(),m=(0,i.useLatestValue)(p),g=(0,r.useCallback)((function(e){void 0===e&&(e=[]),m.current||s((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[m]),h=(0,r.useRef)(null),v=(0,i.useLazyMemo)((t=>{if(p&&!n)return De;if(!t||t===De||f.current!==e||null!=l){const t=new Map;for(let n of e){if(!n)continue;if(l&&l.length>0&&!l.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new te(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,l,n,p,c]);return(0,r.useEffect)((()=>{f.current=e}),[e]),(0,r.useEffect)((()=>{p||g()}),[n,p]),(0,r.useEffect)((()=>{l&&l.length>0&&s(null)}),[JSON.stringify(l)]),(0,r.useEffect)((()=>{p||"number"!=typeof u||null!==h.current||(h.current=setTimeout((()=>{g(),h.current=null}),u))}),[u,p,g,...o]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:null!=l}}(ne,{dragging:k,dependencies:[j.x,j.y],config:re.droppable}),se=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return(0,i.useLazyMemo)((e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(N,P),ue=(0,r.useMemo)((()=>G?(0,i.getEventCoordinates)(G):null),[G]),ce=function(){const e=!1===(null==X?void 0:X.autoScrollEnabled),t="object"==typeof f?!1===f.enabled:!1===f,n=k&&!e&&!t;if("object"==typeof f)return{...f,enabled:n};return{enabled:n}}(),de=function(e,t){return Te(e,t)}(se,re.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:a=!0}=e;const l=(0,r.useRef)(!1),{x:s,y:u}="boolean"==typeof a?{x:a,y:a}:a;(0,i.useIsomorphicLayoutEffect)((()=>{if(!s&&!u||!t)return void(l.current=!1);if(l.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=I(n(e),o);if(s||(r.x=0),u||(r.y=0),l.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=U(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,s,u,o,n])}({activeNode:null!=P?N.get(P):null,config:ce.layoutShiftCompensation,initialRect:de,measure:re.draggable.measure});const fe=ke(se,re.draggable.measure,de),pe=ke(se?se.parentElement:null),me=(0,r.useRef)({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:ae,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ge=L.getNodeFor(null==(t=me.current.over)?void 0:t.id),he=function(e){let{measure:t}=e;const[n,o]=(0,r.useState)(null),a=Re({callback:(0,r.useCallback)((e=>{for(const{target:n}of e)if((0,i.isHTMLElement)(n)){o((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t])}),l=(0,r.useCallback)((e=>{const n=je(e);null==a||a.disconnect(),n&&(null==a||a.observe(n)),o(n?t(n):null)}),[t,a]),[s,u]=(0,i.useNodeRef)(l);return(0,r.useMemo)((()=>({nodeRef:s,rect:n,setRef:u})),[n,s,u])}({measure:re.dragOverlay.measure}),ve=null!=(n=he.nodeRef.current)?n:se,be=k?null!=(l=he.rect)?l:fe:null,ye=Boolean(he.nodeRef.current&&he.rect),Ee=I(we=ye?null:fe,Te(we));var we;const Ce=Ne(ve?(0,i.getWindow)(ve):null),Oe=function(e){const t=(0,r.useRef)(e),n=(0,i.useLazyMemo)((n=>e?n&&n!==Pe&&e&&t.current&&e.parentNode===t.current.parentNode?n:B(e):Pe),[e]);return(0,r.useEffect)((()=>{t.current=e}),[e]),n}(k?null!=ge?ge:se:null),Se=function(e,t){void 0===t&&(t=F);const[n]=e,o=Ne(n?(0,i.getWindow)(n):null),[a,l]=(0,r.useState)(Ae);function s(){l((()=>e.length?e.map((e=>z(e)?o:new te(t(e),e))):Ae))}const u=Re({callback:s});return(0,i.useIsomorphicLayoutEffect)((()=>{null==u||u.disconnect(),s(),e.forEach((e=>null==u?void 0:u.observe(e)))}),[e]),a}(Oe),Me=Xe(E,{transform:{x:j.x-Ee.x,y:j.y-Ee.y,scaleX:1,scaleY:1},activatorEvent:G,active:q,activeNodeRect:fe,containerNodeRect:pe,draggingNodeRect:be,over:me.current.over,overlayNodeRect:he.rect,scrollableAncestors:Oe,scrollableAncestorRects:Se,windowRect:Ce}),Be=ue?(0,i.add)(ue,j):null,Ue=function(e){const[t,n]=(0,r.useState)(null),o=(0,r.useRef)(e),a=(0,r.useCallback)((e=>{const t=H(e.target);t&&n((e=>e?(e.set(t,$(t)),new Map(e)):null))}),[]);return(0,r.useEffect)((()=>{const t=o.current;if(e!==t){r(t);const i=e.map((e=>{const t=H(e);return t?(t.addEventListener("scroll",a,{passive:!0}),[t,$(t)]):null})).filter((e=>null!=e));n(i.length?new Map(i):null),o.current=e}return()=>{r(e),r(t)};function r(e){e.forEach((e=>{const t=H(e);null==t||t.removeEventListener("scroll",a)}))}}),[a,e]),(0,r.useMemo)((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>(0,i.add)(e,t)),y):Q(e):y),[e,t])}(Oe),He=Ie(Ue),Je=Ie(Ue,[fe]),Qe=(0,i.add)(Me,He),Ze=be?A(be,Me):null,et=q&&Ze?v({active:q,collisionRect:Ze,droppableRects:ae,droppableContainers:ne,pointerCoordinates:Be}):null,tt=x(et,"id"),[nt,rt]=(0,r.useState)(null),ot=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ye?Me:(0,i.add)(Me,Je),null!=(s=null==nt?void 0:nt.rect)?s:null,fe),at=(0,r.useRef)(null),it=(0,r.useCallback)(((e,t)=>{let{sensor:n,options:r}=t;if(null==K.current)return;const o=N.get(K.current);if(!o)return;const i=e.nativeEvent,l=new n({active:K.current,activeNode:o,event:i,options:r,context:me,onAbort(e){if(!N.get(e))return;const{onDragAbort:t}=Z.current,n={id:e};null==t||t(n),S({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!N.get(e))return;const{onDragPending:o}=Z.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(a),S({type:"onDragPending",event:a})},onStart(e){const t=K.current;if(null==t)return;const n=N.get(t);if(!n)return;const{onDragStart:r}=Z.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:V}};(0,a.unstable_batchedUpdates)((()=>{null==r||r(o),R(Ge.Initializing),O({type:g.DragStart,initialCoordinates:e,active:t}),S({type:"onDragStart",event:o}),Y(at.current),J(i)}))},onMove(e){O({type:g.DragMove,coordinates:e})},onEnd:s(g.DragEnd),onCancel:s(g.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=me.current;let l=null;if(t&&o){const{cancelDrop:a}=Z.current;if(l={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===g.DragEnd&&"function"==typeof a){await Promise.resolve(a(l))&&(e=g.DragCancel)}}K.current=null,(0,a.unstable_batchedUpdates)((()=>{O({type:e}),R(Ge.Uninitialized),rt(null),Y(null),J(null),at.current=null;const t=e===g.DragEnd?"onDragEnd":"onDragCancel";if(l){const e=Z.current[t];null==e||e(l),S({type:t,event:l})}}))}}at.current=l}),[N]),lt=(0,r.useCallback)(((e,t)=>(n,r)=>{const o=n.nativeEvent,a=N.get(r);if(null!==K.current||!a||o.dndKit||o.defaultPrevented)return;const i={active:a};!0===e(n,t.options,i)&&(o.dndKit={capturedBy:t.sensor},K.current=r,it(n,t))}),[N,it]),st=function(e,t){return(0,r.useMemo)((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(h,lt);!function(e){(0,r.useEffect)((()=>{if(!i.canUseDOM)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(h),(0,i.useIsomorphicLayoutEffect)((()=>{fe&&T===Ge.Initializing&&R(Ge.Initialized)}),[fe,T]),(0,r.useEffect)((()=>{const{onDragMove:e}=Z.current,{active:t,activatorEvent:n,collisions:r,over:o}=me.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:Qe.x,y:Qe.y},over:o};(0,a.unstable_batchedUpdates)((()=>{null==e||e(i),S({type:"onDragMove",event:i})}))}),[Qe.x,Qe.y]),(0,r.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=me.current;if(!e||null==K.current||!t||!o)return;const{onDragOver:i}=Z.current,l=r.get(tt),s=l&&l.rect.current?{id:l.id,rect:l.rect.current,data:l.data,disabled:l.disabled}:null,u={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:s};(0,a.unstable_batchedUpdates)((()=>{rt(s),null==i||i(u),S({type:"onDragOver",event:u})}))}),[tt]),(0,i.useIsomorphicLayoutEffect)((()=>{me.current={activatorEvent:G,active:q,activeNode:se,collisionRect:Ze,collisions:et,droppableRects:ae,draggableNodes:N,draggingNode:ve,draggingNodeRect:be,droppableContainers:L,over:nt,scrollableAncestors:Oe,scrollAdjustedTranslate:Qe},V.current={initial:be,translated:Ze}}),[q,se,et,Ze,N,ve,be,ae,L,nt,Oe,Qe]),_e({...ce,delta:j,draggingRect:Ze,pointerCoordinates:Be,scrollableAncestors:Oe,scrollableAncestorRects:Se});const ut=(0,r.useMemo)((()=>({active:q,activeNode:se,activeNodeRect:fe,activatorEvent:G,collisions:et,containerNodeRect:pe,dragOverlay:he,draggableNodes:N,droppableContainers:L,droppableRects:ae,over:nt,measureDroppableContainers:ie,scrollableAncestors:Oe,scrollableAncestorRects:Se,measuringConfiguration:re,measuringScheduled:le,windowRect:Ce})),[q,se,fe,G,et,pe,he,N,L,ae,nt,ie,Oe,Se,re,le,Ce]),ct=(0,r.useMemo)((()=>({activatorEvent:G,activators:st,active:q,activeNodeRect:fe,ariaDescribedById:{draggable:ee},dispatch:O,draggableNodes:N,over:nt,measureDroppableContainers:ie})),[G,st,q,fe,O,ee,N,nt,ie]);return o().createElement(c.Provider,{value:D},o().createElement(Ve.Provider,{value:ct},o().createElement(qe.Provider,{value:ut},o().createElement(Ye.Provider,{value:ot},p)),o().createElement(ze,{disabled:!1===(null==d?void 0:d.restoreFocus)})),o().createElement(m,{...d,hiddenTextDescribedById:ee}))})),Qe=(0,r.createContext)(null),Ze="button",et="Draggable";function tt(e){let{id:t,data:n,disabled:o=!1,attributes:a}=e;const l=(0,i.useUniqueId)(et),{activators:s,activatorEvent:u,active:c,activeNodeRect:d,ariaDescribedById:f,draggableNodes:p,over:m}=(0,r.useContext)(Ve),{role:g=Ze,roleDescription:h="draggable",tabIndex:v=0}=null!=a?a:{},b=(null==c?void 0:c.id)===t,y=(0,r.useContext)(b?Ye:Qe),[E,w]=(0,i.useNodeRef)(),[C,_]=(0,i.useNodeRef)(),O=function(e,t){return(0,r.useMemo)((()=>e.reduce(((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e}),{})),[e,t])}(s,t),x=(0,i.useLatestValue)(n);(0,i.useIsomorphicLayoutEffect)((()=>(p.set(t,{id:t,key:l,node:E,activatorNode:C,data:x}),()=>{const e=p.get(t);e&&e.key===l&&p.delete(t)})),[p,t]);return{active:c,activatorEvent:u,activeNodeRect:d,attributes:(0,r.useMemo)((()=>({role:g,tabIndex:v,"aria-disabled":o,"aria-pressed":!(!b||g!==Ze)||void 0,"aria-roledescription":h,"aria-describedby":f.draggable})),[o,g,v,b,h,f.draggable]),isDragging:b,listeners:o?void 0:O,node:E,over:m,setNodeRef:w,setActivatorNodeRef:_,transform:y}}function nt(){return(0,r.useContext)(qe)}const rt="Droppable",ot={timeout:25};function at(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:a}=e;const l=(0,i.useUniqueId)(rt),{active:s,dispatch:u,over:c,measureDroppableContainers:d}=(0,r.useContext)(Ve),f=(0,r.useRef)({disabled:n}),p=(0,r.useRef)(!1),m=(0,r.useRef)(null),h=(0,r.useRef)(null),{disabled:v,updateMeasurementsFor:b,timeout:y}={...ot,...a},E=(0,i.useLatestValue)(null!=b?b:o),w=Re({callback:(0,r.useCallback)((()=>{p.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout((()=>{d(Array.isArray(E.current)?E.current:[E.current]),h.current=null}),y)):p.current=!0}),[y]),disabled:v||!s}),C=(0,r.useCallback)(((e,t)=>{w&&(t&&(w.unobserve(t),p.current=!1),e&&w.observe(e))}),[w]),[_,O]=(0,i.useNodeRef)(C),x=(0,i.useLatestValue)(t);return(0,r.useEffect)((()=>{w&&_.current&&(w.disconnect(),p.current=!1,w.observe(_.current))}),[_,w]),(0,r.useEffect)((()=>(u({type:g.RegisterDroppable,element:{id:o,key:l,disabled:n,node:_,rect:m,data:x}}),()=>u({type:g.UnregisterDroppable,key:l,id:o}))),[o]),(0,r.useEffect)((()=>{n!==f.current.disabled&&(u({type:g.SetDroppableDisabled,id:o,key:l,disabled:n}),f.current.disabled=n)}),[o,l,n,u]),{active:s,rect:m,isOver:(null==c?void 0:c.id)===o,node:_,over:c,setNodeRef:O}}function it(e){let{animation:t,children:n}=e;const[a,l]=(0,r.useState)(null),[s,u]=(0,r.useState)(null),c=(0,i.usePrevious)(n);return n||a||!c||l(c),(0,i.useIsomorphicLayoutEffect)((()=>{if(!s)return;const e=null==a?void 0:a.key,n=null==a?void 0:a.props.id;null!=e&&null!=n?Promise.resolve(t(n,s)).then((()=>{l(null)})):l(null)}),[t,a,s]),o().createElement(o().Fragment,null,n,a?(0,r.cloneElement)(a,{ref:u}):null)}const lt={x:0,y:0,scaleX:1,scaleY:1};function st(e){let{children:t}=e;return o().createElement(Ve.Provider,{value:He},o().createElement(Ye.Provider,{value:lt},t))}const ut={position:"fixed",touchAction:"none"},ct=e=>(0,i.isKeyboardEvent)(e)?"transform 250ms ease":void 0,dt=(0,r.forwardRef)(((e,t)=>{let{as:n,activatorEvent:r,adjustScale:a,children:l,className:s,rect:u,style:c,transform:d,transition:f=ct}=e;if(!u)return null;const p=a?d:{...d,scaleX:1,scaleY:1},m={...ut,width:u.width,height:u.height,top:u.top,left:u.left,transform:i.CSS.Transform.toString(p),transformOrigin:a&&r?w(r,u):void 0,transition:"function"==typeof f?f(r):f,...c};return o().createElement(n,{className:s,style:m,ref:t},l)})),ft=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:a,className:i}=e;if(null!=a&&a.active)for(const[e,t]of Object.entries(a.active))void 0!==t&&(o[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=a&&a.dragOverlay)for(const[e,t]of Object.entries(a.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=i&&i.active&&n.node.classList.add(i.active),null!=i&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[e,t]of Object.entries(o))n.node.style.setProperty(e,t);null!=i&&i.active&&n.node.classList.remove(i.active)}},pt={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:i.CSS.Transform.toString(t)},{transform:i.CSS.Transform.toString(n)}]},sideEffects:ft({styles:{active:{opacity:"0"}}})};function mt(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return(0,i.useEvent)(((e,a)=>{if(null===t)return;const l=n.get(e);if(!l)return;const s=l.node.current;if(!s)return;const u=je(a);if(!u)return;const{transform:c}=(0,i.getWindow)(a).getComputedStyle(a),d=j(c);if(!d)return;const f="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...pt,...e};return e=>{let{active:a,dragOverlay:i,transform:l,...s}=e;if(!t)return;const u={x:i.rect.left-a.rect.left,y:i.rect.top-a.rect.top},c={scaleX:1!==l.scaleX?a.rect.width*l.scaleX/i.rect.width:1,scaleY:1!==l.scaleY?a.rect.height*l.scaleY/i.rect.height:1},d={x:l.x-u.x,y:l.y-u.y,...c},f=o({...s,active:a,dragOverlay:i,transform:{initial:l,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;const g=null==r?void 0:r({active:a,dragOverlay:i,...s}),h=i.node.animate(f,{duration:t,easing:n,fill:"forwards"});return new Promise((e=>{h.onfinish=()=>{null==g||g(),e()}}))}}(t);return Z(s,o.draggable.measure),f({active:{id:e,data:l.data,node:s,rect:o.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:o.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:o,transform:d})}))}let gt=0;function ht(e){return(0,r.useMemo)((()=>{if(null!=e)return gt++,gt}),[e])}const vt=o().memo((e=>{let{adjustScale:t=!1,children:n,dropAnimation:a,style:i,transition:l,modifiers:s,wrapperElement:u="div",className:c,zIndex:d=999}=e;const{activatorEvent:f,active:p,activeNodeRect:m,containerNodeRect:g,draggableNodes:h,droppableContainers:v,dragOverlay:b,over:y,measuringConfiguration:E,scrollableAncestors:w,scrollableAncestorRects:C,windowRect:_}=nt(),O=(0,r.useContext)(Ye),x=ht(null==p?void 0:p.id),S=Xe(s,{activatorEvent:f,active:p,activeNodeRect:m,containerNodeRect:g,draggingNodeRect:b.rect,over:y,overlayNodeRect:b.rect,scrollableAncestors:w,scrollableAncestorRects:C,transform:O,windowRect:_}),D=Te(m),T=mt({config:a,draggableNodes:h,droppableContainers:v,measuringConfiguration:E}),R=D?b.setRef:void 0;return o().createElement(st,null,o().createElement(it,{animation:T},p&&x?o().createElement(dt,{key:x,id:p.id,ref:R,as:u,activatorEvent:f,adjustScale:t,className:c,transition:l,rect:D,style:{zIndex:d,...i},transform:S},n):null))}))},8831:function(e,t,n){n.r(t),n.d(t,{createSnapModifier:function(){return o},restrictToFirstScrollableAncestor:function(){return s},restrictToHorizontalAxis:function(){return a},restrictToParentElement:function(){return l},restrictToVerticalAxis:function(){return u},restrictToWindowEdges:function(){return c},snapCenterToCursor:function(){return d}});var r=n(4979);function o(e){return t=>{let{transform:n}=t;return{...n,x:Math.ceil(n.x/e)*e,y:Math.ceil(n.y/e)*e}}}const a=e=>{let{transform:t}=e;return{...t,y:0}};function i(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}const l=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:r}=e;return n&&t?i(r,n,t):r},s=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e;const o=r[0];return t&&o?i(n,t,o):n},u=e=>{let{transform:t}=e;return{...t,x:0}},c=e=>{let{transform:t,draggingNodeRect:n,windowRect:r}=e;return n&&r?i(t,n,r):t},d=e=>{let{activatorEvent:t,draggingNodeRect:n,transform:o}=e;if(n&&t){const e=(0,r.getEventCoordinates)(t);if(!e)return o;const a=e.x-n.left,i=e.y-n.top;return{...o,x:o.x+a-n.width/2,y:o.y+i-n.height/2}}return o}},3627:function(e,t,n){n.r(t),n.d(t,{SortableContext:function(){return y},arrayMove:function(){return l},arraySwap:function(){return s},defaultAnimateLayoutChanges:function(){return w},defaultNewIndexGetter:function(){return E},hasSortableData:function(){return D},horizontalListSortingStrategy:function(){return f},rectSortingStrategy:function(){return p},rectSwappingStrategy:function(){return m},sortableKeyboardCoordinates:function(){return R},useSortable:function(){return S},verticalListSortingStrategy:function(){return h}});var r=n(1594),o=n.n(r),a=n(6733),i=n(4979);function l(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function s(e,t,n){const r=e.slice();return r[t]=e[n],r[n]=e[t],r}function u(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function c(e){return null!==e&&e>=0}const d={scaleX:1,scaleY:1},f=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:a,index:i}=e;const l=null!=(t=n[o])?t:r;if(!l)return null;const s=function(e,t,n){const r=e[t],o=e[t-1],a=e[t+1];if(!r||!o&&!a)return 0;if(no&&i<=a?{x:-l.width-s,y:0,...d}:i=a?{x:l.width+s,y:0,...d}:{x:0,y:0,...d}};const p=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const a=l(t,r,n),i=t[o],s=a[o];return s&&i?{x:s.left-i.left,y:s.top-i.top,scaleX:s.width/i.width,scaleY:s.height/i.height}:null},m=e=>{let t,n,{activeIndex:r,index:o,rects:a,overIndex:i}=e;return o===r&&(t=a[o],n=a[i]),o===i&&(t=a[o],n=a[r]),n&&t?{x:n.left-t.left,y:n.top-t.top,scaleX:n.width/t.width,scaleY:n.height/t.height}:null},g={scaleX:1,scaleY:1},h=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:a,overIndex:i}=e;const l=null!=(t=a[n])?t:r;if(!l)return null;if(o===n){const e=a[i];return e?{x:0,y:nn&&o<=i?{x:0,y:-l.height-s,...g}:o=i?{x:0,y:l.height+s,...g}:{x:0,y:0,...g}};const v="Sortable",b=o().createContext({activeIndex:-1,containerId:v,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:p,disabled:{draggable:!1,droppable:!1}});function y(e){let{children:t,id:n,items:l,strategy:s=p,disabled:c=!1}=e;const{active:d,dragOverlay:f,droppableRects:m,over:g,measureDroppableContainers:h}=(0,a.useDndContext)(),y=(0,i.useUniqueId)(v,n),E=Boolean(null!==f.rect),w=(0,r.useMemo)((()=>l.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[l]),C=null!=d,_=d?w.indexOf(d.id):-1,O=g?w.indexOf(g.id):-1,x=(0,r.useRef)(w),S=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{S&&C&&h(w)}),[S,w,C,h]),(0,r.useEffect)((()=>{x.current=w}),[w]);const R=(0,r.useMemo)((()=>({activeIndex:_,containerId:y,disabled:T,disableTransforms:D,items:w,overIndex:O,useDragOverlay:E,sortedRects:u(w,m),strategy:s})),[_,y,T.draggable,T.droppable,D,w,O,m,E,s]);return o().createElement(b.Provider,{value:R},t)}const E=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return l(n,r,o).indexOf(t)},w=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:a,newIndex:i,previousItems:l,previousContainerId:s,transition:u}=e;return!(!u||!r)&&((l===a||o!==i)&&(!!n||i!==o&&t===s))},C={duration:200,easing:"ease"},_="transform",O=i.CSS.Transition.toString({property:_,duration:0,easing:"linear"}),x={roleDescription:"sortable"};function S(e){let{animateLayoutChanges:t=w,attributes:n,disabled:o,data:l,getNewIndex:s=E,id:u,strategy:d,resizeObserverConfig:f,transition:p=C}=e;const{items:m,containerId:g,activeIndex:h,disabled:v,disableTransforms:y,sortedRects:S,overIndex:D,useDragOverlay:T,strategy:R}=(0,r.useContext)(b),M=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(o,v),k=m.indexOf(u),P=(0,r.useMemo)((()=>({sortable:{containerId:g,index:k,items:m},...l})),[g,l,k,m]),I=(0,r.useMemo)((()=>m.slice(m.indexOf(u))),[m,u]),{rect:N,node:A,isOver:j,setNodeRef:L}=(0,a.useDroppable)({id:u,data:P,disabled:M.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:F,activatorEvent:W,activeNodeRect:B,attributes:U,setNodeRef:H,listeners:V,isDragging:q,over:$,setActivatorNodeRef:K,transform:z}=(0,a.useDraggable)({id:u,data:P,attributes:{...x,...n},disabled:M.draggable}),X=(0,i.useCombinedRefs)(L,H),Y=Boolean(F),G=Y&&!y&&c(h)&&c(D),J=!T&&q,Q=J&&G?z:null,Z=G?null!=Q?Q:(null!=d?d:R)({rects:S,activeNodeRect:B,activeIndex:h,overIndex:D,index:k}):null,ee=c(h)&&c(D)?s({id:u,items:m,activeIndex:h,overIndex:D}):k,te=null==F?void 0:F.id,ne=(0,r.useRef)({activeId:te,items:m,newIndex:ee,containerId:g}),re=m!==ne.current.items,oe=t({active:F,containerId:g,isDragging:q,isSorting:Y,id:u,index:k,items:m,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:p,wasDragging:null!=ne.current.activeId}),ae=function(e){let{disabled:t,index:n,node:o,rect:l}=e;const[s,u]=(0,r.useState)(null),c=(0,r.useRef)(n);return(0,i.useIsomorphicLayoutEffect)((()=>{if(!t&&n!==c.current&&o.current){const e=l.current;if(e){const t=(0,a.getClientRect)(o.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&u(n)}}n!==c.current&&(c.current=n)}),[t,n,o,l]),(0,r.useEffect)((()=>{s&&u(null)}),[s]),s}({disabled:!oe,index:k,node:A,rect:N});return(0,r.useEffect)((()=>{Y&&ne.current.newIndex!==ee&&(ne.current.newIndex=ee),g!==ne.current.containerId&&(ne.current.containerId=g),m!==ne.current.items&&(ne.current.items=m)}),[Y,ee,g,m]),(0,r.useEffect)((()=>{if(te===ne.current.activeId)return;if(null!=te&&null==ne.current.activeId)return void(ne.current.activeId=te);const e=setTimeout((()=>{ne.current.activeId=te}),50);return()=>clearTimeout(e)}),[te]),{active:F,activeIndex:h,attributes:U,data:P,rect:N,index:k,newIndex:ee,items:m,isOver:j,isSorting:Y,isDragging:q,listeners:V,node:A,overIndex:D,over:$,setNodeRef:X,setActivatorNodeRef:K,setDroppableNodeRef:L,setDraggableNodeRef:H,transform:null!=ae?ae:Z,transition:function(){if(ae||re&&ne.current.newIndex===k)return O;if(J&&!(0,i.isKeyboardEvent)(W)||!p)return;if(Y||oe)return i.CSS.Transition.toString({...p,property:_});return}()}}function D(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const T=[a.KeyboardCode.Down,a.KeyboardCode.Right,a.KeyboardCode.Up,a.KeyboardCode.Left],R=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:l,over:s,scrollableAncestors:u}}=t;if(T.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];l.getEnabled().forEach((n=>{if(!n||null!=n&&n.disabled)return;const i=o.get(n.id);if(i)switch(e.code){case a.KeyboardCode.Down:r.topi.top&&t.push(n);break;case a.KeyboardCode.Left:r.left>i.left&&t.push(n);break;case a.KeyboardCode.Right:r.left1&&(d=c[1].id),null!=d){const e=l.get(n.id),t=l.get(d),s=t?o.get(t.id):null,c=null==t?void 0:t.node.current;if(c&&s&&e&&t){const n=(0,a.getScrollableAncestors)(c).some(((e,t)=>u[t]!==e)),o=M(e,t),l=function(e,t){if(!D(e)||!D(t))return!1;if(!M(e,t))return!1;return e.data.current.sortable.indexe=>{t.forEach((t=>t(e)))}),t)}const a="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function i(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function l(e){return"nodeType"in e}function s(e){var t,n;return e?i(e)?e:l(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function u(e){const{Document:t}=s(e);return e instanceof t}function c(e){return!i(e)&&e instanceof s(e).HTMLElement}function d(e){return e instanceof s(e).SVGElement}function f(e){return e?i(e)?e.document:l(e)?u(e)?e:c(e)||d(e)?e.ownerDocument:document:document:document}const p=a?r.useLayoutEffect:r.useEffect;function m(e){const t=(0,r.useRef)(e);return p((()=>{t.current=e})),(0,r.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r{e.current=setInterval(t,n)}),[]),(0,r.useCallback)((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}function h(e,t){void 0===t&&(t=[e]);const n=(0,r.useRef)(e);return p((()=>{n.current!==e&&(n.current=e)}),t),n}function v(e,t){const n=(0,r.useRef)();return(0,r.useMemo)((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function b(e){const t=m(e),n=(0,r.useRef)(null),o=(0,r.useCallback)((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,o]}function y(e){const t=(0,r.useRef)();return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}let E={};function w(e,t){return(0,r.useMemo)((()=>{if(t)return t;const n=null==E[e]?0:E[e]+1;return E[e]=n,e+"-"+n}),[e,t])}function C(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t}),{...t})}}const _=C(1),O=C(-1);function x(e){return"clientX"in e&&"clientY"in e}function S(e){if(!e)return!1;const{KeyboardEvent:t}=s(e.target);return t&&e instanceof t}function D(e){if(!e)return!1;const{TouchEvent:t}=s(e.target);return t&&e instanceof t}function T(e){if(D(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return x(e)?{x:e.clientX,y:e.clientY}:null}const R=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[R.Translate.toString(e),R.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),M="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function k(e){return e.matches(M)?e:e.querySelector(M)}},2038:function(e,t,n){var r=a(n(4121)),o=a(n(1240));function a(e){return e&&e.__esModule?e:{default:e}}window.document.addEventListener("DOMContentLoaded",(()=>{(0,r.default)(),(0,o.default)()}))},4121:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=b(n(5207)),o=b(n(584)),a=b(n(7105)),i=b(n(6721)),l=b(n(2512)),s=b(n(5563)),u=b(n(5297)),c=b(n(7651)),d=b(n(1305)),f=b(n(7660)),p=b(n(7333)),m=b(n(2382)),g=b(n(8953)),h=b(n(1950)),v=b(n(6573));function b(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.component.registerMany({ElementEditor:i.default,ElementToolbar:s.default,ElementAddNewButton:u.default,ElementList:l.default,Element:o.default,ElementActions:a.default,ElementHeader:c.default,ElementContent:d.default,ElementSummary:f.default,ElementInlineEditForm:p.default,AddElementPopover:m.default,HoverBar:g.default,DragPositionIndicator:h.default,TextCheckboxGroupField:v.default})}},1240:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=d(n(5207)),o=d(n(2977)),a=d(n(3337)),i=d(n(4)),l=d(n(9283)),s=d(n(8501)),u=d(n(2221)),c=d(n(5904));function d(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.transform("elemental-fieldgroup",(e=>{e.component("FieldGroup.HistoryViewer.VersionDetail",o.default,"HistoricElement")}),{after:"field-holders"}),r.default.transform("blocks-history-revert",(e=>{e.component("HistoryViewerToolbar.VersionedAdmin.HistoryViewer.Element.HistoryViewerVersionDetail",a.default,"BlockRevertRequest")})),r.default.transform("element-actions",(e=>{e.component("ElementActions",s.default,"ElementActionsWithSave"),e.component("ElementActions",u.default,"ElementActionsWithPublish"),e.component("ElementActions",c.default,"ElementActionsWithUnpublish"),e.component("ElementActions",l.default,"ElementActionsWithDuplicate"),e.component("ElementActions",i.default,"ElementActionsWithArchive")}))}},26:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(1594)),o=s(n(6935)),a=s(n(6923)),i=n(3556),l=n(9791);function s(e){return e&&e.__esModule?e:{default:e}}const u=e=>{const{className:t,title:n,label:o}=e,l={className:(0,a.default)(t,"dropdown-item"),...e};return r.default.createElement(i.DropdownItem,l,o||n)};u.propTypes={disabled:o.default.bool,className:o.default.string,onClick:o.default.func,title:o.default.string,name:o.default.string,type:l.elementTypeType,active:o.default.bool,label:o.default.string},u.defaultProps={disabled:!1};t.default=u},4:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=d(n(26)),a=d(n(5815)),i=n(6721),l=d(n(5609)),s=d(n(6177)),u=n(1135),c=d(n(4014));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}const p=e=>t=>{const{fetchElements:n}=(0,r.useContext)(i.ElementEditorContext),d=void 0!==t.element.canDelete&&!t.element.canDelete,f=a.default._t("ElementArchiveAction.ARCHIVE","Archive"),p={label:f,title:d?a.default._t("ElementArchiveAction.ARCHIVE_PERMISSION_DENY","Archive, insufficient permissions"):f,disabled:d,className:"element-editor__actions-archive",onClick:e=>{e.stopPropagation();const r=t.element.isPublished;let o=a.default._t("ElementArchiveAction.CONFIRM_DELETE","Are you sure you want to send this block to the archive?");if(r&&(o=a.default._t("ElementArchiveAction.CONFIRM_DELETE_AND_UNPUBLISH","Warning: This block will be unpublished before being sent to the archive. Are you sure you want to proceed?")),!window.confirm(o))return;const i=t.element.id,d=`${(0,u.getConfig)().controllerLink.replace(/\/$/,"")}/api/delete`;l.default.post(d,{id:i},{"X-SecurityID":s.default.get("SecurityID")}).then((()=>n())).catch((async e=>{const t=await(0,c.default)(e);window.jQuery.noticeAdd({text:t,stay:!0,type:"error"})}))},toggle:t.toggle};return r.default.createElement(e,t,t.children,r.default.createElement(o.default,p))};t.Component=p;t.default=p},9283:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=d(n(26)),a=d(n(5815)),i=n(6721),l=d(n(5609)),s=d(n(6177)),u=n(1135),c=d(n(4014));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}const p=e=>t=>{const{fetchElements:n}=(0,r.useContext)(i.ElementEditorContext);if(t.type.broken)return r.default.createElement(e,t);const d=void 0!==t.element.canCreate&&!t.element.canCreate,f=a.default._t("ElementArchiveAction.DUPLICATE","Duplicate"),p={label:f,title:d?a.default._t("ElementArchiveAction.DUPLICATE_PERMISSION_DENY","Duplicate, insufficient permissions"):f,disabled:d,className:"element-editor__actions-duplicate",onClick:e=>{e.stopPropagation();const r=t.element.id,o=`${(0,u.getConfig)().controllerLink.replace(/\/$/,"")}/api/duplicate`;l.default.post(o,{id:r},{"X-SecurityID":s.default.get("SecurityID")}).then((()=>n())).catch((async e=>{const t=await(0,c.default)(e);window.jQuery.noticeAdd({text:t,stay:!0,type:"error"})}))},toggle:t.toggle};return r.default.createElement(e,t,t.children,r.default.createElement(o.default,p))};t.Component=p;t.default=p},2221:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=l(n(26)),a=l(n(5815)),i=n(584);function l(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}const u=e=>t=>{const{formDirty:n,onPublishButtonClick:l}=(0,r.useContext)(i.ElementContext),{element:s}=t,u=void 0!==t.element.canPublish&&!t.element.canPublish,c=a.default._t("ElementArchiveAction.PUBLISH","Publish"),d={label:c,title:u?a.default._t("ElementArchiveAction.PUBLISH_PERMISSION_DENY","Publish, insufficient permissions"):c,disabled:u,className:"element-editor__actions-publish",onClick:e=>{e.stopPropagation(),l()},toggle:t.toggle};return t.type.broken?r.default.createElement(e,t):r.default.createElement(e,t,t.children,(n||!s.isLiveVersion)&&r.default.createElement(o.default,d))};t.Component=u;t.default=u},8501:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=l(n(26)),a=l(n(5815)),i=n(584);function l(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}const u=e=>t=>{const{onSaveButtonClick:n,formDirty:l}=(0,r.useContext)(i.ElementContext),s={title:a.default._t("ElementSaveAction.SAVE","Save"),className:"element-editor__actions-save",onClick:e=>{e.stopPropagation(),n()},toggle:t.toggle};return!t.expandable||t.type.broken?r.default.createElement(e,t):r.default.createElement(e,t,t.children,l&&r.default.createElement(o.default,s))};t.Component=u;t.default=u},5904:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=c(n(26)),a=c(n(5815)),i=c(n(5609)),l=n(6721),s=c(n(6177)),u=n(1135);function c(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}const f=e=>t=>{const{fetchElements:n}=(0,r.useContext)(l.ElementEditorContext);if(t.type.broken)return r.default.createElement(e,t);const c=(e,t,n)=>{const r=a.default.inject(a.default._t("ElementHeader.NOTITLE","Untitled {type} block"),{type:e}),o=a.default.inject(a.default._t("ElementUnpublishAction.SUCCESS_NOTIFICATION","Removed '{title}' from the published page"),{title:t||r}),i=a.default.inject(a.default._t("ElementUnpublishAction.ERROR_NOTIFICATION","Error unpublishing '{title}'"),{title:t||r});window.jQuery.noticeAdd({text:n?o:i,stay:!1,type:n?"success":"error"})},d=void 0!==t.element.canUnpublish&&!t.element.canUnpublish,f=a.default._t("ElementArchiveAction.UNPUBLISH","Unpublish"),p={label:f,title:d?a.default._t("ElementArchiveAction.UNPUBLISH_PERMISSION_DENY","Unpublish, insufficient permissions"):f,disabled:d,className:"element-editor__actions-unpublish",onClick:e=>{e.stopPropagation(),(()=>{const e=t.element.id,r=`${(0,u.getConfig)().controllerLink.replace(/\/$/,"")}/api/unpublish`;i.default.post(r,{id:e},{"X-SecurityID":s.default.get("SecurityID")}).then((()=>n())).then((()=>c(t.type.title,t.element.title,!0))).catch((()=>c(t.type.title,t.element.title,!1)))})()},toggle:t.toggle};return r.default.createElement(e,t,t.children,t.element.isPublished&&r.default.createElement(o.default,p))};t.Component=f;t.default=f},2382:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=b(n(1594)),o=h(n(6935)),a=n(9040),i=n(9367),l=h(n(6923)),s=b(n(8918)),u=n(5207),c=n(9791),d=h(n(5815)),f=h(n(5609)),p=h(n(6177)),m=n(6721),g=h(n(4014));function h(e){return e&&e.__esModule?e:{default:e}}function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(v=function(e){return e?n:t})(e)}function b(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=v(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}class y extends r.Component{constructor(e){super(e),this.handleToggle=this.handleToggle.bind(this),y.contextType=m.ElementEditorContext}getElementButtonClickHandler(e){return t=>{t.preventDefault();const n=`${p.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController").controllerLink}/api/create`;f.default.post(n,{elementClass:e.class,elementalAreaID:this.props.areaId,insertAfterElementID:this.props.insertAfterElement},{"X-SecurityID":p.default.get("SecurityID")}).then((()=>{const{fetchElements:e}=this.context;return e()})).then((()=>{const e=window.jQuery(".cms-preview");e.entwine("ss.preview")._loadUrl(e.find("iframe").attr("src"))})).catch((async e=>{const t=await(0,g.default)(e);this.props.actions.toasts.error(t)})),this.handleToggle()}}handleToggle(){const{toggle:e}=this.props;e()}render(){const{PopoverOptionSetComponent:e,elementTypes:t,container:n,extraClass:o,isOpen:a,placement:i,target:s}=this.props,u=(0,l.default)("element-editor-add-element",o),c=t.map((e=>({content:e.title,key:e.name,className:(0,l.default)(e.icon,"btn--icon-xl","element-editor-add-element__button"),onClick:this.getElementButtonClickHandler(e)})));return r.default.createElement(e,{buttons:c,searchPlaceholder:d.default._t("ElementAddElementPopover.SEARCH_BLOCKS","Search blocks"),extraClass:u,container:n,isOpen:a,placement:i,target:s,toggle:this.handleToggle})}}t.Component=y,y.propTypes={container:o.default.oneOfType([o.default.string,o.default.func,o.default.object]),elementTypes:o.default.arrayOf(c.elementTypeType).isRequired,extraClass:o.default.oneOfType([o.default.string,o.default.array,o.default.object]),isOpen:o.default.bool.isRequired,placement:o.default.string,target:o.default.oneOfType([o.default.string,o.default.func,o.default.object]).isRequired,toggle:o.default.func.isRequired,areaId:o.default.number.isRequired,insertAfterElement:o.default.oneOfType([o.default.number,o.default.string])};const E=(0,u.inject)(["PopoverOptionSet"],(e=>({PopoverOptionSetComponent:e})),(()=>"ElementEditor"))(y);t.default=(0,i.compose)((0,a.connect)(null,(function(e){return{actions:{toasts:(0,i.bindActionCreators)(s,e)}}})))(E)},5297:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=u(n(6935)),a=n(3556),i=u(n(5815)),l=n(9791),s=n(5207);function u(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}class d extends r.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={popoverOpen:!1}}toggle(){this.setState((e=>({popoverOpen:!e.popoverOpen})))}render(){const{AddElementPopoverComponent:e,elementTypes:t,areaId:n}=this.props,o={id:`ElementalArea${n}_AddButton`,color:"primary",onClick:this.toggle,className:"font-icon-plus"};return r.default.createElement("div",null,r.default.createElement(a.Button,o,i.default._t("ElementAddNewButton.ADD_BLOCK","Add block")),r.default.createElement(e,{placement:"bottom-start",target:o.id,isOpen:this.state.popoverOpen,elementTypes:t,toggle:this.toggle,areaId:n,insertAfterElement:0}))}}t.Component=d,d.defaultProps={},d.propTypes={elementTypes:o.default.arrayOf(l.elementTypeType).isRequired,areaId:o.default.number.isRequired};t.default=(0,s.inject)(["AddElementPopover"],(e=>({AddElementPopoverComponent:e})),(()=>"ElementEditor.ElementList.AddNewButton"))(d)},1305:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),a=(r=n(6935))&&r.__esModule?r:{default:r},i=n(5207),l=n(9367);function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class u extends o.PureComponent{render(){const{id:e,fileUrl:t,fileTitle:n,content:r,previewExpanded:a,InlineEditFormComponent:i,SummaryComponent:l,activeTab:s,onFormInit:u,handleLoadingError:c,formDirty:d,broken:f,onFormSchemaSubmitResponse:p,ensureFormRendered:m,formHasRendered:g}=this.props,h=!a&&(m||g),v={"element-editor-editform--collapsed":!a,"element-editor-editform--rendered-not-visible":h};return o.default.createElement("div",{className:"element-editor-content"},!a&&o.default.createElement(l,{content:r,fileUrl:t,fileTitle:n,broken:f}),(a||m||g)&&o.default.createElement(i,{extraClass:v,onClick:e=>e.stopPropagation(),elementId:e,activeTab:s,onFormInit:u,handleLoadingError:c,onFormSchemaSubmitResponse:p,notVisible:h}),d&&o.default.createElement("input",{type:"hidden",name:"change-tracker",className:"element-form-dirty-state",value:"1"}))}}t.Component=u,u.propTypes={id:a.default.number,content:a.default.string,fileUrl:a.default.string,fileTitle:a.default.string,previewExpanded:a.default.bool,SummaryComponent:a.default.elementType,InlineEditFormComponent:a.default.elementType,handleLoadingError:a.default.func,broken:a.default.bool,onFormSchemaSubmitResponse:a.default.func,onFormInit:a.default.func,ensureFormRendered:a.default.bool,formHasRendered:a.default.bool,formDirty:a.default.object},u.defaultProps={};t.default=(0,l.compose)((0,i.inject)(["ElementSummary","ElementInlineEditForm"],((e,t)=>({SummaryComponent:e,InlineEditFormComponent:t})),(()=>"ElementEditor.ElementList.Element")))(u)},1950:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(r,i,l):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(1594));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}class a extends r.PureComponent{render(){return r.default.createElement("div",{className:"elemental-editor-drag-indicator"},r.default.createElement("div",{className:"elemental-editor-drag-indicator__ball"}))}}t.default=a},584:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ElementContext=t.Component=void 0;var r=S(n(1594)),o=O(n(6935)),a=n(455),i=n(9791),l=n(9367),s=n(5207),u=O(n(5815)),c=O(n(6923)),d=n(9040),f=n(5381),p=n(2153),m=n(7785),g=S(n(5034)),h=n(3627),v=n(4979),b=S(n(8918)),y=n(9077),E=n(6721),w=n(1135),C=O(n(5609)),_=O(n(6177));function O(e){return e&&e.__esModule?e:{default:e}}function x(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(x=function(e){return e?n:t})(e)}function S(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=x(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const[t,n]=(0,r.useState)(!1),[o,a]=(0,r.useState)(""),[i,l]=(0,r.useState)(!1),[s,d]=(0,r.useState)(e.element.title),[f,p]=(0,r.useState)(!1),[m,g]=(0,r.useState)(!1),[b,y]=(0,r.useState)(!1),[O,x]=(0,r.useState)(!1),[S,R]=(0,r.useState)(!1),[M,k]=(0,r.useState)(!1),[P,I]=(0,r.useState)(!1),[N,A]=(0,r.useState)(!1),{fetchElements:j}=(0,r.useContext)(E.ElementEditorContext),{attributes:L,listeners:F,setNodeRef:W,transform:B,transition:U,isDragging:H,isOver:V}=(0,h.useSortable)({id:e.element.id}),q={transform:v.CSS.Transform.toString(B),transition:U};(0,r.useEffect)((()=>{void 0!==e.formDirty&&!N&&A(!0)}),[e.formDirty]),(0,r.useEffect)((()=>{e.onChangeHasUnsavedChanges(N)}),[N]),(0,r.useEffect)((()=>{e.saveElement&&N&&!m&&g(!0)}),[e.saveElement,N,e.increment]),(0,r.useEffect)((()=>{f&&M&&(p(!1),N?(e.submitForm(),x(!0)):y(!0))}),[f,M]),(0,r.useEffect)((()=>{P&&(I(!1),e.dispatchAddFormChanged())}),[P]);const $=()=>u.default.inject(u.default._t("ElementHeader.NOTITLE","Untitled {type} block"),{type:e.type.title}),K=t=>{(t=>{const n=s||$();if(t){const t=u.default.inject(u.default._t("ElementPublishAction.ERROR_NOTIFICATION","Error publishing '{title}'"),{title:n});e.actions.toasts.error(t)}else{const t=u.default.inject(u.default._t("ElementPublishAction.SUCCESS_NOTIFICATION","Published '{title}' successfully"),{title:n});e.actions.toasts.success(t)}})(t),y(!1),x(!1),j().then((()=>{setTimeout((()=>e.dispatchRemoveFormChanged()),250)}))};(0,r.useEffect)((()=>{M&&m&&(e.submitForm(),g(!1))}),[M,m]),(0,r.useEffect)((()=>{if(M&&b){const t=`${(0,w.getConfig)().controllerLink.replace(/\/$/,"")}/api/publish`;C.default.post(t,{id:e.element.id},{"X-SecurityID":_.default.get("SecurityID")}).then((()=>K(!1))).catch((()=>K(!0)))}}),[M,b]);const z=t=>{const{tabSetName:n,onActivateTab:r}=e;if(o||a(t),t||o)r(n,t||o);else{r(n,"Main")}},X=r=>{const{type:o,link:a}=e;o.broken||("button"!==r.target.type?!o.inlineEditable||i?window.location=a:n(!t):r.stopPropagation())},{element:Y,type:G,areaId:J,HeaderComponent:Q,ContentComponent:Z,link:ee,activeTab:te,formDirty:ne}=e;if(!Y.id)return null;const re=(0,c.default)("element-editor__element",{"element-editor__element--broken":G.broken,"element-editor__element--expandable":G.inlineEditable&&!G.broken,"element-editor__element--dragging":H,"element-editor__element--dragged-over":V},(()=>{const{element:t}=e,n="element-editor__element";return t.isPublished?t.isPublished&&!t.isLiveVersion?`${n}--modified`:`${n}--published`:`${n}--draft`})()),oe={formDirty:ne,onPublishButtonClick:()=>{p(!0),R(!0)},onSaveButtonClick:()=>{R(!0),g(!0)}},ae=r.default.createElement("div",D({className:re,onClick:X,onKeyUp:e=>{const{nodeName:t}=e.target;" "!==e.key&&"Enter"!==e.key||["input","textarea"].includes(t.toLowerCase())||X(e)},role:"button",tabIndex:0,title:(e=>e.broken?u.default._t("ElementalElement.ARCHIVE_BROKEN","Archive this block"):u.default.inject(u.default._t("ElementalElement.TITLE","Edit this {type} block"),{type:e.title}))(G),key:Y.id,ref:W},L,F,{style:q}),r.default.createElement(T.Provider,{value:oe},r.default.createElement(Q,{element:Y,type:G,areaId:J,expandable:G.inlineEditable,link:ee,previewExpanded:t,handleEditTabsClick:t=>{const{activeTab:r}=e;t===r||i||(n(!0),z(t))},activeTab:te,disableTooltip:H}),r.default.createElement(Z,{id:Y.id,fileUrl:Y.blockSchema.fileURL,fileTitle:Y.blockSchema.fileTitle,content:((e,t)=>t.broken?e.title?u.default.inject(u.default._t("ElementalElement.BROKEN_DESCRIPTION_TITLE",'This block had the title "{title}". It is broken and will not display on the front-end. You can archive it to remove it from this elemental area.'),{title:e.title}):u.default._t("ElementalElement.BROKEN_DESCRIPTION","This block is broken and will not display on the front-end. You can archive it to remove it from this elemental area."):e.blockSchema.content)(Y,G),previewExpanded:t&&!H,ensureFormRendered:S,formHasRendered:M,activeTab:te,handleLoadingError:()=>{l(!0)},broken:G.broken,onFormSchemaSubmitResponse:(t,r)=>{if(t.id.match(/\/schema\/elemental-area\/([0-9]+)/))return e.type.inlineEditable&&n(!0),I(!0),O&&x(!1),void e.onAfterSubmitResponse(!1);A(!1),d(r),O&&(x(!1),y(!0)),b||O||(t=>{const n=t||$(),r=u.default.inject(u.default._t("ElementSaveAction.SUCCESS_NOTIFICATION","Saved '{title}' successfully"),{title:n});e.actions.toasts.success(r)})(r),e.onAfterSubmitResponse(!0),j()},onFormInit:()=>(e=>{z(e),k(!0)})(te)})));return ae};t.Component=R,R.propTypes={element:a.elementType,type:i.elementTypeType.isRequired,areaId:o.default.number.isRequired,link:o.default.string.isRequired,activeTab:o.default.string,tabSetName:o.default.string,onActivateTab:o.default.func,isOver:o.default.bool.isRequired,saveElement:o.default.bool.isRequired,onBeforeSubmitForm:o.default.func.isRequired,onAfterSubmitResponse:o.default.func.isRequired,increment:o.default.number.isRequired},R.defaultProps={element:null};t.default=(0,l.compose)((0,d.connect)((function(e,t){const n=t.element.id,r=(0,p.loadElementFormStateName)(n),o=(0,m.loadElementSchemaValue)("schemaUrl",n),a=e.form&&e.form.formSchemas[o]&&e.form.formSchemas[o].schema&&e.form.formSchemas[o].schema.fields.find((e=>"Tabs"===e.component)),i=a&&a.id,l=`element.${r}__${i}`,s=e.unsavedForms.find((e=>e.name===`element.${r}`));return{tabSetName:i,activeTab:e.tabs&&e.tabs.fields&&e.tabs.fields[l]&&e.tabs.fields[l].activeTab,formDirty:s}}),(function(e,t){const n=(0,p.loadElementFormStateName)(t.element.id);return{onActivateTab(t,r){e(g.activateTab(`element.${n}__${t}`,r))},submitForm(){t.onBeforeSubmitForm(t.element.id),e((0,f.submit)(`element.${n}`))},dispatchAddFormChanged(){e((0,y.addFormChanged)(`element.${n}`))},dispatchRemoveFormChanged(){e((0,y.removeFormChanged)(`element.${n}`))},actions:{toasts:(0,l.bindActionCreators)(b,e)}}})),(0,s.inject)(["ElementHeader","ElementContent"],((e,t)=>({HeaderComponent:e,ContentComponent:t})),(()=>"ElementEditor.ElementList.Element")))(R)},7105:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=d(n(6935)),a=n(9367),i=n(3556),l=n(5207),s=n(455),u=n(9791),c=d(n(26));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}class p extends r.Component{constructor(e){super(e),this.handleEditTabsClick=this.handleEditTabsClick.bind(this)}handleEditTabsClick(e){const{handleEditTabsClick:t}=this.props;t(e.target.name)}renderEditTabs(){const{editTabs:e,activeTab:t,type:n,expandable:o}=this.props;return!n.broken&&o&&e&&e.length?e.map((e=>{let{name:o,title:a}=e;return r.default.createElement(c.default,{key:o,name:o,title:a,type:n,onClick:this.handleEditTabsClick,active:o===t})})):null}renderDivider(){const{children:e,editTabs:t,expandable:n}=this.props;return n&&t&&t.length&&0!==r.default.Children.count(e)?r.default.createElement(i.DropdownItem,{divider:!0,role:"separator"}):null}render(){const{children:e,id:t,ActionMenuComponent:n}=this.props;return r.default.createElement(n,{id:`element-editor-actions-${t}`,className:"element-editor-header__actions-dropdown",dropdownMenuProps:{right:!0},dropdownToggleClassNames:["element-editor-header__actions-toggle","btn","btn-sm","btn--no-text","font-icon-dot-3"]},this.renderEditTabs(),this.renderDivider(),e)}}t.Component=p,p.propTypes={element:s.elementType,type:u.elementTypeType.isRequired,areaId:o.default.number.isRequired,activeTab:o.default.string,editTabs:o.default.arrayOf(o.default.shape({title:o.default.string,name:o.default.string})),handleEditTabsClick:o.default.func.isRequired,expandable:o.default.bool},p.defaultProps={editTabs:[],expandable:!0};t.default=(0,a.compose)((0,l.inject)(["ActionMenu"],(e=>({ActionMenuComponent:e})),(()=>"ElementEditor.ElementList.Element")))(p)},6721:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ElementEditorContext=t.Component=void 0;var r=b(n(1594)),o=h(n(6935)),a=n(9040),i=n(5207),l=n(9367),s=n(9791),u=h(n(5799)),c=h(n(5609)),d=h(n(6177)),f=n(1135),p=b(n(8918)),m=h(n(4014)),g=n(3627);function h(e){return e&&e.__esModule?e:{default:e}}function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(v=function(e){return e?n:t})(e)}function b(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=v(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}const y=t.ElementEditorContext=(0,r.createContext)(null);class E extends r.PureComponent{constructor(e){super(e),this.state={dragTargetElementId:null,dragSpot:null,elements:null,isLoading:!0},this.handleDragStart=this.handleDragStart.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.fetchElements=this.fetchElements.bind(this)}handleDragStart(e){const{active:t}=e;this.setState({dragging:t.id})}handleDragEnd(e){const{active:t,over:n}=e,{elements:r}=this.state;if(t.id===n.id)return void this.setState({dragging:!1});const o=r.map((e=>e.id)),a=o.indexOf(t.id),i=o.indexOf(n.id),l=(0,g.arrayMove)(r,a,i),s=i>0?l[i-1].id:0,u=`${(0,f.getConfig)().controllerLink.replace(/\/$/,"")}/api/sort`;c.default.post(u,{id:t.id,afterBlockID:s},{"X-SecurityID":d.default.get("SecurityID")}).then((()=>this.fetchElements())).catch((async e=>{const t=await(0,m.default)(e);this.props.actions.toasts.error(t)})),this.setState({dragging:!1,elements:l})}fetchElements(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.setState((e=>({...e,isLoading:!0})));const e=`${(0,f.getConfig)().controllerLink.replace(/\/$/,"")}/api/readElements/${this.props.areaId}`;return c.default.get(e).then((async e=>{const t=await e.json();this.setState((e=>({...e,elements:t,isLoading:!1})));const n=window.jQuery(".cms-preview");n&&n.entwine("ss.preview")._loadUrl(n.find("iframe").attr("src"))})).catch((async e=>{this.setState({elements:[],isLoading:!1});const t=await(0,m.default)(e);this.props.actions.toasts.error(t)}))}render(){const{ToolbarComponent:e,ListComponent:t,areaId:n,elementTypes:o,allowedElements:a,sharedObject:i,isLoading:l}=this.props,{dragging:s,elements:u}=this.state;if(null===u)return this.fetchElements(!1),null;const c=a.map((e=>o.find((t=>t.class===e)))),d={fetchElements:this.fetchElements};return r.default.createElement("div",{className:"element-editor"},r.default.createElement(y.Provider,{value:d},r.default.createElement(e,{elementTypes:c,areaId:n}),r.default.createElement(t,{allowedElementTypes:c,elementTypes:o,areaId:n,onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,dragging:s,sharedObject:i,elements:u,isLoading:l})))}}t.Component=E,E.propTypes={elementTypes:o.default.arrayOf(s.elementTypeType).isRequired,allowedElements:o.default.arrayOf(o.default.string).isRequired,areaId:o.default.number.isRequired,actions:o.default.shape({handleSortBlock:o.default.func})};const w=[u.default,(0,i.inject)(["ElementToolbar","ElementList"],((e,t)=>({ToolbarComponent:e,ListComponent:t})),(()=>"ElementEditor"))];t.default=(0,l.compose)((0,a.connect)(null,(function(e){return{actions:{toasts:(0,l.bindActionCreators)(p,e)}}})),...w)(E)},2512:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.Component=v,t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=g(n(6935)),a=n(455),i=n(9791),l=n(9367),s=n(5207),u=g(n(6923)),c=g(n(5815)),d=n(6733),f=n(3627),p=n(8831),m=n(1135);function g(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function v(e){let{elements:t,sharedObject:n,ElementComponent:o,HoverBarComponent:a,allowedElementTypes:i,elementTypes:l,areaId:s,onDragEnd:g,onDragStart:h,dragging:v,isLoading:b,LoadingComponent:y}=e;const[E,w]=(0,r.useState)(!1),[C,_]=(0,r.useState)(0),[O,x]=(0,r.useState)({}),[S,D]=(0,r.useState)({});n.setIncrement=_,n.setSaveAllElements=w;const T=(e,n)=>{const r={},o={};(t||[]).forEach((t=>{const a=parseInt(t.id,10);n?r[a]=!1:e.hasOwnProperty(a)?r[a]=e[a]:r[a]=!1,o[a]=null})),x(r),D(o)};(0,r.useEffect)((()=>{T({},!0)}),[]),(0,r.useEffect)((()=>{T(O,!1)}),[t]),(0,r.useEffect)((()=>{if(!t)return;if(!E)return;const e=t.map((e=>parseInt(e.id,10))).filter((e=>O[e]));let r=!0;for(let t=0;tS[e])),a={success:o,reason:o?"":"invalid"};n.entwineResolve(a),T(O,o),w(!1)}),[E,O]);const R=(0,d.useSensors)((0,d.useSensor)(d.PointerSensor,{activationConstraint:{distance:10}})),M=(0,u.default)("elemental-editor-list",{"elemental-editor-list--empty":!t||!t.length});return r.default.createElement("div",{className:M},b?r.default.createElement(y,null):null,(()=>{if(0===t.length)return r.default.createElement("div",null,c.default._t("ElementList.ADD_BLOCKS","Add blocks to place your content"));let e=t.map((e=>{const t=E&&O[e.id]&&null===S[e.id];return r.default.createElement(r.default.Fragment,null,r.default.createElement(o,{key:e.id,element:e,areaId:s,type:(0,m.getElementTypeConfig)(e,l),link:e.blockSchema.actions.edit,saveElement:t,onChangeHasUnsavedChanges:t=>((e,t)=>{x({...O,[e]:t})})(e.id,t),onBeforeSubmitForm:()=>{return t=e.id,void D({...S,[t]:null});var t},onAfterSubmitResponse:t=>((e,t)=>{x({...O,[e]:!t}),D({...S,[e]:t})})(e.id,t),increment:C}),!1===v&&r.default.createElement(a,{key:`create-after-${e.id}`,areaId:s,elementId:e.id,elementTypes:i}))}));return!1===v&&(e=[r.default.createElement(a,{key:0,areaId:s,elementId:0,elementTypes:i})].concat(e)),r.default.createElement(d.DndContext,{modifiers:[p.restrictToVerticalAxis,p.restrictToParentElement],sensors:R,collisionDetection:d.closestCenter,onDragStart:h,onDragEnd:g},r.default.createElement(f.SortableContext,{items:t.map((e=>e.id)),strategy:f.verticalListSortingStrategy},e))})())}v.propTypes={elements:o.default.arrayOf(a.elementType).isRequired,elementTypes:o.default.arrayOf(i.elementTypeType).isRequired,allowedElementTypes:o.default.arrayOf(i.elementTypeType).isRequired,areaId:o.default.number.isRequired,onDragStart:o.default.func,onDragEnd:o.default.func,dragging:o.default.oneOf([o.default.bool,o.default.number]),sharedObject:o.default.object.isRequired},v.defaultProps={sharedObject:{entwineResolve:()=>{},setState:null},elements:[],isLoading:!1};t.default=(0,l.compose)((0,s.inject)(["Element","Loading","HoverBar","DragPositionIndicator"],((e,t,n,r)=>({ElementComponent:e,LoadingComponent:t,HoverBarComponent:n,DragIndicatorComponent:r})),(()=>"ElementEditor.ElementList")))(v)},7651:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=f(n(6935)),a=n(3556),i=n(455),l=n(9791),s=n(9367),u=n(5207),c=f(n(5815)),d=f(n(6923));function f(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}class m extends r.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={tooltipOpen:!1}}componentDidUpdate(){const{tooltipOpen:e}=this.state,{disableTooltip:t}=this.props;e&&t&&this.setState({tooltipOpen:!1})}getBlockTitle(e,t){return t.broken?c.default.inject(c.default._t("ElementHeader.BROKEN","This element is of obsolete type {type}."),{type:t.obsoleteClassName}):e.title?e.title:c.default.inject(c.default._t("ElementHeader.NOTITLE","Untitled {type} block"),{type:t.title})}toggle(){this.setState((e=>({tooltipOpen:!e.tooltipOpen})))}renderVersionedStateMessage(){const{element:{isLiveVersion:e,isPublished:t}}=this.props;if(t&&e)return null;let n="";const o=["element-editor-header__version-state"];return t?e||(n=c.default._t("ElementHeader.STATE_MODIFIED","Item has unpublished changes"),o.push("element-editor-header__version-state--modified")):(n=c.default._t("ElementHeader.STATE_DRAFT","Item has not been published yet"),o.push("element-editor-header__version-state--draft")),r.default.createElement("span",{className:(0,d.default)(o),title:n})}renderStatusFlagBadges(){const e=this.props.element.statusFlags;if(!e)return null;const t=[];for(let[n,o]of Object.entries(e))n=`badge status-${n}`,"string"==typeof o&&(o={text:o}),o.title||(o.title=""),t.push(r.default.createElement("span",{key:n,className:n,title:o.title},o.text));return t}render(){const{element:e,type:t,areaId:n,previewExpanded:o,simple:i,disableTooltip:l,activeTab:s,expandable:u,ElementActionsComponent:f,handleEditTabsClick:p}=this.props,m=this.getBlockTitle(e,t),g=(0,d.default)({"element-editor-header__title":!0,"element-editor-header__title--none":!e.title}),h=c.default._t("ElementHeader.EXPAND","Show editable fields"),v=(0,d.default)("element-editor-header",{"element-editor-header--simple":i}),b=(0,d.default)("element-editor-header__icon-container",{"element-editor-header__icon-container--broken":t.broken}),y=(0,d.default)("element-editor-header__expand",{"font-icon-right-open-big":!u,"font-icon-up-open-big":u&&o,"font-icon-down-open-big":u&&!o}),E=`element-icon-${e.id}`;return r.default.createElement("div",{className:v},r.default.createElement("div",{className:"element-editor-header__drag-handle"},r.default.createElement("i",{className:"font-icon-drag-handle"})),r.default.createElement("div",{className:"element-editor-header__info"},r.default.createElement("div",{className:b},r.default.createElement("i",{className:t.icon,id:E}),this.renderVersionedStateMessage(),!t.broken&&!i&&r.default.createElement(a.Tooltip,{placement:"top",isOpen:this.state.tooltipOpen&&!l,target:E,toggle:this.toggle},t.title)),r.default.createElement("h3",{className:g},m),this.renderStatusFlagBadges()),!i&&r.default.createElement("div",{className:"element-editor-header__actions"},r.default.createElement("div",{role:"none",onClick:e=>e.stopPropagation()},r.default.createElement(f,{element:e,type:t,areaId:n,activeTab:s,editTabs:t.editTabs,handleEditTabsClick:p,expandable:u})),!t.broken&&r.default.createElement("i",{className:y,title:h})))}}t.Component=m,m.propTypes={element:i.elementType.isRequired,type:l.elementTypeType.isRequired,areaId:o.default.number,activeTab:o.default.string,simple:o.default.bool,ElementActionsComponent:o.default.elementType,previewExpanded:o.default.bool,disableTooltip:o.default.bool},m.defaultProps={expandable:!0};t.default=(0,s.compose)((0,u.inject)(["ElementActions"],(e=>({ElementActionsComponent:e})),(()=>"ElementEditor.ElementList.Element")))(m)},8953:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=s(n(6935)),a=n(5207),i=n(9791),l=s(n(5815));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}const c=(0,s(n(7577)).default)("element-editor__hover-bar");function d(e){let{AddElementPopoverComponent:t,elementTypes:n,elementId:o,areaId:a,popoverOpen:i,onToggle:s}=e;const u=`${c("-line")} font-icon-plus-circled`,d=l.default._t("ElementAddNewButton.ADD_BLOCK","Add block"),f={className:c("-area",{"-area--focus":i}),onClick:s,"aria-label":d,title:d,id:`AddBlockHoverBarArea_${a}_${o}`};return r.default.createElement("div",{className:c(""),id:`AddBlockHoverBar_${a}_${o}`},r.default.createElement("button",f,r.default.createElement("span",{className:c("-area-inner")},r.default.createElement("span",{className:u}))),r.default.createElement(t,{placement:"bottom",target:`AddBlockHoverBarArea_${a}_${o}`,isOpen:i,elementTypes:n,toggle:s,container:`#AddBlockHoverBar_${a}_${o}`,areaId:a,insertAfterElement:o}))}class f extends r.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={popoverOpen:!1}}toggle(){this.setState((e=>({popoverOpen:!e.popoverOpen})))}render(){const e={...this.state,...this.props,onToggle:this.toggle};return r.default.createElement(d,e)}}t.Component=f,f.propTypes={elementTypes:o.default.arrayOf(i.elementTypeType).isRequired,elementId:o.default.oneOfType([o.default.string,o.default.number]).isRequired,areaId:o.default.oneOfType([o.default.number,o.default.string]).isRequired};t.default=(0,a.inject)(["AddElementPopover"],(e=>({AddElementPopoverComponent:e})),(()=>"ElementEditor.ElementList.HoverBar"))(f)},7333:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=d(n(6935)),a=d(n(6923)),i=d(n(55)),l=n(7785),s=d(n(5815)),u=n(2153),c=n(9040);function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t.match(/PageElements_[0-9]+_Title/)&&(r=e[t])})),n().then((e=>this.props.onFormSchemaSubmitResponse(e,r)))}render(){const{elementId:e,extraClass:t,onClick:n,onFormInit:o,formHasState:s,notVisible:u}=this.props,{loadingError:c}=this.state,d=(0,a.default)("element-editor-editform",t),f={formTag:"form",schemaUrl:(0,l.loadElementSchemaValue)("schemaUrl",e),identifier:"element",refetchSchemaOnMount:!s,onLoadingError:this.handleLoadingError,onSubmit:this.handleSubmit};c&&(f.loading=!1),"function"==typeof o&&(f.onReduxFormInit=o);const m={};return u&&(m["aria-hidden"]="true"),r.default.createElement("div",p({className:d,onClick:n,role:"presentation"},m),r.default.createElement(i.default,f))}}m.propTypes={extraClass:o.default.oneOfType([o.default.string,o.default.object]),onClick:o.default.func,elementId:o.default.string,handleLoadingError:o.default.func,onFormSchemaSubmitResponse:o.default.func,notVisible:o.default.bool};t.default=(0,c.connect)((function(e,t){const n=(0,u.loadElementFormStateName)(t.elementId);return{formHasState:e.form.formState&&e.form.formState.element&&!!e.form.formState.element[n]}}))(m)},7660:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),o=l(n(6935)),a=l(n(6923)),i=l(n(5815));function l(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class u extends r.PureComponent{render(){const{fileUrl:e,fileTitle:t,content:n,broken:o}=this.props,l=i.default._t("ElementSummary.NO_PREVIEW","No preview available"),s=(0,a.default)("element-editor-summary__content",{"element-editor-summary__content--broken":o});return r.default.createElement("div",{className:"element-editor-summary"},e&&r.default.createElement("img",{className:"element-editor-summary__thumbnail-image",src:e,alt:t}),(n||!e)&&r.default.createElement("p",{className:s},n||l))}}u.defaultProps={},u.propTypes={content:o.default.string,fileUrl:o.default.string,fileTitle:o.default.string,broken:o.default.bool};t.default=u},5563:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(1594)),a=(r=n(6935))&&r.__esModule?r:{default:r},i=n(5207),l=n(9791);function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class u extends o.PureComponent{render(){const{AddNewButtonComponent:e,elementTypes:t,areaId:n}=this.props;return o.default.createElement("div",{className:"element-editor__toolbar"},o.default.createElement(e,{elementTypes:t,areaId:n}))}}u.defaultProps={},u.propTypes={elementTypes:a.default.arrayOf(l.elementTypeType).isRequired,areaId:a.default.number.isRequired,AddNewButtonComponent:a.default.elementType.isRequired,onDragDrop:a.default.func};t.default=(0,i.inject)(["ElementAddNewButton"],(e=>({AddNewButtonComponent:e})),(()=>"ElementEditor.ElementToolbar"))(u)},2977:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(1594)),o=i(n(5815)),a=i(n(6923));function i(e){return e&&e.__esModule?e:{default:e}}t.default=e=>class extends e{getClassName(){const e=[super.getClassName()];return this.props.data.ElementID&&e.unshift("elemental-area__element--historic-inner"),(0,a.default)(e)}render(){const e=this.getLegend(),t=this.props.data.tag||"div",n=this.getClassName(),{data:a}=this.props;return a.ElementID?r.default.createElement(t,{className:n},e,r.default.createElement("div",{className:"elemental-preview elemental-preview--historic"},a.ElementEditLink&&r.default.createElement("a",{className:"elemental-preview__link",href:a.ElementEditLink},r.default.createElement("span",{className:"elemental-preview__link-text"},o.default._t("HistoricElementView.VIEW_BLOCK_HISTORY","Block history")),r.default.createElement("i",{className:"font-icon-angle-right btn--icon-lg elemental-preview__link-caret"})),r.default.createElement("div",{className:"elemental-preview__icon"},r.default.createElement("i",{className:a.ElementIcon})),r.default.createElement("div",{className:"elemental-preview__detail"},r.default.createElement("h3",null,a.ElementTitle," ",r.default.createElement("small",null,a.ElementType)))),this.props.children):super.render()}}},6573:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(1594)),o=n(3556),a=i(n(2623));function i(e){return e&&e.__esModule?e:{default:e}}t.default=(0,a.default)((e=>{const{children:t}=e,n=r.default.Children.toArray(r.default.Children.map(t,((t,n)=>{const o={};return 0===n?(o.id=e.id,o.title=null):1===n&&(o.noHolder=!0),r.default.cloneElement(t,o)})));return e.readOnly?r.default.createElement("div",{className:"text-checkbox-group-field--read-only"},n):1===n.length?n[0]:r.default.createElement(o.InputGroup,{className:"text-checkbox-group-field"},n[0],r.default.createElement(o.InputGroupAddon,{addonType:"append"},r.default.createElement(o.InputGroupText,null,n[1])))}))},51:function(e,t,n){var r=u(n(1669)),o=u(n(1594)),a=n(5145),i=n(5207),l=n(1135),s=n(5381);function u(e){return e&&e.__esModule?e:{default:e}}const c=()=>{setTimeout((()=>{const{store:e}=window.ss;e&&e.dispatch((0,s.destroy)(...Object.keys(e.getState().form.formState.element||{}).map((e=>`element.${e}`))))}),0)};r.default.entwine("ss",(e=>{e(".js-injector-boot .element-editor__container").entwine({ReactRoot:null,AreaIDsSharedObject:{},Increment:0,onmatch(){const e=(0,i.loadComponent)("ElementEditor",{}),t=this.data("schema"),n=(0,l.getConfig)().elementTypes,r=t["elemental-area-id"],s=this.getAreaIDsSharedObject();s.hasOwnProperty(r)||(s[r]={entwineResolve:null,setIncrement:null,setSaveAllElements:null});const u={areaId:r,allowedElements:t["allowed-elements"],elementTypes:n,sharedObject:s[r]};let c=this.getReactRoot();c||(c=(0,a.createRoot)(this[0]),this.setReactRoot(c)),c.render(o.default.createElement(e,u))},onunmatch(){e(".cms-edit-form").data("hasValidationErrors")||c(),this.unmountComponent()},unmountComponent(){const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))},"from .cms-edit-form":{onbeforesubmitform(e,t){if(!t||this.is(".elemental-area--read-only"))return;let n;const r=new Promise((e=>{n=e}));t.promises.push(r),t.onAjaxSuccessCallbacks.push(this.unmountComponent.bind(this));const o=this.data("schema")["elemental-area-id"],a=this.getAreaIDsSharedObject()[o],i=this.getIncrement()+1;this.setIncrement(i),a.entwineResolve=n,a.setIncrement(i),a.setSaveAllElements(!0)},onaftersubmitform(t,n){const r=JSON.parse(n.xhr.responseText).ValidationResult;JSON.parse(r.replace(/<\/?script[^>]*?>/g,"")).isValid?(e(".cms-edit-form").data("hasValidationErrors",!1),c()):e(".cms-edit-form").data("hasValidationErrors",!0)}}}),e(".js-injector-boot .element-editor__container .element-form-dirty-state").entwine({onmatch(){e(".cms-edit-form").trigger("change")},onunmatch(){e(".cms-edit-form").trigger("change")}}),e(".cms-edit-form").entwine({getChangeTrackerOptions(){const t=void 0===this.entwineData("ChangeTrackerOptions");let n=this._super();return t&&(n=e.extend({},n),n.ignoreFieldSelector+=", .elementalarea :input:not(.element-form-dirty-state)",this.setChangeTrackerOptions(n)),n}})}))},7577:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(6923))&&r.__esModule?r:{default:r};t.default=e=>function(){const t=t=>`${e}${t}`;for(var n=arguments.length,r=new Array(n),a=0;a!(!e&&""!==e)&&("object"==typeof e?Array.isArray(e)?e.map(t):Object.entries(e).reduce(((e,n)=>{let[r,o]=n;return Object.assign({},e,{[t(r)]:o})}),{}):t(e))));return(0,o.default)(...i)}},1135:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getElementTypeConfig=t.getConfig=void 0;var r,o=(r=n(6177))&&r.__esModule?r:{default:r};const a=()=>o.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController");t.getConfig=a;t.getElementTypeConfig=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=e.blockSchema.typeName;let r=(Array.isArray(t)?t:a().elementTypes).find((e=>e.class===n||e.name===n));return e.obsoleteClassName&&(r=Object.assign({obsoleteClassName:e.obsoleteClassName},r),Object.preventExtensions(r)),r}},2153:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.loadElementFormStateName=void 0;var r,o=(r=n(6177))&&r.__esModule?r:{default:r};t.loadElementFormStateName=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=o.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController").form.elementForm.formNameTemplate;return e?t.replace("{id}",e):t}},7785:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.loadElementSchemaValue=void 0;var r,o=(r=n(6177))&&r.__esModule?r:{default:r};t.loadElementSchemaValue=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=o.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController").form.elementForm[e]||"";return t?`${n}/${t}`:n}},3337:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(1594)),o=l(n(5609)),a=n(1135),i=l(n(6177));function l(e){return e&&e.__esModule?e:{default:e}}t.default=e=>t=>{const n={...t};return n.hasOwnProperty("actions")||(n.actions={}),n.actions.revertToVersion=(e,t,n,r)=>{const l=`${(0,a.getConfig)().controllerLink.replace(/\/$/,"")}/api/revert`;return o.default.post(l,{id:e,fromVersion:t,fromStage:n,toStage:r},{"X-SecurityID":i.default.get("SecurityID")})},r.default.createElement(e,n)}},455:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.elementType=void 0;var r,o=(r=n(6935))&&r.__esModule?r:{default:r};t.elementType=o.default.shape({id:o.default.number,title:o.default.string,blockSchema:o.default.object,inlineEditable:o.default.bool,published:o.default.bool,liveVersion:o.default.bool,version:o.default.number})},9791:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.elementTypeType=void 0;var r,o=(r=n(6935))&&r.__esModule?r:{default:r};t.elementTypeType=o.default.shape({name:o.default.string,title:o.default.string,icon:o.default.string,inlineEditable:o.default.bool,editTabs:o.default.arrayOf(o.default.shape({title:o.default.string,name:o.default.string})),config:o.default.object})},5609:function(e){e.exports=Backend},6177:function(e){e.exports=Config},2623:function(e){e.exports=FieldHolder},55:function(e){e.exports=FormBuilderLoader},5207:function(e){e.exports=Injector},6935:function(e){e.exports=PropTypes},1594:function(e){e.exports=React},5145:function(e){e.exports=ReactDomClient},9040:function(e){e.exports=ReactRedux},3556:function(e){e.exports=Reactstrap},9367:function(e){e.exports=Redux},5381:function(e){e.exports=ReduxForm},5034:function(e){e.exports=TabsActions},8918:function(e){e.exports=ToastsActions},9077:function(e){e.exports=UnsavedFormsActions},6923:function(e){e.exports=classnames},4014:function(e){e.exports=getJsonErrorMessage},5815:function(e){e.exports=i18n},1669:function(e){e.exports=jQuery},5799:function(e){e.exports=withDragDropContext}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(51),n(2038)}(); \ No newline at end of file diff --git a/client/dist/styles/bundle.css b/client/dist/styles/bundle.css index 7a0a90a2..57f1989d 100644 --- a/client/dist/styles/bundle.css +++ b/client/dist/styles/bundle.css @@ -1 +1 @@ -.elemental-edit{display:flex;color:inherit}.elemental-edit:hover,.elemental-edit:focus{text-decoration:none;color:inherit}.elemental-editor .col-EditorPreview{padding-left:0}.elemental-preview__detail{display:inline-block;margin-left:.76925rem;margin-top:1px}.elemental-preview__detail h3{font-weight:400;line-height:26px;margin:0;-webkit-font-smoothing:antialiased}.elemental-preview__detail p{align-items:center;display:flex;margin-bottom:0;margin-top:6px}.elemental-preview__detail small{color:rgb(86.4147727273,107.0511363636,140.5852272727);font-size:13px}.elemental-preview__thumbnail-image{margin-right:.76925rem}.elemental-preview__thumbnail-image img{border-radius:.192rem}.elemental-preview__thumbnail-image--placeholder{border-radius:0;height:36px;margin-left:-4px}.elemental-preview__icon{color:rgb(86.4147727273,107.0511363636,140.5852272727);display:inline-block;flex-direction:row;font-size:2.3rem;width:28px;vertical-align:top;margin-top:-1px}.ss-gridfield-orderable.elemental-editor .col-reorder .handle{opacity:.5;padding:22px 0 0}.ss-gridfield-orderable.elemental-editor .col-reorder .handle .icon{font-size:1.3em}.elemental-editor .ss-gridfield-item:hover .handle{opacity:1}.elemental-editor .grid-field__table{margin-bottom:12px}@media(max-width: 991.98px){.elemental-editor .grid-field__table .col-EditorPreview{display:table-cell}}.elemental-report__grid-field .element-editor-header__version-state{bottom:9px;left:14px}.element-editor .form-group:nth-child(1n){display:block}@media(min-width: 992px){.element-editor .form-group:nth-child(1n) .form__field-label,.element-editor .form-group:nth-child(1n) .form__field-holder{flex:0 0 83.33333333%;max-width:83.33333333%;margin-left:0}}.elemental-block__history-tab{margin-top:-1.5385rem}.cms-edit-form .fieldgroup.elemental-area__element--historic{margin-left:0;margin-right:0}.cms-edit-form .fieldgroup.elemental-area__element--historic.form-group{border-top:1px solid rgb(218.7079545455,224.0352272727,232.6920454545)}.cms-edit-form .fieldgroup.elemental-area__element--historic .form__field-holder{flex:0 0 100%;max-width:100%}.elemental-preview{line-height:20px}.elemental-preview--historic{margin-bottom:1rem}.elemental-preview__link{float:right;margin-top:4px}.elemental-preview__link:hover{text-decoration:none}.elemental-preview__link:hover .elemental-preview__link-text{text-decoration:underline}.elemental-preview__link-caret{display:block;float:right;margin-top:-2px;margin-left:2px}div.elemental-area__element--historic.elemental-area__element--historic-inner{background:rgba(0,0,0,0);border:0;padding-left:0;padding-right:0;padding-top:1.5385rem}.elemental-area--read-only{border-bottom:1px solid rgb(218.7079545455,224.0352272727,232.6920454545);margin:2.30775rem -1.5385rem}.history-viewer__version-detail fieldset{overflow:visible}.elemental-report__grid-field .ss-gridfield-item td:first-child{width:1px}.elemental-report__grid-field .col-Icon{font-size:1.5rem}.elemental-report__grid-field .element-item--draft,.elemental-report__grid-field .element-item--modified{bottom:8px;left:14px;height:6px;width:6px}.textcheckboxgroup .input-group-append .form-check-input{margin-left:0;position:relative}.element-editor .action-menu .dropdown-item.disabled{font-style:italic;pointer-events:initial;cursor:not-allowed;color:rgb(111.3181818182,132.4090909091,166.6818181818)}.elemental-editor__add-new-block-control{width:20rem}.elemental-editor__add-new-block-control a{line-height:1.85em}.element-editor__element{border-bottom:1px solid rgb(218.7079545455,224.0352272727,232.6920454545);color:inherit;cursor:pointer;min-height:8rem;padding:.9231rem 1.5385rem 1.8462rem}.element-editor__element:focus,.element-editor__element:hover{box-shadow:0 2px 5px 0 rgba(0,0,0,.1),0 2px 10px 0 rgba(0,0,0,.1);outline-width:0}.element-editor__element:hover .element-editor-header__drag-handle{display:block}.element-editor__element--broken{cursor:default}.element-editor__element--dragging{opacity:.3;cursor:grabbing}.elemental-editor-list{background-color:#fff;border-top:1px solid rgb(218.7079545455,224.0352272727,232.6920454545);margin-left:-1.5385rem;margin-right:-1.5385rem;min-height:calc(8rem + 1px);position:relative;margin-bottom:1.5385rem}.elemental-editor-list--empty{border-bottom:1px solid rgb(218.7079545455,224.0352272727,232.6920454545);display:flex;align-items:center;justify-content:center}.element-editor-editform{margin-top:.76925rem;cursor:auto;margin-bottom:-1rem}.element-editor-editform .mce-tinymce{box-sizing:border-box}.element-editor-editform__form{width:100%}.element-editor-editform .element-editor-editform__form .form-group .form__field-holder{flex:1 0 100%;max-width:900px}.element-editor-editform--rendered-not-visible{position:absolute;top:-9999px;left:-9999px}.element-editor-editform .btn--hidden{display:none}.element-editor-editform .text-checkbox-group-field{align-items:flex-start}.element-editor-editform .text-checkbox-group-field .form-group{margin-bottom:0;flex:auto}.element-editor-header{display:flex;align-items:center;justify-content:space-between}.element-editor-header__title{font-size:15px;font-weight:400;margin:0 0 0 .76925rem;-webkit-font-smoothing:antialiased;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.element-editor-header__title--none{font-style:italic;color:rgb(111.3181818182,132.4090909091,166.6818181818)}.element-editor-header__info,.element-editor-header__actions{align-items:center;display:flex;flex-grow:1}.element-editor-header__info{max-width:calc(100% - 60px)}.element-editor-header__info .badge{padding:2px 3px 2px 4px;margin-left:.5rem}.element-editor-header__actions{justify-content:flex-end}.element-editor-header__actions-toggle{padding-top:3px;padding-bottom:3px}.element-editor-header__icon-container{margin-left:-2px;color:rgb(86.4147727273,107.0511363636,140.5852272727);font-size:2.154rem;height:28px;line-height:1.5rem}.element-editor-header__icon-container--broken{color:#da273b}.element-editor-header__expand{font-size:1.1rem;margin-left:3px;width:unset}.element-editor-header__version-state{border:1px solid #cf3f00;border-radius:100%;bottom:6px;box-shadow:0 0 1px .5px #fff;display:block;height:8px;left:22px;position:relative;width:8px;z-index:1}.element-editor-header__version-state--draft{background-color:#ff7f22}.element-editor-header__version-state--modified{background-color:#fff7f0}.element-editor-header__drag-handle{display:none;position:absolute;left:5px;cursor:grab}.element-editor-header--simple .element-editor-header__drag-handle{display:block}.element-editor-header--simple .element-editor-header__info{width:460px}.element-editor-header .dropdown-item.active{cursor:default}.element-editor-summary{display:flex;margin-top:.9231rem;margin-left:36px;align-items:center;min-height:2em}.element-editor-summary__thumbnail-image{border-radius:.1536rem;height:36px;margin:-.6154rem .9231rem -.6154rem 0}.element-editor-summary__content{color:rgb(86.4147727273,107.0511363636,140.5852272727);line-height:1.3;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.element-editor-summary__content--broken{overflow:visible;white-space:normal}.element-editor__toolbar{margin-bottom:1rem}.element-editor__hover-bar{height:0;display:flex;width:100%;position:relative;align-items:center}.element-editor__hover-bar-area{background-color:rgba(0,0,0,0);min-height:1.8462rem;width:100%;margin:0;padding:0;border:0;outline:none;transition:all ease .2s;position:relative}.element-editor__hover-bar-area:hover,.element-editor__hover-bar-area:focus,.element-editor__hover-bar-area--focus{outline:none}.element-editor__hover-bar-area:hover .element-editor__hover-bar-area-inner,.element-editor__hover-bar-area:focus .element-editor__hover-bar-area-inner,.element-editor__hover-bar-area--focus .element-editor__hover-bar-area-inner{margin:0 20px}.element-editor__hover-bar-area:hover .element-editor__hover-bar-line,.element-editor__hover-bar-area:focus .element-editor__hover-bar-line,.element-editor__hover-bar-area--focus .element-editor__hover-bar-line{opacity:1;border-radius:5px;max-height:5px}.element-editor__hover-bar-area:hover .element-editor__hover-bar-line:before,.element-editor__hover-bar-area:focus .element-editor__hover-bar-line:before,.element-editor__hover-bar-area--focus .element-editor__hover-bar-line:before{transform:translateY(calc(3px - 50%)) scale(1)}.element-editor__hover-bar-area-inner{margin:0;display:block;position:relative;transition:all ease .2s}.element-editor__hover-bar-line{background-color:#005ae1;transition:all ease .2s;opacity:0;align-self:center;width:100%;border:0;position:absolute;display:flex;justify-content:flex-end;padding:0;top:50%;transform:translateY(-66%);max-height:0;border-radius:0}.element-editor__hover-bar-line:before{font-size:1.5rem;background-image:radial-gradient(#fff 50%, transparent 50%);position:relative;z-index:2;margin-right:50%;right:-0.5em;display:block;height:1em;transform:translateY(calc(-1px - 50%)) scale(0);transition:all ease .2s;color:#005ae1}.elemental-editor-drag-indicator{height:3px;margin:-2px 0 -1px;background-color:#29abe2}.elemental-editor-drag-indicator__ball{position:relative;height:7px;width:7px;top:-2px;left:-3px;border-radius:3.5px;background-color:#29abe2}.element-editor--dragging{cursor:grabbing}.element-editor-drag-preview{top:0;left:0;position:fixed;pointer-events:none;z-index:100;background-color:#fff;border:1px solid rgb(206.0738636364,213.2556818182,224.9261363636);padding:.9231rem 1.5385rem;box-shadow:0 2px 5px 0 rgba(0,0,0,.1),0 2px 10px 0 rgba(0,0,0,.1)}.text-checkbox-group-field .form-check{display:inline;padding-left:0;margin-bottom:0}.text-checkbox-group-field--read-only{display:flex}.text-checkbox-group-field--read-only :first-child{flex:1}.text-checkbox-group-field--read-only .show-title{font-style:italic} +.elemental-edit{display:flex;color:inherit}.elemental-edit:hover,.elemental-edit:focus{text-decoration:none;color:inherit}.elemental-editor .col-EditorPreview{padding-left:0}.elemental-preview__detail{display:inline-block;margin-left:.76925rem;margin-top:1px}.elemental-preview__detail h3{font-weight:400;line-height:26px;margin:0;-webkit-font-smoothing:antialiased}.elemental-preview__detail p{align-items:center;display:flex;margin-bottom:0;margin-top:6px}.elemental-preview__detail small{color:rgb(86.4147727273,107.0511363636,140.5852272727);font-size:13px}.elemental-preview__thumbnail-image{margin-right:.76925rem}.elemental-preview__thumbnail-image img{border-radius:.192rem}.elemental-preview__thumbnail-image--placeholder{border-radius:0;height:36px;margin-left:-4px}.elemental-preview__icon{color:rgb(86.4147727273,107.0511363636,140.5852272727);display:inline-block;flex-direction:row;font-size:2.3rem;width:28px;vertical-align:top;margin-top:-1px}.ss-gridfield-orderable.elemental-editor .col-reorder .handle{opacity:.5;padding:22px 0 0}.ss-gridfield-orderable.elemental-editor .col-reorder .handle .icon{font-size:1.3em}.elemental-editor .ss-gridfield-item:hover .handle{opacity:1}.elemental-editor .grid-field__table{margin-bottom:12px}@media(max-width: 991.98px){.elemental-editor .grid-field__table .col-EditorPreview{display:table-cell}}.elemental-report__grid-field .element-editor-header__version-state{bottom:9px;left:14px}.element-editor .form-group:nth-child(1n){display:block}@media(min-width: 992px){.element-editor .form-group:nth-child(1n) .form__field-label,.element-editor .form-group:nth-child(1n) .form__field-holder{flex:0 0 83.33333333%;max-width:83.33333333%;margin-left:0}}.elemental-block__history-tab{margin-top:-1.5385rem}.cms-edit-form .fieldgroup.elemental-area__element--historic{margin-left:0;margin-right:0}.cms-edit-form .fieldgroup.elemental-area__element--historic.form-group{border-top:1px solid rgb(218.7079545455,224.0352272727,232.6920454545)}.cms-edit-form .fieldgroup.elemental-area__element--historic .form__field-holder{flex:0 0 100%;max-width:100%}.elemental-preview{line-height:20px}.elemental-preview--historic{margin-bottom:1rem}.elemental-preview__link{float:right;margin-top:4px}.elemental-preview__link:hover{text-decoration:none}.elemental-preview__link:hover .elemental-preview__link-text{text-decoration:underline}.elemental-preview__link-caret{display:block;float:right;margin-top:-2px;margin-left:2px}div.elemental-area__element--historic.elemental-area__element--historic-inner{background:rgba(0,0,0,0);border:0;padding-left:0;padding-right:0;padding-top:1.5385rem}.elemental-area--read-only{border-bottom:1px solid rgb(218.7079545455,224.0352272727,232.6920454545);margin:2.30775rem -1.5385rem}.history-viewer__version-detail fieldset{overflow:visible}.elemental-report__grid-field .ss-gridfield-item td:first-child{width:1px}.elemental-report__grid-field .col-Icon{font-size:1.5rem}.elemental-report__grid-field .element-item--draft,.elemental-report__grid-field .element-item--modified{bottom:8px;left:14px;height:6px;width:6px}.textcheckboxgroup .input-group-append .form-check-input{margin-left:0;position:relative}.element-editor .action-menu .dropdown-item.disabled{font-style:italic;pointer-events:initial;cursor:not-allowed;color:rgb(111.3181818182,132.4090909091,166.6818181818)}.elemental-editor__add-new-block-control{width:20rem}.elemental-editor__add-new-block-control a{line-height:1.85em}.element-editor__element{border-bottom:1px solid rgb(218.7079545455,224.0352272727,232.6920454545);color:inherit;cursor:pointer;min-height:8rem;padding:.9231rem 1.5385rem 1.8462rem}.element-editor__element:focus,.element-editor__element:hover{box-shadow:0 2px 5px 0 rgba(0,0,0,.1),0 2px 10px 0 rgba(0,0,0,.1);outline-width:0}.element-editor__element:hover .element-editor-header__drag-handle{display:block}.element-editor__element--broken{cursor:default}.element-editor__element--dragging{opacity:.3;cursor:grabbing}.elemental-editor-list{background-color:#fff;border-top:1px solid rgb(218.7079545455,224.0352272727,232.6920454545);margin-left:-1.5385rem;margin-right:-1.5385rem;min-height:calc(8rem + 1px);position:relative;margin-bottom:1.5385rem}.elemental-editor-list--empty{border-bottom:1px solid rgb(218.7079545455,224.0352272727,232.6920454545);display:flex;align-items:center;justify-content:center}.element-editor-editform{margin-top:.76925rem;cursor:auto;margin-bottom:-1rem}.element-editor-editform .mce-tinymce{box-sizing:border-box}.element-editor-editform__form{width:100%}.element-editor-editform .element-editor-editform__form .form-group .form__field-holder{flex:1 0 100%;max-width:900px}.element-editor-editform--rendered-not-visible{position:absolute;top:-9999px;left:-9999px}.element-editor-editform .btn--hidden{display:none}.element-editor-editform .text-checkbox-group-field{align-items:flex-start}.element-editor-editform .text-checkbox-group-field .form-group{margin-bottom:0;flex:auto}.element-editor-header{display:flex;align-items:center;justify-content:space-between}.element-editor-header__title{font-size:15px;font-weight:400;margin:0 0 0 .76925rem;-webkit-font-smoothing:antialiased;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.element-editor-header__title--none{font-style:italic;color:rgb(111.3181818182,132.4090909091,166.6818181818)}.element-editor-header__info,.element-editor-header__actions{align-items:center;display:flex;flex-grow:1}.element-editor-header__info{max-width:calc(100% - 60px)}.element-editor-header__info .badge{padding:2px 3px 2px 4px;margin-left:.5rem}.element-editor-header__actions{justify-content:flex-end}.element-editor-header__actions-toggle{padding-top:3px;padding-bottom:3px}.element-editor-header__icon-container{margin-left:-2px;color:rgb(86.4147727273,107.0511363636,140.5852272727);font-size:2.154rem;height:28px;line-height:1.5rem}.element-editor-header__icon-container--broken{color:#da273b}.element-editor-header__expand{font-size:1.1rem;margin-left:3px;width:unset}.element-editor-header__version-state{border:1px solid #cf3f00;border-radius:100%;bottom:6px;box-shadow:0 0 1px .5px #fff;display:block;height:8px;left:22px;position:relative;width:8px;z-index:1}.element-editor-header__version-state--draft{background-color:#ff7f22}.element-editor-header__version-state--modified{background-color:#fff7f0}.element-editor-header__drag-handle{display:none;position:absolute;left:5px;cursor:grab}.element-editor-header--simple .element-editor-header__drag-handle{display:block}.element-editor-header--simple .element-editor-header__info{width:460px}.element-editor-header .dropdown-item.active{cursor:default}.element-editor-summary{display:flex;margin-top:.9231rem;margin-left:36px;align-items:center;min-height:2em}.element-editor-summary__thumbnail-image{border-radius:.1536rem;height:36px;margin:-.6154rem .9231rem -.6154rem 0}.element-editor-summary__content{color:rgb(86.4147727273,107.0511363636,140.5852272727);line-height:1.3;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.element-editor-summary__content--broken{overflow:visible;white-space:normal}.element-editor__toolbar{margin-bottom:1rem}.element-editor__hover-bar{height:0;display:flex;width:100%;position:relative;align-items:center}.element-editor__hover-bar-area{background-color:rgba(0,0,0,0);min-height:1.8462rem;width:100%;margin:0;padding:0;border:0;outline:none;transition:all ease .2s;position:relative}.element-editor__hover-bar-area:hover,.element-editor__hover-bar-area:focus,.element-editor__hover-bar-area--focus{outline:none}.element-editor__hover-bar-area:hover .element-editor__hover-bar-area-inner,.element-editor__hover-bar-area:focus .element-editor__hover-bar-area-inner,.element-editor__hover-bar-area--focus .element-editor__hover-bar-area-inner{margin:0 20px}.element-editor__hover-bar-area:hover .element-editor__hover-bar-line,.element-editor__hover-bar-area:focus .element-editor__hover-bar-line,.element-editor__hover-bar-area--focus .element-editor__hover-bar-line{opacity:1;border-radius:5px;max-height:5px}.element-editor__hover-bar-area:hover .element-editor__hover-bar-line:before,.element-editor__hover-bar-area:focus .element-editor__hover-bar-line:before,.element-editor__hover-bar-area--focus .element-editor__hover-bar-line:before{transform:translateY(calc(3px - 50%)) scale(1)}.element-editor__hover-bar-area-inner{margin:0;display:block;position:relative;transition:all ease .2s}.element-editor__hover-bar-line{background-color:#005ae1;transition:all ease .2s;opacity:0;align-self:center;width:100%;border:0;position:absolute;display:flex;justify-content:flex-end;padding:0;top:50%;transform:translateY(-66%);max-height:0;border-radius:0}.element-editor__hover-bar-line:before{font-size:1.5rem;background-image:radial-gradient(#fff 50%, transparent 50%);position:relative;z-index:2;margin-right:50%;right:-0.5em;display:block;height:1em;transform:translateY(calc(-1px - 50%)) scale(0);transition:all ease .2s;color:#005ae1}.elemental-editor-drag-indicator{height:3px;margin:-2px 0 -1px;background-color:#29abe2}.elemental-editor-drag-indicator__ball{position:relative;height:7px;width:7px;top:-2px;left:-3px;border-radius:3.5px;background-color:#29abe2}.element-editor--dragging{cursor:grabbing}.text-checkbox-group-field .form-check{display:inline;padding-left:0;margin-bottom:0}.text-checkbox-group-field--read-only{display:flex}.text-checkbox-group-field--read-only :first-child{flex:1}.text-checkbox-group-field--read-only .show-title{font-style:italic} diff --git a/client/src/components/ElementEditor/Element.js b/client/src/components/ElementEditor/Element.js index b0db95eb..58da42e0 100644 --- a/client/src/components/ElementEditor/Element.js +++ b/client/src/components/ElementEditor/Element.js @@ -13,9 +13,8 @@ import { submit } from 'redux-form'; import { loadElementFormStateName } from 'state/editor/loadElementFormStateName'; import { loadElementSchemaValue } from 'state/editor/loadElementSchemaValue'; import * as TabsActions from 'state/tabs/TabsActions'; -import { DragSource, DropTarget } from 'react-dnd'; -import { getEmptyImage } from 'react-dnd-html5-backend'; -import { elementDragSource, isOverTop } from 'lib/dragHelpers'; +import { useSortable } from '@dnd-kit/sortable'; +import { CSS } from '@dnd-kit/utilities'; import * as toastsActions from 'state/toasts/ToastsActions'; import { addFormChanged, removeFormChanged } from 'state/unsavedForms/UnsavedFormsActions'; import { ElementEditorContext } from 'components/ElementEditor/ElementEditor'; @@ -43,6 +42,20 @@ const Element = (props) => { const [doDispatchAddFormChanged, setDoDispatchAddFormChanged] = useState(false); const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false); const { fetchElements } = useContext(ElementEditorContext); + const { + attributes, + listeners, + setNodeRef, + transform, + transition, + isDragging, + isOver, + } = useSortable({ id: props.element.id }); + + const style = { + transform: CSS.Transform.toString(transform), + transition, + }; useEffect(() => { // Note that formDirty from redux can be set to undefined after failed validation @@ -65,18 +78,6 @@ const Element = (props) => { } }, [props.saveElement, hasUnsavedChanges, props.increment]); - useEffect(() => { - if (props.connectDragPreview) { - // Use empty image as a drag preview so browsers don't draw it - // and we can draw whatever we want on the custom drag layer instead. - props.connectDragPreview(getEmptyImage(), { - // IE fallback: specify that we'd rather screenshot the node - // when it already knows it's being dragged so we can hide it with CSS. - captureDraggingState: true, - }); - } - }, []); - useEffect(() => { if (justClickedPublishButton && formHasRendered) { setJustClickedPublishButton(false); @@ -363,11 +364,6 @@ const Element = (props) => { ContentComponent, link, activeTab, - connectDragSource, - connectDropTarget, - isDragging, - isOver, - onDragEnd, formDirty, } = props; @@ -393,7 +389,7 @@ const Element = (props) => { onSaveButtonClick: handleSaveButtonClick, }; - const content = connectDropTarget(
{ tabIndex={0} title={getLinkTitle(type)} key={element.id} + // sortable properties + ref={setNodeRef} + {...attributes} + {...listeners} + style={style} > { handleEditTabsClick={handleTabClick} activeTab={activeTab} disableTooltip={isDragging} - onDragEnd={onDragEnd} /> { onFormInit={() => handleFormInit(activeTab)} /> -
); - - if (!previewExpanded) { - return connectDragSource(content); - } + ; return content; }; @@ -508,14 +504,7 @@ Element.propTypes = { activeTab: PropTypes.string, tabSetName: PropTypes.string, onActivateTab: PropTypes.func, - connectDragSource: PropTypes.func.isRequired, - connectDragPreview: PropTypes.func.isRequired, - connectDropTarget: PropTypes.func.isRequired, - isDragging: PropTypes.bool.isRequired, isOver: PropTypes.bool.isRequired, - onDragOver: PropTypes.func, // eslint-disable-line react/no-unused-prop-types - onDragEnd: PropTypes.func, // eslint-disable-line react/no-unused-prop-types - onDragStart: PropTypes.func, // eslint-disable-line react/no-unused-prop-types saveElement: PropTypes.bool.isRequired, onBeforeSubmitForm: PropTypes.func.isRequired, // eslint-disable-line react/no-unused-prop-types onAfterSubmitResponse: PropTypes.func.isRequired, @@ -529,35 +518,7 @@ Element.defaultProps = { export { Element as Component }; -const elementTarget = { - drop(props, monitor, component) { - const { element } = props; - - return { - target: element.id, - dropSpot: isOverTop(monitor, component) ? 'top' : 'bottom', - }; - }, - - hover(props, monitor, component) { - const { element, onDragOver } = props; - - if (onDragOver) { - onDragOver(element, isOverTop(monitor, component)); - } - }, -}; - export default compose( - DropTarget('element', elementTarget, (connector, monitor) => ({ - connectDropTarget: connector.dropTarget(), - isOver: monitor.isOver(), - })), - DragSource('element', elementDragSource, (connector, monitor) => ({ - connectDragSource: connector.dragSource(), - connectDragPreview: connector.dragPreview(), - isDragging: monitor.isDragging(), - })), connect(mapStateToProps, mapDispatchToProps), inject( ['ElementHeader', 'ElementContent'], diff --git a/client/src/components/ElementEditor/ElementDragPreview.js b/client/src/components/ElementEditor/ElementDragPreview.js deleted file mode 100644 index a37abb9f..00000000 --- a/client/src/components/ElementEditor/ElementDragPreview.js +++ /dev/null @@ -1,52 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import Header from 'components/ElementEditor/Header'; -import { DragLayer } from 'react-dnd'; -import { elementType } from 'types/elementType'; -import { elementTypeType } from 'types/elementTypeType'; -import { getElementTypeConfig } from 'state/editor/elementConfig'; - -// eslint-disable-next-line react/prefer-stateless-function -class ElementDragPreview extends Component { - render() { - const { isDragging, element, elementTypes, currentOffset } = this.props; - - if (!isDragging || !currentOffset) { - return null; - } - - const { x, y } = currentOffset; - const transform = `translate(${x}px, ${y}px)`; - const style = { - transform, - WebkitTransform: transform, - }; - const type = getElementTypeConfig(element, elementTypes); - - return ( -
-
-
- ); - } -} - -ElementDragPreview.propTypes = { - element: elementType, - elementTypes: PropTypes.arrayOf(elementTypeType), - isDragging: PropTypes.bool, - currentOffset: PropTypes.shape({ - x: PropTypes.number.isRequired, - y: PropTypes.number.isRequired, - }), -}; - -export default DragLayer(monitor => ({ - element: monitor.getItem(), - currentOffset: monitor.getSourceClientOffset(), - isDragging: monitor.isDragging(), -}))(ElementDragPreview); diff --git a/client/src/components/ElementEditor/ElementDragPreview.scss b/client/src/components/ElementEditor/ElementDragPreview.scss deleted file mode 100644 index 89bd0888..00000000 --- a/client/src/components/ElementEditor/ElementDragPreview.scss +++ /dev/null @@ -1,11 +0,0 @@ -.element-editor-drag-preview { - top: 0; - left: 0; - position: fixed; - pointer-events: none; - z-index: 100; // Higher than CMS tree view - background-color: $white; - border: 1px solid $border-color; - padding: $spacer-sm $panel-padding-x; - box-shadow: $z-depth-1; -} diff --git a/client/src/components/ElementEditor/ElementEditor.js b/client/src/components/ElementEditor/ElementEditor.js index 02dc5b6b..6c63eaf5 100644 --- a/client/src/components/ElementEditor/ElementEditor.js +++ b/client/src/components/ElementEditor/ElementEditor.js @@ -5,14 +5,13 @@ import { connect } from 'react-redux'; import { inject } from 'lib/Injector'; import { bindActionCreators, compose } from 'redux'; import { elementTypeType } from 'types/elementTypeType'; -import { DropTarget } from 'react-dnd'; -import ElementDragPreview from 'components/ElementEditor/ElementDragPreview'; import withDragDropContext from 'lib/withDragDropContext'; import backend from 'lib/Backend'; import Config from 'lib/Config'; import { getConfig } from 'state/editor/elementConfig'; import * as toastsActions from 'state/toasts/ToastsActions'; import getJsonErrorMessage from 'lib/getJsonErrorMessage'; +import { arrayMove } from '@dnd-kit/sortable'; export const ElementEditorContext = createContext(null); @@ -31,40 +30,46 @@ class ElementEditor extends PureComponent { isLoading: true, }; - this.handleDragOver = this.handleDragOver.bind(this); + this.handleDragStart = this.handleDragStart.bind(this); this.handleDragEnd = this.handleDragEnd.bind(this); this.fetchElements = this.fetchElements.bind(this); } /** - * Hook for ReactDND triggered by hovering over a drag _target_. - * - * This tracks the current hover target and whether it's above the top half of the target - * or the bottom half. - * - * @param element - * @param isOverTop + * Hook triggered when a draggable is picked up. */ - handleDragOver(element = null, isOverTop = null) { - const id = element ? element.id : false; - + handleDragStart(event) { + const { active } = event; this.setState({ - dragTargetElementId: id, - dragSpot: isOverTop === false ? 'bottom' : 'top', + dragging: active.id, }); } /** - * Hook for ReactDND triggered when a drag source is dropped onto a drag target. - * - * @param sourceId - * @param afterId + * Hook triggered when a draggable is dropped onto a drop target. */ - handleDragEnd(sourceId, afterId) { + handleDragEnd(event) { + const { active, over } = event; + const { elements } = this.state; + + // This happens if letting go of the draggable where it started. + if (active.id === over.id) { + this.setState({ + dragging: false, + }); + return; + } + + const elementIDs = elements.map(e => e.id); + const fromIndex = elementIDs.indexOf(active.id); + const toIndex = elementIDs.indexOf(over.id); + const sortedElements = arrayMove(elements, fromIndex, toIndex); + const afterBlockID = toIndex > 0 ? sortedElements[toIndex - 1].id : 0; + const url = `${getConfig().controllerLink.replace(/\/$/, '')}/api/sort`; backend.post(url, { - id: sourceId, - afterBlockID: afterId, + id: active.id, + afterBlockID, }, { 'X-SecurityID': Config.get('SecurityID') }) @@ -75,8 +80,10 @@ class ElementEditor extends PureComponent { }); this.setState({ - dragTargetElementId: null, - dragSpot: null, + dragging: false, + // Setting elements ensures there is no "pop" between dropping the element and reloading + // the list with fetchElements above, as the elements will already be rendered in the new order. + elements: sortedElements, }); } @@ -121,13 +128,11 @@ class ElementEditor extends PureComponent { ListComponent, areaId, elementTypes, - isDraggingOver, - connectDropTarget, allowedElements, sharedObject, isLoading, } = this.props; - const { dragTargetElementId, dragSpot, elements } = this.state; + const { dragging, elements } = this.state; if (elements === null) { this.fetchElements(false); @@ -146,32 +151,25 @@ class ElementEditor extends PureComponent { fetchElements: this.fetchElements, }; - return connectDropTarget( -
- - - - - -
- ); + return
+ + + + +
; } } @@ -188,10 +186,6 @@ export { ElementEditor as Component }; const params = [ withDragDropContext, - DropTarget('element', {}, (connector, monitor) => ({ - connectDropTarget: connector.dropTarget(), - isDraggingOver: monitor.isOver(), // isDragging is not available on DropTargetMonitor - })), inject( ['ElementToolbar', 'ElementList'], (ToolbarComponent, ListComponent) => ({ diff --git a/client/src/components/ElementEditor/ElementList.js b/client/src/components/ElementEditor/ElementList.js index df8d0774..53959e7a 100644 --- a/client/src/components/ElementEditor/ElementList.js +++ b/client/src/components/ElementEditor/ElementList.js @@ -6,27 +6,22 @@ import { compose } from 'redux'; import { inject } from 'lib/Injector'; import classNames from 'classnames'; import i18n from 'i18n'; -import { DropTarget } from 'react-dnd'; -import { getDragIndicatorIndex } from 'lib/dragHelpers'; +import { DndContext, closestCenter, PointerSensor, useSensor, useSensors } from '@dnd-kit/core'; +import { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable'; +import { restrictToVerticalAxis, restrictToParentElement } from '@dnd-kit/modifiers'; import { getElementTypeConfig } from 'state/editor/elementConfig'; function ElementList({ elements, sharedObject, - connectDropTarget, ElementComponent, HoverBarComponent, - DragIndicatorComponent, allowedElementTypes, elementTypes, areaId, onDragEnd, - onDragOver, onDragStart, - isDraggingOver, - dragTargetElementId, - draggedItem, - dragSpot, + dragging, isLoading, LoadingComponent, }) { @@ -116,6 +111,16 @@ function ElementList({ setSaveAllElements(false); }, [saveAllElements, hasUnsavedChangesBlockIDs]); + const sensors = useSensors( + // Pointer sensor is for touch and mouse. + // The activation constraint allows clicking and small twitches without starting a "drag". + useSensor(PointerSensor, { + activationConstraint: { + distance: 10 + } + }), + ); + const handleChangeHasUnsavedChanges = (elementID, hasUnsavedChanges) => { setHasUnsavedChangesBlockIDs({ ...hasUnsavedChangesBlockIDs, @@ -141,13 +146,6 @@ function ElementList({ }); }; - const getCurrentDragIndicatorIndex = () => getDragIndicatorIndex( - elements.map(element => element.id), - dragTargetElementId, - draggedItem && draggedItem.id, - dragSpot - ); - /** * Renders a list of Element components, each with an elementType object * of data mapped into it. @@ -161,32 +159,30 @@ function ElementList({ const saveElement = saveAllElements && hasUnsavedChangesBlockIDs[element.id] && validBlockIDs[element.id] === null; - return
+ return <> handleChangeHasUnsavedChanges(element.id, hasUnsavedChanges)} onBeforeSubmitForm={() => handleBeforeSubmitForm(element.id)} onAfterSubmitResponse={(valid) => handleAfterSubmitResponse(element.id, valid)} increment={increment} /> - {isDraggingOver || } -
; + ; }); // Add a insert point above the first block for consistency - if (!isDraggingOver) { + if (dragging === false) { output = [ ); - } - - return output; + return + element.id)} + strategy={verticalListSortingStrategy} + > + {output} + + ; }; /** @@ -221,12 +225,11 @@ function ElementList({ 'elemental-editor-list', { 'elemental-editor-list--empty': !elements || !elements.length } ); - return connectDropTarget( -
- {renderLoading()} - {renderBlocks()} -
- ); + + return
+ {renderLoading()} + {renderBlocks()} +
; } ElementList.propTypes = { @@ -234,10 +237,9 @@ ElementList.propTypes = { elementTypes: PropTypes.arrayOf(elementTypeType).isRequired, allowedElementTypes: PropTypes.arrayOf(elementTypeType).isRequired, areaId: PropTypes.number.isRequired, - dragTargetElementId: PropTypes.oneOfType([PropTypes.number, PropTypes.bool]), - onDragOver: PropTypes.func, onDragStart: PropTypes.func, onDragEnd: PropTypes.func, + dragging: PropTypes.oneOf([PropTypes.bool, PropTypes.number]), sharedObject: PropTypes.object.isRequired, }; @@ -252,35 +254,7 @@ ElementList.defaultProps = { export { ElementList as Component }; -const elementListTarget = { - drop(props, monitor) { - const { elements } = props; - const elementTargetDropResult = monitor.getDropResult(); - - if (!elementTargetDropResult) { - return {}; - } - - const dropIndex = getDragIndicatorIndex( - elements.map(element => element.id), - elementTargetDropResult.target, - monitor.getItem(), - elementTargetDropResult.dropSpot, - ); - const dropAfterID = elements[dropIndex - 1] ? elements[dropIndex - 1].id : '0'; - - return { - ...elementTargetDropResult, - dropAfterID, - }; - }, -}; - export default compose( - DropTarget('element', elementListTarget, (connector, monitor) => ({ - connectDropTarget: connector.dropTarget(), - draggedItem: monitor.getItem(), - })), inject( ['Element', 'Loading', 'HoverBar', 'DragPositionIndicator'], (ElementComponent, LoadingComponent, HoverBarComponent, DragIndicatorComponent) => ({ diff --git a/client/src/components/ElementEditor/Header.js b/client/src/components/ElementEditor/Header.js index 44b8d533..45e06853 100644 --- a/client/src/components/ElementEditor/Header.js +++ b/client/src/components/ElementEditor/Header.js @@ -7,9 +7,6 @@ import { compose } from 'redux'; import { inject } from 'lib/Injector'; import i18n from 'i18n'; import classNames from 'classnames'; -import { DragSource } from 'react-dnd'; -import { elementDragSource } from 'lib/dragHelpers'; -import { getEmptyImage } from 'react-dnd-html5-backend'; class Header extends Component { constructor(props) { @@ -22,19 +19,6 @@ class Header extends Component { }; } - componentDidMount() { - const { connectDragPreview } = this.props; - if (connectDragPreview) { - // Use empty image as a drag preview so browsers don't draw it - // and we can draw whatever we want on the custom drag layer instead. - connectDragPreview(getEmptyImage(), { - // IE fallback: specify that we'd rather screenshot the node - // when it already knows it's being dragged so we can hide it with CSS. - captureDraggingState: true, - }); - } - } - componentDidUpdate() { const { tooltipOpen } = this.state; const { disableTooltip } = this.props; @@ -136,7 +120,6 @@ class Header extends Component { render() { const { - connectDragSource, element, type, areaId, @@ -214,10 +197,6 @@ class Header extends Component { ); - if (previewExpanded) { - return connectDragSource(content); - } - return content; } } @@ -231,9 +210,6 @@ Header.propTypes = { ElementActionsComponent: PropTypes.elementType, previewExpanded: PropTypes.bool, disableTooltip: PropTypes.bool, - connectDragSource: PropTypes.func.isRequired, - connectDragPreview: PropTypes.func.isRequired, - onDragEnd: PropTypes.func, // eslint-disable-line react/no-unused-prop-types }; Header.defaultProps = { @@ -243,10 +219,6 @@ Header.defaultProps = { export { Header as Component }; export default compose( - DragSource('element', elementDragSource, connector => ({ - connectDragSource: connector.dragSource(), - connectDragPreview: connector.dragPreview(), - })), inject( ['ElementActions'], (ElementActionsComponent) => ({ diff --git a/client/src/components/ElementEditor/Toolbar.js b/client/src/components/ElementEditor/Toolbar.js index fc942fc6..870ebcc5 100644 --- a/client/src/components/ElementEditor/Toolbar.js +++ b/client/src/components/ElementEditor/Toolbar.js @@ -2,20 +2,17 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { inject } from 'lib/Injector'; import { elementTypeType } from 'types/elementTypeType'; -import { DropTarget } from 'react-dnd'; // eslint-disable-next-line react/prefer-stateless-function class Toolbar extends PureComponent { render() { - const { AddNewButtonComponent, elementTypes, areaId, connectDropTarget } = this.props; - return connectDropTarget( -
- -
- ); + const { AddNewButtonComponent, elementTypes, areaId, } = this.props; + return
+ +
; } } @@ -24,26 +21,13 @@ Toolbar.propTypes = { elementTypes: PropTypes.arrayOf(elementTypeType).isRequired, areaId: PropTypes.number.isRequired, AddNewButtonComponent: PropTypes.elementType.isRequired, - connectDropTarget: PropTypes.func.isRequired, - onDragOver: PropTypes.func, // eslint-disable-line react/no-unused-prop-types onDragDrop: PropTypes.func, // eslint-disable-line react/no-unused-prop-types }; -const toolbarTarget = { - hover(props) { - const { onDragOver } = props; - if (onDragOver) { - onDragOver(); - } - } -}; - -export default DropTarget('element', toolbarTarget, connect => ({ - connectDropTarget: connect.dropTarget(), -}))(inject( +export default inject( ['ElementAddNewButton'], (AddNewButtonComponent) => ({ AddNewButtonComponent, }), () => 'ElementEditor.ElementToolbar' -)(Toolbar)); +)(Toolbar); diff --git a/client/src/components/ElementEditor/tests/ElementEditor-test.js b/client/src/components/ElementEditor/tests/ElementEditor-test.js index 0c8af0c9..092af3ee 100644 --- a/client/src/components/ElementEditor/tests/ElementEditor-test.js +++ b/client/src/components/ElementEditor/tests/ElementEditor-test.js @@ -92,11 +92,16 @@ function createJsonError(message) { const jQuery = jest.fn(); window.jQuery = jQuery; +const mockEvent = { + active: { id: 1 }, + over: { id: 2 }, +}; + function makeProps(obj = {}) { return { ToolbarComponent: ({ elementTypes }) =>
type.class).join(',')} />, ListComponent: ({ elements, onDragEnd }) =>
- {elements.map(element =>
onDragEnd(1, 2)}>{element.title}
)} + {elements.map(element =>
onDragEnd(mockEvent)}>{element.title}
)}
, areaId: 8, elementTypes: [ diff --git a/client/src/lib/dragHelpers.js b/client/src/lib/dragHelpers.js deleted file mode 100644 index 5220f48c..00000000 --- a/client/src/lib/dragHelpers.js +++ /dev/null @@ -1,57 +0,0 @@ -import { findDOMNode } from 'react-dom'; - -export const isOverTop = (monitor, component) => { - const clientOffset = monitor.getClientOffset(); - const componentRect = findDOMNode(component).getBoundingClientRect(); - - return clientOffset.y < componentRect.y + (componentRect.height / 2); -}; - -export const getDragIndicatorIndex = (items, dragTarget, draggedItem, dragSpot) => { - if (dragTarget === null || !draggedItem) { - return null; - } - - let targetIndex = dragTarget ? - items.findIndex(element => element === dragTarget) : 0; - const sourceIndex = items.findIndex(item => item === draggedItem); - - if (dragSpot === 'bottom') { - targetIndex += 1; - } - - // Don't render if... - if ( - // The indicator will be placed before the item that's being dragged - (sourceIndex === targetIndex) - // The indicator will be placed after the item that's being dragged - || (sourceIndex + 1 === targetIndex) - ) { - return null; - } - - return targetIndex; -}; - -export const elementDragSource = { - beginDrag(props) { - return props.element; - }, - - endDrag(props, monitor) { - const { onDragEnd } = props; - const dropResult = monitor.getDropResult(); - - if (!onDragEnd || !dropResult || !dropResult.dropAfterID) { - return; - } - - const itemID = monitor.getItem().id; - const { dropAfterID } = dropResult; - - // Only trigger the drop handler if the dragged element was moved, to avoid unnecessary work - if (itemID !== dropAfterID) { - onDragEnd(itemID, dropAfterID); - } - } -}; diff --git a/client/src/styles/bundle.scss b/client/src/styles/bundle.scss index f71f1893..7ec9cd1e 100644 --- a/client/src/styles/bundle.scss +++ b/client/src/styles/bundle.scss @@ -22,5 +22,4 @@ @import "../components/ElementEditor/HoverBar"; @import "../components/ElementEditor/DragPositionIndicator"; @import "../components/ElementEditor/ElementEditor"; -@import "../components/ElementEditor/ElementDragPreview"; @import "../components/TextCheckboxGroupField/TextCheckboxGroupField"; diff --git a/package.json b/package.json index 92cc3d25..30750b7b 100644 --- a/package.json +++ b/package.json @@ -33,13 +33,14 @@ }, "homepage": "https://github.com/dnadesign/silverstripe-elemental#readme", "dependencies": { + "@dnd-kit/core": "^6.3.1", + "@dnd-kit/modifiers": "^9.0.0", + "@dnd-kit/sortable": "^10.0.0", "@popperjs/core": "^2.11.6", "bootstrap": "^4.6.2", "classnames": "^2.3.2", "prop-types": "^15.8.1", "react": "^18.2.0", - "react-dnd": "^5.0.0", - "react-dnd-html5-backend": "^5.0.1", "react-dom": "^18.2.0", "react-redux": "^9.2.0", "reactstrap": "^8.9.0", diff --git a/yarn.lock b/yarn.lock index ca388503..c7aa52fc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -993,6 +993,45 @@ resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== +"@dnd-kit/accessibility@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@dnd-kit/accessibility/-/accessibility-3.1.1.tgz#3b4202bd6bb370a0730f6734867785919beac6af" + integrity sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw== + dependencies: + tslib "^2.0.0" + +"@dnd-kit/core@^6.3.1": + version "6.3.1" + resolved "https://registry.yarnpkg.com/@dnd-kit/core/-/core-6.3.1.tgz#4c36406a62c7baac499726f899935f93f0e6d003" + integrity sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ== + dependencies: + "@dnd-kit/accessibility" "^3.1.1" + "@dnd-kit/utilities" "^3.2.2" + tslib "^2.0.0" + +"@dnd-kit/modifiers@^9.0.0": + version "9.0.0" + resolved "https://registry.yarnpkg.com/@dnd-kit/modifiers/-/modifiers-9.0.0.tgz#96a0280c77b10c716ef79d9792ce7ad04370771d" + integrity sha512-ybiLc66qRGuZoC20wdSSG6pDXFikui/dCNGthxv4Ndy8ylErY0N3KVxY2bgo7AWwIbxDmXDg3ylAFmnrjcbVvw== + dependencies: + "@dnd-kit/utilities" "^3.2.2" + tslib "^2.0.0" + +"@dnd-kit/sortable@^10.0.0": + version "10.0.0" + resolved "https://registry.yarnpkg.com/@dnd-kit/sortable/-/sortable-10.0.0.tgz#1f9382b90d835cd5c65d92824fa9dafb78c4c3e8" + integrity sha512-+xqhmIIzvAYMGfBYYnbKuNicfSsk4RksY2XdmJhT+HAC01nix6fHCztU68jooFiMUB01Ky3F0FyOvhG/BZrWkg== + dependencies: + "@dnd-kit/utilities" "^3.2.2" + tslib "^2.0.0" + +"@dnd-kit/utilities@^3.2.2": + version "3.2.2" + resolved "https://registry.yarnpkg.com/@dnd-kit/utilities/-/utilities-3.2.2.tgz#5a32b6af356dc5f74d61b37d6f7129a4040ced7b" + integrity sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg== + dependencies: + tslib "^2.0.0" + "@dual-bundle/import-meta-resolve@^4.1.0": version "4.1.0" resolved "https://registry.yarnpkg.com/@dual-bundle/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz#519c1549b0e147759e7825701ecffd25e5819f7b" @@ -2303,7 +2342,7 @@ arraybuffer.prototype.slice@^1.0.3: is-array-buffer "^3.0.4" is-shared-array-buffer "^1.0.2" -asap@^2.0.0, asap@^2.0.6, asap@~2.0.3: +asap@^2.0.0: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA== @@ -2323,11 +2362,6 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -autobind-decorator@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/autobind-decorator/-/autobind-decorator-2.4.0.tgz#ea9e1c98708cf3b5b356f7cf9f10f265ff18239c" - integrity sha512-OGYhWUO72V6DafbF8PM8rm3EPbfuyMZcJhtm5/n26IDwO18pohE4eNazLoCGhPiXOCD0gEGmrbU3849QvM8bbw== - autoprefixer@^10.4.13: version "10.4.20" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.20.tgz#5caec14d43976ef42e32dcb4bd62878e96be5b3b" @@ -2452,14 +2486,6 @@ babel-preset-jest@^29.6.3: babel-plugin-jest-hoist "^29.6.3" babel-preset-current-node-syntax "^1.0.0" -babel-runtime@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" - integrity sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g== - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.11.0" - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -2611,11 +2637,6 @@ chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" -change-emitter@^0.1.2: - version "0.1.6" - resolved "https://registry.yarnpkg.com/change-emitter/-/change-emitter-0.1.6.tgz#e8b2fe3d7f1ab7d69a32199aff91ea6931409515" - integrity sha512-YXzt1cQ4a2jqazhcuSWEOc1K2q8g9H6eWNsyZgi640LDzRWVQ2eDe+Y/kVdftH+vYdPF2rgDb3dLdpxE1jvAxw== - char-regex@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" @@ -2835,16 +2856,6 @@ core-js-compat@^3.38.0, core-js-compat@^3.38.1: dependencies: browserslist "^4.24.2" -core-js@^1.0.0: - version "1.2.7" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" - integrity sha512-ZiPp9pZlgxpWRu0M+YWbm6+aQ84XEfH1JRXvfOc/fILWI0VKhLC2LX13X1NYq4fULzLMq7Hfh43CSo2/aIaUPA== - -core-js@^2.4.0: - version "2.6.12" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" - integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== - core-js@^3.26.0: version "3.39.0" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.39.0.tgz#57f7647f4d2d030c32a72ea23a0555b2eaa30f83" @@ -3142,16 +3153,6 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" -dnd-core@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/dnd-core/-/dnd-core-4.0.5.tgz#3b83d138d0d5e265c73ec978dec5e1ed441dc665" - integrity sha512-GSyGmfGom9oyTFJ4Ll/95Dn3ZDvPkrgINwfeOd+gTI0RGIN1TcTGChrHnIHF3A3e1PymyEKZg+3ouN3w2uIJGQ== - dependencies: - asap "^2.0.6" - invariant "^2.2.4" - lodash "^4.17.10" - redux "^4.0.0" - doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" @@ -3215,7 +3216,7 @@ emojis-list@^3.0.0: resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== -encoding@^0.1.11, encoding@^0.1.13: +encoding@^0.1.13: version "0.1.13" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== @@ -3750,19 +3751,6 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -fbjs@^0.8.1: - version "0.8.18" - resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.18.tgz#9835e0addb9aca2eff53295cd79ca1cfc7c9662a" - integrity sha512-EQaWFK+fEPSoibjNy8IxUtaFOMXcWsY0JaVrQoZR9zC8N2Ygf9iDITPWjUTVIax95b6I742JFLqASHfsag/vKA== - dependencies: - core-js "^1.0.0" - isomorphic-fetch "^2.1.1" - loose-envify "^1.0.0" - object-assign "^4.1.0" - promise "^7.1.1" - setimmediate "^1.0.5" - ua-parser-js "^0.7.30" - file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -4130,11 +4118,6 @@ hasown@^2.0.0, hasown@^2.0.1, hasown@^2.0.2: dependencies: function-bind "^1.1.2" -hoist-non-react-statics@^2.3.1, hoist-non-react-statics@^2.5.0: - version "2.5.5" - resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47" - integrity sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw== - hoist-non-react-statics@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" @@ -4328,7 +4311,7 @@ interpret@^3.1.1: resolved "https://registry.yarnpkg.com/interpret/-/interpret-3.1.1.tgz#5be0ceed67ca79c6c4bc5cf0d7ee843dcea110c4" integrity sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ== -invariant@^2.1.0, invariant@^2.2.4: +invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== @@ -4534,11 +4517,6 @@ is-shared-array-buffer@^1.0.2, is-shared-array-buffer@^1.0.3: dependencies: call-bind "^1.0.7" -is-stream@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== - is-stream@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" @@ -4600,14 +4578,6 @@ isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== -isomorphic-fetch@^2.1.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" - integrity sha512-9c4TNAKYXM5PRyVcwUZrF3W09nQ+sO7+jydgs4ZGW9dhsLG2VOlISJABombdQqQRXCwuYG3sYV/puGf5rp0qmA== - dependencies: - node-fetch "^1.0.1" - whatwg-fetch ">=0.10.0" - istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" @@ -5423,7 +5393,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== -lodash@^4.17.10, lodash@^4.17.15, lodash@^4.17.21: +lodash@^4.17.15, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -5727,14 +5697,6 @@ node-addon-api@^7.0.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-7.1.1.tgz#1aba6693b0f255258a049d621329329322aad558" integrity sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ== -node-fetch@^1.0.1: - version "1.7.3" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" - integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== - dependencies: - encoding "^0.1.11" - is-stream "^1.0.1" - node-gyp@^9.0.0, node-gyp@^9.1.0: version "9.4.1" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-9.4.1.tgz#8a1023e0d6766ecb52764cc3a734b36ff275e185" @@ -5984,7 +5946,7 @@ nwsapi@^2.2.2: resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.13.tgz#e56b4e98960e7a040e5474536587e599c4ff4655" integrity sha512-cTGB9ptp9dY9A5VbMSe7fQBcl/tt22Vcqdq8+eN93rblOuE0aCFu4aZ2vMwct/2t+lFnosm8RkQW1I0Omb1UtQ== -object-assign@^4.1.0, object-assign@^4.1.1: +object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== @@ -6421,13 +6383,6 @@ promise-retry@^2.0.1: err-code "^2.0.2" retry "^0.12.0" -promise@^7.1.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" - integrity sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg== - dependencies: - asap "~2.0.3" - prompts@^2.0.1: version "2.4.2" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" @@ -6491,28 +6446,6 @@ randombytes@^2.1.0: dependencies: safe-buffer "^5.1.0" -react-dnd-html5-backend@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/react-dnd-html5-backend/-/react-dnd-html5-backend-5.0.1.tgz#0b578d79c5c01317c70414c8d717f632b919d4f1" - integrity sha512-TLEjqDMUHRJAgRvdX2L0ssnF6bL30cVkxwO6+OkxWCoPJoiyS6Y6pl4LRidOjJ7CpeMTKeawFdIlbuezHL4oeQ== - dependencies: - autobind-decorator "^2.1.0" - dnd-core "^4.0.5" - lodash "^4.17.10" - shallowequal "^1.0.2" - -react-dnd@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/react-dnd/-/react-dnd-5.0.0.tgz#c4a17c70109e456dad8906be838e6ee8f32b06b5" - integrity sha512-y7qOPo4N7050p5WNli5XNfE5Ij3tl8Gw+Q6jhS0tABO3sCFZzCNKUCMUk7qTQd3t/MMDn2+Ck6xJgsGv+9Qi1A== - dependencies: - dnd-core "^4.0.5" - hoist-non-react-statics "^2.5.0" - invariant "^2.1.0" - lodash "^4.17.10" - recompose "^0.27.1" - shallowequal "^1.0.2" - react-dom@^18.2.0: version "18.3.1" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4" @@ -6536,7 +6469,7 @@ react-is@^18.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== -react-lifecycles-compat@^3.0.2, react-lifecycles-compat@^3.0.4: +react-lifecycles-compat@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== @@ -6651,18 +6584,6 @@ rechoir@^0.8.0: dependencies: resolve "^1.20.0" -recompose@^0.27.1: - version "0.27.1" - resolved "https://registry.yarnpkg.com/recompose/-/recompose-0.27.1.tgz#1a49e931f183634516633bbb4f4edbfd3f38a7ba" - integrity sha512-p7xsyi/rfNjHfdP7vPU02uSFa+Q1eHhjKrvO+3+kRP4Ortj+MxEmpmd+UQtBGM2D2iNAjzNI5rCyBKp9Ob5McA== - dependencies: - babel-runtime "^6.26.0" - change-emitter "^0.1.2" - fbjs "^0.8.1" - hoist-non-react-statics "^2.3.1" - react-lifecycles-compat "^3.0.2" - symbol-observable "^1.0.4" - redux-form@^8.3.10: version "8.3.10" resolved "https://registry.yarnpkg.com/redux-form/-/redux-form-8.3.10.tgz#335657fafd4b26b91b4ce65371cd9dabe3648158" @@ -6677,13 +6598,6 @@ redux-form@^8.3.10: prop-types "^15.6.1" react-is "^16.4.2" -redux@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/redux/-/redux-4.2.1.tgz#c08f4306826c49b5e9dc901dee0452ea8fce6197" - integrity sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w== - dependencies: - "@babel/runtime" "^7.9.2" - redux@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/redux/-/redux-5.0.1.tgz#97fa26881ce5746500125585d5642c77b6e9447b" @@ -6714,11 +6628,6 @@ regenerate@^1.4.2: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== -regenerator-runtime@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" - integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== - regenerator-runtime@^0.14.0: version "0.14.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" @@ -6994,11 +6903,6 @@ set-function-name@^2.0.1, set-function-name@^2.0.2: functions-have-names "^1.2.3" has-property-descriptors "^1.0.2" -setimmediate@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== - shallow-clone@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" @@ -7006,11 +6910,6 @@ shallow-clone@^3.0.0: dependencies: kind-of "^6.0.2" -shallowequal@^1.0.2: - version "1.1.0" - resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" - integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -7414,11 +7313,6 @@ svg-tags@^1.0.0: resolved "https://registry.yarnpkg.com/svg-tags/-/svg-tags-1.0.0.tgz#58f71cee3bd519b59d4b2a843b6c7de64ac04764" integrity sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA== -symbol-observable@^1.0.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" - integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== - symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" @@ -7541,6 +7435,11 @@ tsconfig-paths@^3.15.0: minimist "^1.2.6" strip-bom "^3.0.0" +tslib@^2.0.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -7612,11 +7511,6 @@ typed-styles@^0.0.7: resolved "https://registry.yarnpkg.com/typed-styles/-/typed-styles-0.0.7.tgz#93392a008794c4595119ff62dde6809dbc40a3d9" integrity sha512-pzP0PWoZUhsECYjABgCGQlRGL1n7tOHsgwYv3oIiEpJwGhFTuty/YNeduxQYzXXa3Ge5BdT6sHYIQYpl4uJ+5Q== -ua-parser-js@^0.7.30: - version "0.7.39" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.39.tgz#c71efb46ebeabc461c4612d22d54f88880fabe7e" - integrity sha512-IZ6acm6RhQHNibSt7+c09hhvsKy9WUr4DVbeq9U8o71qxyYtJpQeDxQnMrVqnIFMLcQjHO0I9wgfO2vIahht4w== - uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" @@ -7869,11 +7763,6 @@ whatwg-encoding@^2.0.0: dependencies: iconv-lite "0.6.3" -whatwg-fetch@>=0.10.0: - version "3.6.20" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz#580ce6d791facec91d37c72890995a0b48d31c70" - integrity sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg== - whatwg-mimetype@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz#5fa1a7623867ff1af6ca3dc72ad6b8a4208beba7"