From e03bc329f7d79ae8ce38aee6dea46ae865c215db Mon Sep 17 00:00:00 2001 From: Andrew Paxley Date: Wed, 28 Jun 2023 13:33:10 +1200 Subject: [PATCH] NEW add ListboxField react component --- client/dist/js/bundle.js | 44 +-- client/dist/js/vendor.js | 2 +- client/dist/styles/bundle.css | 2 +- client/src/boot/registerComponents.js | 2 + .../components/ListboxField/ListboxField.js | 258 ++++++++++++++++++ .../components/ListboxField/ListboxField.scss | 109 ++++++++ client/src/styles/bundle.scss | 1 + package.json | 1 + yarn.lock | 5 + 9 files changed, 400 insertions(+), 24 deletions(-) create mode 100644 client/src/components/ListboxField/ListboxField.js create mode 100644 client/src/components/ListboxField/ListboxField.scss diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index ca6d00eaf..f34f7a064 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1,38 +1,38 @@ -(self.webpackChunksilverstripe_admin=self.webpackChunksilverstripe_admin||[]).push([[296],{13978:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=y(n(19755)),a=y(n(67294)),i=n(86706),s=n(20745),o=n(79655),l=y(n(94974)),d=y(n(15586)),u=y(n(80507)),c=y(n(55766)),f=n(2663),p=y(n(4754)),h=n(11962),m=y(n(96869)),g=n(89250),v=n(80195),b=y(n(3730));function y(e){return e&&e.__esModule?e:{default:e}}var _=class{constructor(e,t){this.store=e,this.client=t;const n=l.default.get("absoluteBaseUrl");d.default.setAbsoluteBase(n),this.shouldConfirmBeforeUnload=this.shouldConfirmBeforeUnload.bind(this)}setStore(e){this.store=e}setClient(e){this.client=e}start(e){this.matchesReactRoute(e)?this.initReactRouter():this.initLegacyRouter();const t=window.onbeforeunload;window.onbeforeunload=()=>this.shouldConfirmBeforeUnload()?p.default._t("Admin.CONFIRMUNSAVEDSHORT","WARNING: Your changes have not been saved."):"function"==typeof t?t():void 0}matchesReactRoute(e){const t=l.default.get("sections"),n=d.default.resolveURLToBase(e).replace(/\/$/,"");return!!t.find((e=>{const t=d.default.resolveURLToBase(e.url).replace(/\/$/,"");return!!e.reactRouter&&n.match(t)}))}initReactRouter(){u.default.updateRootRoute({component:c.default});const e=u.default.getRootRoute(),t=(0,o.createBrowserRouter)((0,o.createRoutesFromElements)(a.default.createElement(g.Route,{path:e.path,element:a.default.createElement(e.component,null,a.default.createElement(b.default,{shouldBlockFn:this.shouldConfirmBeforeUnload,blockMessage:this.getUnsavedChangesMessage()}))},u.default.getChildRoutes().map((e=>a.default.createElement(g.Route,{key:e.path,path:e.path,element:a.default.createElement(e.component,null)}))))),{basename:(0,v.joinUrlPaths)(l.default.get("baseUrl"),l.default.get("adminUrl"))});(0,s.createRoot)(document.getElementsByClassName("cms-content")[0]).render(a.default.createElement(f.ApolloProvider,{client:this.client},a.default.createElement(i.Provider,{store:this.store},a.default.createElement(o.RouterProvider,{router:t}))))}initLegacyRouter(){const e=l.default.get("sections"),t=this.store;(0,d.default)("*",((e,n)=>{const r=this.getUnsavedChangesMessage();this.shouldConfirmBeforeUnload()&&!window.confirm(r)||(e.store=t,n())}));let n=null;e.forEach((e=>{let t=d.default.resolveURLToBase(e.url);t=t.replace(/\/$/,""),t=`${t}(/*?)?`,(0,d.default)(t,((e,t)=>{if("complete"!==document.readyState||e.init)return void t();n||(n=window.location.pathname);const a=e.state&&e.state.__forceReload;(e.path!==n||a)&&(n=e.path.replace(/#.*$/,""),(0,r.default)(".cms-container").entwine("ss").handleStateChange(null,e.state))}))}));(0,s.createRoot)(document.createElement("div")).render(a.default.createElement("a",{role:"none",onClick:()=>{}})),d.default.start()}shouldConfirmBeforeUnload(){const e=this.store.getState(),t=e.unsavedForms||[],n=e.form.formSchemas;return t.filter((t=>{const r=Object.values(n).find((e=>e.name===t.name));return!!(r&&r.state&&r.state.notifyUnsavedChanges)&&(0,h.isDirty)(t.name,m.default)(e)})).length>0}getUnsavedChangesMessage(){return p.default._t("Admin.CONFIRMUNSAVED","Are you sure you want to navigate away\n from this page?\n\nWARNING: Your changes have not been saved.\n\n\n Press OK to continue, or Cancel to stay on the current page.")}};t.default=_},56029:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=n(71745),i=(r=n(2395))&&r.__esModule?r:{default:r};var s=e=>{const t={};return e&&e.__schema.types.forEach((e=>{e.possibleTypes&&(t[e.name]=e.possibleTypes.map((e=>e.name)))})),new a.InMemoryCache({possibleTypes:t,dataIdFromObject:i.default,addTypename:!0})};t.default=s},56062:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(2663),a=l(n(94974)),i=l(n(85478)),s=l(n(66783)),o=l(n(56029));function l(e){return e&&e.__esModule?e:{default:e}}var d=async e=>{const t=a.default.getSection("SilverStripe\\Admin\\LeftAndMain").graphql,n=t&&t.cachedTypenames;let l;try{l=await(0,i.default)(e,n)}catch(e){l=null}const d=(0,o.default)(l),u=(0,s.default)(e),c=(0,r.from)(u);return new r.ApolloClient({cache:d,link:c})};t.default=d},66783:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=n(2663),i=n(63200),s=(r=n(94974))&&r.__esModule?r:{default:r},o=n(80195);var l=e=>{const t=new a.HttpLink({uri:(0,o.joinUrlPaths)(e,"admin/graphql"),fetchOptions:{credentials:"same-origin",headers:{accept:"application/json"}}}),n=(0,i.onError)((e=>{let{networkError:t}=e;t&&console.log(`[Network error]: ${t}`)}));return[new a.ApolloLink(((e,t)=>(e.setContext({headers:{"X-CSRF-TOKEN":s.default.get("SecurityID")}}),t(e)))),n,t]};t.default=l},2395:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=e=>{const t=e.id||e.ID;return t&&t>=0&&e.__typename?`${e.__typename}:${t}`:null};t.default=n},85478:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=(r=n(94301))&&r.__esModule?r:{default:r},i=n(80195);const s=e=>{const t=e.data;return t.__schema.types=t.__schema.types.filter((e=>null!==e.possibleTypes)),t},o=e=>{if(!e.ok)throw new Error("The types.graphql file could not be loaded. You probably need to run a ?flush to generate it.\n Alternatively, you can use the IntrospectionProvider extension to generate the file dynamically.\n More information: https://github.com/silverstripe/silverstripe-graphql/#schema-introspection");return e};var l=async function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=!!document.body.getAttribute("data-graphql-legacy"),r=[(0,i.joinUrlPaths)(e,"_graphql/admin.types.graphql"),(0,i.joinUrlPaths)(e,"admin.types.graphql")],l=[(0,i.joinUrlPaths)(e,"admin/graphql/types"),(0,i.joinUrlPaths)(e,"assets/admin.types.graphql")];let d,u;n?(t&&l.reverse(),[d,u]=l):[d,u]=r;const c={method:"GET",headers:{"Content-Type":"application/json"},uri:e,credentials:"same-origin"},f=async e=>(0,a.default)(e,c).then(o).then((e=>e.json())).then(s);let p;try{p=await f(d)}catch(e){if(!u)return Promise.reject(e);try{p=await f(u)}catch(e){return Promise.reject(e)}}return Promise.resolve(p)};t.default=l},59467:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__,n=window.__REDUX_DEVTOOLS_EXTENSION__||window.devToolsExtension;if("function"==typeof t)return t(e);if("function"==typeof n)return(0,r.compose)(e,n());return e};var r=n(14890)},10374:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(54582)),a=l(n(39062)),i=l(n(94184)),s=n(48834),o=l(n(98028));function l(e){return e&&e.__esModule?e:{default:e}}const d=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.extraClass?e.extraClass.split(" ").reduce(((e,t)=>({...e,[t]:!0})),{}):{};"string"==typeof e.data.pristineClass&&(n[e.data.pristineClass]=t),"string"==typeof e.data.dirtyClass&&(n[e.data.dirtyClass]=!t);const r=t?e.data.pristineTitle:e.data.dirtyTitle,a=t?e.data.pristineIcon:e.data.dirtyIcon;return{...e,title:r||e.title,icon:a||e.icon,extraClass:(0,i.default)(n)}};var u=()=>{r.default.transform("field-holders",(e=>{["FieldGroup"].forEach((t=>e.component("FieldGroup",o.default,`${t}Holder`)))})),r.default.transform("form-action-changed",(e=>{e.form.alterSchema("*",(e=>(e.mutateField("action_save",(t=>{const n=e.isPristine();return d(t,n)})),e.mutateField("action_publish",(t=>{const n=t.data.isPublished&&!t.data.isModified&&e.isPristine();return d(t,n)})),e.getState())))})),r.default.transform("schema-validation",(e=>{e.form.addValidation("*",((e,t,n)=>{const r=new a.default(e),i=Object.keys(e).reduce(((e,t)=>{const a=(0,s.findField)(n.fields,t);if(!a)return e;const{valid:i,errors:o}=r.validateFieldSchema(a);return i?e:{...e,[t]:o}}),{});return t.addErrors(i),t.getState()}))}))};t.default=u},27274:function(e,t,n){"use strict";var r=h(n(54582)),a=n(14890),i=h(n(53894)),s=h(n(94974)),o=h(n(56062)),l=n(32212),d=h(n(89521)),u=h(n(24180)),c=h(n(59467)),f=h(n(10374)),p=h(n(13978));function h(e){return e&&e.__esModule?e:{default:e}}window.ss=window.ss||{},window.onload=async function(){const e=s.default.get("absoluteBaseUrl"),t=await(0,o.default)(e);(0,d.default)(),(0,u.default)();const n=[i.default],h=s.default.get("debugging");let m=(0,a.applyMiddleware)(...n);h&&(m=(0,c.default)(m));const g=m(a.createStore);window.ss.apolloClient=t;const v=new p.default(null,t);(0,f.default)(),r.default.init((()=>{const e=(0,a.combineReducers)(r.default.reducer.getAll()),t=g(e,{});t.dispatch((0,l.setConfig)(s.default.getAll())),r.default.reducer.setStore(t),window.ss.store=t,v.setStore(t),v.start(window.location.pathname),window.jQuery&&window.jQuery("body").addClass("js-react-boot").addClass("js-injector-boot")})),window.setTimeout((()=>r.default.load()),0)}},89521:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(11962),a=ee(n(54582)),i=ee(n(95393)),s=ee(n(37294)),o=ee(n(22602)),l=ee(n(45332)),d=ee(n(74898)),u=ee(n(19423)),c=ee(n(81463)),f=ee(n(63182)),p=ee(n(79629)),h=ee(n(49954)),m=ee(n(41370)),g=ee(n(5110)),v=ee(n(88940)),b=ee(n(71375)),y=ee(n(63980)),_=ee(n(20693)),w=ee(n(65732)),O=ee(n(7162)),E=ee(n(618)),C=ee(n(21677)),T=ee(n(82432)),S=ee(n(75917)),P=ee(n(61404)),M=ee(n(40505)),j=ee(n(59644)),D=ee(n(52935)),k=ee(n(59888)),R=ee(n(48297)),I=ee(n(55742)),x=ee(n(65963)),A=ee(n(23296)),N=ee(n(3080)),F=ee(n(36800)),L=ee(n(80384)),$=ee(n(34411)),U=ee(n(18871)),B=ee(n(57129)),V=ee(n(98031)),W=ee(n(72543)),H=ee(n(85362)),q=ee(n(97023)),z=ee(n(97228)),G=ee(n(20164)),K=ee(n(62266)),X=ee(n(65693)),Y=ee(n(1922)),Q=ee(n(92227)),J=ee(n(71255)),Z=ee(n(49331));function ee(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{a.default.component.registerMany({ActionMenu:i.default,Badge:s.default,Button:o.default,BackButton:l.default,TextField:d.default,HiddenField:u.default,DateField:c.default,TimeField:f.default,DatetimeField:p.default,CheckboxField:h.default,CheckboxSetField:m.default,OptionsetField:g.default,GridField:v.default,GridFieldActions:b.default,FieldGroup:D.default,SingleSelectField:y.default,PopoverField:_.default,HeaderField:w.default,LiteralField:O.default,HtmlReadonlyField:E.default,LookupField:C.default,CompositeField:T.default,Tabs:P.default,TabItem:M.default,FormAction:j.default,LabelField:S.default,TreeDropdownField:k.default,Preview:N.default,ReduxForm:F.default,ReduxFormField:r.Field,Form:x.default,FormAlert:A.default,FormBuilderModal:R.default,NotFoundComponent:I.default,UsedOnTable:L.default,Loading:$.default,CircularLoading:U.default,VersionedBadge:B.default,ViewModeToggle:V.default,ResizeAware:W.default,Tag:H.default,TagList:q.default,CompactTagList:z.default,Tip:G.default,Search:K.default,SearchToggle:X.default,HtmlEditorField:Y.default,NumberField:Q.default,PopoverOptionSet:J.default,ToastsContainer:Z.default})}},24180:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=b(n(54582)),a=n(14890),i=n(11962),s=b(n(18373)),o=b(n(54191)),l=b(n(81951)),d=b(n(20430)),u=b(n(5452)),c=b(n(54558)),f=b(n(80573)),p=b(n(13346)),h=b(n(11146)),m=b(n(32659)),g=b(n(22793)),v=b(n(84231));function b(e){return e&&e.__esModule?e:{default:e}}t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,a.combineReducers)({formState:i.reducer,formSchemas:o.default});r.default.reducer.registerMany({config:s.default,form:t,records:l.default,breadcrumbs:d.default,treeDropdownField:u.default,tabs:c.default,mobileMenu:f.default,unsavedForms:p.default,usedOn:h.default,viewMode:g.default,toasts:v.default,...e}),r.default.transform("admin",(e=>{e.reducer("form",m.default)}))}},61534:function(e,t,n){"use strict";n(28432),n(77300),n(12523),n(46844),n(58794),n(91044),n(94033),n(39432),n(10452),n(99324),n(66273),n(62746),n(86673),n(92173),n(65986),n(64482),n(4567),n(77511),n(64300),n(16741),n(31968),n(31643),n(63063),n(16089),n(14755),n(50194),n(37386),n(87577),n(43109),n(4193),n(40127),n(44368),n(40256),n(29094),n(60462),n(49841),n(99511),n(14536),n(96582),n(1488),n(69860),n(33281),n(79035),n(8592),n(46508),n(28170),n(53438),n(83361),n(94813),n(72472),n(55488),n(40829),n(47157),n(53877),n(71080),n(37904),n(97976),n(8145),n(87746),n(86317),n(87603),n(59628),n(70184),n(91673),n(60128),n(87872),n(60140),n(57006),n(19602),n(27729),n(54218),n(98441),n(96007),n(43893),n(1913),n(88854),n(47640),n(50628),n(62596),n(73843),n(49266),n(95075),n(49958),n(60395),n(41221),n(88615),n(82165),n(56970),n(73366),n(81047),n(87594),n(15878),n(75350),n(8162),n(76406),n(8298),n(40303),n(44686),n(49785),n(13305),n(57893),n(49414),n(42886),n(17106),n(27274)},34625:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=(r=n(67294))&&r.__esModule?r:{default:r};var i=e=>a.default.createElement("div",{className:"accordion",role:"tablist","aria-multiselectable":"true"},e.children);t.default=i},56448:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=(r=n(67294))&&r.__esModule?r:{default:r};var i=e=>{const t=`${e.groupid}_Header`,n=`${e.groupid}_Items`,r=n.replace(/\\/g,"_"),i=t.replace(/\\/g,"_"),s={id:r,"aria-expanded":!0,className:"list-group list-group-flush collapse show",role:"tabpanel","aria-labelledby":t};return a.default.createElement("div",{className:"accordion__block"},a.default.createElement("a",{className:"accordion__title","data-toggle":"collapse",href:`#${r}`,"aria-expanded":"true","aria-controls":n,id:i,role:"tab"},e.title),a.default.createElement("div",s,e.children))};t.default=i},95393:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=l(n(45697)),i=n(53556),s=l(n(4754)),o=l(n(94184));function l(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)}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;tthis.setState({isOpen:!this.state.isOpen})),0)}render(){const{dropdownToggleProps:e,dropdownMenuProps:t,dropdownToggleClassNames:n,className:a,toggleCallback:l,...d}=this.props,c=(0,o.default)(n,e.className),f=(0,o.default)("action-menu__dropdown",t.className);return r.default.createElement(i.Dropdown,u({className:(0,o.default)("action-menu",a),isOpen:this.state.isOpen,toggle:this.toggle},d),r.default.createElement(i.DropdownToggle,u({className:c,"aria-label":s.default._t("Admin.ACTIONS","View actions")},e)),r.default.createElement(i.DropdownMenu,u({className:f},t),this.props.children))}}c.propTypes={toggleCallback:a.default.func,dropdownToggleClassNames:a.default.arrayOf(a.default.string)},c.defaultProps={className:"",dropdownToggleClassNames:["action-menu__toggle","btn","btn--no-text","btn--icon-xl","font-icon-dot-3"],dropdownToggleProps:{},dropdownMenuProps:{}};var f=c;t.default=f},37294:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.statuses=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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=s(n(94184)),i=s(n(45697));function s(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}const l=["default","info","success","warning","danger","primary","secondary"];t.statuses=l;class d extends r.PureComponent{render(){const{status:e,inverted:t,className:n,message:i}=this.props;if(!e)return null;const s=t?`badge-${e}--inverted`:"",o=(0,a.default)(n,"badge",`badge-${e}`,s);return r.default.createElement("span",{className:o},i)}}d.propTypes={message:i.default.node,status:i.default.oneOf(l),className:i.default.string,inverted:i.default.bool},d.defaultProps={status:"default",className:"badge-pill",inverted:!1};var u=d;t.default=u},71691:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=n(86706),i=d(n(94184)),s=d(n(45697)),o=d(n(67388)),l=d(n(5257));function d(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 c extends r.Component{getLastCrumb(){return this.props.crumbs&&this.props.crumbs[this.props.crumbs.length-1]}renderBreadcrumbs(){return this.props.crumbs?this.props.crumbs.slice(0,-1).map((e=>r.default.createElement("li",{key:e.text,className:"breadcrumb__item"},r.default.createElement(l.default,{className:"breadcrumb__item-title",href:e.href,onClick:e.onClick},e.text)))):null}renderLastCrumb(){const e=this.getLastCrumb();return e?r.default.createElement("div",{className:"breadcrumb__item breadcrumb__item--last"},r.default.createElement("h2",{className:"breadcrumb__item-title"},e.text,e.icon&&this.renderIcons([e.icon]),e.icons&&this.renderIcons(e.icons))):null}renderIcons(e){return e.map(((e,t)=>{const{nodeName:n,className:a,hasRestrictedAccess:s,...l}=e;let d={...l};const u=(0,i.default)(["breadcrumb__icon",a]);return d={tabIndex:"0",...d},d.hasOwnProperty("onClick")&&(d={role:"button",...d}),d.key=`breadcrumb-icon-${t}`,"FileStatusIcon"===n?(d.fileID=0,d.hasRestrictedAccess=s,d.extraClassName=u,r.default.createElement(o.default,d)):(d.className=u,r.default.createElement("span",d))}))}render(){return r.default.createElement("div",{className:"breadcrumb__container fill-height flexbox-area-grow"},this.props.crumbs&&this.props.crumbs.length>1&&r.default.createElement("div",{className:"breadcrumb__list-container"},r.default.createElement("ol",{className:"breadcrumb"},this.renderBreadcrumbs())),this.renderLastCrumb())}}t.Component=c,c.propTypes={crumbs:s.default.arrayOf(s.default.shape({onClick:s.default.func,text:s.default.string,icon:s.default.shape({nodeName:s.default.string,className:s.default.string,onClick:s.default.func,action:e=>{if(e.action)throw new Error("action: no longer used")}}),icons:s.default.arrayOf(s.default.shape({nodeName:s.default.string,className:s.default.string,onClick:s.default.func}))}))};var f=(0,a.connect)((function(e){return{crumbs:e.breadcrumbs}}))(c);t.default=f},45332:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(67294)),a=o(n(22602)),i=o(n(94184)),s=o(n(4754));function o(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{className:t,...n}=e;return r.default.createElement(a.default,l({className:(0,i.default)(t,"back-button")},n))};d.propTypes=a.default.propTypes,d.defaultProps={...a.default.defaultProps,noText:!0,icon:"left-open-big",children:s.default._t("Admin.BACK","Back")};var u=d;t.default=u},22602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(67294)),a=n(53556),i=l(n(45697)),s=l(n(94184)),o=l(n(29258));function l(e){return e&&e.__esModule?e:{default:e}}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{className:t,noText:n,children:i,...o}=e;return r.default.createElement(a.Button,d({className:(0,s.default)(t,{"btn--no-text":n}),"aria-label":n?i:void 0},o),n?void 0:i)};u.propTypes={...a.Button.propTypes,noText:i.default.bool},u.defaultProps={...a.Button.defaultProps,noText:!1};var c=(0,o.default)(u);t.default=c},29258:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(67294)),a=s(n(45697)),i=s(n(94184));function s(e){return e&&e.__esModule?e:{default:e}}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=t=>{let{icon:n,className:a,...s}=t;return r.default.createElement(e,o({className:(0,i.default)(a,n&&`font-icon-${n}`)},s))};return t.propTypes={...e.propTypes,icon:a.default.string},t.defaultProps=e.defaultProps,t.displayName=e.name,t};t.default=l},49954:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=s(n(67294)),a=s(n(98028)),i=s(n(31885));function s(e){return e&&e.__esModule?e:{default:e}}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;tr.default.createElement(i.default,o({},e,{type:"checkbox"}));t.Component=l;var d=e=>{const t=(0,a.default)(l);return r.default.createElement(t,o({},e,{hideLabels:!0}))};t.default=d},41370:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=o(n(31885)),i=o(n(98028)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t`${e}`)):[]}getOptionProps(e,t){const n=this.getValues(),r=this.getItemKey(e,t);return{key:r,id:r,name:this.props.name,className:this.props.itemClass,disabled:e.disabled||this.props.disabled,readOnly:this.props.readOnly,onChange:this.handleChange,value:n.indexOf(`${e.value}`)>-1,title:e.title,type:"checkbox"}}handleChange(e,t){if("function"==typeof this.props.onChange){const n=this.getValues(),r=this.props.source.filter(((e,r)=>this.getItemKey(e,r)===t.id?1===t.value:n.indexOf(`${e.value}`)>-1)).map((e=>`${e.value}`));this.props.onChange(e,{id:this.props.id,value:r})}}render(){return this.props.source?r.default.createElement("div",null,this.props.source.map(((e,t)=>r.default.createElement(a.default,d({},this.getOptionProps(e,t),{hideLabels:!0}))))):null}}t.Component=u,u.propTypes={className:s.default.string,extraClass:s.default.string,itemClass:s.default.string,id:s.default.string,name:s.default.string.isRequired,source:s.default.arrayOf(s.default.shape({value:s.default.oneOfType([s.default.string,s.default.number]),title:s.default.any,disabled:s.default.bool})),onChange:s.default.func,value:s.default.any,readOnly:s.default.bool,disabled:s.default.bool},u.defaultProps={extraClass:"",className:"",value:[]};var c=e=>{const t=(0,i.default)(u);return r.default.createElement(t,e)};t.default=c},82432:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=s(n(10259)),i=s(n(45697));function s(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}class l extends r.Component{getLegend(){return"fieldset"===this.props.data.tag&&this.props.data.legend?(0,a.default)("legend",this.props.data.legend):null}getClassName(){return`${this.props.className} ${this.props.extraClass}`}render(){const e=this.getLegend(),t=this.props.data.tag||"div",n=this.getClassName();return r.default.createElement(t,{className:n},e,this.props.children)}}t.Component=l,l.propTypes={data:i.default.oneOfType([i.default.array,i.default.shape({tag:i.default.string,legend:i.default.string})]),extraClass:i.default.string},l.defaultProps={className:"",extraClass:""};var d=l;t.default=d},81463:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=d(n(98028)),a=n(74898),i=d(n(30381)),s=d(n(68300)),o=d(n(4754)),l=d(n(45697));function d(e){return e&&e.__esModule?e:{default:e}}class u extends a.Component{render(){return super.render()}moment(){return i.default.locale(this.getLang()),(0,i.default)(...arguments)}getLang(){return(this.asHTML5()?this.props.isoLang:this.props.lang)||(0,i.default)().locale()}asHTML5(){return this.props.data.html5&&this.hasNativeSupport()}hasNativeSupport(){return this.props.modernizr.inputtypes.date}getInputProps(){const e=o.default.inject(o.default._t("Admin.FormatExample","Example: {format}"),{format:this.moment().endOf("month").format("L")}),t=this.asHTML5()?this.props.value:this.getLocalisedValue(),n=this.asHTML5()?"date":"text";return{...super.getInputProps(),type:n,value:t,placeholder:e}}getLocalisedValue(){return this.convertToLocalised(this.props.value)}isMultiline(){return!1}handleChange(e){const t=e.target.value;let n="";n=this.asHTML5()?t:this.convertToIso(t),"function"==typeof this.props.onChange&&this.triggerChange(e,n)}triggerChange(e,t){this.props.onChange(e,{id:this.props.id,value:t})}convertToIso(e){let t="";if(e){const n=this.moment(e,["L","YYYY-MM-DD"]);n.isValid()&&(t=n.format("YYYY-MM-DD"))}return t}convertToLocalised(e){let t="";if(e){const n=this.moment(e);n.isValid()&&(t=n.format("L"))}return t}}t.Component=u,u.propTypes={lang:l.default.string,isoLang:l.default.string,modernizr:l.default.object,data:l.default.shape({html5:l.default.bool})},u.defaultProps={modernizr:s.default,data:{}};var c=(0,r.default)(u);t.default=c},79629:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=o(n(98028)),a=n(81463),i=o(n(30381)),s=o(n(4754));function o(e){return e&&e.__esModule?e:{default:e}}const l="L LT";class d extends a.Component{getInputProps(){const e=s.default.inject(s.default._t("Admin.FormatExample","Example: {format}"),{format:this.moment().endOf("month").format(l)}),t=this.asHTML5()?"datetime-local":"text";return{...super.getInputProps(),type:t,placeholder:e}}isMultiline(){return!1}hasNativeSupport(){return this.props.modernizr.inputtypes["datetime-local"]}triggerChange(e,t){/^\d{4}-\d\d-\d\dT\d\d:\d\d$/.test(t)?this.props.onChange(e,{id:this.props.id,value:`${t}:00`}):this.props.onChange(e,{id:this.props.id,value:t})}convertToLocalised(e){i.default.locale(this.props.lang);let t="";if(e){const n=this.moment(e);n.isValid()&&(t=n.format(l))}return t}convertToIso(e){i.default.locale(this.props.lang);let t="";if(e){const n=[l,"L",i.default.ISO_8601],r=this.moment(e,n);r.isValid()&&(t=r.format("YYYY-MM-DDTHH:mm:ss"))}return t}}t.Component=d,d.propTypes=a.Component.propTypes,d.defaultProps=a.Component.defaultProps;var u=(0,r.default)(d);t.default=u},52935:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(82432)),a=s(n(45697)),i=s(n(94184));function s(e){return e&&e.__esModule?e:{default:e}}class o extends r.default{getClassName(){return(0,i.default)("field-group-component",{"field-group-component__small-holder":this.props.smallholder},super.getClassName())}}o.propTypes={...r.default.propTypes,smallholder:a.default.bool},o.defaultProps={...r.default.defaultProps,smallholder:!0};var l=o;t.default=l},98028:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=c(n(67294)),a=n(53556),i=d(n(10259)),s=d(n(94184)),o=d(n(45697)),l=c(n(20164));function d(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function c(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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}var f=function(e){class t extends r.Component{getMessage(){let e=null;this.props.message&&this.props.message.value&&(e=this.props.message);const t=this.props.meta;return t&&t.error&&t.touched&&(!e||t.dirty)&&(e=t.error),e}getHolderProps(){return{className:(0,s.default)({field:!0,[this.props.extraClass]:!0,readonly:this.props.readOnly}),id:this.props.holderId}}renderMessage(){const e=this.getMessage();if(!e)return null;const t=(0,s.default)(["form__field-message",`form__field-message--${e.type}`]),n=(0,i.default)("div",e.value);return r.default.createElement("div",{className:t},n)}renderLeftTitle(){const e=this.props.leftTitle?this.props.leftTitle:this.props.title;return!e||this.props.hideLabels?null:(0,i.default)(a.Label,e,{className:"form__field-label",for:this.props.id})}renderRightTitle(){return!this.props.rightTitle||this.props.hideLabels?null:(0,i.default)(a.Label,this.props.rightTitle,{className:"form__field-label",for:this.props.id})}renderField(){const t=Boolean(this.getMessage()),n={...this.props,extraClass:(0,s.default)(this.props.extraClass,{"is-invalid":t})},i=r.default.createElement(e,n),o=this.props.data&&this.props.data.prefix?this.props.data.prefix:"",l=this.props.data&&this.props.data.suffix?this.props.data.suffix:"";return o||l?r.default.createElement(a.InputGroup,null,o&&r.default.createElement(a.InputGroupAddon,{addonType:"prepend"},o),i,l&&r.default.createElement(a.InputGroupAddon,{addonType:"append"},l)):i}renderTitleTip(){return this.props.id&&this.props.titleTip&&this.props.titleTip.content?r.default.createElement(l.default,{id:`FieldHolder-${this.props.id}-titleTip`,content:this.props.titleTip.content,fieldTitle:this.props.title,type:l.TIP_TYPES.TITLE,icon:"menu-help"}):null}renderDescription(){return null===this.props.description?null:(0,i.default)("div",this.props.description,{className:"form__field-description"})}render(){return this.props.noHolder?this.renderField():r.default.createElement(a.FormGroup,this.getHolderProps(),this.renderLeftTitle(),this.renderTitleTip(),r.default.createElement("div",{className:"form__field-holder"},this.renderField(),this.renderMessage(),this.renderDescription()),this.renderRightTitle())}}return t.propTypes={leftTitle:o.default.any,rightTitle:o.default.any,title:o.default.any,extraClass:o.default.string,holderId:o.default.string,id:o.default.string,name:o.default.string,description:o.default.any,hideLabels:o.default.bool,message:o.default.shape({extraClass:o.default.string,value:o.default.any,type:o.default.string}),data:o.default.oneOfType([o.default.array,o.default.shape({prefix:o.default.string,suffix:o.default.string})]),titleTip:o.default.shape(l.tipShape)},t.defaultProps={className:"",extraClass:"",leftTitle:null,rightTitle:null,title:"",description:null,hideLabels:!1,noHolder:!1,message:null,data:{}},t};t.default=f},67388:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=l(n(45697)),i=l(n(4754)),s=l(n(94184)),o=n(53556);function l(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)}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t{this.container=e}},this.props.children)}}o.propTypes={children:i.default.any,className:i.default.string,onClickOut:i.default.func.isRequired},o.defaultProps={className:""};var l=o;t.default=l},65963:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=s(n(23296)),i=s(n(45697));function s(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;tr.default.createElement(e,l({key:n,className:n?"":"message-box--panel-top"},t)))):null}render(){const e=!1!==this.props.valid,t=this.props.mapFieldsToComponents(this.props.fields),n=this.props.mapActionsToComponents(this.props.actions),a=this.renderMessages(),i=this.props.formTag,s=["form"];!1===e&&s.push("form--invalid"),this.props.attributes&&this.props.attributes.className&&s.push(this.props.attributes.className);const o={...this.props.attributes,onSubmit:this.props.handleSubmit,className:s.join(" ")};return r.default.createElement(i,l({},o,{ref:e=>{this.form=e,this.props.setDOM(e)},role:"form"}),t&&r.default.createElement("fieldset",this.props.fieldHolder,a,this.props.afterMessages,t),n&&n.length?r.default.createElement("div",this.props.actionHolder,n):null)}}t.Component=d,d.propTypes={autoFocus:i.default.bool,setDOM:i.default.func,valid:i.default.bool,actions:i.default.array,fieldHolder:i.default.shape({className:i.default.string}),actionHolder:i.default.shape({className:i.default.string}),extraClass:i.default.string,afterMessages:i.default.node,attributes:i.default.shape({action:i.default.string.isRequired,className:i.default.string,encType:i.default.string,id:i.default.string,method:i.default.string.isRequired}),fields:i.default.array.isRequired,handleSubmit:i.default.func,mapActionsToComponents:i.default.func.isRequired,mapFieldsToComponents:i.default.func.isRequired,messages:i.default.arrayOf(i.default.shape({extraClass:i.default.string,value:i.default.any,type:i.default.string})),formTag:i.default.oneOfType([i.default.func,i.default.string]),FormAlertComponent:i.default.oneOfType([i.default.object,i.default.func])},d.defaultProps={setDOM:()=>null,formTag:"form",actionHolder:{className:"btn-toolbar"},FormAlertComponent:a.default};var u=d;t.default=u},430:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={CSRF_HEADER:"X-SecurityID"}},59644:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=o(n(10259)),i=o(n(94184)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}class d extends r.Component{constructor(e){super(e),this.handleClick=this.handleClick.bind(this)}getButtonProps(){const{attributes:e,id:t,name:n}=this.props;return{...void 0===e?{}:e,id:t,name:n,className:this.getButtonClasses(),disabled:this.isDisabled(),onClick:this.handleClick}}getButtonClasses(){const{title:e,loading:t,extraClass:n}=this.props,r={btn:!0,"btn--no-text":"string"!=typeof e,"btn--loading":t,disabled:this.isDisabled()},a=this.getButtonStyle();a&&(r[`btn-${a}`]=!0);const s=this.getIcon();return s&&(r[`font-icon-${s}`]=!0),"string"==typeof n&&(r[n]=!0),(0,i.default)(r)}getButtonStyle(){if(void 0!==this.props.data.buttonStyle)return this.props.data.buttonStyle;if(void 0!==this.props.buttonStyle)return this.props.buttonStyle;return this.props.extraClass.split(" ").find((e=>e.indexOf("btn-")>-1))?null:this.isPrimary()?"primary":"secondary"}getIcon(){return this.props.icon||this.props.data.icon||null}getLoadingIcon(){return this.props.loading?r.default.createElement("div",{className:"btn__loading-icon"},r.default.createElement("span",{className:"btn__circle btn__circle--1"}),r.default.createElement("span",{className:"btn__circle btn__circle--2"}),r.default.createElement("span",{className:"btn__circle btn__circle--3"})):null}isDisabled(){const{disabled:e,readOnly:t}=this.props;return e||t}isPrimary(){const{extraClass:e,name:t}=this.props,n=e?e.split(" "):[];return"action_save"===t||!!n.find((e=>"ss-ui-action-constructive"===e))}handleClick(e){"function"==typeof this.props.onClick&&this.props.onClick(e,this.props.name||this.props.id)}render(){const{title:e}=this.props;return r.default.createElement("button",this.getButtonProps(),this.getLoadingIcon(),(0,a.default)("span",e,{className:"btn__title"}))}}d.propTypes={id:s.default.string,name:s.default.string,onClick:s.default.func,title:s.default.string,type:s.default.string,loading:s.default.bool,icon:s.default.string,disabled:s.default.bool,readOnly:s.default.bool,data:s.default.oneOfType([s.default.array,s.default.shape({buttonStyle:s.default.string})]),extraClass:s.default.string,attributes:s.default.object},d.defaultProps={title:"",icon:"",extraClass:"",attributes:{},data:{},disabled:!1,readOnly:!1};var u=d;t.default=u},23296:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=n(53556),i=l(n(10259)),s=l(n(94184)),o=l(n(45697));function l(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}class u extends r.Component{constructor(e){super(e),this.handleClosed=this.handleClosed.bind(this),this.state={visible:!0}}getMessageStyle(){switch(this.props.type){case"good":case"success":return"success";case"info":return"info";case"warn":case"warning":return"warning";default:return"danger"}}getMessageProps(){const e=this.props.type||"no-type";return{className:(0,s.default)(["message-box",`message-box--${e}`,this.props.className,this.props.extraClass]),color:this.getMessageStyle(),toggle:this.props.closeLabel?this.handleClosed:null,isOpen:!this.props.closeLabel||this.state.visible}}handleClosed(){"function"==typeof this.props.onClosed?this.props.onClosed():this.setState({visible:!1})}render(){if("boolean"!=typeof this.props.visible&&this.state.visible||this.props.visible){const e=(0,i.default)("div",this.props.value);if(e)return r.default.createElement(a.Alert,this.getMessageProps(),e)}return null}}u.propTypes={extraClass:o.default.string,value:o.default.any,type:o.default.string,onClosed:o.default.func,closeLabel:o.default.string,visible:o.default.bool},u.defaultProps={extraClass:"",className:""};var c=u;t.default=c},56334:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.schemaPropType=t.default=t.basePropTypes=t.Component=void 0;var r=f(n(67294)),a=u(n(45697)),i=u(n(21965)),s=f(n(48834)),o=n(48942),l=u(n(1591)),d=n(54582);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)}function f(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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;tthis.context.injector.get(e,`${n}.${t}`);switch(e){case"Integer":case"Decimal":return r("NumberField");case"String":case"Text":return r("TextField");case"Date":return r("DateField");case"Time":return r("TimeField");case"Datetime":return r("DatetimeField");case"Hidden":return r("HiddenField");case"SingleSelect":return r("SingleSelectField");case"Custom":return r("GridField");case"Structural":return r("CompositeField");case"Boolean":return r("CheckboxField");case"MultiSelect":return r("CheckboxSetField");default:return null}}validateForm(e){if("function"==typeof this.props.validate)return this.props.validate(e);if(!(this.props.schema&&this.props.schema.schema))return{};const t=this.context.injector.validate(this.props.identifier);let n={};return t&&(n=t(e,this.props.schema.schema)||{}),(0,o.createErrorBlock)(n)}buildComponent(e){const t=e.input||{},n={...e,...e.input,onChange:t.onChange?(e,n)=>{t.onChange(n?n.value:e)}:null};delete n.input;const a=this.getComponent(n);if(null===a)return null;if(null!==n.schemaComponent&&void 0===a)throw Error(`Component not found in injector: ${n.schemaComponent}`);const i=this.props.createFn;return"function"==typeof i?i(a,n):r.default.createElement(a,p({key:n.id},n))}mapFieldsToComponents(e){const t=this.props.baseFieldComponent;return e.map((e=>{let n=e;return e.children&&(n=Object.assign({},e,{children:this.mapFieldsToComponents(e.children)})),n=Object.assign({onAutofill:this.props.onAutofill,formid:this.props.form},n),"Structural"===e.schemaType||!0===e.readOnly?this.buildComponent(n):r.default.createElement(t,p({key:n.id},n,{component:this.buildComponent}))}))}handleAction(e){"function"==typeof this.props.onAction&&this.props.onAction(e,this.props.values),e.isPropagationStopped()||this.setState({submittingAction:e.currentTarget.name})}handleSubmit(e){let t="";this.state.submittingAction?t=this.state.submittingAction:this.props.schema.schema.actions[0]&&(t=this.props.schema.schema.actions[0].name);const n=Object.assign({},e,t?{[t]:1}:{}),r={"X-Formschema-Request":this.props.responseRequestedSchema.join(),"X-Requested-With":"XMLHttpRequest"},a=e=>this.submitApi(e||n,r).then((e=>(this.setState({submittingAction:null}),e))).catch((e=>{throw this.setState({submittingAction:null}),e}));return"function"==typeof this.props.onSubmit?this.props.onSubmit(n,t,a):a()}mapActionsToComponents(e){return e.map((e=>{const t=Object.assign({},e);return e.children?t.children=this.mapActionsToComponents(e.children):(t.onClick=this.handleAction,this.props.submitting&&this.state.submittingAction===e.name&&(t.loading=!0)),this.buildComponent(t)}))}normalizeFields(e,t){return e.map((e=>{const n=t&&t.fields?t.fields.find((t=>t.id===e.id)):{},r=i.default.recursive(!0,(0,s.schemaMerge)(e,n),{schemaComponent:n&&n.component?n.component:e.component});return e.children&&(r.children=this.normalizeFields(e.children,t)),r}))}render(){const e=this.props.schema.schema,t=this.props.schema.state,n=this.props.baseFormComponent,a={...e.attributes,className:e.attributes.class,encType:e.attributes.enctype,noValidate:!0};delete a.class,delete a.enctype;const{asyncValidate:i,fieldHolder:o,actionHolder:l,onSubmitFail:d,onSubmitSuccess:u,shouldAsyncValidate:c,touchOnBlur:f,touchOnChange:p,persistentSubmitErrors:h,form:m,afterMessages:g,autoFocus:v,formTag:b}=this.props,y={form:m,afterMessages:g,fields:this.normalizeFields(e.fields,t),fieldHolder:o,actions:this.normalizeFields(e.actions,t),actionHolder:l,attributes:a,data:e.data,initialValues:(0,s.default)(e,t),onSubmit:this.handleSubmit,valid:t&&t.valid,messages:t&&Array.isArray(t.messages)?t.messages:[],mapActionsToComponents:this.mapActionsToComponents,mapFieldsToComponents:this.mapFieldsToComponents,asyncValidate:i,onSubmitFail:d,onSubmitSuccess:u,shouldAsyncValidate:c,touchOnBlur:f,touchOnChange:p,persistentSubmitErrors:h,validate:this.validateForm,autoFocus:v,setDOM:e=>{this.formDOM=e},formTag:b};return r.default.createElement(n,y)}}t.Component=h;const m=a.default.shape({id:a.default.string,schema:a.default.shape({attributes:a.default.shape({class:a.default.string,enctype:a.default.string}),fields:a.default.array.isRequired}),state:a.default.shape({fields:a.default.array}),loading:a.default.bool,stateOverride:a.default.shape({fields:a.default.array})});t.schemaPropType=m;const g={createFn:a.default.func,onSubmit:a.default.func,onAction:a.default.func,asyncValidate:a.default.func,onSubmitFail:a.default.func,onSubmitSuccess:a.default.func,shouldAsyncValidate:a.default.func,touchOnBlur:a.default.bool,touchOnChange:a.default.bool,persistentSubmitErrors:a.default.bool,validate:a.default.func,values:a.default.object,submitting:a.default.bool,baseFormComponent:a.default.elementType.isRequired,baseFieldComponent:a.default.elementType.isRequired,getCustomFields:a.default.func,responseRequestedSchema:a.default.arrayOf(a.default.oneOf(["schema","state","errors","auto"])),identifier(e,t,n){return/^[A-Za-z0-9_.]+$/.test(e[t])?null:new Error(`\n Invalid identifier supplied to ${n}. Must be a set of\n dot-separated alphanumeric strings.\n `)}};t.basePropTypes=g,h.propTypes=Object.assign({},g,{form:a.default.string.isRequired,schema:m.isRequired,autoFocus:a.default.bool}),h.defaultProps={responseRequestedSchema:["auto"],autoFocus:!1};var v=(0,d.withInjector)(h);t.default=v},48297:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=u(n(4754)),i=n(53556),s=u(n(16304)),o=u(n(10259)),l=u(n(94184)),d=u(n(45697));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)}const f=()=>null;class p extends r.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this),this.handleHide=this.handleHide.bind(this),this.clearResponse=this.clearResponse.bind(this),this.handleLoadingError=this.handleLoadingError.bind(this)}getForm(){const{FormBuilderLoaderComponent:e}=this.props;return this.props.schemaUrl?r.default.createElement(e,{fieldHolder:{className:(0,l.default)("modal-body",this.props.bodyClassName)},actionHolder:{className:"modal-footer"},autoFocus:this.props.autoFocus,schemaUrl:this.props.schemaUrl,onSubmit:this.handleSubmit,onAction:this.props.onAction,onLoadingError:this.handleLoadingError,identifier:this.props.identifier}):null}getResponse(){if(!this.state||!this.state.response)return null;let e="";return e=this.state.error?this.props.responseClassBad:this.props.responseClassGood,r.default.createElement("div",{className:e},(0,o.default)("span",{html:this.state.response}))}clearResponse(){this.setState({response:null})}handleLoadingError(e){const t=this.props.onLoadingError!==f;if(this.props.showErrorMessage||!t){const t=e.errors&&e.errors[0];this.setState({response:t.value,error:!0})}t&&this.props.onLoadingError(e)}handleHide(){this.clearResponse(),"function"==typeof this.props.onClosed&&this.props.onClosed()}handleSubmit(e,t,n){this.clearResponse();let r=null;if(r="function"==typeof this.props.onSubmit?this.props.onSubmit(e,t,n):n(),!r)throw new Error("Promise was not returned for submitting");return r.then((e=>(e&&this.setState({response:e.message,error:!1}),e))).catch((e=>{e.then((e=>{this.setState({response:e,error:!0})}))})),r}renderHeader(){let{title:e}=this.props;const{ModalHeaderComponent:t}=this.props;if(!1!==e){if("object"==typeof e){e=(new DOMParser).parseFromString(e.html,"text/html").body.textContent||""}return r.default.createElement(t,{toggle:this.handleHide},e)}return!0===this.props.showCloseButton&&"function"==typeof this.props.onClosed?r.default.createElement("button",{type:"button",className:"close modal__close-button",onClick:this.handleHide,"aria-label":a.default._t("Admin.CLOSE","Close")}):null}render(){const e=this.getForm(),t=this.getResponse(),{ModalComponent:n}=this.props;return r.default.createElement(n,{isOpen:this.props.isOpen,toggle:this.handleHide,className:this.props.className,modalClassName:this.props.modalClassName,size:this.props.size},this.renderHeader(),t,e,this.props.children)}}p.propTypes={autoFocus:d.default.bool,isOpen:d.default.bool,title:d.default.oneOfType([d.default.string,d.default.bool,d.default.shape({html:d.default.string})]),className:d.default.string,bodyClassName:d.default.string,modalClassName:d.default.string,showCloseButton:d.default.bool,size:d.default.string,onClosed:d.default.func,schemaUrl:d.default.string,onSubmit:d.default.func,onAction:d.default.func,responseClassGood:d.default.string,responseClassBad:d.default.string,identifier:d.default.string,showErrorMessage:d.default.bool,onLoadingError:d.default.func,ModalComponent:d.default.oneOfType([d.default.object,d.default.func]),ModalHeaderComponent:d.default.oneOfType([d.default.object,d.default.func]),FormBuilderLoaderComponent:d.default.oneOfType([d.default.object,d.default.func])},p.defaultProps={showErrorMessage:!1,showCloseButton:!0,onLoadingError:f,isOpen:!1,title:null,modalClassName:"form-builder-modal",responseClassGood:"alert alert-success",responseClassBad:"alert alert-danger",ModalComponent:i.Modal,ModalHeaderComponent:i.ModalHeader,FormBuilderLoaderComponent:s.default};var h=p;t.default=h},88940:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=y(n(67294)),a=v(n(4754)),i=n(14890),s=n(86706),o=v(n(59746)),l=v(n(73542)),d=v(n(84002)),u=v(n(58227)),c=v(n(18052)),f=v(n(13527)),p=v(n(430)),h=y(n(30772)),m=v(n(10259)),g=v(n(45697));function v(e){return e&&e.__esModule?e:{default:e}}function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}function 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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}const _=[];class w extends r.Component{constructor(e){super(e),this.deleteRecord=this.deleteRecord.bind(this),this.editRecord=this.editRecord.bind(this)}componentDidMount(){const e=this.props.data;this.props.actions.fetchRecords(e.recordType,e.collectionReadEndpoint.method,e.collectionReadEndpoint.url)}createRowActions(e){return r.default.createElement(c.default,{className:"grid-field__cell--actions",key:"Actions"},r.default.createElement(f.default,{icon:"cog",onClick:this.editRecord,record:e}),r.default.createElement(f.default,{icon:"cancel",onClick:this.deleteRecord,record:e}))}createCell(e,t){const n=this.props.data.onDrillDown,r={className:n?"grid-field__cell--drillable":"",onDrillDown:n?t=>n(t,e):null,key:`${t.name}`,width:t.width},a=t.field.split(".").reduce(((e,t)=>e[t]),e);return(0,m.default)(c.default,a,r)}createRow(e){const t={className:this.props.data.onDrillDown?"grid-field__row--drillable":"",key:`${e.ID}`},n=this.props.data.columns.map((t=>this.createCell(e,t))),a=this.createRowActions(e);return r.default.createElement(u.default,t,n,a)}deleteRecord(e,t){e.preventDefault();const n={};n[p.default.CSRF_HEADER]=this.props.config.SecurityID,confirm(a.default._t("CampaignAdmin.DELETECAMPAIGN","Are you sure you want to delete this record?"))&&this.props.actions.deleteRecord(this.props.data.recordType,t,this.props.data.itemDeleteEndpoint.method,this.props.data.itemDeleteEndpoint.url,n)}editRecord(e,t){e.preventDefault(),this.props.data&&"function"==typeof this.props.data.onEditRecord&&this.props.data.onEditRecord(e,t)}render(){if(this.props.records===_)return r.default.createElement("div",null,a.default._t("CampaignAdmin.LOADING","Loading..."));if(!this.props.records.length)return r.default.createElement("div",null,a.default._t("CampaignAdmin.NO_RECORDS","No campaigns created yet."));const e=r.default.createElement("th",{key:"holder",className:"grid-field__action-placeholder"}),t=this.props.data.columns.map((e=>r.default.createElement(d.default,{key:e.name},e.name))),n=r.default.createElement(l.default,null,t.concat(e)),i=this.props.records.map((e=>this.createRow(e)));return r.default.createElement(o.default,{header:n,rows:i})}}w.propTypes={data:g.default.shape({recordType:g.default.string.isRequired,headerColumns:g.default.array,collectionReadEndpoint:g.default.object,onDrillDown:g.default.func,onEditRecord:g.default.func})};var O=(0,s.connect)((function(e,t){const n=t.data&&t.data.recordType;return{config:e.config,records:n&&e.records[n]?e.records[n]:_}}),(function(e){return{actions:(0,i.bindActionCreators)(h,e)}}))(w);t.default=O},13527:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),i=(r=n(45697))&&r.__esModule?r:{default:r};function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class o extends a.Component{constructor(e){super(e),this.handleClick=this.handleClick.bind(this)}handleClick(e){this.props.onClick(e,this.props.record.ID)}render(){return a.default.createElement("button",{className:`grid-field__icon-action font-icon-${this.props.icon} btn--icon-lg`,onClick:this.handleClick})}}o.propTypes={onClick:i.default.func.isRequired};var l=o;t.default=l},18052:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=s(n(94184)),i=s(n(45697));function s(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;tr.default.createElement(a.default,null,e.children);t.default=s},84002:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=(r=n(67294))&&r.__esModule?r:{default:r};var i=e=>a.default.createElement("th",null,e.children);t.default=i},58227:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=(r=n(67294))&&r.__esModule?r:{default:r};var i=e=>{const t=`grid-field__row ${e.className}`;return a.default.createElement("tr",{tabIndex:0,className:t},e.children)};t.default=i},59746:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),i=(r=n(45697))&&r.__esModule?r:{default:r};function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class o extends a.Component{generateHeader(){return void 0!==this.props.header?this.props.header:(this.props.data,null)}generateRows(){return void 0!==this.props.rows?this.props.rows:(this.props.data,null)}render(){return a.default.createElement("div",{className:"grid-field"},a.default.createElement("table",{className:"table table-hover grid-field__table"},a.default.createElement("thead",null,this.generateHeader()),a.default.createElement("tbody",null,this.generateRows())))}}o.propTypes={data:i.default.object,header:i.default.object,rows:i.default.array};var l=o;t.default=l},71375:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=n(53556),i=d(n(86010)),s=d(n(95393)),o=d(n(94184)),l=d(n(45697));function d(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 c extends r.PureComponent{renderMultipleActions(e){const t=e.reduce(((e,t)=>{const n=e,r=t.group;if(!r)throw new Error(`Action: "${t.title}" has no group assigned`);return n[r]||(n[r]=[]),n[r].push(t),n}),[]);return r.default.createElement(s.default,{dropdownMenuProps:{right:!0},dropdownToggleClassNames:["action-menu__toggle","btn","btn--no-text","btn-sm","font-icon-dot-3"]},Object.keys(t).map(((e,n)=>[0!==n&&r.default.createElement(a.DropdownItem,{divider:!0,key:e}),t[e].map(((e,t)=>r.default.createElement(i.default,{data:e.data,title:e.title,type:e.type,url:e.url,key:t})))])))}renderSingleAction(e){const{type:t,title:n,data:i}=e;let s,{url:l}=e;"submit"===t&&(s="submit",l=void 0);const d=(0,o.default)("action",i.classNames);return r.default.createElement(a.Button,{className:d,type:s,href:l,"data-url":i["data-url"],"data-action-state":i["data-action-state"],name:i.name,color:"secondary"},n)}render(){const{schema:e}=this.props;return e.length>1?this.renderMultipleActions(e):1===e.length?this.renderSingleAction(e[0]):null}}const f=i.default.propTypes;f.group=l.default.string,c.propTypes=l.default.arrayOf(l.default.shape(f)).isRequired;var p=c;t.default=p},86010:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=n(53556),i=o(n(94184)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}class d extends r.PureComponent{render(){const{type:e,title:t,data:n}=this.props;let{url:s}=this.props;const o=(0,i.default)("action",n.classNames);let l=null;switch(e){case"submit":case"button":l="button",s=void 0;break;case"link":l="a";break;default:l=void 0}return r.default.createElement(a.DropdownItem,{className:o,href:s,tag:l,type:"button"===l?"button":void 0,"data-url":n["data-url"],"data-action-state":n["data-action-state"],name:n.name},t)}}d.propTypes={data:s.default.object,title:s.default.string.isRequired,type:s.default.oneOf(["submit","link"]),url:s.default.string};var u=d;t.default=u},65732:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(67294)),a=s(n(45697)),i=s(n(94184));function s(e){return e&&e.__esModule?e:{default:e}}function o(e){let{className:t,extraClass:n,id:a,data:{headingLevel:s,title:o}}=e;const l=`h${s||3}`;return r.default.createElement("div",{className:"field"},r.default.createElement(l,{className:(0,i.default)(t,n),id:a},o))}o.propTypes={className:a.default.string,extraClass:a.default.string,id:a.default.string,data:a.default.oneOfType([a.default.array,a.default.shape({headingLevel:a.default.number,title:a.default.string})]).isRequired},o.defaultProps={className:"",extraClass:""};var l=o;t.default=l},19423:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=n(53556),i=o(n(94184)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}class d extends r.Component{getInputProps(){return{className:(0,i.default)(this.props.className,this.props.extraClass),id:this.props.id,name:this.props.name,type:"hidden",value:this.props.value||""}}render(){return r.default.createElement(a.Input,this.getInputProps())}}d.propTypes={id:s.default.string,extraClass:s.default.string,name:s.default.string.isRequired,value:s.default.any},d.defaultProps={className:"",extraClass:"",value:""};var u=d;t.default=u},1922:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=o(n(67294)),a=o(n(69227)),i=n(74898),s=o(n(98028));function o(e){return e&&e.__esModule?e:{default:e}}n(51726);class l extends i.Component{constructor(e){super(e),this.state={isReady:!e.data.editorjs},this.inputRef=null,this.handleReady=this.handleReady.bind(this)}getInputProps(){return{...super.getInputProps(),...this.props.data.attributes,innerRef:e=>{this.inputRef=e}}}getEditorElement(){return document.getElementById(this.getInputProps().id)}getEditor(){return window.TinyMCE&&window.TinyMCE.get(this.getInputProps().id)}handleReady(){!window.TinyMCE&&window.tinymce&&(window.TinyMCE=window.tinymce),this.setState({isReady:!0})}registerChangeListener(){const e=this.getEditorElement();this.getEditor().on("change keyup setcontent",(()=>{super.handleChange({target:e})}))}renderDependencyScript(){return window.tinymce||window.TinyMCE?(setTimeout((()=>{this.handleReady()}),0),null):r.default.createElement(a.default,{url:this.props.data.editorjs,onLoad:this.handleReady})}render(){return this.state.isReady?super.render():this.renderDependencyScript()}componentDidUpdate(e,t){const{isReady:n}=this.state;if(!n)return;n!==t.isReady&&setTimeout((()=>{const{document:e,jQuery:t}=window,n=t?t.Event("EntwineElementsAdded"):new Event("noop"),r=this.getEditorElement();n.targets=[r],t&&t(e).triggerHandler(n),this.registerChangeListener()}),1);const{value:r}=this.props;if(r!==e.value){const e=new Event("change",{bubbles:!0});e.simulated=!0,e.value=r,this.inputRef.dispatchEvent(e)}}componentWillUnmount(){if(!this.state.isReady)return;const{document:e,jQuery:t}=window,n=t?t.Event("EntwineElementsRemoved"):new Event("noop"),r=this.getEditorElement(),a=this.getEditor();a&&a.save(),n.targets=[r],super.handleChange({target:r}),t&&t(e).triggerHandler(n)}}t.Component=l;var d=(0,s.default)(l);t.default=d},618:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=o(n(98028)),i=n(53556),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{id:t,className:n,title:a,extraClass:i,data:s}=e;const o=s&&s.target,l=`${n} ${i}`;return r.default.createElement("label",{id:t,className:l,htmlFor:o},a)};s.propTypes={id:a.default.number,className:a.default.string,extraClass:a.default.string,title:a.default.node,data:a.default.shape({target:a.default.string})},s.defaultProps={className:"",extraClass:""};var o=s;t.default=o},5257:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(67294)),a=s(n(45697)),i=n(79655);function s(e){return e&&e.__esModule?e:{default:e}}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;tr.default.createElement("div",{className:"list-group"},e.items.map((e=>r.default.createElement(a.default,e))));o.propTypes={items:i.default.array};var l=o;t.default=l},12906:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),i=(r=n(45697))&&r.__esModule?r:{default:r};function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class o extends a.Component{constructor(e){super(e),this.handleClick=this.handleClick.bind(this)}handleClick(e){this.props.onClick&&this.props.onClick(e,this.props.onClickArg)}render(){const e=`list-group-item ${this.props.className}`;return a.default.createElement("a",{role:"button",tabIndex:0,className:e,onClick:this.handleClick},this.props.children)}}o.propTypes={onClickArg:i.default.any,onClick:i.default.func};var l=o;t.default=l},7162:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),i=(r=n(45697))&&r.__esModule?r:{default:r};function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;tt.value===e));return t?t.title:""}return e&&e.length?e.map((e=>{const t=this.props.source.find((t=>t.value===e));return t&&t.title})).filter((e=>`${e}`.length)).join(", "):""}getFieldProps(){return{id:this.props.id,name:this.props.name,className:`${this.props.className} ${this.props.extraClass}`}}render(){if(!this.props.source)return null;const e=`('${s.default._t("Admin.NONE","None")}')`,t=this.getValueCSV()||e;return r.default.createElement(a.Input,u({plaintext:!0},this.getFieldProps(),{tag:"p"}),t)}}t.Component=c,c.propTypes={extraClass:o.default.string,id:o.default.string,name:o.default.string.isRequired,source:o.default.arrayOf(o.default.shape({value:o.default.oneOfType([o.default.string,o.default.number]),title:o.default.any,disabled:o.default.bool})),value:o.default.any},c.defaultProps={extraClass:"",className:"",value:[]};var f=(0,i.default)(c);t.default=f},86827:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=s(n(94184)),i=s(n(45697));function s(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}class l extends r.Component{constructor(){super(),this.handleClick=this.handleClick.bind(this)}handleClick(e){e.preventDefault(),"function"==typeof this.props.onClick&&this.props.onClick(e)}render(){const e=(0,a.default)({"cms-mobile-menu-toggle":!0,"cms-mobile-menu-toggle--open":this.props.isOpen});return r.default.createElement("button",{type:"button",className:e,href:"#toggle-mobile-menu",onClick:this.handleClick,"aria-controls":this.props.controls,"aria-expanded":Boolean(this.props.isOpen)},r.default.createElement("span",null),r.default.createElement("span",null),r.default.createElement("span",null),r.default.createElement("span",null))}}l.propTypes={isOpen:i.default.bool.isRequired,onClick:i.default.func.isRequired,controls:i.default.string},l.defaultProps={controls:""};var d=l;t.default=d},26195:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=n(11521),i=n(86706),s=(r=n(86827))&&r.__esModule?r:{default:r};var o=(0,i.connect)((e=>({isOpen:e.mobileMenu.isOpen})),(e=>({onClick(){e((0,a.toggleMobileMenu)())}})))(s.default);t.default=o},3730:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r,a=n(67294),i=(r=n(45697))&&r.__esModule?r:{default:r},s=n(79655);function o(e){let{shouldBlockFn:t,blockMessage:n}=e;const r=(0,s.unstable_useBlocker)(t);return(0,a.useEffect)((()=>{if("blocked"===r.state){confirm(n)?r.proceed():r.reset()}}),[r.state]),null}o.propTypes={shouldBlockFn:i.default.func.isRequired,blockMessage:i.default.string.isRequired}},55742:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(67294)),a=l(n(4754)),i=l(n(94184)),s=l(n(23296)),o=l(n(45697));function l(e){return e&&e.__esModule?e:{default:e}}const d=e=>{let{itemName:t,name:n,value:o}=e;return r.default.createElement("div",{className:(0,i.default)(t,"not-found-component")},r.default.createElement(s.default,{value:a.default.inject(a.default._t("Admin.NOT_FOUND_COMPONENT","The component here ({component}) failed to load, there is a chance that you may lose data when saving due to this."),{component:t})}),n&&"string"==typeof o?r.default.createElement("input",{type:"hidden",name:n,value:o}):null)};d.propTypes={itemName:o.default.string.isRequired,name:o.default.string,value:o.default.any};var u=d;t.default=u},92227:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=i(n(98028)),a=i(n(16725));function i(e){return e&&e.__esModule?e:{default:e}}class s extends a.default{getInputProps(){const e=super.getInputProps();return Object.assign(e,{type:"number"}),e}}t.Component=s;var o=(0,r.default)(s);t.default=o},31885:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=n(53556),i=l(n(94184)),s=l(n(10259)),o=l(n(45697));function l(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}class u extends r.Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}getInputProps(){const e=(0,i.default)({[this.props.className]:!0,[this.props.extraClass]:!0,"form-check":!0,checked:this.props.value,disabled:this.props.readOnly,"option-field--disabled":this.props.readOnly||this.props.disabled});return{id:this.props.id,type:this.props.type,name:this.props.name,disabled:this.props.disabled||this.props.readOnly,readOnly:this.props.readOnly,className:e,onChange:this.handleChange,checked:!!this.props.value,value:1}}handleChange(e){if(this.props.readOnly||this.props.disabled)return void e.preventDefault();let t=null;"function"==typeof this.props.onChange?t=this.props.onChange:"function"==typeof this.props.onClick&&(t=this.props.onClick),t&&t(e,{id:this.props.id,value:e.target.checked?1:0})}render(){const e=null!==this.props.leftTitle?this.props.leftTitle:this.props.title,t=null!==this.props.rightTitle?`${e} ${this.props.rightTitle}`:e;return r.default.createElement(a.FormGroup,{check:!0},r.default.createElement(a.Label,{check:!0},r.default.createElement(a.Input,this.getInputProps()),(0,s.default)("span",t)))}}t.Component=u,u.propTypes={type:o.default.oneOf(["checkbox","radio"]),leftTitle:o.default.any,rightTitle:o.default.any,title:o.default.any,extraClass:o.default.string,id:o.default.string,name:o.default.string,onChange:o.default.func,value:o.default.oneOfType([o.default.string,o.default.number,o.default.bool]),readOnly:o.default.bool,disabled:o.default.bool},u.defaultProps={extraClass:"",className:"",type:"radio",leftTitle:null,rightTitle:null};var c=u;t.default=c},5110:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=o(n(31885)),i=o(n(98028)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;tthis.getItemKey(e,n)===t.id));this.props.onChange(e,{id:this.props.id,value:n.value})}}render(){return this.props.source?r.default.createElement("div",null,this.props.source.map(((e,t)=>r.default.createElement(a.default,d({},this.getOptionProps(e,t),{hideLabels:!0}))))):null}}t.Component=u,u.propTypes={extraClass:s.default.string,itemClass:s.default.string,id:s.default.string,name:s.default.string.isRequired,source:s.default.arrayOf(s.default.shape({value:s.default.oneOfType([s.default.string,s.default.number]),title:s.default.oneOfType([s.default.string,s.default.number]),disabled:s.default.bool})),onChange:s.default.func,value:s.default.oneOfType([s.default.string,s.default.number]),readOnly:s.default.bool,disabled:s.default.bool},u.defaultProps={extraClass:"",className:"",itemClass:""};var c=(0,i.default)(u);t.default=c},20693:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=n(53556),i=o(n(94184)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}class d extends r.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={isOpen:!1}}getPlacement(){return this.props.data.placement||"bottom"}getContainer(){return this.props.container?this.props.container:this.wrapper}toggle(){const{toggleCallback:e}=this.props;window.setTimeout((()=>this.setState({isOpen:!this.state.isOpen},e)),0)}render(){const e=this.getPlacement(),t=(0,i.default)({btn:!0,"btn-secondary":!0,[this.props.className]:!0,[this.props.buttonClassName]:!0,"btn--no-focus":this.state.isOpen,"font-icon-dot-3 btn--no-text":!this.props.title,[`btn--icon-${this.props.buttonSize}`]:!this.props.title}),n={id:this.props.id,type:"button",className:t,onClick:this.toggle,title:this.props.data.buttonTooltip},s=(0,i.default)({[this.props.className]:!0,"popover-container":!0,"popover-field":!0});return r.default.createElement("div",{className:s,ref:e=>{this.wrapper=e}},r.default.createElement(a.Button,n,this.props.title),r.default.createElement(a.Popover,{id:`${this.props.id}_Popover`,placement:e,isOpen:this.state.isOpen,target:this.props.id,toggle:this.toggle,className:this.props.popoverClassName,container:this.getContainer()},r.default.createElement(a.PopoverHeader,null,this.props.data.popoverTitle),r.default.createElement(a.PopoverBody,null,this.props.children)))}}d.propTypes={id:s.default.string.isRequired,title:s.default.any,container:s.default.any,className:s.default.string,buttonClassName:s.default.string,popoverClassName:s.default.string,buttonSize:s.default.oneOf(["sm","md","large","xl"]),data:s.default.oneOfType([s.default.array,s.default.shape({popoverTitle:s.default.string,buttonTooltip:s.default.string,placement:s.default.oneOf(["top","bottom","left","right"])})]),toggleCallback:s.default.func},d.defaultProps={data:{},className:"",buttonClassName:"",popoverClassName:"",buttonSize:"xl",toggleCallback:()=>{}};var u=d;t.default=u},71255:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=l(n(45697)),i=n(53556),s=l(n(94184)),o=l(n(4754));function l(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)}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;tr.default.createElement(l,u({},e.buttonProps,{className:(0,s.default)(e.className,i),key:e.key,onClick:e.onClick}),e.content))))}render(){const{container:e,className:t,isOpen:n,placement:a,target:i,PopoverComponent:o}=this.props;return r.default.createElement(o,{className:(0,s.default)(t),container:e,hideArrow:!0,isOpen:n,onKeyDown:this.handleKeyDown,placement:a,target:i,toggle:this.handleToggle,trigger:"legacy"},this.renderSearchBox(),this.renderOptionButtons())}}c.propTypes={buttons:a.default.arrayOf(a.default.shape({key:a.default.string.isRequired,content:a.default.node.isRequired,onClick:a.default.func.isRequired,className:a.default.oneOfType([a.default.string,a.default.object,a.default.arrayOf(a.default.string)]),buttonProps:a.default.object})).isRequired,onSearch:a.default.func,container:a.default.oneOfType([a.default.string,a.default.elementType]),isOpen:a.default.bool.isRequired,placement:a.default.string,target:a.default.oneOfType([a.default.string,a.default.elementType]).isRequired,toggle:a.default.func.isRequired,searchPlaceholder:a.default.string,disableSearch:a.default.bool,ButtonComponent:a.default.oneOfType([a.default.object,a.default.func]),PopoverComponent:a.default.oneOfType([a.default.object,a.default.func]),className:a.default.oneOfType([a.default.string,a.default.array,a.default.object]),searchClassName:a.default.oneOfType([a.default.string,a.default.array,a.default.object]),searchInputClassName:a.default.oneOfType([a.default.string,a.default.array,a.default.object]),clearButtonClassName:a.default.oneOfType([a.default.string,a.default.array,a.default.object]),buttonContainerClassName:a.default.oneOfType([a.default.string,a.default.array,a.default.object]),emptyResultClassName:a.default.oneOfType([a.default.string,a.default.array,a.default.object]),buttonClassName:a.default.oneOfType([a.default.string,a.default.array,a.default.object])},c.defaultProps={searchPlaceholder:o.default._t("PopoverOptionSet.SEARCH_PLACEHOLDER","Search"),onSearch:(e,t)=>t.filter((t=>{let{content:n}=t;return n.toLowerCase().includes(e.toLowerCase())})),disableSearch:!1,ButtonComponent:i.Button,PopoverComponent:i.Popover,className:"popover-option-set",searchClassName:"popover-option-set__search",searchInputClassName:"popover-option-set__search-input",clearButtonClassName:"popover-option-set__search-clear btn btn-link",buttonContainerClassName:"popover-option-set__button-container",emptyResultClassName:"popover-option-set__no-results",buttonClassName:"popover-option-set__button"};var f=c;t.default=f},3080:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=d(n(4754)),i=d(n(95393)),s=d(n(94184)),o=n(54582),l=d(n(45697));function d(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 c extends r.Component{constructor(e){super(e),this.state={frameLoaded:!1},this.handleBackClick=this.handleBackClick.bind(this),this.setFrameLoaded=this.setFrameLoaded.bind(this)}componentDidUpdate(e){this.state.frameLoaded&&e.previewUrl!==this.props.previewUrl&&this.setFrameLoaded(!1)}setFrameLoaded(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState({frameLoaded:e})}handleBackClick(e){"function"==typeof this.props.onBack&&(e.preventDefault(),this.props.onBack(e))}buildToolbarButtons(){const e=[];if(this.props.itemLinks&&this.props.itemLinks.edit){const t=this.props.itemLinks.edit.href;e.push(r.default.createElement("a",{key:"edit",href:t,className:"btn btn-outline-secondary font-icon-edit"},r.default.createElement("span",{className:"btn__title"},a.default._t("Admin.EDIT","Edit"))))}return e}renderMoreActions(){return this.props.moreActions&&0!==this.props.moreActions.length?r.default.createElement(i.default,null,this.props.moreActions):null}renderBody(){let e=null,t="";return this.props.itemLinks&&this.props.itemLinks.preview&&(this.props.itemLinks.preview.Stage?(e=this.props.itemLinks.preview.Stage.href,t=this.props.itemLinks.preview.Stage.type):this.props.itemLinks.preview.Live&&(e=this.props.itemLinks.preview.Live.href,t=this.props.itemLinks.preview.Live.type)),this.props.itemId?e?t&&0===t.indexOf("image/")?r.default.createElement("div",{className:"preview__file-container panel--scrollable"},r.default.createElement("img",{alt:e,className:"preview__file--fits-space",src:e})):r.default.createElement("iframe",{style:{visibility:this.state.frameLoaded?"visible":"hidden"},className:"flexbox-area-grow preview__iframe",src:e,onLoad:this.setFrameLoaded}):r.default.createElement("div",{className:"preview__overlay"},r.default.createElement("h3",{className:"preview__overlay-text"},a.default._t("Admin.NO_ITEM_PREVIEW","There is no preview available for this item."))):r.default.createElement("div",{className:"preview__overlay"},r.default.createElement("h3",{className:"preview__overlay-text"},a.default._t("Admin.NO_PREVIEW","No preview available.")))}render(){const{className:e,ViewModeComponent:t}=this.props,n=(0,s.default)("preview",e);return r.default.createElement("div",{className:n},this.renderBody(),r.default.createElement("div",{className:"toolbar toolbar--south"},r.default.createElement("div",{className:"btn-toolbar"},this.buildToolbarButtons(),r.default.createElement(t,{id:"view-mode-toggle-in-preview-nb",area:"preview"}),this.renderMoreActions())))}}t.Component=c,c.propTypes={className:l.default.string,itemLinks:l.default.object,itemId:l.default.number,onBack:l.default.func,moreActions:l.default.arrayOf(l.default.element),ViewModeComponent:l.default.elementType},c.defaultProps={className:"flexbox-area-grow fill-height"};var f=(0,o.inject)(["ViewModeToggle"],(e=>({ViewModeComponent:e})),(()=>"Admin.Preview"))(c);t.default=f},72543:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(67294),a=s(n(91033)),i=s(n(45697));function s(e){return e&&e.__esModule?e:{default:e}}class o extends r.Component{constructor(e){super(e),this.render=this.render.bind(this),this.handleResize=this.handleResize.bind(this),this.state={},this.observer=new a.default((e=>e.forEach((e=>{let{contentRect:t}=e;return this.handleResize(t)}))))}componentDidMount(){this.observer.observe(this.container);const e={width:this.container.offsetWidth,height:this.container.offsetHeight};this.handleResize(e)}componentWillUnmount(){this.observer.disconnect()}handleResize(e){const{width:t,height:n}=this.state;t===e.width&&n===e.height||this.setState(e),this.props.onResize&&this.props.onResize(e)}render(){const{children:e,onlyEvent:t,component:n,onResize:a,widthPropName:i,heightPropName:s,...o}=this.props,{width:l,height:d}=this.state,u="string"!=typeof n,c={[[i||"width"]]:l,[[s||"height"]]:d};return(0,r.createElement)(n,{[u?"getRef":"ref"]:e=>{this.container=e},...u&&c,...o},"function"==typeof e?e({width:l,height:d}):r.Children.map(e,(e=>(0,r.isValidElement)(e)?(0,r.cloneElement)(e,t?null:c):e)))}}o.propTypes={component:i.default.oneOfType([i.default.string,i.default.elementType]),onResize:i.default.func},o.defaultProps={component:"div"};var l=o;t.default=l},62266:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0,t.hasFilters=T;var r=w(n(4754)),a=_(n(67294)),i=n(86706),s=w(n(73935)),o=n(14890),l=_(n(39042)),d=n(11962),u=n(35237),c=w(n(79298)),f=w(n(90161)),p=w(n(96869)),h=w(n(31824)),m=w(n(97019)),g=w(n(65693)),v=w(n(18992)),b=w(n(45697));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,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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function w(e){return e&&e.__esModule?e:{default:e}}function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t0}class S extends a.Component{constructor(e){super(e),this.expand=this.expand.bind(this),this.handleChange=this.handleChange.bind(this),this.getData=this.getData.bind(this),this.doSearch=this.doSearch.bind(this),this.focusInput=this.focusInput.bind(this),this.focusFirstFormField=this.focusFirstFormField.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.toggle=this.toggle.bind(this),this.open=this.open.bind(this),this.searchTermIsDirty=this.searchTermIsDirty.bind(this),this.clearFilters=this.clearFilters.bind(this),this.clearSearchBox=this.clearSearchBox.bind(this),this.clearFormFilter=this.clearFormFilter.bind(this),this.focusFormFilter=this.focusFormFilter.bind(this),this.formatTagData=this.formatTagData.bind(this);const t=e.term||e.filters&&e.filters[`${e.filterPrefix}${e.name}`]||"";this.state={display:e.display,searchText:t,initialSearchText:t}}componentDidMount(){this.setOverrides(this.props)}componentWillUnmount(){this.setOverrides()}setOverrides(e){if(e&&(!T(e.filters)||this.props.formSchemaUrl!==e.formSchemaUrl)){const t=e&&e.formSchemaUrl||this.props.formSchemaUrl;t&&this.props.actions.schema.setSchemaStateOverrides(t,null)}if(e&&T(e.filters)&&e.formSchemaUrl){const t=e.filters||{},n={fields:Object.keys(t).map((e=>({name:e,value:t[e]})))};this.props.actions.schema.setSchemaStateOverrides(e.formSchemaUrl,n)}}getData(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{name:t,filterPrefix:n,formData:r}=this.props,{searchText:a}=this.state,i={};return Object.keys(r).forEach((e=>{const t=r[e];t&&(i[e]=t)})),!e&&a&&void 0===r[`${n}${t}`]&&(i[`${n}${t}`]=a.trim()),i}handleChange(e){const t=e.target.value;this.state.searchText!==t&&this.setState({searchText:t});const{schemaName:n,name:r,filterPrefix:a,actions:i,formData:s}=this.props;void 0!==s[`${a}${r}`]&&i.reduxForm.change(n,`${a}${r}`,t)}focusInput(){if(this.state.display===E.NONE)return;const e=s.default.findDOMNode(this);if(!e)return;const t=e.querySelector(".search-box__content-field");t!==document.activeElement&&(t.focus(),t.select&&t.select())}focusFirstFormField(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"input, textarea, select, button";if(this.state.display!==E.EXPANDED)return;const t=s.default.findDOMNode(this);if(!t)return;const n=t.querySelector(".search-form");if(!n)return;const r=n.querySelector(e);r&&(r.focus(),r.select&&r.select())}clearFormData(e){""!==this.state.searchText&&this.setState({searchText:""});const t=e&&e.formSchemaUrl||this.props.formSchemaUrl;if(t){const n=e&&e.identifier||this.props.identifier;this.props.actions.schema.setSchemaStateOverrides(t,{fields:[]}),this.props.actions.reduxForm.reset(n)}}clearFormFilter(e){const t=this.props.tagData[e],n={[e]:void 0},{schemaName:r,filters:a}=this.props;this.props.actions.reduxForm.change(r,e,""),this.setOverrides({...this.props,filters:{...a,[e]:void 0}}),Array.isArray(t.linkedFields)&&t.linkedFields.forEach((e=>{n[e]=void 0})),this.doSearch(n)}focusFormFilter(e){const t=this.props.tagData[e].focusSelector||`[name=${e}]`;this.expand(),setTimeout((()=>this.focusFirstFormField(t)),50)}open(){this.show(),this.focusInput()}hide(){this.clearSearchBox(),this.props.onHide?this.props.onHide():this.state.display!==E.NONE&&this.setState({display:E.NONE})}show(){this.state.display!==E.VISIBLE&&this.setState({display:E.VISIBLE});const{schemaName:e,formData:t,name:n,actions:r}=this.props;void 0!==t[n]&&r.reduxForm.change(e,n,this.state.searchText)}expand(){this.state.display!==E.EXPANDED&&this.setState({display:E.EXPANDED})}toggle(){switch(this.state.display){case E.VISIBLE:this.expand(),setTimeout(this.focusFirstFormField,50);break;case E.EXPANDED:this.show()}}searchTermIsDirty(){const{searchText:e,initialSearchText:t}=this.state;return e.trim()!==t.trim()}doSearch(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{name:t,filterPrefix:n}=this.props,r={},a=this.getData();Object.entries(a).forEach((i=>{let[s,o]=i,l=s,d=o;e.hasOwnProperty(s)&&(d=e[s]),n.length>0&&s.startsWith(n)&&(l=s.substring(n.length)),(!n.length>0||s!==t||void 0===a[`${n}${t}`])&&(r[l]=d)}));const i=r[t]||"";this.state.display===E.VISIBLE&&this.state.initialSearchText===i&&this.state.searchText===i||this.setState({display:E.VISIBLE,initialSearchText:i,searchText:i}),this.props.onSearch(r)}clearFilters(){this.clearFormData(),this.focusFirstFormField()}clearSearchBox(){this.clearFormData(),this.focusInput()}formatTagData(){const{tagData:e,name:t,filterPrefix:n}=this.props,r=Object.assign({},e),a=`${n}${t}`;return r&&r[a]&&delete r[a],r?Object.values(r).map((e=>{let{key:t,label:n,value:r}=e;return{key:t,label:n,value:r}})):[]}render(){const{formSchemaUrl:e,forceFilters:t,id:n,displayBehavior:r,identifier:i,formIsDirty:s,tagData:o,name:l,...d}=this.props;if(this.state.display===E.NONE)return r===C.TOGGLABLE?a.default.createElement(g.default,{onToggle:this.show}):a.default.createElement("div",null);const u=`${n}_ExtraFields`,c=this.state.searchText,p=this.state.display===E.EXPANDED,v=this.state.display===E.VISIBLE,b=[C.HIDEABLE,C.TOGGLABLE].includes(r),y=s||this.searchTermIsDirty(),_=this.getData(),w=Object.keys(_).length>0;return a.default.createElement(f.default,{onClickOut:this.show,className:"search"},a.default.createElement(h.default,O({},d,{name:`SearchBox__${l}`,onChange:this.handleChange,onSearch:this.doSearch,onToggleFilter:this.toggle,onHideFilter:this.show,onHide:this.hide,onClear:this.clearSearchBox,searchText:c,hideable:b,expanded:p,id:`${n}_searchbox`,showFilters:Boolean(t||e),dirty:y,clearable:w,onTagDelete:this.clearFormFilter,onTagClick:this.focusFormFilter,tagData:this.formatTagData()}),a.default.createElement(m.default,{id:u,identifier:i,visible:v,expanded:p,formSchemaUrl:e,onSearch:this.doSearch,onClear:this.clearFilters,clearable:w})))}}t.Component=S,S.propTypes={onSearch:b.default.func,onHide:b.default.func,id:b.default.string.isRequired,display:b.default.oneOf(Object.values(E)),formSchemaUrl:b.default.string,filters:b.default.object,formData:b.default.object,placeholder:b.default.string,displayBehavior:b.default.oneOf(Object.values(C)),term:b.default.string,name:b.default.string,filterPrefix:b.default.string,forceFilters:b.default.bool,formIsDirty:b.default.bool,identifier:b.default.string,schemaName:b.default.string,tagHandlers:b.default.object,borders:b.default.shape({top:b.default.bool,right:b.default.bool,bottom:b.default.bool,left:b.default.bool})},S.defaultProps={placeholder:r.default._t("Admin.SEARCH","Search"),display:E.VISIBLE,displayBehavior:C.NONE,filters:{},formData:{},term:"",filterPrefix:"",forceFilters:!1,name:"searchTerm",identifier:"Admin.SearchForm"};var P=(0,i.connect)((function(e,t){const n=e.form.formSchemas[t.formSchemaUrl];if(!n||!n.name)return{formData:{}};const r=n.name,a=(0,c.default)((0,p.default)(e),r),i=a&&a.values||{},s=(0,v.default)(n,t.filters,t.tagHandlers||{});return{formData:i,formIsDirty:(0,u.isDirty)(r,p.default)(e),schemaName:r,tagData:s}}),(function(e){return{actions:{schema:(0,o.bindActionCreators)(l,e),reduxForm:(0,o.bindActionCreators)({reset:d.reset,initialize:d.initialize,change:d.change},e)}}}))(S);t.default=P},31824:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=p(n(4754)),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),i=n(53556),s=p(n(94184)),o=p(n(43117)),l=p(n(97228)),d=p(n(72543)),u=p(n(73935)),c=p(n(45697));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(e){return e&&e.__esModule?e:{default:e}}class h extends a.Component{constructor(e){super(e),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.renderInput=this.renderInput.bind(this),this.renderFilterButton=this.renderFilterButton.bind(this),this.renderEnterHint=this.renderEnterHint.bind(this),this.renderHideButton=this.renderHideButton.bind(this),this.componentDidUpdate=this.componentDidUpdate.bind(this),this.onResize=this.onResize.bind(this),this.setWidth=this.setWidth.bind(this),this.renderTags=this.renderTags.bind(this),this.getComponentWidth=this.getComponentWidth.bind(this),this.calculateSpaceForTags=this.calculateSpaceForTags.bind(this),this.calculateInputLeftPadding=this.calculateInputLeftPadding.bind(this),this.calculateInputRightPadding=this.calculateInputRightPadding.bind(this),this.onTagListResize=this.onTagListResize.bind(this),this.focusOnLastTag=this.focusOnLastTag.bind(this),this.focusOnInput=this.focusOnInput.bind(this),this.state={hasFocus:!1,width:window.innerWidth-180-55,tagWidth:0}}componentDidUpdate(){const e=this.getComponentWidth();this.setWidth(e)}onResize(e){this.setWidth(e.width)}onTagListResize(e){const t=e.width;this.state.tagWidth!==t&&this.setState({tagWidth:t})}setWidth(e){this.state.width!==e&&this.setState({width:e})}getComponentWidth(){const e=u.default.findDOMNode(this);return e?e.getBoundingClientRect().width:0}calculateInputLeftPadding(){const e=this.state.width>576?55:20;return this.state.tagWidth+e}calculateInputRightPadding(){return this.state.width<576?121:264}calculateSpaceForTags(){let e=this.state.width;e-=150,e=e-55-52;const{hideable:t,showFilters:n}=this.props;return t&&(e-=52),n&&(e-=52),e=Math.max(e,0),e}handleKeyDown(e){"Enter"===e.key?(e.preventDefault(),this.props.onSearch()):0===e.target.selectionStart&&("ArrowLeft"===e.key||"Backspace"===e.key&&e.target.selectionEnd-e.target.selectionStart==0)&&(e.preventDefault(),this.focusOnLastTag())}handleFocus(){this.state.hasFocus||this.setState({hasFocus:!0}),this.props.onHideFilter&&this.props.onHideFilter()}handleBlur(){this.state.hasFocus&&this.setState({hasFocus:!1})}focusOnLastTag(){const e=u.default.findDOMNode(this);if(!e)return;const t=e.querySelector(".compact-tag-list__visible .tag:last-child");t&&t.focus()}focusOnInput(){const e=u.default.findDOMNode(this);if(!e)return;const t=e.querySelector("input");t&&t.focus()}renderInput(){const{id:e,searchText:t,onChange:n,placeholder:r,name:i,borders:o}=this.props,l={paddingLeft:`${this.calculateInputLeftPadding()}px`,paddingRight:`${this.calculateInputRightPadding()}px`},d=Object.assign({},h.defaultProps.borders,o),u="search-box__content-field",c=(0,s.default)("form-control",u,{[`${u}--top-border`]:d.top,[`${u}--right-border`]:d.right,[`${u}--bottom-border`]:d.bottom,[`${u}--left-border`]:d.left});return a.default.createElement("input",{"aria-labelledby":`${e}_label`,type:"search",name:i,placeholder:r,className:c,onKeyDown:this.handleKeyDown,onChange:n,onFocus:this.handleFocus,onBlur:this.handleBlur,value:t,id:e,autoFocus:!0,style:l})}renderTags(){const{tagData:e,onTagDelete:t,onTagClick:n,onToggleFilter:r}=this.props;return a.default.createElement("div",{className:"search-box__tags"},a.default.createElement(d.default,{onResize:this.onTagListResize},a.default.createElement(l.default,{onTagDelete:t,onTagClick:n,onHolderFocus:this.focusOnInput,tags:e,onSummary:r,maxSize:this.calculateSpaceForTags(),deletable:!0})))}renderEnterHint(){return a.default.createElement("div",{role:"presentation",className:"search-box__enter",onClick:e=>{e.stopPropagation(),e.preventDefault(),this.props.onSearch()}},r.default._t("Admin.ENTER","Enter")," ↵")}renderFilterButton(){const{expanded:e,onToggleFilter:t,formId:n}=this.props,o=(0,s.default)("btn--icon","font-icon-caret-down-two","search-box__filter-trigger",this.state.width<576?"search-box--no-label":"",{collapsed:!e}),l=this.state.width<576?"sr-only":"";return a.default.createElement(i.Button,{"aria-expanded":e,"aria-controls":n,"aria-label":r.default._t("Admin.ADVANCED","Advanced"),onClick:t,className:o,title:r.default._t("Admin.ADVANCED","Advanced")},a.default.createElement("span",{className:l},"Search options"))}renderHideButton(){const{id:e,onHide:t}=this.props;return a.default.createElement(i.Button,{onClick:t,title:r.default._t("Admin.CLOSE","Close"),"aria-label":r.default._t("Admin.CLOSE","Close"),className:"font-icon-cancel btn--no-text btn--icon-lg search-box__cancel","aria-controls":e,"aria-expanded":"true"})}render(){const{children:e,id:t,hideable:n,expanded:o,showFilters:l,dirty:u,clearable:c}=this.props,f=(0,s.default)("search-box",{"search-box--hideable":n,"search-box--not-hideable":!n,"search-box--has-focus":this.state.hasFocus,"search-box--has-not-focus":!this.state.hasFocus,"search-box--has-filters":l,"search-box--has-not-filters":!l,"search-box--compact":this.state.width<576,"search-box--expanded":o}),p=(u||!c)&&this.state.hasFocus;return a.default.createElement("div",{className:f},a.default.createElement(d.default,{onResize:this.onResize},a.default.createElement("div",{className:"search-box__group"},a.default.createElement(i.Label,{for:t,id:`${t}_label`,hidden:!0},r.default._t("Admin.SEARCH","Search")),this.renderTags(),this.renderInput(),p&&this.renderEnterHint(),e,a.default.createElement("div",{className:"icon font-icon-search"}),l&&this.renderFilterButton(),n&&this.renderHideButton())))}}t.Component=h,h.propTypes={onSearch:c.default.func,onToggleFilter:c.default.func,onHideFilter:c.default.func,onChange:c.default.func,onHide:c.default.func,onTagDelete:c.default.func,onTagClick:c.default.func,placeholder:c.default.string,expanded:c.default.bool,formId:c.default.string,id:c.default.string,searchText:c.default.string,hideable:c.default.bool,showFilters:c.default.bool,name:c.default.string,dirty:c.default.bool,clearable:c.default.bool,tagData:c.default.arrayOf(o.default)},h.defaultProps={placeholder:r.default._t("Admin.SEARCH","Search"),tagData:[],filters:{},formData:{},term:"",borders:{top:!1,right:!1,bottom:!0,left:!0}};var m=h;t.default=m},97019:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=c,t.default=void 0;var r=l(n(4754)),a=l(n(67294)),i=l(n(16304)),s=n(53556),o=l(n(45697));function l(e){return e&&e.__esModule?e:{default:e}}const d=r.default._t("Admin.SEARCH","Search"),u=r.default._t("Admin.CLEAR","Clear");function c(e){let{visible:t,expanded:n,onSearch:r,onClear:o,formSchemaUrl:l,id:c,identifier:f,clearable:p}=e;const h=(m=r,e=>{"Enter"===e.key&&(e.preventDefault(),m())});var m;const g=t||n;return a.default.createElement(s.Collapse,{id:c,isOpen:n,className:"search-form"},a.default.createElement("div",{className:"search-form__wrapper",onKeyDown:h},g&&l&&a.default.createElement(i.default,{className:"no-change-track",formTag:"div",identifier:f,schemaUrl:l,onSubmit:()=>(r(),Promise.resolve())}),a.default.createElement(s.Button,{className:"search-form__submit",onClick:()=>r(),color:"primary",type:"button"},d),p&&a.default.createElement(s.Button,{className:"search-form__clear",onClick:()=>o()},u)))}c.propTypes={onSearch:o.default.func,onClear:o.default.func,visible:o.default.bool,expanded:o.default.bool,id:o.default.string.isRequired,formSchemaUrl:o.default.string,identifier:o.default.string,clearable:o.default.bool},c.defaultProps={formData:{}};var f=c;t.default=f},65693:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=l(n(4754)),a=l(n(67294)),i=n(53556),s=l(n(94184)),o=l(n(45697));function l(e){return e&&e.__esModule?e:{default:e}}const d=r.default._t("Admin.SHOW_SEARCH","Show search"),u=e=>(0,s.default)("btn--no-text","search-toggle","font-icon-search","btn--icon-lg",{"search-toggle__active":e}),c=e=>{let{onToggle:t,toggled:n}=e;return a.default.createElement(i.Button,{title:d,onClick:t,className:u(n)},a.default.createElement("span",{className:"sr-only"},d))};t.Component=c,c.propTypes={onToggle:o.default.func,toggled:o.default.bool};var f=c;t.default=f},47465:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=(r=n(58592))&&r.__esModule?r:{default:r};const i=(e,t,n)=>{if(!Array.isArray(t)||0===t.length)return!1;const r=n.state.fields.find((t=>{let{name:n}=t;return n===e}));if(r&&r.source){return t.map((e=>{const t=r.source.find((t=>{let{value:n}=t;return n.toString()===e.toString()}));return t&&t.title?t.title:e})).join(", ")||!1}return!1};var s={Date:(0,a.default)("ll"),Time:(0,a.default)("LT"),Datetime:(0,a.default)("lll"),Hidden:()=>!1,SingleSelect:(e,t,n)=>{if(void 0===e.value)return!1;const r=i(e.key,[e.value],n);return!!r&&Object.assign({},e,{value:r})},Boolean:e=>{if(e.value){const{value:t,...n}=e;return n}return!1},MultiSelect:(e,t,n)=>{const r=i(e.key,e.value,n);return!!r&&Object.assign({},e,{value:r})},default:e=>!!e.value&&e};t.default=s},58592:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=(r=n(30381))&&r.__esModule?r:{default:r};var i=e=>(t,n)=>{let{lang:r}=n;if(!t.value)return!1;if(t.value&&r){a.default.locale(r);const n=(0,a.default)(t.value);if(n.isValid())return Object.assign({},t,{value:n.format(e)})}return t};t.default=i},18992:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=(r=n(47465))&&r.__esModule?r:{default:r};const i=(e,t)=>{let{key:n,value:r,label:a}=t;return`${e}${a.toLowerCase()||n} ${r||""} `};var s=function(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e.metadata.loading)return{};const s=r=>{const a={key:r.name,label:r.title,value:t[r.name]};let i;return i="function"==typeof n[`#${a.key}`]?n[`#${a.key}`]:"function"==typeof n[r.schemaType]?n[r.schemaType]:n.default,i(a,r,e,t)};n=Object.assign({},a.default,{Structural:(e,t)=>{const{children:n}=t;if(!Array.isArray(n)||0===n.length)return!1;const r=n.map(s).filter((e=>!1!==e)).reduce(i,"").trim(),a=n.map((e=>e.name)),o=`[name=${n[0].name}]`;return!!r&&Object.assign({},e,{value:r,linkedFields:a,focusSelector:o})}},r);const o=e.schema.fields.map(s).filter((e=>!1!==e)),l={};return o.forEach((e=>{l[e.key]=e})),l};t.default=s},63980:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=l(n(98028)),i=l(n(4754)),s=n(53556),o=l(n(45697));function l(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)}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;te.value===this.props.value));return e="string"==typeof e?e:this.props.value||"",r.default.createElement(s.Input,u({plaintext:!0},this.getInputProps(),{tag:"p"}),e)}getSelectField(){const e=this.props.source?this.props.source.slice():[];return this.props.data.hasEmptyDefault&&!e.find((e=>!e.value))&&e.unshift({value:"",title:this.props.data.emptyString,disabled:!1}),r.default.createElement(s.Input,u({type:"select"},this.getInputProps()),e.map(((e,t)=>{const n=`${this.props.name}-${e.value||`empty${t}`}`,a=e.description||null;return r.default.createElement("option",{key:n,value:e.value,disabled:e.disabled,title:a},e.title)})))}getInputProps(){const e={className:`${this.props.className} ${this.props.extraClass} no-chosen`,id:this.props.id,name:this.props.name,disabled:this.props.disabled};return this.props.readOnly||Object.assign(e,{onChange:this.handleChange,value:this.props.value||""}),e}handleChange(e){"function"==typeof this.props.onChange&&this.props.onChange(e,{id:this.props.id,value:e.target.value})}render(){let e=null;return e=this.props.readOnly?this.getReadonlyField():this.getSelectField(),e}}t.Component=c,c.propTypes={id:o.default.string,name:o.default.string.isRequired,onChange:o.default.func,value:o.default.oneOfType([o.default.string,o.default.number]),readOnly:o.default.bool,disabled:o.default.bool,source:o.default.arrayOf(o.default.shape({value:o.default.oneOfType([o.default.string,o.default.number]),title:o.default.oneOfType([o.default.string,o.default.number]),description:o.default.string,disabled:o.default.bool})),data:o.default.oneOfType([o.default.array,o.default.shape({hasEmptyDefault:o.default.bool,emptyString:o.default.oneOfType([o.default.string,o.default.number])})])},c.defaultProps={source:[],extraClass:"",className:"",data:{emptyString:i.default._t("Boolean.ANY","Any")}};var f=(0,a.default)(c);t.default=f},10202:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(67294)),a=n(53556),i=o(n(94184)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){let{title:t,disabled:n,active:s,tabClassName:o,onToggle:l}=e;if(!t)return null;const d=(0,i.default)(o,{active:s});return r.default.createElement(a.NavItem,null,r.default.createElement(a.NavLink,{onClick:l,disabled:n,className:d},t))}l.propTypes={title:s.default.string,disabled:s.default.bool,active:s.default.bool,tabClassName:s.default.string,onToggle:s.default.func.isRequired},l.defaultProps={disabled:!1,active:!1};var d=l;t.default=d},40505:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(67294)),a=n(53556),i=l(n(45697)),s=u(n(93390)),o=l(n(94184));function l(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)}function u(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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function c(e){let{name:t,className:n,extraClass:i,disabled:l,children:d}=e;const{activeTab:u,isOnActiveTab:c}=(0,s.default)(),f=t,p=(0,r.useMemo)((()=>({activeTab:u,currentTab:f,isOnActiveTab:!1!==c&&u===t})),[u,f,c]);return r.default.createElement(s.TabContext.Provider,{value:p},r.default.createElement(a.TabPane,{tabId:t,className:(0,o.default)(n,i),disabled:l},r.default.createElement(a.Fade,{in:c},d)))}c.propTypes={name:i.default.string.isRequired,extraClass:i.default.string,className:i.default.string,disabled:i.default.bool};var f=c;t.default=f},96870:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(67294)),a=n(53556),i=o(n(45697)),s=o(n(10202));function o(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{props:n}=e;return r.default.createElement(s.default,l({},n,{onToggle:()=>t!==n.name&&i(n.name),active:t===n.name}))}));return o&&o.length>1?r.default.createElement(a.Nav,{tabs:!0,role:"tablist"},o):null}d.propTypes={currentTab:i.default.string,onToggle:i.default.func.isRequired};var u=d;t.default=u},61404:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=m,t.default=void 0;var r=h(n(67294)),a=n(53556),i=f(n(94184)),s=f(n(45697)),o=n(86706),l=h(n(53104)),d=f(n(96870)),u=f(n(56204)),c=h(n(93390));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)}function h(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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function m(e){let{hideNav:t,children:n,activeTab:s,className:o,extraClass:l,id:f,activateTab:p,defaultActiveKey:h}=e;const m={className:(0,i.default)([o,l]),id:f},g=s||(0,u.default)(h,n),v=(0,c.default)(),b=v?v.isOnActiveTab:void 0,y=(0,r.useMemo)((()=>({activeTab:g,isOnActiveTab:b})),[s,b]);return r.default.createElement("div",m,r.default.createElement("div",{className:"wrapper"},!t&&r.default.createElement(d.default,{currentTab:g,onToggle:p},n),r.default.createElement(a.TabContent,{activeTab:g},r.default.createElement(c.TabContext.Provider,{value:y},n))))}m.propTypes={id:s.default.string.isRequired,defaultActiveKey:s.default.string,extraClass:s.default.string,hideNav:s.default.bool,activateTab:s.default.func,activeTab:s.default.string},m.defaultProps={className:"",extraClass:"",hideNav:!1};const g=e=>`${e.formid}__${e.id}`;var v=(0,o.connect)((function(e,t){const n=g(t);return{...e.tabs.fields[n]?e.tabs.fields[n]:{activeTab:null}}}),(function(e,t){const n=g(t);return{activateTab(t){e(l.activateTab(n,t))}}}))(m);t.default=v},56204:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const n=r.Children.toArray(t);if(!n||0===n.length)return"";let a;"string"==typeof e&&(a=n.find((t=>{let{props:{name:n}}=t;return n===e})));a||(a=n[0]);return a.props.name};var r=n(67294)},97228:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=u(n(97023)),i=u(n(53621)),s=u(n(72543)),o=u(n(94184)),l=u(n(73935)),d=u(n(45697));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)}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t({showSummaryView:t})))}render(){const{maxSize:e,onSummary:t,...n}=this.props,l=this.state.showSummaryView,d=this.props.tags.length,u=(0,o.default)("compact-tag-list",{"compact-tag-list__show-summary-view":l});return r.default.createElement("div",{className:u},r.default.createElement(s.default,{onResize:this.onResize,className:"compact-tag-list__placeholder","aria-hidden":!0},r.default.createElement(a.default,f({},n,{focusable:!1}))),r.default.createElement("div",{className:"compact-tag-list__visible"},l?r.default.createElement(i.default,{count:d,onClick:t,onNext:n.onHolderFocus}):r.default.createElement(a.default,n)))}}p.propTypes=Object.assign({},a.default.propTypes,{maxSize:d.default.number,onSummary:d.default.func}),p.defaultProps={maxSize:0,onSummary:()=>{}};var h=p;t.default=h},53621:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(67294)),a=o(n(85362)),i=o(n(4754)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{label:t,count:n,...i}=e;return r.default.createElement(a.default,l({},i,{deletable:!1,title:`${n} ${t}`}),n," ",r.default.createElement("span",{className:"font-icon-sliders","aria-label":t}))};d.propTypes=Object.assign({},a.default.propTypes,{label:s.default.string,count:s.default.number}),d.defaultProps={label:i.default._t("Admin.SUMMARY_TAG_LABEL","filters")};var u=d;t.default=u},85362:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(67294)),a=n(53556),i=l(n(94184)),s=l(n(4754)),o=l(n(45697));function l(e){return e&&e.__esModule?e:{default:e}}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{onClick:t,onDelete:n,onDeleteKey:s,onBackSpace:o,onPrevious:l,onNext:u,deletable:c,dataKey:p,label:h,value:m,children:g,focusable:v,...b}=e;const y=((e,t,n)=>(t||e)+(n?`: ${n}`:""))(p,h,m);return r.default.createElement(a.Button,d({},b,{role:"button",className:(0,i.default)("tag-component","btn-sm",{"tag-component--deletable":c}),onClick:e=>{e.preventDefault(),t(p)},tabIndex:v?0:void 0,onKeyDown:e=>{((e,t,n,r,a,i)=>{switch(e.key){case"Backspace":e.preventDefault(),r(t);break;case"Delete":e.preventDefault(),n(t);break;case"ArrowLeft":e.preventDefault(),a(t);break;case"ArrowRight":e.preventDefault(),i(t)}})(e,p,s,o,l,u)},title:y}),c&&r.default.createElement(f,{onDelete:n,dataKey:p}),g||y)},c=e=>{e.target.parentElement.focus()},f=e=>{let{dataKey:t,onDelete:n}=e;return r.default.createElement(a.Button,{onClick:e=>{e.stopPropagation(),e.preventDefault(),n(t)},"aria-label":s.default._t("Admin.REMOVE_TAG","Remove Tag"),title:s.default._t("Admin.REMOVE_TAG","Remove Tag"),onFocus:c,tabIndex:-1,className:"tag-component__delete font-icon-cancel btn--no-text btn--icon-sm"})};u.propTypes={onClick:o.default.func,onDelete:o.default.func,onDeleteKey:o.default.func,onBackSpace:o.default.func,onPrevious:o.default.func,onNext:o.default.func,deletable:o.default.bool,dataKey:o.default.string,label:o.default.string,value:o.default.string,focusable:o.default.bool},u.defaultProps={tag:"span",deletable:!1,onClick:()=>{},onDelete:()=>{},onDeleteKey:()=>{},onBackSpace:()=>{},onPrevious:()=>{},onNext:()=>{},focusable:!0};var p=u;t.default=p},97023:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=o(n(67294)),a=o(n(85362)),i=o(n(43117)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=document.activeElement[e?"nextElementSibling":"previousElementSibling"];return!!t&&(t.focus(),!0)},c=e=>{let{tags:t,deletable:n,focusable:i,onTagDelete:s,onTagClick:o,onHolderFocus:c}=e;const f=e=>{u(d)||c(),s(e)},p=e=>{u(false)||u(d)||c(),s(e)};return r.default.createElement("ul",{className:"tag-list"},t.map((e=>r.default.createElement(a.default,l({},e,{tag:"li",deletable:n,dataKey:e.key,focusable:i,onDelete:s,onDeleteKey:n&&s?f:void 0,onBackSpace:n&&s?p:void 0,onNext:()=>{u(d)||c()},onPrevious:()=>{u(false)},onClick:o})))))};t.Component=c,c.propTypes={onTagClick:s.default.func,onTagDelete:s.default.func,onHolderFocus:s.default.func,deletable:s.default.bool,tags:s.default.arrayOf(i.default),focusable:s.default.bool},c.defaultProps={deletable:!1,focusable:!0,onTagDelete:()=>{},onTagClick:()=>{},onHolderFocus:()=>{}};var f=c;t.default=f},43117:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=(r=n(45697))&&r.__esModule?r:{default:r};var i=a.default.shape({key:a.default.string.isRequired,label:a.default.string,value:a.default.string});t.default=i},74898:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=i(n(98028)),a=i(n(16725));function i(e){return e&&e.__esModule?e:{default:e}}class s extends a.default{getInputProps(){const e=super.getInputProps();return this.isMultiline()&&Object.assign(e,{type:"textarea",rows:this.props.data.rows,cols:this.props.data.columns}),e}isMultiline(){return this.props.data&&this.props.data.rows>1}}t.Component=s;var o=(0,r.default)(s);t.default=o},63182:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=d(n(98028)),a=n(81463),i=d(n(30381)),s=d(n(68300)),o=d(n(4754)),l=d(n(45697));function d(e){return e&&e.__esModule?e:{default:e}}const u="LT";class c extends a.Component{getInputProps(){const e=o.default.inject(o.default._t("Admin.FormatExample","Example: {format}"),{format:(0,i.default)().endOf("month").format(u)}),t=this.asHTML5()?"time":"text";return{...super.getInputProps(),type:t,placeholder:e}}isMultiline(){return!1}hasNativeSupport(){return this.props.modernizr.inputtypes.time}convertToLocalised(e){let t="";if(e){const n=(0,i.default)(e,"HH:mm:ss");n.isValid()&&(t=n.format(u))}return t}convertToIso(e){let t="";if(e){const n=(0,i.default)(e,u);n.isValid()&&(t=n.format("HH:mm:ss"))}return t}}t.Component=c,c.propTypes={lang:l.default.string,modernizr:l.default.object,data:l.default.shape({html5:l.default.bool})},c.defaultProps={modernizr:s.default,data:{}};var f=(0,r.default)(c);t.default=f},20164:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tipShape=t.default=t.TIP_TYPES=t.TIP_IMPORTANCE_LEVELS=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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=d(n(45697)),i=n(53556),s=d(n(4754)),o=d(n(22602)),l=d(n(94184));function d(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={TITLE:"title",INPUT_GROUP:"input-group"};t.TIP_TYPES=c;const f={NORMAL:"normal",HIGH:"high"};t.TIP_IMPORTANCE_LEVELS=f;const p={[f.NORMAL]:{iconColor:"muted",description:s.default._t("Admin.NORMAL_TIP","Tip")},[f.HIGH]:{iconColor:"danger",description:s.default._t("Admin.IMPORTANT_TIP","Important tip")}};function h(e){const{content:t,fieldTitle:n,icon:a,id:d,importance:u}=e,{iconColor:f,description:h}=p[u],m=s.default.inject(s.default._t("Admin.TIP_LABEL","{description} for {fieldTitle}"),{description:h,fieldTitle:n}),g=["tip",e.extraClass];e.type===c.TITLE?g.push("tip--title"):e.type===c.INPUT_GROUP&&g.push("tip--input-group","btn--last","btn-outline-secondary",`text-${f}`);const v=`${d}-tip`,b={id:v,onClick:()=>{},className:(0,l.default)(g),noText:!0,icon:a};return r.default.createElement(r.Fragment,null,r.default.createElement(o.default,b,m),r.default.createElement(i.UncontrolledPopover,{trigger:"legacy",placement:"top-end",target:v},r.default.createElement(i.PopoverBody,null,t)))}const m={content:a.default.string.isRequired,importance:a.default.oneOf(Object.values(f)),type:a.default.oneOf(Object.values(c)),icon:a.default.string};t.tipShape=m,h.propTypes={...m,extraClass:a.default.string,fieldTitle:a.default.string.isRequired,id:a.default.string.isRequired},h.defaultProps={importance:f.NORMAL,icon:"lamp",type:c.INPUT_GROUP};var g=h;t.default=g},87890:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toastShape=t.default=void 0;var r=u(n(67294)),a=u(n(45697)),i=u(n(4754)),s=n(53556),o=u(n(94184)),l=n(46735),d=u(n(22602));function u(e){return e&&e.__esModule?e:{default:e}}const c={text:a.default.string.isRequired,dismissed:a.default.bool.isRequired,type:a.default.string.isRequired,actions:a.default.arrayOf(a.default.shape(d.default.propTypes))};t.toastShape=c;const f=e=>{let{type:t,text:n,onDismiss:a,dismissed:u,actions:c}=e;const f=(0,o.default)("toast",`toast--${t}`,{"toast--dismissing":u});return r.default.createElement(s.Toast,{className:f,isOpen:!0},r.default.createElement(s.ToastBody,{className:"toast__body"},r.default.createElement(d.default,{className:"toast__close",icon:"cancel",noText:!0,onClick:e=>{e.preventDefault(),a()},color:"none"},i.default._t("Admin.DISMISS","Dismiss")),r.default.createElement("div",{className:"toast__content",role:"alert","aria-live":"assertive","aria-atomic":"true"},n)),c.length>0&&r.default.createElement(l.ToastActions,{actions:c,onDismiss:a,dismissed:u}))};f.propTypes={...c,onDismiss:a.default.func.isRequired},f.defaultProps={actions:[]};var p=f;t.default=p},46735:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ToastActions=t.ToastAction=void 0;var r=s(n(67294)),a=s(n(45697)),i=s(n(22602));function s(e){return e&&e.__esModule?e:{default:e}}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{label:t,href:n,onClick:a,dismissed:s,onDismiss:l}=e;const d=n?{href:n,tag:"a"}:{onClick:e=>{e.preventDefault(),s||(a&&a(),l())}};return r.default.createElement(i.default,o({color:"link",className:"toast__action"},d),t)};t.ToastAction=l;const d=e=>{let{actions:t,dismissed:n,onDismiss:a}=e;return 0===t.length?null:r.default.createElement("div",{className:"toast__actions"},t.slice(0,2).map(((e,t)=>r.default.createElement(l,o({key:t},e,{onDismiss:a,dismissed:n})))))};t.ToastActions=d,d.propTypes={dismissed:a.default.bool.isRequired,actions:a.default.arrayOf(a.default.shape({label:a.default.string.isRequired,href:a.default.string,onClick:a.default.func})),onDismiss:a.default.func.isRequired},d.defaultProps={actions:[]};var u=d;t.default=u},60452:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=s(n(45697)),i=s(n(87890));function s(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{toasts:t,onDismiss:n,onPause:a,onResume:s}=e;const[o,d]=(0,r.useState)(void 0),u=e=>()=>{o&&clearTimeout(o),d(setTimeout(e,100))},c=u(a),f=u(s),p={onMouseEnter:c,onFocus:c,onMouseLeave:f,onBlur:f};return r.default.createElement("div",l({className:"toasts","aria-live":"polite","aria-atomic":"true"},p),r.default.createElement("div",{className:"toasts__wrapper"},t.map((e=>{let{id:t,...a}=e;return r.default.createElement(i.default,l({key:t},a,{onDismiss:()=>n(t)}))}))))};d.propTypes={toasts:a.default.arrayOf(a.default.shape(i.default.propTypes)).isRequired,onDismiss:a.default.func.isRequired,onPause:a.default.func.isRequired,onResume:a.default.func.isRequired},d.defaultProps={};var u=d;t.default=u},53330:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(67294)),a=s(n(45697)),i=s(n(45332));function s(e){return e&&e.__esModule?e:{default:e}}const o=e=>{let{showBackButton:t,children:n,onBackButtonClick:a}=e;return r.default.createElement("div",{className:"toolbar toolbar--north"},r.default.createElement("div",{className:"toolbar__navigation fill-width"},t&&r.default.createElement(i.default,{onClick:e=>{e.preventDefault(),"function"==typeof a&&a(e)},className:"toolbar__back-button"}),n))};o.propTypes={onBackButtonClick:a.default.func,showBackButton:a.default.bool},o.defaultProps={showBackButton:!1};var l=o;t.default=l},59888:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.SINGLE_EMPTY_VALUE=t.MULTI_EMPTY_VALUE=t.ConnectedTreeDropdownField=t.Component=void 0,Object.defineProperty(t,"findTreeByID",{enumerable:!0,get:function(){return b.findTreeByID}}),Object.defineProperty(t,"findTreeByPath",{enumerable:!0,get:function(){return b.findTreeByPath}}),Object.defineProperty(t,"findTreePath",{enumerable:!0,get:function(){return b.findTreePath}});var r=w(n(67294)),a=y(n(45697)),i=n(86706),s=n(14890),o=y(n(10932)),l=y(n(25114)),d=y(n(4754)),u=y(n(98028)),c=y(n(94301)),f=w(n(14504)),p=w(n(25548)),h=y(n(98268)),m=y(n(8575)),g=n(53556),v=n(10259),b=n(11355);function y(e){return e&&e.__esModule?e:{default:e}}function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_=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=_(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{children:t}=e;return r.default.createElement("span",{className:"treedropdownfield__option-title--highlighted"},t)};class T extends r.Component{constructor(e){super(e),this.render=this.render.bind(this),this.renderInput=this.renderInput.bind(this),this.renderMenuList=this.renderMenuList.bind(this),this.renderOption=this.renderOption.bind(this),this.formatOptionLabel=this.formatOptionLabel.bind(this),this.getBreadcrumbs=this.getBreadcrumbs.bind(this),this.getDropdownOptions=this.getDropdownOptions.bind(this),this.getVisibleTree=this.getVisibleTree.bind(this),this.handleBack=this.handleBack.bind(this),this.handleChange=this.handleChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleNavigate=this.handleNavigate.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleSearchReset=this.handleSearchReset.bind(this),this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.callFetch=this.callFetch.bind(this),this.lazyLoad=this.lazyLoad.bind(this),this.filterOption=this.filterOption.bind(this),this.noOptionsMessage=this.noOptionsMessage.bind(this),this.state={opened:!1},this.searchTimer=null}componentDidMount(){this.props.readOnly||this.props.disabled||this.initialise();const e=this.props.id,t=(this.props.data.multiple?this.props.data.valueObjects||[]:[this.props.data.valueObject]).filter((e=>e));t.length&&this.props.actions.treeDropdownField.addSelectedValues(e,t)}componentDidUpdate(e){if(this.props.readOnly||this.props.disabled)return;let t=!1,n=[];this.props.search!==e.search&&(t=!0,n=this.props.visible),e.data.urlTree!==this.props.data.urlTree&&(t=!0),e.data.cacheKey!==this.props.data.cacheKey&&(t=!0),t&&this.loadTree(n,this.props.search,this.props)}getVisibleTree(){return this.props.findTreeByPath(this.props.tree,this.props.visible)}getBreadcrumbs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.visible;const t=[];if(!e)return t;let n=this.props.tree;for(const r of e){if(!n.children)break;if(n=n.children.find((e=>e.id===r)),!n)break;t.push(n)}return t}getDropdownOptions(){const e=this.props.value,t=this.getVisibleTree();let n=t?[...t.children]:[];const r=this.props.selectedValues.filter((t=>t.id===e||Array.isArray(e)&&e.find((e=>e===t.id))));return!this.state.opened&&this.props.data.showSelectedPath?n=r.map((e=>({...e,title:e.titlePath||e.title}))):r.length&&(n=[...r.filter((e=>!n.find((t=>t.id===e.id)))),...n]),n.unshift({id:this.props.data.multiple?"":0,title:this.props.data.hasEmptyDefault?this.props.data.emptyString:null,disabled:!n.length||!this.props.data.hasEmptyDefault}),n}getPath(e){const t=this.props.findTreePath(this.props.tree,e,this.props.data.treeBaseId);return this.getBreadcrumbs(t).reduce(((e,t)=>`${e}${t.contextString||""}${t.title}/`),"")}initialise(){return this.loadTree([],this.props.search).then((e=>{let t=[];!this.props.data.multiple&&this.props.value&&(t=this.props.findTreePath(e,this.props.value,this.props.data.treeBaseId),t?t.pop():t=[]),this.props.actions.treeDropdownField.setVisible(this.props.id,t)}))}callFetch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props;const r=m.default.parse(n.data.urlTree,!0);n.data.showSearch&&t.length&&(r.query.search=t,r.query.flatList="1"),e.length?r.query.ID=e[e.length-1]:!n.data.multiple&&n.value&&(r.query.forceValue=n.value),r.query.format="json",r.search=null;const a=m.default.format(r);return this.props.fetch(a,{credentials:"same-origin"}).then((e=>e.json()))}lazyLoad(e){if(e.find((e=>this.props.loading.indexOf(e)>-1||this.props.failed.indexOf(e)>-1)))return Promise.resolve({});const t=this.props.findTreeByPath(this.props.tree,e);return t&&(0===t.count||t.children.length)?Promise.resolve({}):this.loadTree(e)}loadTree(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props;return n.actions.treeDropdownField.beginTreeUpdating(n.id,e),this.callFetch(e,t,n).then((t=>(n.actions.treeDropdownField.updateTree(n.id,e,t),t))).catch((t=>{if(n.actions.treeDropdownField.updateTreeFailed(n.id,e),"function"==typeof n.onLoadingError)return n.onLoadingError({errors:[{value:t.message,type:"error"}]});throw t}))}hasSearch(){return this.props.data.showSearch&&Boolean(this.props.search)}filterOption(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=this.getVisibleTree();if((0===e.value||""===e.value)&&(!this.props.data.hasEmptyDefault||this.props.visible.length||this.hasSearch()))return!1;const r=e.label&&e.label.toLocaleLowerCase(),a=t.toLocaleLowerCase();return a?r&&r.includes(a):!n||!e.value||n.children.find((t=>t.id===e.value))}handleOpen(){this.setState({opened:!0}),this.handleSearchReset()}handleClose(){this.setState({opened:!1})}handleSearchReset(){clearTimeout(this.searchTimer),this.props.actions.treeDropdownField.setSearch(this.props.id,"")}handleSearchChange(e){clearTimeout(this.searchTimer),this.searchTimer=setTimeout((()=>{this.props.actions.treeDropdownField.setSearch(this.props.id,e)}),500)}handleChange(e){let t=null;if(this.handleSearchReset(),this.props.data.multiple){if(t=E,e&&e.length){const n=e&&e.filter(((t,n)=>e.findIndex((e=>e.id===t.id))===n));t=n.map((e=>e.id)),this.props.actions.treeDropdownField.addSelectedValues(this.props.id,n)}}else{const n=e?e.id:null;let r=(this.getVisibleTree()||this.props.tree).children.find((e=>e.id===n));r&&(this.props.data.showSelectedPath&&(r={...r,titlePath:this.getPath(n)}),this.props.actions.treeDropdownField.addSelectedValues(this.props.id,[r])),t=n||0}"function"==typeof this.props.onChange&&this.props.onChange(t)}handleNavigate(e,t){if(this.hasSearch())return;e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.preventDefault();let n=this.props.findTreePath(this.props.tree,t,this.props.data.treeBaseId);n||(n=this.props.visible.slice(0),n.push(t)),this.lazyLoad(n),this.props.actions.treeDropdownField.setVisible(this.props.id,n)}handleKeyDown(e){if(this.hasSearch())return void(27===e.keyCode&&this.handleSearchReset(e));const t=this.selectField.state.focusedOption;if(t)switch(e.keyCode){case 37:this.handleBack(e);break;case 39:t.count&&this.handleNavigate(e,t.id)}}handleBack(e){if(this.hasSearch())return;e.stopPropagation(),e.preventDefault();let t=this.props.visible;t.length&&(t=t.slice(0,t.length-1)),this.lazyLoad(t),this.props.actions.treeDropdownField.setVisible(this.props.id,t)}renderInput(e){let{children:t,...n}=e;return n.id=this.props.id,r.default.createElement(f.components.Input,n,t)}renderBreadcrumbs(e,t){let{cx:n,getStyles:a,getClassNames:i,...s}=t;if(0===e.length)return null;e=e.map((e=>e.title)).join(" / ");const l=this.hasSearch()?"font-icon-search":"font-icon-left-open-big",d=n({option:!0,breadcrumbs:!0},i("option",{})),u=o.default.div(a("option",s));return r.default.createElement(u,{className:d,onClick:this.handleBack,role:"button",tabIndex:0},r.default.createElement("button",{type:"button",className:"treedropdownfield__breadcrumbs-button"},r.default.createElement("span",{className:`icon ${l}`})),r.default.createElement("span",{className:"treedropdownfield__breadcrumbs-crumbs flexbox-area-grow"},e))}renderMenuList(e){let{children:t,...n}=e;const a=this.getBreadcrumbs();return r.default.createElement(f.components.MenuList,n,this.renderBreadcrumbs(a,n),t)}renderOption(e){let{children:t,...n}=e,a=null;const i=n.data;if(i.count&&!this.hasSearch()){const e=e=>this.handleNavigate(e,i.id);a=r.default.createElement("button",{type:"button",className:"treedropdownfield__option-button fill-width",onClick:e,onMouseDown:e,onTouchStart:e},r.default.createElement("span",{className:"treedropdownfield__option-count-icon font-icon-right-open-big"}))}let s=null;return this.hasSearch()&&(s=i.contextString,s||!this.props.data.hasEmptyDefault||this.props.visible.length||(s=this.props.data.emptyString)),r.default.createElement(f.components.Option,n,r.default.createElement("span",{className:"treedropdownfield__option-title-box flexbox-area-grow fill-height"},r.default.createElement("span",{className:"treedropdownfield__option-title"},t),s&&r.default.createElement("span",{className:"treedropdownfield__option-context"},s)),a)}renderReadOnly(){const e={id:this.props.id,readOnly:this.props.readOnly,disabled:this.props.disabled},t=this.props.extraClass?`treedropdownfield ${this.props.extraClass}`:"treedropdownfield";let n=this.props.data.hasEmptyDefault?this.props.data.emptyString:"";const a=this.props.selectedValues;if(this.props.data.multiple){n=this.props.value.map((e=>a.find((t=>t.id===e))||e)).map((e=>e.title)).join(", ")}else{const e=a.find((e=>e.id===this.props.value));n=this.props.value,e&&"string"==typeof e.title&&(n=e.title)}return r.default.createElement("div",{className:t},r.default.createElement("span",{className:"treedropdownfield__title"},n),r.default.createElement(g.Input,O({type:"hidden",name:this.props.name,value:this.props.value},e)))}formatOptionLabel(e,t){let{context:n,inputValue:r}=t;const{title:a}=e;return this.props.search.length?(0,v.mapHighlight)(a||"",this.props.search,C):a}noOptionsMessage(e){let{inputValue:t}=e;const n=this.getVisibleTree()||{};return this.props.failed.indexOf(n.id||0)>=0?d.default._t("Admin.TREEDROPDOWN_FAILED","Failed to load"):t||!n.id?d.default._t("Admin.TREEDROPDOWN_NO_OPTIONS","No options"):d.default._t("Admin.TREEDROPDOWN_NO_CHILDREN","No children")}render(){if(this.props.readOnly||this.props.disabled)return this.renderReadOnly();const e=this.props.extraClass?`treedropdownfield ${this.props.extraClass}`:"treedropdownfield",t=this.getDropdownOptions(),n=Array.isArray(this.props.value)?this.props.value:[this.props.value];let a=this.props.selectedValues.filter((e=>n.includes(e.id)));a.length||(a=t.filter((e=>n.includes(e.id)))),!a.length&&this.props.data.hasEmptyDefault&&(a=t[0]);const i=void 0!==this.props.data.showSearch&&this.props.data.showSearch,s={Input:this.renderInput,MenuList:this.renderMenuList,Option:this.renderOption},o=this.getVisibleTree()||{},u=this.props.loading.indexOf(o.id||0)>=0;return r.default.createElement(l.default,null,r.default.createElement(f.default,{isSearchable:i,isMulti:this.props.data.multiple,isClearable:!0,className:e,name:this.props.name,options:t,delimiter:",",components:s,formatOptionLabel:this.formatOptionLabel,filterOption:this.filterOption,onChange:this.handleChange,onMenuOpen:this.handleOpen,onMenuClose:this.handleClose,onKeyDown:this.handleKeyDown,onInputChange:this.handleSearchChange,isLoading:u,loadingMessage:()=>d.default._t("Admin.TREEDROPDOWN_LOADING","Loading..."),noOptionsMessage:this.noOptionsMessage,value:a,ref:e=>{this.selectField=e},placeholder:this.props.data.emptyString,getOptionLabel:e=>{let{title:t}=e;return t},getOptionValue:e=>{let{id:t}=e;return t},classNamePrefix:"treedropdownfield",classNames:{option:()=>"fill-width"}}))}}t.Component=T,T.propTypes={className:a.default.string,extraClass:a.default.string,id:a.default.string,name:a.default.string.isRequired,onChange:a.default.func,value:a.default.oneOfType([a.default.string,a.default.number,a.default.array]),readOnly:a.default.bool,disabled:a.default.bool,tree:a.default.shape(h.default.propTypes),findTreeByPath:a.default.func,findTreePath:a.default.func,visible:a.default.array,loading:a.default.array,failed:a.default.array,selectedValues:a.default.array,data:a.default.shape({cacheKey:a.default.string,urlTree:a.default.string.isRequired,emptyString:a.default.string,valueObject:a.default.shape(h.default.propTypes),valueObjects:a.default.arrayOf(a.default.shape(h.default.propTypes)),hasEmptyDefault:a.default.bool,showSearch:a.default.bool,multiple:a.default.bool,showSelectedPath:a.default.bool,treeBaseId:a.default.number}),onLoadingError:a.default.func,search:a.default.string,actions:a.default.shape({treeDropdownField:a.default.object}),fetch:a.default.func},T.defaultProps={value:"",extraClass:"",className:"",tree:{},visible:[],loading:[],failed:[],findTreeByPath:b.findTreeByPath,findTreePath:b.findTreePath,fetch:c.default};const S=(0,i.connect)((function(e,t){const n=t.id,r=e.treeDropdownField.fields[n]?e.treeDropdownField.fields[n]:{tree:{},visible:[],loading:[],failed:[],search:"",selectedValues:[]};let a=t.value;return t.data.multiple&&t.value===E&&(a=[]),t.data.multiple||t.value||(a=0),{...r,value:a}}),(function(e){return{actions:{treeDropdownField:(0,s.bindActionCreators)(p,e)}}}))(T);t.ConnectedTreeDropdownField=S;var P=(0,u.default)(S);t.default=P},98268:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=(r=n(45697))&&r.__esModule?r:{default:r};const i=()=>null;i.propTypes={id:a.default.oneOfType([a.default.string,a.default.number]),title:a.default.string,titlePath:a.default.string,disabled:a.default.bool,parentid:a.default.number,count:a.default.number,depth:a.default.number,expanded:a.default.bool,limited:a.default.bool,marked:a.default.bool,opened:a.default.bool,children:a.default.array};var s=i;t.default=s},11355:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findTreePath=t.findTreeByPath=t.findTreeByID=void 0;const n=(e,t)=>{if(!e||0===Object.keys(e).length)return null;if(0===t.length)return e;const r=t.slice(0),a=r.shift(),i=e.children.find((e=>e.id===a));return i?n(i,r):null};t.findTreeByPath=n;const r=(e,t)=>{if(!t||!e||!e.children||0===Object.keys(e).length)return null;if(e.id===t)return e;for(const n of e.children){const e=r(n,t);if(null!==e)return e}return null};t.findTreeByID=r;const a=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t)return[];if(!e||0===Object.keys(e).length)return null;if(e.id===t)return[e.id];if(!e.children)return null;for(const r of e.children){const i=a(r,t);if(null!==i)return e.id&&e.id!==n&&i.unshift(e.id),i}return null};t.findTreePath=a},80384:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=d(n(45697)),i=d(n(94184)),s=d(n(4754)),o=d(n(34411)),l=d(n(6732));function d(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 c extends r.PureComponent{renderHeader(){return r.default.createElement("thead",null,r.default.createElement("tr",null,r.default.createElement("th",{scope:"col",className:"used-on__col--index"},s.default._t("Admin.USED_ON_NUM","#")),r.default.createElement("th",{scope:"col",className:"used-on__col--title"},s.default._t("Admin.USED_ON","Used on"))))}renderBody(){const{usedOn:e,loading:t,error:n}=this.props;if(n||!e||!e.length){let e=null,a=null;n?(e=s.default.inject(s.default._t("Admin.LOADING_ERROR","As error occured when loading the data: {message}"),{message:n}),a="error"):t?(e=r.default.createElement(o.default,null),a="loading"):(e=s.default._t("Admin.NOT_USED","This file is currently not in use."),a="empty");const l=(0,i.default)(["used-on__message",`used-on__message--${a}`]);return r.default.createElement("tbody",{"aria-live":"polite"},r.default.createElement("tr",null,r.default.createElement("td",{className:l,colSpan:"3"},e)))}return r.default.createElement("tbody",{"aria-live":"polite"},e.map(this.renderRow))}renderRow(e,t){const{id:n,type:a}=e,s=e.ancestors?[e].concat(e.ancestors).reverse():[e].reverse();let o="#",l=!0;const d=s.map(((e,a)=>{let s=e.title;const d=e.link;s&&s.length>=25&&(s=`${s.substring(0,25).trim()}...`),d&&(o=d);const u=`${t}-${n}-${a}`,c=["used-on__title-item"];return l&&(c.push("used-on__title-item--first"),l=!1),r.default.createElement("li",{className:(0,i.default)(c),key:u},s)})),u=`${t}-${n}`;return r.default.createElement("tr",{key:u,className:"used-on__row"},r.default.createElement("td",{className:"used-on__col--index"},r.default.createElement("a",{href:o,className:"used-on__cell-link"},t+1)),r.default.createElement("td",{className:"used-on__col--title"},r.default.createElement("a",{href:o,className:"used-on__cell-link"},r.default.createElement("ul",{className:"used-on__title-items"},d),r.default.createElement("span",{className:"used-on__type"},a))))}render(){return r.default.createElement("table",{className:"table used-on__table"},this.renderHeader(),this.renderBody())}}t.Component=c,c.propTypes={loading:a.default.bool,usedOn:a.default.arrayOf(a.default.shape({id:a.default.oneOfType([a.default.string,a.default.number]),title:a.default.string,type:a.default.string,link:a.default.string,ancestors:a.default.arrayOf(a.default.shape({title:a.default.string,link:a.default.string})).isRequired})),error:a.default.string};var f=(0,l.default)(c);t.default=f},6732:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),i=(r=n(45697))&&r.__esModule?r:{default:r},s=n(86706),o=n(36992),l=n(93390);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)}var u=e=>{class t extends a.Component{componentDidMount(){this.haveFetchedData=!1,this.props.forceFetch&&this.fetchDataFromEndpoint()}componentDidUpdate(e){const t=this.props.tabContext;(e.identifier!==this.props.identifier||!t||t.isOnActiveTab)&&this.fetchDataFromEndpoint()}fetchDataFromEndpoint(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;const{method:t,url:n}=e.data.readUsageEndpoint||{};this.haveFetchedData&&!this.props.forceFetch||e.loadUsedOn(e.identifier,t,n),this.haveFetchedData=!0}render(){return a.default.createElement(e,this.props)}}t.propTypes={identifier:i.default.string,loading:i.default.bool,data:i.default.oneOfType([i.default.array,i.default.shape({recordClass:i.default.string,recordId:i.default.oneOfType([i.default.string,i.default.number]),readUsageEndpoint:i.default.shape({url:i.default.string,method:i.default.string})})]),usedOn:i.default.array,forceFetch:i.default.bool};const n=(0,l.injectTabContext)(t),r=(0,s.connect)(((e,t)=>{const{recordClass:n,recordId:r}=t.data,a=n&&r?`${n}#${r}`:"",i=e.usedOn;return{identifier:a,loading:i.loading.includes(a),usedOn:i.usedOn[a]||null,error:i.errors[a]||null}}),{loadUsedOn:o.loadUsedOn})(n);return r.Component=n,r};t.default=u},57129:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.statuses=t.default=void 0;var r=l(n(67294)),a=l(n(94184)),i=l(n(45697)),s=l(n(37294)),o=l(n(4754));function l(e){return e&&e.__esModule?e:{default:e}}const d=["draft","modified","live","archived"];t.statuses=d;const u=e=>{let{status:t,className:n}=e;const i={className:(0,a.default)(n,"versioned-badge",`versioned-badge--${t}`),message:o.default._t(`ADMIN.${t.toUpperCase()}`,(l=t,l.replace(/^\w/,(e=>e.toUpperCase())))),status:"default"};var l;return r.default.createElement(s.default,i)};u.propTypes={status:i.default.oneOf(d).isRequired,className:i.default.string};var c=u;t.default=c},98031:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=f(n(45697)),i=n(53556),s=f(n(4754)),o=n(86706),l=n(14890),d=n(56486),u=n(15005),c=f(n(94184));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)}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;tthis.setState((e=>({dropdownOpen:!e.dropdownOpen})))),0)}handleSplitSelect(){this.props.onSplitSelect()}handlePreviewSelect(){this.props.onPreviewSelect()}handleEditSelect(){this.props.onEditSelect()}renderSplitDropdownItem(){const{activeState:e,splitAvailable:t,splitIconClass:n}=this.props,a=(0,c.default)("btn","icon-view","first",n,{"viewmode-toggle__button":!0,"viewmode-toggle--selected":e===u.VIEW_MODE_STATES.SPLIT,disabled:!t});return r.default.createElement(i.DropdownItem,{type:"button",disabled:!t,className:a,value:u.VIEW_MODE_STATES.SPLIT,onClick:this.handleSplitSelect,id:"splitModeButton"},s.default._t("Admin.SPLIT_MODE","Split mode"))}renderEditDropDownItem(){const{activeState:e,editIconClass:t}=this.props,n=(0,c.default)("btn","icon-view","last","viewmode-toggle__button",t,{"viewmode-toggle--selected":e===u.VIEW_MODE_STATES.EDIT});return r.default.createElement(i.DropdownItem,{type:"button",className:n,value:"content",onClick:this.handleEditSelect},s.default._t("Admin.EDIT_MODE","Edit mode"))}renderPreviewDropDownItem(){const{activeState:e,previewIconClass:t}=this.props,n=(0,c.default)("btn","icon-view","viewmode-toggle__button",t,{"viewmode-toggle--selected":e===u.VIEW_MODE_STATES.PREVIEW});return r.default.createElement(i.DropdownItem,{type:"button",className:n,value:"preview",onClick:this.handlePreviewSelect},s.default._t("Admin.PREVIEW_MODE","Preview mode"))}render(){const{activeState:e,area:t,splitAvailable:n,dropdownToggleProps:a}=this.props;if(t===u.VIEW_MODE_STATES.EDIT&&e===u.VIEW_MODE_STATES.SPLIT)return null;const o=(0,c.default)(this.getIconClass(),"btn","viewmode-toggle__dropdown",a.classname);return r.default.createElement(i.Dropdown,{isOpen:this.state.dropdownOpen,toggle:this.toggle,className:"viewmode-toggle"},r.default.createElement(i.DropdownToggle,h({className:o,caret:!0},a),r.default.createElement("span",{className:"viewmode-toggle__chosen-view-title"},this.getTitle())),r.default.createElement(i.DropdownMenu,null,this.renderSplitDropdownItem(),this.renderEditDropDownItem(),this.renderPreviewDropDownItem(),!n&&r.default.createElement("div",{className:"disabled-tooltip"},r.default.createElement("span",{className:"disabled-tooltip-span"},s.default._t("Admin.SCREEN_TOO_SMALL","Screen size too small")))))}}t.Component=m,m.propTypes={activeState:a.default.oneOf(Object.values(u.VIEW_MODE_STATES)),area:a.default.string.isRequired,splitAvailable:a.default.bool,onPreviewSelect:a.default.func,onEditSelect:a.default.func,onSplitSelect:a.default.func,editIconClass:a.default.string,previewIconClass:a.default.string,splitIconClass:a.default.string},m.defaultProps={splitAvailable:!0,editIconClass:"font-icon-edit-write",previewIconClass:"font-icon-eye",splitIconClass:"font-icon-columns",dropdownToggleProps:{}};var g=(0,l.compose)((0,o.connect)((function(e){return{activeState:e.viewMode.activeState,splitAvailable:e.viewMode.splitAvailable}}),(function(e){return{onSplitSelect(){e((0,d.selectSplitMode)())},onEditSelect(){e((0,d.selectEditMode)())},onPreviewSelect(){e((0,d.selectPreviewMode)())}}})))(m);t.default=g},55766:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,a=(r=n(67294))&&r.__esModule?r:{default:r},i=n(54582),s=n(89250);var o=(0,i.provideInjector)((e=>{let{children:t}=e;return a.default.createElement("div",{className:"app"},t,a.default.createElement(s.Outlet,null))}));t.default=o},25114:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(67294)),a=s(n(66751)),i=n(70917);function s(e){return e&&e.__esModule?e:{default:e}}var o=function(e){let{children:t}=e;return window.ssReactSelectCache||(window.ssReactSelectCache=(0,a.default)({key:"react-select",insertionPoint:document.querySelector("title")})),r.default.createElement(i.CacheProvider,{value:window.ssReactSelectCache},t)};t.default=o},36800:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(67294)),a=n(11962),i=n(54582),s=l(n(96869)),o=l(n(45697));function l(e){return e&&e.__esModule?e:{default:e}}const d=e=>{const t=e.formComponent,n={...e};return delete n.formComponent,r.default.createElement(t,n)};d.propTypes={formComponent:o.default.elementType.isRequired};const u=(0,i.inject)(["Form"],(e=>({formComponent:e})))(d);var c=(0,a.reduxForm)({getFormState:s.default,destroyOnUnmount:!1})(u);t.default=c},16304:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0,t.createFormIdentifierFromProps=O,t.default=void 0;var r=w(n(4754)),a=_(n(67294)),i=w(n(45697)),s=n(86706),o=n(14890),l=w(n(94301)),d=w(n(16012)),u=n(11962),c=w(n(48834)),f=n(48942),p=_(n(39042)),h=w(n(21965)),m=_(n(56334)),g=w(n(79298)),v=n(54582),b=w(n(96869));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,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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function w(e){return e&&e.__esModule?e:{default:e}}function O(e){let{identifier:t,schema:n={}}=e;return[t,n.schema&&n.schema.name].filter((e=>e)).join(".")}class E extends a.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this),this.reduceSchemaErrors=this.reduceSchemaErrors.bind(this),this.handleAutofill=this.handleAutofill.bind(this)}componentDidMount(){const{schema:e,refetchSchemaOnMount:t}=this.props;!t&&e||this.fetch()}componentDidUpdate(e){this.props.schemaUrl!==e.schemaUrl&&this.fetch()}getMessages(e){const t={};return e&&e.fields&&e.fields.forEach((e=>{e.message&&(t[e.name]=e.message)})),t}getIdentifier(){return O(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props)}handleSubmit(e,t,n){let r=null;const a=()=>n().then((e=>{let t=e;if(t){const e=void 0!==t.state;if(t=this.reduceSchemaErrors(t),this.props.actions.schema.setSchema(this.props.schemaUrl,t,this.getIdentifier()),e){const e=t.schema||this.props.schema.schema,n=(0,c.default)(e,t.state);this.props.actions.reduxForm.initialize(this.getIdentifier(),n)}}return t}));if(r="function"==typeof this.props.onSubmit?this.props.onSubmit(e,t,a):a(),!r)throw new Error("Promise was not returned for submitting");return r.then((e=>{if(!e||!e.state)return e;const t=this.getMessages(e.state);if(Object.keys(t).length)throw new u.SubmissionError(t);return e}))}reduceSchemaErrors(e){if(!e.errors)return e;let t={...e};return t.state||(t={...t,state:this.props.schema.state}),t={...t,state:{...t.state,fields:t.state.fields.map((t=>{let n=e.errors.find((e=>e.field===t.name));return n&&(n=(0,f.createErrorHtml)([n.value])),{...t,message:n}}))},messages:e.errors.filter((e=>!e.field))},delete t.errors,(0,d.default)(t)}overrideStateData(e){if(!this.props.stateOverrides||!e)return e;const t=this.props.stateOverrides.fields;let n=e.fields;return t&&n&&(n=n.map((e=>{const n=t.find((t=>t.name===e.name));return n?h.default.recursive(!0,e,n):e}))),Object.assign({},e,this.props.stateOverrides,{fields:n})}callFetch(e){return(0,l.default)(this.props.schemaUrl,{headers:{"X-FormSchema-Request":e.join(","),Accept:"application/json"},credentials:"same-origin"}).then((e=>e.status>=200&&e.status<300?e.json():new Promise(((t,n)=>e.json().then((t=>{n({status:e.status,statusText:e.statusText,json:t})})).catch((()=>{n({status:e.status,statusText:e.statusText,json:{}})}))))))}fetch(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.props.loading)return Promise.resolve({});const r=["auto",e&&"schema",t&&"state",n&&"errors"].filter((e=>e));return this.props.actions.schema.setSchemaLoading(this.props.schemaUrl,!0),"function"==typeof this.props.onFetchingSchema&&this.props.onFetchingSchema(),this.callFetch(r).then((e=>{if(this.props.actions.schema.setSchemaLoading(this.props.schemaUrl,!1),e.errors?"function"==typeof this.props.onLoadingError&&this.props.onLoadingError(e):"function"==typeof this.props.onLoadingSuccess&&this.props.onLoadingSuccess(),void 0!==e.id&&e.state){const t=Object.assign({},e,{state:this.overrideStateData(e.state)}),n=O({...this.props,schema:{...this.props.schema,...t}});this.props.actions.schema.setSchema(this.props.schemaUrl,t,n);const r=e.schema||this.props.schema.schema,a=(0,c.default)(r,t.state);return this.props.actions.reduxForm.initialize(n,a,!1,{keepSubmitSucceeded:!0}),"function"==typeof this.props.onReduxFormInit&&this.props.onReduxFormInit(),t}return e})).catch((e=>{if(this.props.actions.schema.setSchemaLoading(this.props.schemaUrl,!1),"function"==typeof this.props.onLoadingError)return this.props.onLoadingError(this.normaliseError(e));throw e}))}normaliseError(e){if(e.json&&e.json.errors)return e.json;if(e.status&&e.statusText)return{errors:[{code:e.status,value:e.statusText,type:"error"}]};return{errors:[{value:e.message||r.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred."),type:"error"}]}}handleAutofill(e,t){this.props.actions.reduxForm.autofill(this.getIdentifier(),e,t)}render(){const e=this.props.loadingComponent;if(!this.props.schema||!this.props.schema.schema||this.props.loading)return a.default.createElement(e,{containerClass:"loading--form flexbox-area-grow"});const t=Object.assign({},this.props,{form:this.getIdentifier(),onSubmitSuccess:this.props.onSubmitSuccess,onSubmit:this.handleSubmit,onAutofill:this.handleAutofill,autoFocus:this.props.autoFocus});return a.default.createElement(m.default,t)}}t.Component=E,E.propTypes=Object.assign({},m.basePropTypes,{actions:i.default.shape({schema:i.default.object,reduxFrom:i.default.object}),autoFocus:i.default.bool,identifier:i.default.string.isRequired,schemaUrl:i.default.string.isRequired,schema:m.schemaPropType,refetchSchemaOnMount:i.default.bool.isRequired,form:i.default.string,submitting:i.default.bool,onFetchingSchema:i.default.func,onReduxFormInit:i.default.func,loadingComponent:i.default.elementType.isRequired}),E.defaultProps={refetchSchemaOnMount:!0};var C=(0,o.compose)((0,v.inject)(["ReduxForm","ReduxFormField","Loading"],((e,t,n)=>({loadingComponent:n,baseFormComponent:e,baseFieldComponent:t})),(e=>{let{identifier:t}=e;return t})),(0,s.connect)((function(e,t){const n=e.form.formSchemas[t.schemaUrl],r=O({...t,schema:n}),a=(0,g.default)((0,b.default)(e),r);return{schema:n,submitting:a&&a.submitting,values:a&&a.values,stateOverrides:n&&n.stateOverride,loading:n&&n.metadata&&n.metadata.loading}}),(function(e){return{actions:{schema:(0,o.bindActionCreators)(p,e),reduxForm:(0,o.bindActionCreators)({autofill:u.autofill,initialize:u.initialize},e)}}})))(E);t.default=C},52583:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.createInsertLinkModal=t.InsertLinkModal=void 0;var r=f(n(67294)),a=u(n(45697)),i=n(14890),s=n(86706),o=u(n(48297)),l=u(n(63596)),d=f(n(39042));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)}function f(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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}class p extends r.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this),e.isOpen||e.setOverrides(null)}componentDidUpdate(e){const t=this.props;(t.isOpen&&!e.isOpen||!t.isOpen&&e.isOpen)&&t.setOverrides(t.isOpen?t:null)}getModalProps(){const e=Object.assign({},this.props,{onSubmit:this.handleSubmit,onClosed:this.props.onClosed,autoFocus:!0,showErrorMessage:!0});return delete e.onInsert,delete e.sectionConfig,e}handleSubmit(e,t){if("action_cancel"===t)this.props.onClosed();else this.props.onInsert(e,t);return Promise.resolve()}render(){const e=this.getModalProps();return r.default.createElement(o.default,e)}}function h(e){return{actions:{schema:(0,i.bindActionCreators)(d,e)}}}t.InsertLinkModal=p,p.propTypes={isOpen:a.default.bool,schemaUrl:a.default.string,onInsert:a.default.func.isRequired,onClosed:a.default.func.isRequired,setOverrides:a.default.func.isRequired,actions:a.default.object,requireLinkText:a.default.bool,currentPageID:a.default.number},p.defaultProps={};t.createInsertLinkModal=(e,t)=>(0,i.compose)((0,s.connect)((function(n,r){const a=n.config.sections.find((t=>t.name===e)),i=r.requireLinkText?"?requireLinkText":"";return{sectionConfig:a,schemaUrl:`${a.form[t].schemaUrl}${i}`.replace(/:pageid/,r.currentPageID)}}),h),l.default)(p);var m=(0,i.compose)((0,s.connect)((()=>({})),h),l.default)(p);t.default=m},63596:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.FileSchemaHandler=t.ConnectedFileSchemaHandler=void 0;var r,a=u(n(67294)),i=(r=n(45697))&&r.__esModule?r:{default:r},s=n(14890),o=u(n(39042)),l=n(86706);function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function u(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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:null;if(e){if(e.schemaUrl){const t=Object.assign({},e.fileAttributes);delete t.ID;const n={fields:Object.entries(t).map((e=>{const[t,n]=e;return{name:t,value:n}}))};this.props.actions.schema.setSchemaStateOverrides(e.schemaUrl,n)}}else{const e=this.props.schemaUrl;e&&this.props.actions.schema.setSchemaStateOverrides(e,null)}}render(){const{Component:e,...t}=this.props;return a.default.createElement(e,c({setOverrides:this.setOverrides},t))}}function p(e,t){return{actions:{...t&&t.actions||{},schema:(0,s.bindActionCreators)(o,e)}}}t.FileSchemaHandler=f,f.propTypes={fileAttributes:i.default.object,Component:i.default.elementType,schemaUrl:i.default.string,actions:i.default.object};const h=(0,l.connect)((()=>({})),p())(f);t.ConnectedFileSchemaHandler=h;var m=function(e){return(0,l.connect)((function(){return{Component:e}}),p)(f)};t.default=m},73276:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(67294)),a=d(n(45697)),i=n(53556),s=n(54582),o=d(n(94301)),l=d(n(94974));function d(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t{class t extends r.Component{constructor(e){super(e),this.state={active:l.default.getSection(f).sudoModeActive||!1,showVerification:!1,loading:!1,errorMessage:null},this.handleConfirmNotice=this.handleConfirmNotice.bind(this),this.handleVerify=this.handleVerify.bind(this),this.handleVerifyInputKeyPress=this.handleVerifyInputKeyPress.bind(this),this.passwordInput=null,this.setPasswordInput=e=>{this.passwordInput=e}}handleConfirmNotice(){this.setState({showVerification:!0},(()=>this.passwordInput&&this.passwordInput.focus()))}handleVerify(){this.setState({loading:!0});const e=new FormData;e.append("SecurityID",l.default.get("SecurityID")),e.append("Password",this.passwordInput.value),(0,o.default)(l.default.getSection(f).endpoints.activate,{method:"POST",body:e}).then((e=>e.json().then((e=>e.result?this.setState({loading:!1,active:!0}):this.setState({loading:!1,errorMessage:e.message},(()=>this.passwordInput.focus()))))))}handleVerifyInputKeyPress(e){13===e.charCode&&(e.stopPropagation(),e.preventDefault(),this.handleVerify())}isSudoModeActive(){return!0===this.state.active}renderSudoModeNotice(){const{i18n:e}=window,{showVerification:t}=this.state,n=l.default.getSection(f).helpLink||null;return r.default.createElement("div",{className:"sudo-mode__notice sudo-mode__notice--required"},r.default.createElement("p",{className:"sudo-mode__notice-message"},e._t("Admin.VERIFY_ITS_YOU","Verify it's you first."),n&&r.default.createElement("a",{href:n,className:"sudo-mode__notice-help",target:"_blank",rel:"noopener noreferrer"},e._t("Admin.WHATS_THIS","What is this?"))),!t&&r.default.createElement(i.Button,{className:"sudo-mode__notice-button font-icon-lock",color:"info",onClick:this.handleConfirmNotice},e._t("Admin.VERIFY_TO_CONTINUE","Verify to continue")))}renderSudoModeVerification(){const{i18n:e}=window,{errorMessage:t}=this.state,n={type:"password",name:"sudoModePassword",id:"sudoModePassword",className:"no-change-track",onKeyPress:this.handleVerifyInputKeyPress,innerRef:this.setPasswordInput},a=t?{valid:!1,invalid:!0}:{};return r.default.createElement("div",{className:"sudo-mode__verify"},r.default.createElement(i.FormGroup,{className:"sudo-mode__verify-form-group"},r.default.createElement(i.Label,{for:"sudoModePassword"},e._t("Admin.ENTER_PASSWORD","Enter your password")),r.default.createElement(i.InputGroup,null,r.default.createElement(i.Input,c({},n,a)),r.default.createElement(i.InputGroupAddon,{addonType:"append"},r.default.createElement(i.Button,{className:"sudo-mode__verify-button",color:"info",onClick:this.handleVerify},e._t("Admin.VERIFY","Verify"))),r.default.createElement(i.FormFeedback,null,t))))}renderSudoMode(){const{showVerification:e,loading:t}=this.state,n=this.props.LoadingComponent||(0,s.loadComponent)("CircularLoading","SudoMode");return t?r.default.createElement("div",{className:"sudo-mode alert alert-info"},r.default.createElement(n,{block:!0})):r.default.createElement("div",{className:"sudo-mode alert alert-info"},this.renderSudoModeNotice(),e&&this.renderSudoModeVerification())}render(){return this.isSudoModeActive()?r.default.createElement(e,this.props):this.renderSudoMode()}}return t.propTypes={LoadingComponent:a.default.oneOfType([a.default.node,a.default.func])},t};t.default=p},49331:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=d(n(67294)),a=d(n(60452)),i=n(86706),s=n(14890),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(36158));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function d(e){return e&&e.__esModule?e:{default:e}}var u=(0,i.connect)((e=>{let{toasts:{toasts:t}}=e;return{toasts:t}}),(e=>({actions:(0,s.bindActionCreators)(o,e)})))((e=>{let{toasts:t,actions:{dismiss:n,pause:i,resume:s}}=e;return r.default.createElement(a.default,{toasts:t,onDismiss:n,onPause:i,onResume:s})}));t.default=u},93390:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.TabContext=void 0,t.injectTabContext=function(e){return t=>{const n=o();return r.default.createElement(e,i({},t,{tabContext:n}))}},t.useTabFirstShow=function(e){const t=o(),n=!t||t.isOnActiveTab,[a,i]=(0,r.useState)(!1);(0,r.useEffect)((()=>{n&&(i(!0),e(t))}),[a||n])};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=a(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=i?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=e[s]}r.default=e,n&&n.set(e,r);return r}(n(67294));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?t-1:0),r=1;r{e(".cms-content-actions .add-to-campaign-action,#add-to-campaign__action").entwine({onclick(){let t=e("#add-to-campaign__dialog-wrapper");return t.length||(t=e('
'),e("body").append(t)),t.open(),!1}}),e(".add-to-campaign-modal .add-to-campaign-modal__nav-link").entwine({onclick:t=>{t.preventDefault();const n=e(t.target);window.location=n.attr("href")}}),e("#add-to-campaign__dialog-wrapper").entwine({ReactRoot:null,onunmatch(){this._clearModal()},open(){this._renderModal(!0)},close(){this._renderModal(!1)},_renderModal(t){var n=this;const a=e("form.cms-edit-form :input[name=ID]").val(),o=`${window.ss.store.getState().config.sections.find((e=>"SilverStripe\\CMS\\Controllers\\CMSPageEditController"===e.name)).form.AddToCampaignForm.schemaUrl}/${a}`,d=r.default._t("Admin.ADD_TO_CAMPAIGN","Add to campaign");let u=this.getReactRoot();u||(u=(0,s.createRoot)(this[0])),u.render(i.default.createElement(l,{title:d,isOpen:t,onSubmit:function(){return n._handleSubmitModal(...arguments)},onClosed:()=>this.close(),schemaUrl:o,bodyClassName:"modal__dialog",className:"add-to-campaign-modal",responseClassBad:"modal__response modal__response--error",responseClassGood:"modal__response modal__response--good",identifier:"Admin.AddToCampaign"})),this.setReactRoot(u)},_clearModal(){const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))},_handleSubmitModal(e,t,n){return n()}})}))},76406:function(e,t,n){"use strict";var r,a=(r=n(19755))&&r.__esModule?r:{default:r};(0,a.default)(document).on("click",".confirmedpassword .showOnClick a",(function(){var e=(0,a.default)(".showOnClickContainer",(0,a.default)(this).parent());return e.toggle("fast",(function(){e.toggleClass("d-none").find('input[type="hidden"]').val(e.hasClass("d-none")?0:1)})),!1}))},40303:function(e,t,n){"use strict";var r=o(n(19755)),a=o(n(4754)),i=o(n(30381)),s=o(n(68300));function o(e){return e&&e.__esModule?e:{default:e}}r.default.entwine("ss",(e=>{e("input[type=date]").entwine({onadd(){if(s.default.inputtypes.date)return;if(this.prop("disabled")||this.prop("readonly")||this.hasClass("hasDatepicker"))return;const t=e("",{type:"hidden",name:this.attr("name"),value:this.val()});this.parent().append(t),this.removeAttr("name"),i.default.locale(this.attr("lang"));const n=this.val();let r="";if(n){const e=(0,i.default)(n);e.isValid()&&(r=e.format("L"))}this.val(r);const o=a.default.inject(a.default._t("Admin.FormatExample","Example: {format}"),{format:(0,i.default)().endOf("month").format("L")});this.attr("placeholder",o),this.updateValue()},onchange(){this.updateValue()},updateValue(){const e=this.val();let t="";if(e)for(const n of["L","YYYY-MM-DD"]){const r=(0,i.default)(e,n);if(r.isValid()){t=r.format("YYYY-MM-DD");break}}this.parent().find("input[type=hidden]").val(t)}})}))},57893:function(e,t,n){"use strict";var r=o(n(19755)),a=o(n(4754)),i=o(n(30381)),s=o(n(68300));function o(e){return e&&e.__esModule?e:{default:e}}n(881),r.default.entwine("ss",(e=>{e("input[type=datetime-local]").entwine({onadd(){if(s.default.inputtypes["datetime-local"])return;if(this.prop("disabled")||this.prop("readonly")||this.hasClass("hasDatepicker"))return;const t=e("",{type:"hidden",name:this.attr("name"),value:this.val()});this.parent().append(t),this.removeAttr("name"),i.default.locale(this.attr("lang"));const n=this.val();let r="";if(n){const e=(0,i.default)(n);e.isValid()&&(r=e.format("L LT"))}this.val(r);const o=a.default.inject(a.default._t("Admin.FormatExample","Example: {format}"),{format:(0,i.default)().endOf("month").format("L LT")});this.attr("placeholder",o),this.updateValue()},onchange(){this.updateValue()},updateValue(){const e=this.val();let t="";if(e){const n=(0,i.default)(e,["L LT",i.default.ISO_8601]);n.isValid()&&(t=n.format("YYYY-MM-DDTHH:mm:ss"))}this.parent().find("input[type=hidden]").val(t)}})}))},17106:function(e,t,n){"use strict";var r=l(n(19755)),a=l(n(4754)),i=l(n(67294)),s=n(20745),o=(l(n(62266)),n(48834),n(54582));function l(e){return e&&e.__esModule?e:{default:e}}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t").addClass("ss-gridfield-item loading").attr("colspan",d);l.append(e("").append(u));e.ajax(e.extend({},{headers:{"X-Pjax":"CurrentField"},type:"POST",url:this.data("url"),dataType:"html",success:function(a){if(r.empty().append(e(a).children()),s&&r.find(':input[name="'+s+'"]').focus(),r.find(".grid-field__filter-header, .grid-field__search-holder").length){var i="show"===t.data[0].filter;r.needsColumnFix()&&r.fixColumns(),r.injectSearchButton(i)}n&&n.apply(this,arguments),r.trigger("reload",r),!1!==t.data[0].triggerChange&&r.trigger("change")},error:function(e){alert(a.default._t("Admin.ERRORINTRANSACTION"))},complete:function(e,t){r.find(".loading").removeClass("loading")}},t))},showDetailView:function(e){window.location.href=e},getItems:function(){return this.find(".ss-gridfield-item")},setState:function(e,t){var n=this.getState();n[e]=t,this.find(':input[name="'+this.data("name")+'[GridState]"]').val(JSON.stringify(n))},getState:function(){const e=this.find(':input[name="'+this.data("name")+'[GridState]"]').val();return e?JSON.parse(e):{}},hasFilters:function(){return!!this.getState().GridFieldFilterHeader},needsColumnFix:function(){return this.find(".grid-field__filter-header, .grid-field__search-holder").length&&!this.find(".grid-field__col-compact").length&&!this.find("th.col-Actions").length},fixColumns:function(t){this.find(".sortable-header").append(''),this.find("tbody tr").each((function(){e(this).find("td:last").attr("colspan",2)}));var n=e('');e(".grid-field__filter-header th:last .action").each((function(){e(this).detach(),n.append(e(this))})),e(".grid-field__filter-header").append(n)},injectSearchButton:function(e){const t=this.find(".grid-field__filter-header").length>0;let n;e?(n='',this.addClass("show-filter").find(".grid-field__filter-header, .grid-field__search-holder").removeClass("grid-field__search-holder--hidden"),t||this.find(":button[name=showFilter]").hide()):(n='',this.removeClass("show-filter").find(".grid-field__filter-header, .grid-field__search-holder").addClass("grid-field__search-holder--hidden")),t&&this.find(".sortable-header th:last").html(n)},keepStateInHistory:function(){const t=e(this).find(".gridfield-actionmenu__container").data("schema");t&&t.length>0&&t.filter((e=>{if("link"===e.type){const t=this.buildURLString(e.url),n=t?"?"+t.join("&"):"";window.ss.router.replace(window.location.pathname+n,void 0,void 0,!1)}}))},buildURLString:function(e){const t=[window.location.origin,e].join("/"),n=[window.location.search,new URL(t).searchParams.toString()].join("&").substring(1),r=[],a=[];return n.split("&").forEach((e=>{const t=e.split("=");r[t[0]]=t[1]?t[1]:""})),Object.keys(r).forEach((e=>{a.push([e,r[e]].join("="))})),a}}),e(".grid-field *").entwine({getGridField:function(){return this.closest(".grid-field")}}),e(".gridfield-actionmenu__container").entwine({Timer:null,Component:null,Actions:null,ReactRoot:null,onmatch(){this._super();let t=[];e(".action-menu--handled",this.parent()).each((function(){const n=e(this).detach();t.push(n)})),this.setActions(t);const n=this.closest(".cms-content").attr("id"),r=n?{context:n}:{},a=(0,o.loadComponent)("GridFieldActions",r);this.setComponent(a),this.refresh()},onunmatch(){this._super();const t=this.getReactRoot();t&&(t.unmount(),this.setReactRoot(null));const n=this.getActions(),r=this.parent();n&&e(n).each((function(){e(this).appendTo(r)}))},refresh(){const e=this.data("schema"),t=this.getComponent();let n=this.getReactRoot();n||(n=(0,s.createRoot)(this[0])),n.render(i.default.createElement(t,{schema:e})),this.setReactRoot(n)}}),e(".grid-field :button[name=showFilter]").entwine({onclick:function(e){this.closest(".grid-field").find(".grid-field__filter-header, .grid-field__search-holder").removeClass("grid-field__search-holder--hidden").find(":input:first").focus(),this.closest(".grid-field").addClass("show-filter"),this.parent().html(''),e.preventDefault()}}),e(".grid-field .ss-gridfield-item").entwine({onclick:function(t){if(t.target.classList.contains("action-menu__toggle"))return this._super(t),!1;if(e(t.target).closest(".action").length)return this._super(t),!1;var n=this.find(".edit-link, .view-link");n.length&&this.getGridField().showDetailView(n.prop("href"))},onmouseover:function(){this.find(".edit-link, .view-link").length&&this.css("cursor","pointer")},onmouseout:function(){this.css("cursor","default")}}),e(".grid-field .action.action_import:button").entwine({onclick:function(e){e.preventDefault(),this.openmodal()},onmatch:function(){this._super(),"open"===this.data("state")&&this.openmodal()},onunmatch:function(){this._super()},openmodal:function(){let t=e(this.data("target")),n=e(this.data("modal"));t.length<1?(t=n,t.appendTo(document.body)):t.innerHTML=n.innerHTML;let r=e(".modal-backdrop");function a(){r.removeClass("show"),t.removeClass("show"),setTimeout((function(){r.remove()}),150)}r.length<1&&(r=e(''),r.appendTo(document.body)),t.find("[data-dismiss]").add(".modal-backdrop").on("click",(function(){a()})),e(document).on("keydown",(function(e){27===e.keyCode&&a()})),setTimeout((function(){r.addClass("show"),t.addClass("show")}),0)}}),e(".grid-field .action:button").entwine({onclick:function(t){var n="show";let r=!0;if(this.is(":disabled"))return void t.preventDefault();!this.hasClass("ss-gridfield-button-close")&&this.closest(".grid-field").hasClass("show-filter")||(n="hidden"),(this.hasClass("ss-gridfield-pagination-action")||this.hasClass("grid-field__sort"))&&(r=!1);var a=[{name:this.attr("name"),value:this.val(),filter:n,triggerChange:r}],i=this.data("action-state");i&&a.push({name:"ActionState",value:JSON.stringify(i)});const s=e(this).getGridField();s.reload({data:a},(function(t,n,r){s.keepStateInHistory();const a=r.getResponseHeader("X-Message-Text"),i=r.getResponseHeader("X-Message-Type");if(a&&i){var o=e("#Form_EditForm_error");o.addClass(i),o.html(a),o.show()}})),t.preventDefault()},actionurl:function(){var t=this.closest(":button"),n=this.getGridField(),r=this.closest("form"),a=r.find(":input.gridstate").serialize(),i=r.find('input[name="SecurityID"]').val();a+="&"+encodeURIComponent(t.attr("name"))+"="+encodeURIComponent(t.val()),i&&(a+="&SecurityID="+encodeURIComponent(i));var s=this.data("action-state");s&&(a+="&ActionState="+encodeURIComponent(JSON.stringify(s))),window.location.search&&(a=window.location.search.replace(/^\?/,"")+"&"+a);var o=-1==n.data("url").indexOf("?")?"?":"&";return e.path.makeUrlAbsolute(n.data("url")+o+a,e("base").attr("href"))}}),e(".grid-field .add-existing-autocompleter").entwine({onbuttoncreate:function(){var e=this;this.toggleDisabled(),this.find('input[type="text"]').on("keyup",(function(){e.toggleDisabled()}))},onunmatch:function(){this.find('input[type="text"]').off("keyup")},toggleDisabled:function(){var e=this.find(".ss-ui-button"),t=""!==this.find('input[type="text"]').val(),n=e.is(":disabled");(t&&n||!t&&!n)&&e.attr("disabled",!n)}}),e(".grid-field .grid-field__col-compact .action--delete, .grid-field .grid-field__col-compact .action--archive, .cms-edit-form .btn-toolbar .action--delete, .cms-edit-form .btn-toolbar .action--archive").entwine({onclick:function(t){const n=e(this).hasClass("action--archive")?a.default._t("Admin.ARCHIVECONFIRMMESSAGE","Are you sure you want to archive this record?"):a.default._t("Admin.DELETECONFIRMMESSAGE","Are you sure you want to delete this record?");if(!confirm(n))return t.preventDefault(),!1;this._super(t)}}),e(".grid-field .grid-print-button.action:button").entwine({UUID:null,onmatch:function(){this._super(),this.setUUID((new Date).getTime())},onunmatch:function(){this._super()},onclick:function(e){var t=this.actionurl();return window.open(t),e.preventDefault(),!1}}),e(".ss-gridfield-print-iframe").entwine({onmatch:function(){this._super(),this.hide().on("load",(function(){this.focus(),(this.contentWindow||this).print()}))},onunmatch:function(){this._super()}}),e(".grid-field .action.no-ajax, .grid-field .no-ajax .action:button").entwine({onclick:function(e){return window.location.href=this.actionurl(),e.preventDefault(),!1}}),e(".grid-field .action-detail").entwine({onclick:function(){return this.getGridField().showDetailView(e(this).prop("href")),!1}}),e(".grid-field[data-selectable]").entwine({getSelectedItems:function(){return this.find(".ss-gridfield-item.ui-selected")},getSelectedIDs:function(){return e.map(this.getSelectedItems(),(function(t){return e(t).data("id")}))}}),e(".grid-field[data-selectable] .ss-gridfield-items").entwine({onadd:function(){this._super(),this.selectable()},onremove:function(){this._super(),this.data("selectable")&&this.selectable("destroy")}}),e(".js-injector-boot .grid-field .grid-field__search-holder").entwine({Component:null,ReactRoot:null,onmatch(){this._super(),this.prependTo(this.parent());const e=this.closest(".cms-content").attr("id"),t=e?{context:e}:{},n=(0,o.loadComponent)("Search",t);this.setComponent(n),this.refresh()},onunmatch(){this._super();const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))},close(){const t=this.data("schema"),n=[{name:t.clearAction,value:"",filter:"hidden",triggerChange:!1}];t.clearActionState&&n.push({name:"ActionState",value:t.clearActionState});const r=e(this).getGridField();r.reload({data:n},(function(){r.keepStateInHistory()}))},search(t){const n=this.data("schema"),r=[{name:n.searchAction,value:"",filter:"show",triggerChange:!1}];n.searchActionState&&r.push({name:"ActionState",value:n.searchActionState});for(const[e,a]of Object.entries(t))if(a){const t=`filter[${n.gridfield}][${e}]`;r.push({name:t,value:a})}const a=e(this).getGridField();a.reload({data:r},(function(){a.keepStateInHistory()}))},refresh(){const e=this.data("schema"),t=this.getComponent();String(e.gridfield).replace(/\-/g,".");let n=this.getReactRoot();n||(n=(0,s.createRoot)(this[0])),n.render(i.default.createElement(t,d({id:`${e.gridfield}Search`,display:"VISIBLE",displayBehavior:"HIDEABLE",filterPrefix:"Search__",onHide:()=>this.close(),onSearch:e=>this.search(e)},e))),this.setReactRoot(n)}}),e(".js-injector-boot .grid-field .search-box__content-field").entwine({onkeydown:function(e){"Enter"===e.key&&e.preventDefault()}}),e(".grid-field .grid-field__filter-header :input").entwine({onmatch:function(){var e=this.closest(".extra").find(".ss-gridfield-button-filter"),t=this.closest(".extra").find(".ss-gridfield-button-reset");this.val()&&(e.addClass("filtered"),t.addClass("filtered")),this._super()},onunmatch:function(){this._super()},onkeydown:function(t){if(!this.closest(".ss-gridfield-button-reset").length){var n=this.closest(".extra").find(".ss-gridfield-button-filter"),r=this.closest(".extra").find(".ss-gridfield-button-reset");if("13"==t.keyCode){var a=this.closest(".grid-field__filter-header").find(".ss-gridfield-button-filter"),i="show";!this.hasClass("ss-gridfield-button-close")&&this.closest(".grid-field").hasClass("show-filter")||(i="hidden");var s=[{name:a.attr("name"),value:a.val(),filter:i,triggerChange:!1}];a.data("action-state")&&s.push({name:"ActionState",value:JSON.stringify(a.data("action-state"))});const t=e(this).getGridField(),n=function(){t.keepStateInHistory()};return t.reload({data:s},n),!1}n.addClass("hover-alike"),r.addClass("hover-alike")}}}),e(".grid-field .relation-search").entwine({onfocusin:function(t){this.autocomplete({source:function(t,n){var r=e(this.element);e(this.element).closest("form");e.ajax({headers:{"X-Pjax":"Partial"},dataType:"json",type:"GET",url:e(r).data("searchUrl"),data:encodeURIComponent(r.attr("name"))+"="+encodeURIComponent(r.val()),success:n,error:function(e){alert(a.default._t("Admin.ERRORINTRANSACTION","An error occured while fetching data from the server\n Please try again later."))}})},select:function(t,n){var r=e('');r.val(n.item.id),e(this).closest(".grid-field").find(".action_gridfield_relationfind").replaceWith(r),e(this).closest(".grid-field").find(".action_gridfield_relationadd").removeAttr("disabled")}})}}),e(".grid-field .pagination-page-number input").entwine({onkeydown:function(t){if(13==t.keyCode){t.preventDefault();var n=parseInt(e(this).val(),10),r=e(this).getGridField();r.setState("GridFieldPaginator",{currentPage:n});const a=function(){r.keepStateInHistory()};return r.reload({},a),!1}}})}))},49414:function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var _jquery=_interopRequireDefault(__webpack_require__(19755));__webpack_require__(51726);var _lodash=_interopRequireDefault(__webpack_require__(91658));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var ss=void 0!==window.ss?window.ss:{};ss.editorWrappers={},ss.editorWrappers.tinyMCE=function(){var editorID;return{init:function(e){editorID=e,this.create()},destroy:function(){tinymce.EditorManager.execCommand("mceRemoveEditor",!1,editorID)},getInstance:function(){return tinymce.EditorManager.get(editorID)},onopen:function(){},onclose:function(){},getConfig:function(){var e="#"+editorID,t=(0,_jquery.default)(e).data("config"),n=this;return t.selector=e,t.setup=function(e){e.on("change",(function(){n.save()}))},t},save:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=this.getInstance();t.save(),e.silent||((0,_jquery.default)(t.getElement()).trigger("change"),t.getElement().dispatchEvent(new Event("input",{bubbles:!0})))},create:function(){let e,t,n;function r(r){const a=r.target;!e||(new Date-e)/100>500?(n=$(a).scrollTop(),$(".mce-floatpanel").css("opacity","0")):window.clearTimeout(t),e=new Date,t=window.setTimeout((()=>function(t,n){const r=$(t).scrollTop();$(".mce-floatpanel").each(((e,t)=>{const a=parseFloat(t.style.top);$(t).css("top",a-(r-n)+"px")})),$(".mce-floatpanel").css("opacity","1"),e=void 0}(a,n)),500)}var a=this.getConfig();void 0!==a.baseURL&&(tinymce.EditorManager.baseURL=a.baseURL),a.skin=a.skin||"silverstripe",tinymce.init(a).then((e=>{if(e.length>0&&e[0].container){$(e[0].container).closest(".panel--scrollable").on("scroll",(e=>r(e)))}}))},repaint:function(){},isDirty:function(){return this.getInstance().isDirty()},getContent:function(){return this.getInstance().getContent()},getSelection:function(){return this.getInstance().selection.getSel().toString()||""},getDOM:function(){return this.getInstance().getElement()},getContainer:function(){return this.getInstance().getContainer()},getSelectedNode:function(){return this.getInstance().selection.getNode()},selectNode:function(e){this.getInstance().selection.select(e)},setContent:function(e,t){this.getInstance().setContent(e,t)},insertContent:function(e,t){this.getInstance().insertContent(e,t)},replaceContent:function(e,t){this.getInstance().execCommand("mceReplaceContent",!1,e,t)},insertLink:function(e,t,n){if(n){n=n.replaceAll("<","<").replaceAll(">",">");const t=this.getInstance().dom.create("a",e,n);this.getInstance().selection.setNode(t)}else this.getInstance().execCommand("mceInsertLink",!1,e,t)},removeLink:function(){this.getInstance().execCommand("unlink",!1)},cleanLink:function(href,node){var settings=this.getConfig,cb=settings.urlconverter_callback,cu=tinyMCE.settings.convert_urls;return cb&&(href=eval(cb+"(href, node, true);")),cu&&href.match(new RegExp("^"+(0,_lodash.default)(tinyMCE.settings.document_base_url)+"(.*)$"))&&(href=RegExp.$1),href.match(/^javascript:\s*mctmp/)&&(href=""),href},createBookmark:function(){return this.getInstance().selection.getBookmark()},moveToBookmark:function(e){this.getInstance().selection.moveToBookmark(e),this.getInstance().focus()},blur:function(){this.getInstance().selection.collapse()},addUndo:function(){this.getInstance().undoManager.add()}}},ss.editorWrappers.default=ss.editorWrappers.tinyMCE,_jquery.default.entwine("ss",(function(e){e("textarea.htmleditor").entwine({Editor:null,onadd:function(){var e=this.data("editor")||"default",t=ss.editorWrappers[e]();this.setEditor(t),t.init(this.attr("id")),this._super()},onmatch:function(){this.getEditor()||this.onadd(),this._super()},onremove:function(){this.getEditor().destroy(),this._super()},onunmatch:function(){this.getEditor()&&this.onremove(),this._super()},"from .cms-edit-form":{onbeforesubmitform:function(){this.getEditor().save({silent:!0}),this._super()}},openLinkDialog:function(){this.openDialog("link")},openMediaDialog:function(){this.openDialog("media")},openEmbedDialog:function(){this.openDialog("embed")},openDialog:function(t){if("media"===t&&window.InsertMediaModal){let t=e("#insert-media-react__dialog-wrapper");return t.length||(t=e('